@pega/cosmos-react-core 5.0.0-dev.5.0 → 5.0.0-dev.6.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (739) hide show
  1. package/lib/components/AIButton/AIButton.d.ts.map +1 -1
  2. package/lib/components/AIButton/AIButton.js.map +1 -1
  3. package/lib/components/Actions/Actions.d.ts +5 -2
  4. package/lib/components/Actions/Actions.d.ts.map +1 -1
  5. package/lib/components/Actions/Actions.js +3 -3
  6. package/lib/components/Actions/Actions.js.map +1 -1
  7. package/lib/components/AdditionalInfo/AdditionalInfo.d.ts +3 -3
  8. package/lib/components/AdditionalInfo/AdditionalInfo.d.ts.map +1 -1
  9. package/lib/components/AdditionalInfo/AdditionalInfo.js.map +1 -1
  10. package/lib/components/AppShell/AppHeader.d.ts +3 -3
  11. package/lib/components/AppShell/AppHeader.d.ts.map +1 -1
  12. package/lib/components/AppShell/AppHeader.js.map +1 -1
  13. package/lib/components/AppShell/AppHeader.styles.d.ts +1 -1
  14. package/lib/components/AppShell/AppHeader.styles.d.ts.map +1 -1
  15. package/lib/components/AppShell/AppHeader.styles.js.map +1 -1
  16. package/lib/components/AppShell/AppShell.d.ts +2 -2
  17. package/lib/components/AppShell/AppShell.d.ts.map +1 -1
  18. package/lib/components/AppShell/AppShell.js.map +1 -1
  19. package/lib/components/AppShell/AppShellContext.d.ts +3 -3
  20. package/lib/components/AppShell/AppShellContext.d.ts.map +1 -1
  21. package/lib/components/AppShell/AppShellContext.js.map +1 -1
  22. package/lib/components/AppShell/AppShellList.d.ts +2 -2
  23. package/lib/components/AppShell/AppShellList.d.ts.map +1 -1
  24. package/lib/components/AppShell/AppShellList.js.map +1 -1
  25. package/lib/components/AppShell/AppShellSearch.d.ts +2 -2
  26. package/lib/components/AppShell/AppShellSearch.d.ts.map +1 -1
  27. package/lib/components/AppShell/AppShellSearch.js.map +1 -1
  28. package/lib/components/AppShell/ContextSwitcher.d.ts +3 -3
  29. package/lib/components/AppShell/ContextSwitcher.d.ts.map +1 -1
  30. package/lib/components/AppShell/ContextSwitcher.js.map +1 -1
  31. package/lib/components/AppShell/Drawer.d.ts +1 -1
  32. package/lib/components/AppShell/Drawer.d.ts.map +1 -1
  33. package/lib/components/AppShell/Drawer.js.map +1 -1
  34. package/lib/components/AppShell/Drawer.styles.d.ts +1 -1
  35. package/lib/components/AppShell/Drawer.styles.d.ts.map +1 -1
  36. package/lib/components/AppShell/Drawer.styles.js.map +1 -1
  37. package/lib/components/AppShell/NavigationList.d.ts +2 -2
  38. package/lib/components/AppShell/NavigationList.d.ts.map +1 -1
  39. package/lib/components/AppShell/NavigationList.js.map +1 -1
  40. package/lib/components/AppShell/NavigationListItemWrapper.d.ts +2 -2
  41. package/lib/components/AppShell/NavigationListItemWrapper.d.ts.map +1 -1
  42. package/lib/components/AppShell/NavigationListItemWrapper.js.map +1 -1
  43. package/lib/components/AppShell/Operator.d.ts +1 -1
  44. package/lib/components/AppShell/Operator.d.ts.map +1 -1
  45. package/lib/components/AppShell/Operator.js.map +1 -1
  46. package/lib/components/AppShell/style-utils.d.ts +1 -1
  47. package/lib/components/AppShell/style-utils.d.ts.map +1 -1
  48. package/lib/components/AppShell/style-utils.js.map +1 -1
  49. package/lib/components/Avatar/Avatar.d.ts +2 -2
  50. package/lib/components/Avatar/Avatar.d.ts.map +1 -1
  51. package/lib/components/Avatar/Avatar.js.map +1 -1
  52. package/lib/components/Backdrop/Backdrop.d.ts +2 -2
  53. package/lib/components/Backdrop/Backdrop.d.ts.map +1 -1
  54. package/lib/components/Backdrop/Backdrop.js.map +1 -1
  55. package/lib/components/Badges/Alert.d.ts +1 -1
  56. package/lib/components/Badges/Alert.d.ts.map +1 -1
  57. package/lib/components/Badges/Alert.js.map +1 -1
  58. package/lib/components/Badges/Count.d.ts +1 -1
  59. package/lib/components/Badges/Count.d.ts.map +1 -1
  60. package/lib/components/Badges/Count.js.map +1 -1
  61. package/lib/components/Badges/Keyboard.d.ts +1 -1
  62. package/lib/components/Badges/Keyboard.d.ts.map +1 -1
  63. package/lib/components/Badges/Keyboard.js.map +1 -1
  64. package/lib/components/Badges/Selection.d.ts +2 -2
  65. package/lib/components/Badges/Selection.d.ts.map +1 -1
  66. package/lib/components/Badges/Selection.js.map +1 -1
  67. package/lib/components/Badges/Status.d.ts +2 -2
  68. package/lib/components/Badges/Status.d.ts.map +1 -1
  69. package/lib/components/Badges/Status.js.map +1 -1
  70. package/lib/components/Badges/Tag.d.ts +2 -2
  71. package/lib/components/Badges/Tag.d.ts.map +1 -1
  72. package/lib/components/Badges/Tag.js.map +1 -1
  73. package/lib/components/Banner/Banner.d.ts +2 -2
  74. package/lib/components/Banner/Banner.d.ts.map +1 -1
  75. package/lib/components/Banner/Banner.js.map +1 -1
  76. package/lib/components/Boolean/BooleanDisplay.d.ts +1 -1
  77. package/lib/components/Boolean/BooleanDisplay.d.ts.map +1 -1
  78. package/lib/components/Boolean/BooleanDisplay.js.map +1 -1
  79. package/lib/components/Breadcrumbs/Breadcrumbs.d.ts +4 -4
  80. package/lib/components/Breadcrumbs/Breadcrumbs.d.ts.map +1 -1
  81. package/lib/components/Breadcrumbs/Breadcrumbs.js.map +1 -1
  82. package/lib/components/Button/BareButton.d.ts +3 -3
  83. package/lib/components/Button/BareButton.d.ts.map +1 -1
  84. package/lib/components/Button/BareButton.js.map +1 -1
  85. package/lib/components/Button/BareRoleButton.d.ts +2 -2
  86. package/lib/components/Button/BareRoleButton.d.ts.map +1 -1
  87. package/lib/components/Button/BareRoleButton.js.map +1 -1
  88. package/lib/components/Button/Button.d.ts +3 -3
  89. package/lib/components/Button/Button.d.ts.map +1 -1
  90. package/lib/components/Button/Button.js.map +1 -1
  91. package/lib/components/Card/Card.d.ts +2 -2
  92. package/lib/components/Card/Card.d.ts.map +1 -1
  93. package/lib/components/Card/Card.js.map +1 -1
  94. package/lib/components/Card/CardContent.d.ts +3 -3
  95. package/lib/components/Card/CardContent.d.ts.map +1 -1
  96. package/lib/components/Card/CardContent.js.map +1 -1
  97. package/lib/components/Card/CardFooter.d.ts +3 -3
  98. package/lib/components/Card/CardFooter.d.ts.map +1 -1
  99. package/lib/components/Card/CardFooter.js.map +1 -1
  100. package/lib/components/Card/CardHeader.d.ts +2 -2
  101. package/lib/components/Card/CardHeader.d.ts.map +1 -1
  102. package/lib/components/Card/CardHeader.js.map +1 -1
  103. package/lib/components/Card/CardMedia.d.ts +2 -2
  104. package/lib/components/Card/CardMedia.d.ts.map +1 -1
  105. package/lib/components/Card/CardMedia.js.map +1 -1
  106. package/lib/components/Card/CollapsibleCard.d.ts +2 -2
  107. package/lib/components/Card/CollapsibleCard.d.ts.map +1 -1
  108. package/lib/components/Card/CollapsibleCard.js.map +1 -1
  109. package/lib/components/Checkbox/Checkbox.d.ts +4 -4
  110. package/lib/components/Checkbox/Checkbox.d.ts.map +1 -1
  111. package/lib/components/Checkbox/Checkbox.js.map +1 -1
  112. package/lib/components/ColorPicker/ColorPicker.d.ts +4 -4
  113. package/lib/components/ColorPicker/ColorPicker.d.ts.map +1 -1
  114. package/lib/components/ColorPicker/ColorPicker.js.map +1 -1
  115. package/lib/components/ComboBox/ComboBox.d.ts +1 -1
  116. package/lib/components/ComboBox/ComboBox.d.ts.map +1 -1
  117. package/lib/components/ComboBox/ComboBox.js.map +1 -1
  118. package/lib/components/ComboBox/ComboBox.types.d.ts +3 -3
  119. package/lib/components/ComboBox/ComboBox.types.d.ts.map +1 -1
  120. package/lib/components/ComboBox/ComboBox.types.js.map +1 -1
  121. package/lib/components/ComboBox/ComboBoxInput.d.ts +5 -4
  122. package/lib/components/ComboBox/ComboBoxInput.d.ts.map +1 -1
  123. package/lib/components/ComboBox/ComboBoxInput.js.map +1 -1
  124. package/lib/components/ComboBox/MultiSelectInput/MultiSelectInput.d.ts +3 -3
  125. package/lib/components/ComboBox/MultiSelectInput/MultiSelectInput.d.ts.map +1 -1
  126. package/lib/components/ComboBox/MultiSelectInput/MultiSelectInput.js +1 -0
  127. package/lib/components/ComboBox/MultiSelectInput/MultiSelectInput.js.map +1 -1
  128. package/lib/components/ComboBox/MultiSelectInput/MultiSelectInput.types.d.ts +4 -4
  129. package/lib/components/ComboBox/MultiSelectInput/MultiSelectInput.types.d.ts.map +1 -1
  130. package/lib/components/ComboBox/MultiSelectInput/MultiSelectInput.types.js.map +1 -1
  131. package/lib/components/ComboBox/SingleSelectInput/SingleSelectInput.d.ts +3 -3
  132. package/lib/components/ComboBox/SingleSelectInput/SingleSelectInput.d.ts.map +1 -1
  133. package/lib/components/ComboBox/SingleSelectInput/SingleSelectInput.js.map +1 -1
  134. package/lib/components/ComboBox/SingleSelectInput/SingleSelectInput.types.d.ts +4 -3
  135. package/lib/components/ComboBox/SingleSelectInput/SingleSelectInput.types.d.ts.map +1 -1
  136. package/lib/components/ComboBox/SingleSelectInput/SingleSelectInput.types.js.map +1 -1
  137. package/lib/components/CompositeInput/CompositeInput.d.ts +2 -2
  138. package/lib/components/CompositeInput/CompositeInput.d.ts.map +1 -1
  139. package/lib/components/CompositeInput/CompositeInput.js.map +1 -1
  140. package/lib/components/CompositeInput/CompositeInput.types.d.ts +3 -3
  141. package/lib/components/CompositeInput/CompositeInput.types.d.ts.map +1 -1
  142. package/lib/components/CompositeInput/CompositeInput.types.js.map +1 -1
  143. package/lib/components/Configuration/Configuration.d.ts +3 -3
  144. package/lib/components/Configuration/Configuration.d.ts.map +1 -1
  145. package/lib/components/Configuration/Configuration.js.map +1 -1
  146. package/lib/components/CreditCard/CreditCard.types.d.ts +3 -3
  147. package/lib/components/CreditCard/CreditCard.types.d.ts.map +1 -1
  148. package/lib/components/CreditCard/CreditCard.types.js.map +1 -1
  149. package/lib/components/CreditCard/CreditCardDisplay.d.ts +3 -3
  150. package/lib/components/CreditCard/CreditCardDisplay.d.ts.map +1 -1
  151. package/lib/components/CreditCard/CreditCardDisplay.js.map +1 -1
  152. package/lib/components/CreditCard/CreditCardInput.d.ts +3 -3
  153. package/lib/components/CreditCard/CreditCardInput.d.ts.map +1 -1
  154. package/lib/components/CreditCard/CreditCardInput.js.map +1 -1
  155. package/lib/components/Currency/CurrencyDisplay.d.ts +2 -2
  156. package/lib/components/Currency/CurrencyDisplay.d.ts.map +1 -1
  157. package/lib/components/Currency/CurrencyDisplay.js.map +1 -1
  158. package/lib/components/Currency/CurrencyInput.d.ts +3 -3
  159. package/lib/components/Currency/CurrencyInput.d.ts.map +1 -1
  160. package/lib/components/Currency/CurrencyInput.js.map +1 -1
  161. package/lib/components/Currency/CurrencyInput.types.d.ts +1 -1
  162. package/lib/components/Currency/CurrencyInput.types.d.ts.map +1 -1
  163. package/lib/components/Currency/CurrencyInput.types.js.map +1 -1
  164. package/lib/components/DangerButton/DangerButton.d.ts.map +1 -1
  165. package/lib/components/DangerButton/DangerButton.js.map +1 -1
  166. package/lib/components/DateTime/DateTime.types.d.ts +3 -3
  167. package/lib/components/DateTime/DateTime.types.d.ts.map +1 -1
  168. package/lib/components/DateTime/DateTime.types.js.map +1 -1
  169. package/lib/components/DateTime/DateTimeDisplay.d.ts +4 -4
  170. package/lib/components/DateTime/DateTimeDisplay.d.ts.map +1 -1
  171. package/lib/components/DateTime/DateTimeDisplay.js.map +1 -1
  172. package/lib/components/DateTime/DurationDisplay.d.ts +2 -2
  173. package/lib/components/DateTime/DurationDisplay.d.ts.map +1 -1
  174. package/lib/components/DateTime/DurationDisplay.js.map +1 -1
  175. package/lib/components/DateTime/Input/DateInput.d.ts +4 -4
  176. package/lib/components/DateTime/Input/DateInput.d.ts.map +1 -1
  177. package/lib/components/DateTime/Input/DateInput.js.map +1 -1
  178. package/lib/components/DateTime/Input/DateRangeInput.d.ts +4 -4
  179. package/lib/components/DateTime/Input/DateRangeInput.d.ts.map +1 -1
  180. package/lib/components/DateTime/Input/DateRangeInput.js.map +1 -1
  181. package/lib/components/DateTime/Input/DateTimeInput.d.ts +6 -6
  182. package/lib/components/DateTime/Input/DateTimeInput.d.ts.map +1 -1
  183. package/lib/components/DateTime/Input/DateTimeInput.js +1 -0
  184. package/lib/components/DateTime/Input/DateTimeInput.js.map +1 -1
  185. package/lib/components/DateTime/Input/DayOfWeekInput.d.ts +3 -3
  186. package/lib/components/DateTime/Input/DayOfWeekInput.d.ts.map +1 -1
  187. package/lib/components/DateTime/Input/DayOfWeekInput.js.map +1 -1
  188. package/lib/components/DateTime/Input/Duration/DurationInput.d.ts +3 -3
  189. package/lib/components/DateTime/Input/Duration/DurationInput.d.ts.map +1 -1
  190. package/lib/components/DateTime/Input/Duration/DurationInput.js.map +1 -1
  191. package/lib/components/DateTime/Input/Duration/DurationInput.types.d.ts +2 -2
  192. package/lib/components/DateTime/Input/Duration/DurationInput.types.d.ts.map +1 -1
  193. package/lib/components/DateTime/Input/Duration/DurationInput.types.js.map +1 -1
  194. package/lib/components/DateTime/Input/Duration/NumberUnit.d.ts +3 -3
  195. package/lib/components/DateTime/Input/Duration/NumberUnit.d.ts.map +1 -1
  196. package/lib/components/DateTime/Input/Duration/NumberUnit.js.map +1 -1
  197. package/lib/components/DateTime/Input/Duration/Time.d.ts +3 -3
  198. package/lib/components/DateTime/Input/Duration/Time.d.ts.map +1 -1
  199. package/lib/components/DateTime/Input/Duration/Time.js.map +1 -1
  200. package/lib/components/DateTime/Input/MonthInput.d.ts +4 -4
  201. package/lib/components/DateTime/Input/MonthInput.d.ts.map +1 -1
  202. package/lib/components/DateTime/Input/MonthInput.js.map +1 -1
  203. package/lib/components/DateTime/Input/PartInput.d.ts +3 -3
  204. package/lib/components/DateTime/Input/PartInput.d.ts.map +1 -1
  205. package/lib/components/DateTime/Input/PartInput.js.map +1 -1
  206. package/lib/components/DateTime/Input/QuarterInput.d.ts +4 -4
  207. package/lib/components/DateTime/Input/QuarterInput.d.ts.map +1 -1
  208. package/lib/components/DateTime/Input/QuarterInput.js.map +1 -1
  209. package/lib/components/DateTime/Input/TimeInput.d.ts +5 -5
  210. package/lib/components/DateTime/Input/TimeInput.d.ts.map +1 -1
  211. package/lib/components/DateTime/Input/TimeInput.js.map +1 -1
  212. package/lib/components/DateTime/Input/TimeRangeInput.d.ts +7 -6
  213. package/lib/components/DateTime/Input/TimeRangeInput.d.ts.map +1 -1
  214. package/lib/components/DateTime/Input/TimeRangeInput.js.map +1 -1
  215. package/lib/components/DateTime/Input/WeekInput.d.ts +4 -4
  216. package/lib/components/DateTime/Input/WeekInput.d.ts.map +1 -1
  217. package/lib/components/DateTime/Input/WeekInput.js.map +1 -1
  218. package/lib/components/DateTime/Input/useAutoFocusNextInput.d.ts +1 -1
  219. package/lib/components/DateTime/Input/useAutoFocusNextInput.d.ts.map +1 -1
  220. package/lib/components/DateTime/Input/useAutoFocusNextInput.js.map +1 -1
  221. package/lib/components/DateTime/Input/usePickerButton.d.ts +1 -1
  222. package/lib/components/DateTime/Input/usePickerButton.d.ts.map +1 -1
  223. package/lib/components/DateTime/Input/usePickerButton.js.map +1 -1
  224. package/lib/components/DateTime/Input/utils.d.ts +1 -1
  225. package/lib/components/DateTime/Input/utils.d.ts.map +1 -1
  226. package/lib/components/DateTime/Input/utils.js.map +1 -1
  227. package/lib/components/DateTime/Picker/Calendar.d.ts +3 -3
  228. package/lib/components/DateTime/Picker/Calendar.d.ts.map +1 -1
  229. package/lib/components/DateTime/Picker/Calendar.js.map +1 -1
  230. package/lib/components/DateTime/Picker/DatePicker.d.ts +2 -2
  231. package/lib/components/DateTime/Picker/DatePicker.d.ts.map +1 -1
  232. package/lib/components/DateTime/Picker/DatePicker.js.map +1 -1
  233. package/lib/components/DateTime/Picker/DatePicker.types.d.ts +2 -2
  234. package/lib/components/DateTime/Picker/DatePicker.types.d.ts.map +1 -1
  235. package/lib/components/DateTime/Picker/DatePicker.types.js.map +1 -1
  236. package/lib/components/DateTime/Picker/DateRangePicker.d.ts +2 -2
  237. package/lib/components/DateTime/Picker/DateRangePicker.d.ts.map +1 -1
  238. package/lib/components/DateTime/Picker/DateRangePicker.js.map +1 -1
  239. package/lib/components/DateTime/Picker/TimePicker.d.ts +3 -3
  240. package/lib/components/DateTime/Picker/TimePicker.d.ts.map +1 -1
  241. package/lib/components/DateTime/Picker/TimePicker.js.map +1 -1
  242. package/lib/components/DateTime/Picker/Weeks.d.ts +3 -3
  243. package/lib/components/DateTime/Picker/Weeks.d.ts.map +1 -1
  244. package/lib/components/DateTime/Picker/Weeks.js.map +1 -1
  245. package/lib/components/DateTime/utils.d.ts +4 -4
  246. package/lib/components/DateTime/utils.d.ts.map +1 -1
  247. package/lib/components/DateTime/utils.js.map +1 -1
  248. package/lib/components/Dialog/Dialog.d.ts +2 -2
  249. package/lib/components/Dialog/Dialog.d.ts.map +1 -1
  250. package/lib/components/Dialog/Dialog.js.map +1 -1
  251. package/lib/components/Dialog/Dialog.types.d.ts +4 -4
  252. package/lib/components/Dialog/Dialog.types.d.ts.map +1 -1
  253. package/lib/components/Dialog/Dialog.types.js.map +1 -1
  254. package/lib/components/Dialog/FormDialog.d.ts +3 -3
  255. package/lib/components/Dialog/FormDialog.d.ts.map +1 -1
  256. package/lib/components/Dialog/FormDialog.js.map +1 -1
  257. package/lib/components/Dialog/InfoDialog.d.ts +2 -2
  258. package/lib/components/Dialog/InfoDialog.d.ts.map +1 -1
  259. package/lib/components/Dialog/InfoDialog.js.map +1 -1
  260. package/lib/components/Drawer/Drawer.d.ts +2 -2
  261. package/lib/components/Drawer/Drawer.d.ts.map +1 -1
  262. package/lib/components/Drawer/Drawer.js.map +1 -1
  263. package/lib/components/Email/EmailDisplay.d.ts +2 -2
  264. package/lib/components/Email/EmailDisplay.d.ts.map +1 -1
  265. package/lib/components/Email/EmailDisplay.js.map +1 -1
  266. package/lib/components/EmojiPicker/EmojiDisplay.d.ts +2 -2
  267. package/lib/components/EmojiPicker/EmojiDisplay.d.ts.map +1 -1
  268. package/lib/components/EmojiPicker/EmojiDisplay.js.map +1 -1
  269. package/lib/components/EmojiPicker/EmojiPicker.d.ts +4 -4
  270. package/lib/components/EmojiPicker/EmojiPicker.d.ts.map +1 -1
  271. package/lib/components/EmojiPicker/EmojiPicker.js +28 -21
  272. package/lib/components/EmojiPicker/EmojiPicker.js.map +1 -1
  273. package/lib/components/EmptyState/EmptyState.d.ts +2 -2
  274. package/lib/components/EmptyState/EmptyState.d.ts.map +1 -1
  275. package/lib/components/EmptyState/EmptyState.js.map +1 -1
  276. package/lib/components/ErrorState/ErrorState.d.ts +2 -2
  277. package/lib/components/ErrorState/ErrorState.d.ts.map +1 -1
  278. package/lib/components/ErrorState/ErrorState.js.map +1 -1
  279. package/lib/components/ExpandCollapse/ExpandCollapse.d.ts +2 -2
  280. package/lib/components/ExpandCollapse/ExpandCollapse.d.ts.map +1 -1
  281. package/lib/components/ExpandCollapse/ExpandCollapse.js.map +1 -1
  282. package/lib/components/FieldGroup/FieldGroup.d.ts +4 -4
  283. package/lib/components/FieldGroup/FieldGroup.d.ts.map +1 -1
  284. package/lib/components/FieldGroup/FieldGroup.js.map +1 -1
  285. package/lib/components/FieldGroup/FieldGroupList.d.ts +3 -3
  286. package/lib/components/FieldGroup/FieldGroupList.d.ts.map +1 -1
  287. package/lib/components/FieldGroup/FieldGroupList.js.map +1 -1
  288. package/lib/components/FieldValueList/FieldValueList.d.ts +2 -2
  289. package/lib/components/FieldValueList/FieldValueList.d.ts.map +1 -1
  290. package/lib/components/FieldValueList/FieldValueList.js.map +1 -1
  291. package/lib/components/File/FileDisplay.d.ts +3 -3
  292. package/lib/components/File/FileDisplay.d.ts.map +1 -1
  293. package/lib/components/File/FileDisplay.js.map +1 -1
  294. package/lib/components/File/FileInput.d.ts +4 -4
  295. package/lib/components/File/FileInput.d.ts.map +1 -1
  296. package/lib/components/File/FileInput.js +1 -1
  297. package/lib/components/File/FileInput.js.map +1 -1
  298. package/lib/components/File/FileItem.d.ts +3 -3
  299. package/lib/components/File/FileItem.d.ts.map +1 -1
  300. package/lib/components/File/FileItem.js +3 -2
  301. package/lib/components/File/FileItem.js.map +1 -1
  302. package/lib/components/File/FileUploadItem.d.ts +4 -2
  303. package/lib/components/File/FileUploadItem.d.ts.map +1 -1
  304. package/lib/components/File/FileUploadItem.js +15 -6
  305. package/lib/components/File/FileUploadItem.js.map +1 -1
  306. package/lib/components/File/FileVisual.d.ts +4 -4
  307. package/lib/components/File/FileVisual.d.ts.map +1 -1
  308. package/lib/components/File/FileVisual.js.map +1 -1
  309. package/lib/components/Flex/Flex.d.ts +2 -2
  310. package/lib/components/Flex/Flex.d.ts.map +1 -1
  311. package/lib/components/Flex/Flex.js.map +1 -1
  312. package/lib/components/Form/Form.d.ts +3 -3
  313. package/lib/components/Form/Form.d.ts.map +1 -1
  314. package/lib/components/Form/Form.js.map +1 -1
  315. package/lib/components/FormControl/FormControl.d.ts +3 -3
  316. package/lib/components/FormControl/FormControl.d.ts.map +1 -1
  317. package/lib/components/FormControl/FormControl.js.map +1 -1
  318. package/lib/components/FormField/FormField.d.ts +6 -6
  319. package/lib/components/FormField/FormField.d.ts.map +1 -1
  320. package/lib/components/FormField/FormField.js.map +1 -1
  321. package/lib/components/Grid/Grid.d.ts +3 -3
  322. package/lib/components/Grid/Grid.d.ts.map +1 -1
  323. package/lib/components/Grid/Grid.js.map +1 -1
  324. package/lib/components/Grid/Grid.types.d.ts +3 -3
  325. package/lib/components/Grid/Grid.types.d.ts.map +1 -1
  326. package/lib/components/Grid/Grid.types.js.map +1 -1
  327. package/lib/components/HTML/HTML.d.ts +3 -3
  328. package/lib/components/HTML/HTML.d.ts.map +1 -1
  329. package/lib/components/HTML/HTML.js.map +1 -1
  330. package/lib/components/Icon/Icon.d.ts +2 -2
  331. package/lib/components/Icon/Icon.d.ts.map +1 -1
  332. package/lib/components/Icon/Icon.js +10 -2
  333. package/lib/components/Icon/Icon.js.map +1 -1
  334. package/lib/components/IconPicker/IconPicker.d.ts +4 -4
  335. package/lib/components/IconPicker/IconPicker.d.ts.map +1 -1
  336. package/lib/components/IconPicker/IconPicker.js.map +1 -1
  337. package/lib/components/Image/Image.d.ts +2 -2
  338. package/lib/components/Image/Image.d.ts.map +1 -1
  339. package/lib/components/Image/Image.js.map +1 -1
  340. package/lib/components/Input/Input.d.ts +3 -3
  341. package/lib/components/Input/Input.d.ts.map +1 -1
  342. package/lib/components/Input/Input.js.map +1 -1
  343. package/lib/components/Label/Label.d.ts +2 -2
  344. package/lib/components/Label/Label.d.ts.map +1 -1
  345. package/lib/components/Label/Label.js.map +1 -1
  346. package/lib/components/Lightbox/Lightbox.d.ts +3 -3
  347. package/lib/components/Lightbox/Lightbox.d.ts.map +1 -1
  348. package/lib/components/Lightbox/Lightbox.js.map +1 -1
  349. package/lib/components/Lightbox/Lightbox.types.d.ts +4 -4
  350. package/lib/components/Lightbox/Lightbox.types.d.ts.map +1 -1
  351. package/lib/components/Lightbox/Lightbox.types.js.map +1 -1
  352. package/lib/components/Link/Link.d.ts +3 -3
  353. package/lib/components/Link/Link.d.ts.map +1 -1
  354. package/lib/components/Link/Link.js.map +1 -1
  355. package/lib/components/List/CommaSeparatedList.d.ts +2 -2
  356. package/lib/components/List/CommaSeparatedList.d.ts.map +1 -1
  357. package/lib/components/List/CommaSeparatedList.js.map +1 -1
  358. package/lib/components/List/List.d.ts +2 -2
  359. package/lib/components/List/List.d.ts.map +1 -1
  360. package/lib/components/List/List.js.map +1 -1
  361. package/lib/components/List/OrderedList.d.ts +3 -3
  362. package/lib/components/List/OrderedList.d.ts.map +1 -1
  363. package/lib/components/List/OrderedList.js.map +1 -1
  364. package/lib/components/List/UnorderedList.d.ts +3 -3
  365. package/lib/components/List/UnorderedList.d.ts.map +1 -1
  366. package/lib/components/List/UnorderedList.js.map +1 -1
  367. package/lib/components/ListToolbar/ListToolbar.d.ts +1 -1
  368. package/lib/components/ListToolbar/ListToolbar.d.ts.map +1 -1
  369. package/lib/components/ListToolbar/ListToolbar.js.map +1 -1
  370. package/lib/components/ListToolbar/ListToolbar.styles.d.ts.map +1 -1
  371. package/lib/components/ListToolbar/ListToolbar.styles.js.map +1 -1
  372. package/lib/components/ListToolbar/ListToolbar.types.d.ts +6 -6
  373. package/lib/components/ListToolbar/ListToolbar.types.d.ts.map +1 -1
  374. package/lib/components/ListToolbar/ListToolbar.types.js.map +1 -1
  375. package/lib/components/ListToolbar/PresetMenuPopover.d.ts +1 -1
  376. package/lib/components/ListToolbar/PresetMenuPopover.d.ts.map +1 -1
  377. package/lib/components/ListToolbar/PresetMenuPopover.js.map +1 -1
  378. package/lib/components/ListToolbar/helpers.d.ts +1 -1
  379. package/lib/components/ListToolbar/helpers.d.ts.map +1 -1
  380. package/lib/components/ListToolbar/helpers.js.map +1 -1
  381. package/lib/components/LiveLog/LiveLog.d.ts +1 -1
  382. package/lib/components/LiveLog/LiveLog.d.ts.map +1 -1
  383. package/lib/components/LiveLog/LiveLog.js.map +1 -1
  384. package/lib/components/LiveLog/LiveLog.types.d.ts +1 -1
  385. package/lib/components/LiveLog/LiveLog.types.d.ts.map +1 -1
  386. package/lib/components/LiveLog/LiveLog.types.js.map +1 -1
  387. package/lib/components/Location/CurrentLocationButton.d.ts +1 -1
  388. package/lib/components/Location/CurrentLocationButton.d.ts.map +1 -1
  389. package/lib/components/Location/CurrentLocationButton.js.map +1 -1
  390. package/lib/components/Location/Location.types.d.ts +2 -2
  391. package/lib/components/Location/Location.types.d.ts.map +1 -1
  392. package/lib/components/Location/Location.types.js.map +1 -1
  393. package/lib/components/Location/LocationDisplay.d.ts +3 -3
  394. package/lib/components/Location/LocationDisplay.d.ts.map +1 -1
  395. package/lib/components/Location/LocationDisplay.js.map +1 -1
  396. package/lib/components/Location/LocationInput.d.ts +6 -6
  397. package/lib/components/Location/LocationInput.d.ts.map +1 -1
  398. package/lib/components/Location/LocationInput.js.map +1 -1
  399. package/lib/components/Location/LocationView.d.ts +4 -4
  400. package/lib/components/Location/LocationView.d.ts.map +1 -1
  401. package/lib/components/Location/LocationView.js.map +1 -1
  402. package/lib/components/Location/utils.d.ts +1 -1
  403. package/lib/components/Location/utils.d.ts.map +1 -1
  404. package/lib/components/Location/utils.js.map +1 -1
  405. package/lib/components/Mark/Mark.d.ts +2 -2
  406. package/lib/components/Mark/Mark.d.ts.map +1 -1
  407. package/lib/components/Mark/Mark.js.map +1 -1
  408. package/lib/components/Menu/FlyoutMenuList.d.ts +3 -3
  409. package/lib/components/Menu/FlyoutMenuList.d.ts.map +1 -1
  410. package/lib/components/Menu/FlyoutMenuList.js.map +1 -1
  411. package/lib/components/Menu/Menu.context.d.ts +1 -1
  412. package/lib/components/Menu/Menu.context.d.ts.map +1 -1
  413. package/lib/components/Menu/Menu.context.js.map +1 -1
  414. package/lib/components/Menu/Menu.d.ts +3 -3
  415. package/lib/components/Menu/Menu.d.ts.map +1 -1
  416. package/lib/components/Menu/Menu.js.map +1 -1
  417. package/lib/components/Menu/Menu.styles.d.ts +1 -1
  418. package/lib/components/Menu/Menu.styles.d.ts.map +1 -1
  419. package/lib/components/Menu/Menu.styles.js.map +1 -1
  420. package/lib/components/Menu/Menu.types.d.ts +3 -3
  421. package/lib/components/Menu/Menu.types.d.ts.map +1 -1
  422. package/lib/components/Menu/Menu.types.js.map +1 -1
  423. package/lib/components/Menu/MenuGroup.d.ts +1 -1
  424. package/lib/components/Menu/MenuGroup.d.ts.map +1 -1
  425. package/lib/components/Menu/MenuGroup.js.map +1 -1
  426. package/lib/components/Menu/MenuItem.d.ts +3 -3
  427. package/lib/components/Menu/MenuItem.d.ts.map +1 -1
  428. package/lib/components/Menu/MenuItem.js.map +1 -1
  429. package/lib/components/Menu/MenuList.d.ts +2 -2
  430. package/lib/components/Menu/MenuList.d.ts.map +1 -1
  431. package/lib/components/Menu/MenuList.js.map +1 -1
  432. package/lib/components/Menu/MenuListHeader.d.ts +3 -3
  433. package/lib/components/Menu/MenuListHeader.d.ts.map +1 -1
  434. package/lib/components/Menu/MenuListHeader.js.map +1 -1
  435. package/lib/components/Menu/helpers.d.ts +1 -1
  436. package/lib/components/Menu/helpers.d.ts.map +1 -1
  437. package/lib/components/Menu/helpers.js.map +1 -1
  438. package/lib/components/MenuButton/MenuButton.d.ts +3 -3
  439. package/lib/components/MenuButton/MenuButton.d.ts.map +1 -1
  440. package/lib/components/MenuButton/MenuButton.js.map +1 -1
  441. package/lib/components/MetaList/MetaList.d.ts +2 -2
  442. package/lib/components/MetaList/MetaList.d.ts.map +1 -1
  443. package/lib/components/MetaList/MetaList.js.map +1 -1
  444. package/lib/components/Modal/Contexts.d.ts +1 -1
  445. package/lib/components/Modal/Contexts.d.ts.map +1 -1
  446. package/lib/components/Modal/Contexts.js.map +1 -1
  447. package/lib/components/Modal/DockedModals.d.ts +2 -2
  448. package/lib/components/Modal/DockedModals.d.ts.map +1 -1
  449. package/lib/components/Modal/DockedModals.js.map +1 -1
  450. package/lib/components/Modal/MinimizedModal.d.ts +3 -3
  451. package/lib/components/Modal/MinimizedModal.d.ts.map +1 -1
  452. package/lib/components/Modal/MinimizedModal.js.map +1 -1
  453. package/lib/components/Modal/Modal.d.ts +2 -2
  454. package/lib/components/Modal/Modal.d.ts.map +1 -1
  455. package/lib/components/Modal/Modal.js.map +1 -1
  456. package/lib/components/Modal/Modal.styles.d.ts +1 -1
  457. package/lib/components/Modal/Modal.styles.d.ts.map +1 -1
  458. package/lib/components/Modal/Modal.styles.js.map +1 -1
  459. package/lib/components/Modal/ModalManager.d.ts +2 -2
  460. package/lib/components/Modal/ModalManager.d.ts.map +1 -1
  461. package/lib/components/Modal/ModalManager.js.map +1 -1
  462. package/lib/components/MultiStepForm/FormProgress.styles.d.ts +1 -1
  463. package/lib/components/MultiStepForm/FormProgress.styles.d.ts.map +1 -1
  464. package/lib/components/MultiStepForm/FormProgress.styles.js.map +1 -1
  465. package/lib/components/MultiStepForm/HorizontalFormProgress.d.ts +2 -2
  466. package/lib/components/MultiStepForm/HorizontalFormProgress.d.ts.map +1 -1
  467. package/lib/components/MultiStepForm/HorizontalFormProgress.js.map +1 -1
  468. package/lib/components/MultiStepForm/MultiStepForm.d.ts +3 -3
  469. package/lib/components/MultiStepForm/MultiStepForm.d.ts.map +1 -1
  470. package/lib/components/MultiStepForm/MultiStepForm.js.map +1 -1
  471. package/lib/components/MultiStepForm/MultiStepForm.types.d.ts +3 -3
  472. package/lib/components/MultiStepForm/MultiStepForm.types.d.ts.map +1 -1
  473. package/lib/components/MultiStepForm/MultiStepForm.types.js.map +1 -1
  474. package/lib/components/MultiStepForm/VerticalFormProgress.d.ts +2 -2
  475. package/lib/components/MultiStepForm/VerticalFormProgress.d.ts.map +1 -1
  476. package/lib/components/MultiStepForm/VerticalFormProgress.js.map +1 -1
  477. package/lib/components/Number/NumberDisplay.d.ts +1 -1
  478. package/lib/components/Number/NumberDisplay.d.ts.map +1 -1
  479. package/lib/components/Number/NumberDisplay.js.map +1 -1
  480. package/lib/components/Number/NumberInput.d.ts +3 -3
  481. package/lib/components/Number/NumberInput.d.ts.map +1 -1
  482. package/lib/components/Number/NumberInput.js.map +1 -1
  483. package/lib/components/Number/NumberInput.types.d.ts +3 -3
  484. package/lib/components/Number/NumberInput.types.d.ts.map +1 -1
  485. package/lib/components/Number/NumberInput.types.js.map +1 -1
  486. package/lib/components/Number/NumberRangeInput.d.ts +1 -1
  487. package/lib/components/Number/NumberRangeInput.d.ts.map +1 -1
  488. package/lib/components/Number/NumberRangeInput.js.map +1 -1
  489. package/lib/components/PageTemplates/CategorySubPage.d.ts +3 -3
  490. package/lib/components/PageTemplates/CategorySubPage.d.ts.map +1 -1
  491. package/lib/components/PageTemplates/CategorySubPage.js.map +1 -1
  492. package/lib/components/PageTemplates/CategorySubPage.styles.d.ts.map +1 -1
  493. package/lib/components/PageTemplates/CategorySubPage.styles.js.map +1 -1
  494. package/lib/components/PageTemplates/DashboardPage.d.ts +3 -3
  495. package/lib/components/PageTemplates/DashboardPage.d.ts.map +1 -1
  496. package/lib/components/PageTemplates/DashboardPage.js.map +1 -1
  497. package/lib/components/PageTemplates/PageTemplates.d.ts +5 -4
  498. package/lib/components/PageTemplates/PageTemplates.d.ts.map +1 -1
  499. package/lib/components/PageTemplates/PageTemplates.js.map +1 -1
  500. package/lib/components/Pagination/Pagination.d.ts +1 -1
  501. package/lib/components/Pagination/Pagination.d.ts.map +1 -1
  502. package/lib/components/Pagination/Pagination.js.map +1 -1
  503. package/lib/components/Paragraph/ParagraphDisplay.d.ts +2 -2
  504. package/lib/components/Paragraph/ParagraphDisplay.d.ts.map +1 -1
  505. package/lib/components/Paragraph/ParagraphDisplay.js.map +1 -1
  506. package/lib/components/Phone/PhoneDisplay.d.ts +1 -1
  507. package/lib/components/Phone/PhoneDisplay.d.ts.map +1 -1
  508. package/lib/components/Phone/PhoneDisplay.js.map +1 -1
  509. package/lib/components/Phone/PhoneInput.d.ts +3 -3
  510. package/lib/components/Phone/PhoneInput.d.ts.map +1 -1
  511. package/lib/components/Phone/PhoneInput.js.map +1 -1
  512. package/lib/components/Popover/Popover.d.ts +5 -5
  513. package/lib/components/Popover/Popover.d.ts.map +1 -1
  514. package/lib/components/Popover/Popover.js.map +1 -1
  515. package/lib/components/Popover/PopoverManager.d.ts +1 -1
  516. package/lib/components/Popover/PopoverManager.d.ts.map +1 -1
  517. package/lib/components/Popover/PopoverManager.js.map +1 -1
  518. package/lib/components/Popover/modifiers.d.ts +1 -1
  519. package/lib/components/Popover/modifiers.d.ts.map +1 -1
  520. package/lib/components/Popover/modifiers.js.map +1 -1
  521. package/lib/components/Progress/Bar.d.ts +3 -3
  522. package/lib/components/Progress/Bar.d.ts.map +1 -1
  523. package/lib/components/Progress/Bar.js.map +1 -1
  524. package/lib/components/Progress/Ellipsis.d.ts +3 -3
  525. package/lib/components/Progress/Ellipsis.d.ts.map +1 -1
  526. package/lib/components/Progress/Ellipsis.js.map +1 -1
  527. package/lib/components/Progress/Progress.d.ts +3 -3
  528. package/lib/components/Progress/Progress.d.ts.map +1 -1
  529. package/lib/components/Progress/Progress.js.map +1 -1
  530. package/lib/components/Progress/Progress.styles.d.ts +1 -1
  531. package/lib/components/Progress/Progress.styles.d.ts.map +1 -1
  532. package/lib/components/Progress/Progress.styles.js.map +1 -1
  533. package/lib/components/Progress/Progress.types.d.ts +3 -3
  534. package/lib/components/Progress/Progress.types.d.ts.map +1 -1
  535. package/lib/components/Progress/Progress.types.js.map +1 -1
  536. package/lib/components/Progress/Ring.d.ts +3 -3
  537. package/lib/components/Progress/Ring.d.ts.map +1 -1
  538. package/lib/components/Progress/Ring.js.map +1 -1
  539. package/lib/components/QRCode/QRCode.d.ts +2 -2
  540. package/lib/components/QRCode/QRCode.d.ts.map +1 -1
  541. package/lib/components/QRCode/QRCode.js.map +1 -1
  542. package/lib/components/RadioButton/RadioButton.d.ts +3 -3
  543. package/lib/components/RadioButton/RadioButton.d.ts.map +1 -1
  544. package/lib/components/RadioButton/RadioButton.js.map +1 -1
  545. package/lib/components/RadioCheck/RadioCheck.d.ts +3 -3
  546. package/lib/components/RadioCheck/RadioCheck.d.ts.map +1 -1
  547. package/lib/components/RadioCheck/RadioCheck.js.map +1 -1
  548. package/lib/components/RadioCheckGroup/RadioCheckGroup.d.ts +5 -5
  549. package/lib/components/RadioCheckGroup/RadioCheckGroup.d.ts.map +1 -1
  550. package/lib/components/RadioCheckGroup/RadioCheckGroup.js.map +1 -1
  551. package/lib/components/Rating/Rating.d.ts +1 -1
  552. package/lib/components/Rating/Rating.d.ts.map +1 -1
  553. package/lib/components/Rating/Rating.js.map +1 -1
  554. package/lib/components/SearchInput/SearchInput.d.ts +3 -3
  555. package/lib/components/SearchInput/SearchInput.d.ts.map +1 -1
  556. package/lib/components/SearchInput/SearchInput.js.map +1 -1
  557. package/lib/components/Select/Option.d.ts +2 -2
  558. package/lib/components/Select/Option.d.ts.map +1 -1
  559. package/lib/components/Select/Option.js.map +1 -1
  560. package/lib/components/Select/Select.d.ts +3 -3
  561. package/lib/components/Select/Select.d.ts.map +1 -1
  562. package/lib/components/Select/Select.js.map +1 -1
  563. package/lib/components/Sentiment/Sentiment.d.ts +2 -2
  564. package/lib/components/Sentiment/Sentiment.d.ts.map +1 -1
  565. package/lib/components/Sentiment/Sentiment.js.map +1 -1
  566. package/lib/components/ShortcutManager/ShortcutManager.d.ts +1 -1
  567. package/lib/components/ShortcutManager/ShortcutManager.d.ts.map +1 -1
  568. package/lib/components/ShortcutManager/ShortcutManager.js.map +1 -1
  569. package/lib/components/ShortcutManager/ShortcutManager.types.d.ts +1 -1
  570. package/lib/components/ShortcutManager/ShortcutManager.types.d.ts.map +1 -1
  571. package/lib/components/ShortcutManager/ShortcutManager.types.js.map +1 -1
  572. package/lib/components/ShowMoreLess/ShowMoreLess.d.ts +1 -1
  573. package/lib/components/ShowMoreLess/ShowMoreLess.d.ts.map +1 -1
  574. package/lib/components/ShowMoreLess/ShowMoreLess.js.map +1 -1
  575. package/lib/components/Skeleton/LineSkeleton.d.ts +2 -2
  576. package/lib/components/Skeleton/LineSkeleton.d.ts.map +1 -1
  577. package/lib/components/Skeleton/LineSkeleton.js.map +1 -1
  578. package/lib/components/Skeleton/ParagraphSkeleton.d.ts +2 -2
  579. package/lib/components/Skeleton/ParagraphSkeleton.d.ts.map +1 -1
  580. package/lib/components/Skeleton/ParagraphSkeleton.js.map +1 -1
  581. package/lib/components/Skeleton/RectangleSkeleton.d.ts +2 -2
  582. package/lib/components/Skeleton/RectangleSkeleton.d.ts.map +1 -1
  583. package/lib/components/Skeleton/RectangleSkeleton.js.map +1 -1
  584. package/lib/components/SkipLinks/SkipLinks.d.ts +1 -1
  585. package/lib/components/SkipLinks/SkipLinks.d.ts.map +1 -1
  586. package/lib/components/SkipLinks/SkipLinks.js.map +1 -1
  587. package/lib/components/Slider/Slider.d.ts +3 -3
  588. package/lib/components/Slider/Slider.d.ts.map +1 -1
  589. package/lib/components/Slider/Slider.js.map +1 -1
  590. package/lib/components/Slider/Slider.styles.d.ts +3 -3
  591. package/lib/components/Slider/Slider.styles.d.ts.map +1 -1
  592. package/lib/components/Slider/Slider.styles.js.map +1 -1
  593. package/lib/components/Slider/Slider.types.d.ts +2 -2
  594. package/lib/components/Slider/Slider.types.d.ts.map +1 -1
  595. package/lib/components/Slider/Slider.types.js.map +1 -1
  596. package/lib/components/Slider/SliderTicks.d.ts +2 -2
  597. package/lib/components/Slider/SliderTicks.d.ts.map +1 -1
  598. package/lib/components/Slider/SliderTicks.js.map +1 -1
  599. package/lib/components/Slider/utils.d.ts +2 -1
  600. package/lib/components/Slider/utils.d.ts.map +1 -1
  601. package/lib/components/Slider/utils.js.map +1 -1
  602. package/lib/components/SummaryItem/SummaryItem.d.ts +3 -3
  603. package/lib/components/SummaryItem/SummaryItem.d.ts.map +1 -1
  604. package/lib/components/SummaryItem/SummaryItem.js.map +1 -1
  605. package/lib/components/SummaryList/SummaryList.d.ts +6 -5
  606. package/lib/components/SummaryList/SummaryList.d.ts.map +1 -1
  607. package/lib/components/SummaryList/SummaryList.js.map +1 -1
  608. package/lib/components/SummaryList/ViewAll.d.ts +3 -3
  609. package/lib/components/SummaryList/ViewAll.d.ts.map +1 -1
  610. package/lib/components/SummaryList/ViewAll.js.map +1 -1
  611. package/lib/components/Switch/Switch.d.ts +2 -2
  612. package/lib/components/Switch/Switch.d.ts.map +1 -1
  613. package/lib/components/Switch/Switch.js.map +1 -1
  614. package/lib/components/Table/Table.d.ts +1 -1
  615. package/lib/components/Table/Table.d.ts.map +1 -1
  616. package/lib/components/Table/Table.js.map +1 -1
  617. package/lib/components/Tabs/Tab.d.ts +3 -3
  618. package/lib/components/Tabs/Tab.d.ts.map +1 -1
  619. package/lib/components/Tabs/Tab.js.map +1 -1
  620. package/lib/components/Tabs/TabPanel.d.ts +2 -2
  621. package/lib/components/Tabs/TabPanel.d.ts.map +1 -1
  622. package/lib/components/Tabs/TabPanel.js.map +1 -1
  623. package/lib/components/Tabs/Tabs.d.ts +3 -3
  624. package/lib/components/Tabs/Tabs.d.ts.map +1 -1
  625. package/lib/components/Tabs/Tabs.js.map +1 -1
  626. package/lib/components/Tabs/Tabs.types.d.ts +1 -1
  627. package/lib/components/Tabs/Tabs.types.d.ts.map +1 -1
  628. package/lib/components/Tabs/Tabs.types.js.map +1 -1
  629. package/lib/components/Text/Text.d.ts +2 -2
  630. package/lib/components/Text/Text.d.ts.map +1 -1
  631. package/lib/components/Text/Text.js.map +1 -1
  632. package/lib/components/TextArea/TextArea.d.ts +3 -3
  633. package/lib/components/TextArea/TextArea.d.ts.map +1 -1
  634. package/lib/components/TextArea/TextArea.js.map +1 -1
  635. package/lib/components/Toaster/Context.d.ts +1 -1
  636. package/lib/components/Toaster/Context.d.ts.map +1 -1
  637. package/lib/components/Toaster/Context.js.map +1 -1
  638. package/lib/components/Toaster/Toaster.d.ts +3 -3
  639. package/lib/components/Toaster/Toaster.d.ts.map +1 -1
  640. package/lib/components/Toaster/Toaster.js.map +1 -1
  641. package/lib/components/Toaster/Toaster.types.d.ts +2 -2
  642. package/lib/components/Toaster/Toaster.types.d.ts.map +1 -1
  643. package/lib/components/Toaster/Toaster.types.js.map +1 -1
  644. package/lib/components/Tooltip/Tooltip.d.ts +3 -3
  645. package/lib/components/Tooltip/Tooltip.d.ts.map +1 -1
  646. package/lib/components/Tooltip/Tooltip.js.map +1 -1
  647. package/lib/components/Tree/StandardTree.d.ts.map +1 -1
  648. package/lib/components/Tree/StandardTree.js.map +1 -1
  649. package/lib/components/Tree/StandardTree.styles.d.ts +1 -1
  650. package/lib/components/Tree/StandardTree.styles.d.ts.map +1 -1
  651. package/lib/components/Tree/StandardTree.styles.js.map +1 -1
  652. package/lib/components/Tree/Tree.d.ts +2 -2
  653. package/lib/components/Tree/Tree.d.ts.map +1 -1
  654. package/lib/components/Tree/Tree.js.map +1 -1
  655. package/lib/components/URL/URLDisplay.d.ts +2 -2
  656. package/lib/components/URL/URLDisplay.d.ts.map +1 -1
  657. package/lib/components/URL/URLDisplay.js.map +1 -1
  658. package/lib/components/VisuallyHiddenText/VisuallyHiddenText.d.ts +2 -2
  659. package/lib/components/VisuallyHiddenText/VisuallyHiddenText.d.ts.map +1 -1
  660. package/lib/components/VisuallyHiddenText/VisuallyHiddenText.js.map +1 -1
  661. package/lib/hooks/index.d.ts +2 -1
  662. package/lib/hooks/index.d.ts.map +1 -1
  663. package/lib/hooks/index.js.map +1 -1
  664. package/lib/hooks/useActiveDescendant.d.ts +2 -2
  665. package/lib/hooks/useActiveDescendant.d.ts.map +1 -1
  666. package/lib/hooks/useActiveDescendant.js.map +1 -1
  667. package/lib/hooks/useAfterInitialEffect.d.ts +1 -1
  668. package/lib/hooks/useAfterInitialEffect.d.ts.map +1 -1
  669. package/lib/hooks/useAfterInitialEffect.js.map +1 -1
  670. package/lib/hooks/useArrows.d.ts +1 -1
  671. package/lib/hooks/useArrows.d.ts.map +1 -1
  672. package/lib/hooks/useArrows.js.map +1 -1
  673. package/lib/hooks/useAutoResize.d.ts +1 -1
  674. package/lib/hooks/useAutoResize.d.ts.map +1 -1
  675. package/lib/hooks/useAutoResize.js.map +1 -1
  676. package/lib/hooks/useBreakpoint.d.ts +1 -1
  677. package/lib/hooks/useBreakpoint.d.ts.map +1 -1
  678. package/lib/hooks/useBreakpoint.js.map +1 -1
  679. package/lib/hooks/useConsolidatedRef.d.ts +1 -1
  680. package/lib/hooks/useConsolidatedRef.d.ts.map +1 -1
  681. package/lib/hooks/useConsolidatedRef.js.map +1 -1
  682. package/lib/hooks/useDraggable.d.ts +1 -1
  683. package/lib/hooks/useDraggable.d.ts.map +1 -1
  684. package/lib/hooks/useDraggable.js.map +1 -1
  685. package/lib/hooks/useElement.d.ts +1 -1
  686. package/lib/hooks/useElement.d.ts.map +1 -1
  687. package/lib/hooks/useElement.js.map +1 -1
  688. package/lib/hooks/useEscape.d.ts +1 -1
  689. package/lib/hooks/useEscape.d.ts.map +1 -1
  690. package/lib/hooks/useEscape.js.map +1 -1
  691. package/lib/hooks/useEvent.d.ts +1 -1
  692. package/lib/hooks/useEvent.d.ts.map +1 -1
  693. package/lib/hooks/useEvent.js.map +1 -1
  694. package/lib/hooks/useFocusTrap.d.ts +1 -1
  695. package/lib/hooks/useFocusTrap.d.ts.map +1 -1
  696. package/lib/hooks/useFocusTrap.js.map +1 -1
  697. package/lib/hooks/useFocusWithin.d.ts +1 -1
  698. package/lib/hooks/useFocusWithin.d.ts.map +1 -1
  699. package/lib/hooks/useFocusWithin.js.map +1 -1
  700. package/lib/hooks/useI18n.d.ts +4 -0
  701. package/lib/hooks/useI18n.d.ts.map +1 -1
  702. package/lib/hooks/useInputFormatter.d.ts +1 -1
  703. package/lib/hooks/useInputFormatter.d.ts.map +1 -1
  704. package/lib/hooks/useInputFormatter.js.map +1 -1
  705. package/lib/hooks/useItemIntersection.d.ts +1 -1
  706. package/lib/hooks/useItemIntersection.d.ts.map +1 -1
  707. package/lib/hooks/useItemIntersection.js.map +1 -1
  708. package/lib/hooks/useOuterEvent.d.ts +1 -1
  709. package/lib/hooks/useOuterEvent.d.ts.map +1 -1
  710. package/lib/hooks/useOuterEvent.js.map +1 -1
  711. package/lib/hooks/useTestIds.d.ts +1 -1
  712. package/lib/hooks/useTestIds.d.ts.map +1 -1
  713. package/lib/hooks/useTestIds.js.map +1 -1
  714. package/lib/hooks/useTheme.d.ts +1 -1
  715. package/lib/hooks/useTheme.d.ts.map +1 -1
  716. package/lib/hooks/useTheme.js.map +1 -1
  717. package/lib/hooks/useTransitionState.d.ts +1 -1
  718. package/lib/hooks/useTransitionState.d.ts.map +1 -1
  719. package/lib/hooks/useTransitionState.js.map +1 -1
  720. package/lib/i18n/default.d.ts +4 -0
  721. package/lib/i18n/default.d.ts.map +1 -1
  722. package/lib/i18n/default.js +4 -0
  723. package/lib/i18n/default.js.map +1 -1
  724. package/lib/i18n/i18n.d.ts +4 -0
  725. package/lib/i18n/i18n.d.ts.map +1 -1
  726. package/lib/i18n/translate.js.map +1 -1
  727. package/lib/styles/GlobalStyle.d.ts +1 -1
  728. package/lib/styles/GlobalStyle.d.ts.map +1 -1
  729. package/lib/styles/GlobalStyle.js.map +1 -1
  730. package/lib/styles/utils.d.ts +2 -2
  731. package/lib/styles/utils.d.ts.map +1 -1
  732. package/lib/styles/utils.js.map +1 -1
  733. package/lib/theme/ThemeMachine.d.ts +1 -1
  734. package/lib/theme/ThemeMachine.d.ts.map +1 -1
  735. package/lib/theme/ThemeMachine.js.map +1 -1
  736. package/lib/theme/theme.d.ts +2 -1
  737. package/lib/theme/theme.d.ts.map +1 -1
  738. package/lib/theme/theme.js.map +1 -1
  739. package/package.json +1 -1
@@ -1 +1 @@
1
- {"version":3,"file":"utils.js","sourceRoot":"","sources":["../../../src/components/Slider/utils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAIrC;;;;;;;;;;;;;;;;GAgBG;AACH,MAAM,CAAC,MAAM,qBAAqB,GAAG,CACnC,QAA2C,EAC3C,GAAW,EACX,GAAW,EACX,IAAY,EACZ,OAAgB,EACE,EAAE;IACpB,iFAAiF;IACjF,MAAM,IAAI,GAAG,MAAM,CAAC,OAAO,CAAC,QAAQ,CAAC;SAClC,MAAM,CAAC,CAAC,CAAC,SAAS,CAAC,EAAE,EAAE,CAAC,MAAM,CAAC,SAAS,CAAC,IAAI,GAAG,IAAI,MAAM,CAAC,SAAS,CAAC,IAAI,GAAG,CAAC;SAC7E,IAAI,CAAC,CAAC,CAAC,UAAU,CAAC,EAAE,CAAC,UAAU,CAAC,EAAE,EAAE,CAAC,MAAM,CAAC,UAAU,CAAC,GAAG,MAAM,CAAC,UAAU,CAAC,CAAC;SAC7E,GAAG,CAAC,CAAC,CAAC,SAAS,EAAE,SAAS,CAAC,EAAE,EAAE;QAC9B,MAAM,IAAI,GAAG,CAAC,MAAM,CAAC,SAAS,CAAC,GAAG,GAAG,CAAC,GAAG,IAAI,GAAG,CAAC,CAAC,CAAC,+EAA+E;QAClI,MAAM,SAAS,GAAG,IAAI,CAAC;QACvB,MAAM,OAAO,GAAG,SAAS,GAAG,CAAC,CAAC;QAC9B,OAAO;YACL,KAAK,EAAE,SAAS;YAChB,GAAG,EAAE,OAAO;YACZ,KAAK,EAAE,MAAM,CAAC,SAAS,CAAC;YACxB,KAAK,EAAE,SAAS;SACjB,CAAC;IACJ,CAAC,CAAC,CAAC;IAEL,IAAI,CAAC,OAAO;QAAE,OAAO,IAA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,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,IAAI,CAAC,QAAQ,EAAE,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,EAAE,MAAM,CAAC;IACvD,OAAO,MAAM,CAAC,MAAM,CAAC,OAAO,CAAC,QAAQ,IAAI,CAAC,CAAC,CAAC,CAAC;AAC/C,CAAC,CAAC;AAEF;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,oBAAoB,GAAG,CAAC,GAAW,EAAE,GAAW,EAAE,IAAY,EAAU,EAAE;IACrF,OAAO,IAAI,CAAC,GAAG,CACb,GAAG,CAAC,QAAQ,EAAE,CAAC,MAAM,EACrB,CAAC,GAAG,GAAG,IAAI,CAAC,CAAC,QAAQ,EAAE,CAAC,MAAM,EAC9B,GAAG,CAAC,QAAQ,EAAE,CAAC,MAAM,EACrB,CAAC,GAAG,GAAG,IAAI,CAAC,CAAC,QAAQ,EAAE,CAAC,MAAM,CAC/B,CAAC;AACJ,CAAC,CAAC","sourcesContent":["import { triple } 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 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 return Math.max(\n min.toString().length,\n (min + step).toString().length,\n max.toString().length,\n (max - step).toString().length\n );\n};\n"]}
1
+ {"version":3,"file":"utils.js","sourceRoot":"","sources":["../../../src/components/Slider/utils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAKrC;;;;;;;;;;;;;;;;GAgBG;AACH,MAAM,CAAC,MAAM,qBAAqB,GAAG,CACnC,QAA2C,EAC3C,GAAW,EACX,GAAW,EACX,IAAY,EACZ,OAAgB,EACE,EAAE;IACpB,iFAAiF;IACjF,MAAM,IAAI,GAAG,MAAM,CAAC,OAAO,CAAC,QAAQ,CAAC;SAClC,MAAM,CAAC,CAAC,CAAC,SAAS,CAAC,EAAE,EAAE,CAAC,MAAM,CAAC,SAAS,CAAC,IAAI,GAAG,IAAI,MAAM,CAAC,SAAS,CAAC,IAAI,GAAG,CAAC;SAC7E,IAAI,CAAC,CAAC,CAAC,UAAU,CAAC,EAAE,CAAC,UAAU,CAAC,EAAE,EAAE,CAAC,MAAM,CAAC,UAAU,CAAC,GAAG,MAAM,CAAC,UAAU,CAAC,CAAC;SAC7E,GAAG,CAAC,CAAC,CAAC,SAAS,EAAE,SAAS,CAAC,EAAE,EAAE;QAC9B,MAAM,IAAI,GAAG,CAAC,MAAM,CAAC,SAAS,CAAC,GAAG,GAAG,CAAC,GAAG,IAAI,GAAG,CAAC,CAAC,CAAC,+EAA+E;QAClI,MAAM,SAAS,GAAG,IAAI,CAAC;QACvB,MAAM,OAAO,GAAG,SAAS,GAAG,CAAC,CAAC;QAC9B,OAAO;YACL,KAAK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,MAAM,GAAG,CAAC,CAAC,CAAC;YAChC,sBAAsB;YACtB,GAAG,IAAI,IAAI,CAAC,KAAK,CAAC,MAAM,GAAG,CAAC,CAAC,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,IAAI,CAAC,QAAQ,EAAE,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,EAAE,MAAM,CAAC;IACvD,OAAO,MAAM,CAAC,MAAM,CAAC,OAAO,CAAC,QAAQ,IAAI,CAAC,CAAC,CAAC,CAAC;AAC/C,CAAC,CAAC;AAEF;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,oBAAoB,GAAG,CAAC,GAAW,EAAE,GAAW,EAAE,IAAY,EAAU,EAAE;IACrF,OAAO,IAAI,CAAC,GAAG,CACb,GAAG,CAAC,QAAQ,EAAE,CAAC,MAAM,EACrB,CAAC,GAAG,GAAG,IAAI,CAAC,CAAC,QAAQ,EAAE,CAAC,MAAM,EAC9B,GAAG,CAAC,QAAQ,EAAE,CAAC,MAAM,EACrB,CAAC,GAAG,GAAG,IAAI,CAAC,CAAC,QAAQ,EAAE,CAAC,MAAM,CAC/B,CAAC;AACJ,CAAC,CAAC","sourcesContent":["import { triple } from '../../utils';\n\nimport type SliderProps from './Slider.types';\nimport type { 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 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 return Math.max(\n min.toString().length,\n (min + step).toString().length,\n max.toString().length,\n (max - step).toString().length\n );\n};\n"]}
@@ -1,6 +1,6 @@
1
- import { FunctionComponent, ReactNode, Ref, ElementType } from 'react';
2
- import { GridContainerProps } from '../Grid';
3
- import { ForwardProps, NoChildrenProp, TestIdProp } from '../../types';
1
+ import type { FunctionComponent, ReactNode, Ref, ElementType } from 'react';
2
+ import type { GridContainerProps } from '../Grid';
3
+ import type { ForwardProps, NoChildrenProp, TestIdProp } from '../../types';
4
4
  export interface SummaryItemProps extends NoChildrenProp, TestIdProp {
5
5
  /** Region for the primary information. */
6
6
  primary: NonNullable<ReactNode>;
@@ -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,WAAW,EAAE,MAAM,OAAO,CAAC;AAGpG,OAAa,EAAE,kBAAkB,EAAE,MAAM,SAAS,CAAC;AAEnD,OAAO,EAAE,YAAY,EAAE,cAAc,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAOvE,MAAM,WAAW,gBAAiB,SAAQ,cAAc,EAAE,UAAU;IAClE,0CAA0C;IAC1C,OA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CAAC,KAAK,CAAC,CAAC,CAAC,QAAQ,EAAE,EAClE,QAAQ,EAAE,OAAO,OAAO,KAAK,QAAQ,EACrC,gBAAgB,EAAE,gBAAgB,YAEjC,OAAO,GACM,EACf,SAAS,IAAI,CACZ,KAAC,eAAe,mBACD,OAAO,CAAC,SAAS,EAC9B,IAAI,EAAE,EAAE,IAAI,EAAE,WAAW,EAAE,SAAS,EAAE,OAAO,EAAE,EAC/C,gBAAgB,EAAE,gBAAgB,YAEjC,SAAS,GACM,CACnB,EACA,OAAO,IAAI,CACV,KAAC,IAAI,mBACU,OAAO,CAAC,OAAO,EAC5B,EAAE,EAAE,wBAAwB,EAC5B,IAAI,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE,SAAS,EAAE,QAAQ,EAAE,YAE7C,OAAO,GACH,CACR,IACI,CACR,CAAC;AACJ,CAAC,CACF,CAAC;AAEF,eAAe,WAAW,CAAC,WAAW,EAAE,qBAAqB,CAAC,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, TestIdProp } from '../../types';\nimport { StyledProgressRing } from '../Progress';\nimport { useTestIds } from '../../hooks';\nimport { withTestIds } from '../../utils';\n\nimport { getSummaryItemTestIds } from './SummaryItem.test-ids';\n\nexport interface SummaryItemProps extends NoChildrenProp, TestIdProp {\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 function SummaryItem(\n {\n testId,\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 const testIds = useTestIds(testId, getSummaryItemTestIds);\n\n return (\n <Grid\n data-testid={testIds.root}\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\n data-testid={testIds.visual}\n as={StyledVisual}\n item={{ area: 'visual', alignSelf: 'center' }}\n >\n {visual}\n </Grid>\n )}\n <StyledPrimary\n data-testid={testIds.primary}\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 data-testid={testIds.secondary}\n item={{ area: 'secondary', alignSelf: 'start' }}\n overflowStrategy={overflowStrategy}\n >\n {secondary}\n </StyledSecondary>\n )}\n {actions && (\n <Grid\n data-testid={testIds.actions}\n as={StyledSummaryItemActions}\n item={{ area: 'actions', alignSelf: 'center' }}\n >\n {actions}\n </Grid>\n )}\n </Grid>\n );\n }\n);\n\nexport default withTestIds(SummaryItem, getSummaryItemTestIds);\n"]}
1
+ {"version":3,"file":"SummaryItem.js","sourceRoot":"","sources":["../../../src/components/SummaryItem/SummaryItem.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,OAAO,CAAC;AAEnC,OAAO,MAAM,EAAE,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;AAEhD,OAAO,IAAI,MAAM,SAAS,CAAC;AAE3B,OAAO,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAE/C,OAAO,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAC;AACjD,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACzC,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAE1C,OAAO,EAAE,qBAAqB,EA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AAM,GACF,CACR,EACD,KAAC,aAAa,mBACC,OAAO,CAAC,OAAO,EAC5B,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,YAEjC,OAAO,GACM,EACf,SAAS,IAAI,CACZ,KAAC,eAAe,mBACD,OAAO,CAAC,SAAS,EAC9B,IAAI,EAAE,EAAE,IAAI,EAAE,WAAW,EAAE,SAAS,EAAE,OAAO,EAAE,EAC/C,gBAAgB,EAAE,gBAAgB,YAEjC,SAAS,GACM,CACnB,EACA,OAAO,IAAI,CACV,KAAC,IAAI,mBACU,OAAO,CAAC,OAAO,EAC5B,EAAE,EAAE,wBAAwB,EAC5B,IAAI,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE,SAAS,EAAE,QAAQ,EAAE,YAE7C,OAAO,GACH,CACR,IACI,CACR,CAAC;AACJ,CAAC,CACF,CAAC;AAEF,eAAe,WAAW,CAAC,WAAW,EAAE,qBAAqB,CAAC,CAAC","sourcesContent":["import { forwardRef } from 'react';\nimport type { FunctionComponent, ReactNode, Ref, PropsWithoutRef, ElementType } from 'react';\nimport styled, { css } from 'styled-components';\n\nimport Grid from '../Grid';\nimport type { GridContainerProps } from '../Grid';\nimport { defaultThemeProp } from '../../theme';\nimport type { ForwardProps, NoChildrenProp, TestIdProp } from '../../types';\nimport { StyledProgressRing } from '../Progress';\nimport { useTestIds } from '../../hooks';\nimport { withTestIds } from '../../utils';\n\nimport { getSummaryItemTestIds } from './SummaryItem.test-ids';\n\nexport interface SummaryItemProps extends NoChildrenProp, TestIdProp {\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 function SummaryItem(\n {\n testId,\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 const testIds = useTestIds(testId, getSummaryItemTestIds);\n\n return (\n <Grid\n data-testid={testIds.root}\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\n data-testid={testIds.visual}\n as={StyledVisual}\n item={{ area: 'visual', alignSelf: 'center' }}\n >\n {visual}\n </Grid>\n )}\n <StyledPrimary\n data-testid={testIds.primary}\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 data-testid={testIds.secondary}\n item={{ area: 'secondary', alignSelf: 'start' }}\n overflowStrategy={overflowStrategy}\n >\n {secondary}\n </StyledSecondary>\n )}\n {actions && (\n <Grid\n data-testid={testIds.actions}\n as={StyledSummaryItemActions}\n item={{ area: 'actions', alignSelf: 'center' }}\n >\n {actions}\n </Grid>\n )}\n </Grid>\n );\n }\n);\n\nexport default withTestIds(SummaryItem, getSummaryItemTestIds);\n"]}
@@ -1,8 +1,9 @@
1
- import { Ref, FC } from 'react';
2
- import { ActionsProps } from '../Actions';
3
- import { EmptyStateProps } from '../EmptyState';
4
- import { ForwardProps, NoChildrenProp, OmitStrict, Action, HeadingTag } from '../../types';
5
- import SummaryItem, { SummaryItemProps } from '../SummaryItem';
1
+ import type { Ref, FC } from 'react';
2
+ import type { ActionsProps } from '../Actions';
3
+ import type { EmptyStateProps } from '../EmptyState';
4
+ import type { ForwardProps, NoChildrenProp, OmitStrict, Action, HeadingTag } from '../../types';
5
+ import SummaryItem from '../SummaryItem';
6
+ import type { SummaryItemProps } from '../SummaryItem';
6
7
  import type { ErrorStateProps } from '../ErrorState';
7
8
  export interface SummaryListProps extends NoChildrenProp {
8
9
  /** Name of the utility to be used as its heading along with associated actions and aria attributes. */
@@ -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;AAGtE,OAAgB,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAMnD,OAAmB,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;AAC5D,OAAO,EAAE,YAAY,EAAE,cAAc,EAAE,UAAU,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAI3F,OAAO,WAAW,EAAE,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AAI/D,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;AAGrD,MAAM,WAAW,gBAAiB,SAAQ,cAAc;IACtD,uGAAuG;IACvG,IAAI,CAAC,EAAE,MAAM,CAAC;IACd;;;OAGG;IACH,UAAU,CAAC,EAAE,UAAU,CAAC;IACxB,iDAAiD;IACjD,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,gFAAgF;IAChF,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,wHAAwH;IACxH,OAAO,CAAC,EAAE,MAAM,EAAE,CAAC;IACnB,qDAAqD;IACrD,OAAO,CAAC,EAAE,OAAO,GAAG,MAAM,CAAC;IAC3B,qKAAqK;IACrK,KAAK,EAAE,eAAe,EAAE,CAAC;IACzB,4KAA4K;IAC5K,SAAS,CAAC,EAAE,CAAC,QAAQ,EAAE,QAAQ,KAAK,IAAI,CAAC;IACzC,2DAA2D;IAC3D,WAAW,CAAC,EAAE,eAAe,CAAC,SAAS,CAAC,CAAC;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C,IAAI,IAAC,SAAS,EAAE,EAAE,UAAU,EAAE,QAAQ,EAAE,GAAG,EAAE,CAAC,EAAE,aAC9C,IAAI,IAAI,KAAC,IAAI,IAAC,IAAI,EAAE,IAAI,GAAI,EAC5B,IAAI,IAAI,KAAC,IAAI,IAAC,OAAO,EAAE,UAAU,YAAG,IAAI,GAAQ,EAChD,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAC,KAAK,cAAE,KAAK,GAAS,IAC/C,EACN,OAAO,IAAI,KAAC,OAAO,IAAC,KAAK,EAAE,OAAO,EAAE,eAAe,EAAE,IAAI,GAAI,IACtC,CAC3B,EAED,KAAC,wBAAwB,IAAC,OAAO,EAAE,OAAO,YAAG,OAAO,GAA4B,EAE/E,CAAC,KAAK,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,GAAG,KAAK,CAAC,MAAM,IAAI,SAAS,IAAI,CAC3E,KAAC,UAAU,IAAC,OAAO,EAAC,QAAQ,YAC1B,KAAC,MAAM,IACL,OAAO,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,GACP,GACE,CACd,IACI,CACR,CAAC;AACJ,CAAC,CAAC,CAAC;AAEH,eAAe,WAAW,CAAC","sourcesContent":["import { forwardRef, PropsWithoutRef, Ref, FC, useMemo } from 'react';\nimport styled, { css } from 'styled-components';\n\nimport Actions, { ActionsProps } from '../Actions';\nimport Flex from '../Flex';\nimport Text from '../Text';\nimport Count from '../Badges/Count';\nimport Icon from '../Icon';\nimport Card, { CardHeader, CardContent, CardFooter, StyledCard } from '../Card';\nimport EmptyState, { EmptyStateProps } from '../EmptyState';\nimport { ForwardProps, NoChildrenProp, OmitStrict, Action, HeadingTag } 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';\nimport { StyledCardFooter } from '../Card/CardFooter';\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 /**\n * The heading tag to render the provided name as with.\n * @default 'h2'\n */\n headingTag?: HeadingTag;\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\n extends OmitStrict<SummaryItemProps, 'actions'>,\n Pick<ActionsProps, 'contextualLabel'>,\n 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 StyledSummaryListHeader = styled(CardHeader)(\n ({ theme }) =>\n css`\n &:not(${StyledCard} ${StyledCard} > &) {\n padding-block-end: calc(${theme.base.spacing} / 2);\n }\n `\n);\n\nStyledSummaryListHeader.defaultProps = defaultThemeProp;\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-block-end: 0.0625rem solid ${theme.base.palette['border-line']};\n }\n\n &:not(${StyledCard} ${StyledCard} > &) {\n padding-block-end: calc(${theme.base.spacing} / 2);\n\n & + ${StyledCardFooter} {\n padding-block-start: ${theme.base.spacing};\n }\n }\n `\n);\n\nStyledSummaryListContent.defaultProps = defaultThemeProp;\n\nexport const StyledSummaryListItem: typeof SummaryItem = styled(SummaryItem)(\n ({ theme }) =>\n css`\n padding-block: ${theme.base.spacing};\n\n &:not(:last-child) {\n border-block-end: 0.0625rem solid ${theme.base.palette['border-line']};\n }\n `\n);\n\nStyledSummaryListItem.defaultProps = defaultThemeProp;\n\nexport const SummaryListItems = ({ name, items }: Pick<SummaryListProps, 'items' | 'name'>) => {\n const t = useI18n();\n return (\n <ul>\n {items.map(({ id, actions: itemActions, contextualLabel, ...restItemProps }) => {\n return (\n <StyledSummaryListItem\n key={id}\n {...restItemProps}\n forwardedAs='li'\n actions={\n itemActions && (\n <Actions\n items={itemActions}\n contextualLabel={\n name && contextualLabel\n ? t('action_from_summarylist_heading', [contextualLabel, name])\n : contextualLabel\n }\n />\n )\n }\n />\n );\n })}\n </ul>\n );\n};\n\nconst SummaryList: FC<SummaryListProps & ForwardProps> = forwardRef(function SummaryList(\n {\n icon,\n name,\n headingTag = 'h2',\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 name={name} 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 <StyledSummaryListHeader>\n <Flex container={{ alignItems: 'center', gap: 1 }}>\n {icon && <Icon name={icon} />}\n {name && <Text variant={headingTag}>{name}</Text>}\n {typeof count === 'number' && <Count>{count}</Count>}\n </Flex>\n {actions && <Actions items={actions} contextualLabel={name} />}\n </StyledSummaryListHeader>\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\nexport default SummaryList;\n"]}
1
+ {"version":3,"file":"SummaryList.js","sourceRoot":"","sources":["../../../src/components/SummaryList/SummaryList.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,UAAU,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC;AAE5C,OAAO,MAAM,EAAE,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;AAEhD,OAAO,OAAO,MAAM,YAAY,CAAC;AAEjC,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,UAAU,EAAE,MAAM,SAAS,CAAC;AAChF,OAAO,UAAU,MAAM,eAAe,CAAC;AAGvC,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,WAAW,MAAM,gBAAgB,CAAC;AAEzC,OAAO,QAAQ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,UAAU,CAAC,EAC3E,OAAO,EAAE,SAAS,YAEjB,CAAC,CAAC,UAAU,CAAC,GACP,GACE,CACd,IACI,CACR,CAAC;AACJ,CAAC,CAAC,CAAC;AAEH,eAAe,WAAW,CAAC","sourcesContent":["import { forwardRef, useMemo } from 'react';\nimport type { PropsWithoutRef, Ref, FC } from 'react';\nimport styled, { css } from 'styled-components';\n\nimport Actions from '../Actions';\nimport type { ActionsProps } from '../Actions';\nimport Flex from '../Flex';\nimport Text from '../Text';\nimport Count from '../Badges/Count';\nimport Icon from '../Icon';\nimport Card, { CardHeader, CardContent, CardFooter, StyledCard } from '../Card';\nimport EmptyState from '../EmptyState';\nimport type { EmptyStateProps } from '../EmptyState';\nimport type { ForwardProps, NoChildrenProp, OmitStrict, Action, HeadingTag } from '../../types';\nimport { omitProps } from '../../styles';\nimport { useI18n } from '../../hooks';\nimport { defaultThemeProp } from '../../theme';\nimport SummaryItem from '../SummaryItem';\nimport type { SummaryItemProps } from '../SummaryItem';\nimport Progress from '../Progress';\nimport Button from '../Button';\nimport ErrorState from '../ErrorState';\nimport type { ErrorStateProps } from '../ErrorState';\nimport { StyledCardFooter } from '../Card/CardFooter';\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 /**\n * The heading tag to render the provided name as with.\n * @default 'h2'\n */\n headingTag?: HeadingTag;\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\n extends OmitStrict<SummaryItemProps, 'actions'>,\n Pick<ActionsProps, 'contextualLabel'>,\n 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 StyledSummaryListHeader = styled(CardHeader)(\n ({ theme }) =>\n css`\n &:not(${StyledCard} ${StyledCard} > &) {\n padding-block-end: calc(${theme.base.spacing} / 2);\n }\n `\n);\n\nStyledSummaryListHeader.defaultProps = defaultThemeProp;\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-block-end: 0.0625rem solid ${theme.base.palette['border-line']};\n }\n\n &:not(${StyledCard} ${StyledCard} > &) {\n padding-block-end: calc(${theme.base.spacing} / 2);\n\n & + ${StyledCardFooter} {\n padding-block-start: ${theme.base.spacing};\n }\n }\n `\n);\n\nStyledSummaryListContent.defaultProps = defaultThemeProp;\n\nexport const StyledSummaryListItem: typeof SummaryItem = styled(SummaryItem)(\n ({ theme }) =>\n css`\n padding-block: ${theme.base.spacing};\n\n &:not(:last-child) {\n border-block-end: 0.0625rem solid ${theme.base.palette['border-line']};\n }\n `\n);\n\nStyledSummaryListItem.defaultProps = defaultThemeProp;\n\nexport const SummaryListItems = ({ name, items }: Pick<SummaryListProps, 'items' | 'name'>) => {\n const t = useI18n();\n return (\n <ul>\n {items.map(({ id, actions: itemActions, contextualLabel, ...restItemProps }) => {\n return (\n <StyledSummaryListItem\n key={id}\n {...restItemProps}\n forwardedAs='li'\n actions={\n itemActions && (\n <Actions\n items={itemActions}\n contextualLabel={\n name && contextualLabel\n ? t('action_from_summarylist_heading', [contextualLabel, name])\n : contextualLabel\n }\n />\n )\n }\n />\n );\n })}\n </ul>\n );\n};\n\nconst SummaryList: FC<SummaryListProps & ForwardProps> = forwardRef(function SummaryList(\n {\n icon,\n name,\n headingTag = 'h2',\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 name={name} 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 <StyledSummaryListHeader>\n <Flex container={{ alignItems: 'center', gap: 1 }}>\n {icon && <Icon name={icon} />}\n {name && <Text variant={headingTag}>{name}</Text>}\n {typeof count === 'number' && <Count>{count}</Count>}\n </Flex>\n {actions && <Actions items={actions} contextualLabel={name} />}\n </StyledSummaryListHeader>\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\nexport default SummaryList;\n"]}
@@ -1,7 +1,7 @@
1
- import { Ref, FC } from 'react';
2
- import { SearchInputProps } from '../SearchInput';
1
+ import type { Ref, FC } from 'react';
2
+ import type { SearchInputProps } from '../SearchInput';
3
3
  import type { ForwardProps } from '../../types';
4
- import { SummaryListProps } from './SummaryList';
4
+ import type { SummaryListProps } from './SummaryList';
5
5
  export interface ViewAllProps extends Pick<SummaryListProps, 'loading' | 'actions' | 'items'> {
6
6
  searchInputProps?: SearchInputProps;
7
7
  ref?: Ref<HTMLDivElement>;
@@ -1 +1 @@
1
- {"version":3,"file":"ViewAll.d.ts","sourceRoot":"","sources":["../../../src/components/SummaryList/ViewAll.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAc,GAAG,EAAE,EAAE,EAAY,MAAM,OAAO,CAAC;AAMtD,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,CA4BlD,CAAC;AAEH,eAAe,cAAc,CAAC"}
1
+ {"version":3,"file":"ViewAll.d.ts","sourceRoot":"","sources":["../../../src/components/SummaryList/ViewAll.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,GAAG,EAAE,EAAE,EAAE,MAAM,OAAO,CAAC;AAOrC,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AAMvD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAGhD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAC;AAEtD,MAAM,WAAW,YAAa,SAAQ,IAAI,CAAC,gBAAgB,EAAE,SAAS,GAAG,SAAS,GAAG,OAAO,CAAC;IAC3F,gB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GACG,CACR,EACA,OAAO,IAAI,KAAC,OAAO,IAAC,QAAQ,EAAE,KAAK,EAAE,KAAK,EAAE,OAAO,GAAI,IACnD,CACR,EAEA,OAAO,IAAI,KAAC,QAAQ,IAAC,SAAS,EAAC,OAAO,GAAG,EACzC,CAAC,OAAO,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC,KAAC,WAAW,IAAC,KAAK,EAAE,KAAK,GAAI,CAAC,CAAC,CAAC,KAAC,UAAU,KAAG,CAAC,IAC9D,CACjB,CAAC;AACJ,CAAC,CAAC,CAAC;AAEH,eAAe,cAAc,CAAC","sourcesContent":["import { forwardRef, Ref, FC, useState } 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(function SearchableList(\n { loading, actions, items, searchInputProps, ...restProps },\n ref: ViewAllProps['ref']\n) {\n const [searchValue, setSearchValue] = useState<SearchInputProps['value']>('');\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\n onSearchChange={val => {\n searchInputProps.onSearchChange?.(val);\n setSearchValue(val);\n }}\n value={searchInputProps.value || searchValue}\n />\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\nexport default SearchableList;\n"]}
1
+ {"version":3,"file":"ViewAll.js","sourceRoot":"","sources":["../../../src/components/SummaryList/ViewAll.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,UAAU,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAE7C,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,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AAEhE,OAAO,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAC/C,OAAO,QAAQ,MAAM,aAAa,CAAC;AACnC,OAAO,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AACrC,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AACxD,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;A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S,EAAE,EAAE,UAAU,EAAE,QAAQ,EAAE,GAAG,EAAE,CAAC,EAAE,EAAE,IAAI,EAAE,EAAE,IAAI,EAAE,CAAC,EAAE,YAClE,KAAC,WAAW,IACV,cAAc,EAAE,GAAG,CAAC,EAAE;gCACpB,gBAAgB,CAAC,cAAc,EAAE,CAAC,GAAG,CAAC,CAAC;gCACvC,cAAc,CAAC,GAAG,CAAC,CAAC;4BACtB,CAAC,EACD,KAAK,EAAE,gBAAgB,CAAC,KAAK,IAAI,WAAW,GAC5C,GACG,CACR,EACA,OAAO,IAAI,KAAC,OAAO,IAAC,QAAQ,EAAE,KAAK,EAAE,KAAK,EAAE,OAAO,GAAI,IACnD,CACR,EAEA,OAAO,IAAI,KAAC,QAAQ,IAAC,SAAS,EAAC,OAAO,GAAG,EACzC,CAAC,OAAO,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC,KAAC,WAAW,IAAC,KAAK,EAAE,KAAK,GAAI,CAAC,CAAC,CAAC,KAAC,UAAU,KAAG,CAAC,IAC9D,CACjB,CAAC;AACJ,CAAC,CAAC,CAAC;AAEH,eAAe,cAAc,CAAC","sourcesContent":["import { forwardRef, useState } from 'react';\nimport type { 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, { StyledSearchInput } from '../SearchInput';\nimport type { SearchInputProps } 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 from './SummaryList';\nimport type { 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(function SearchableList(\n { loading, actions, items, searchInputProps, ...restProps },\n ref: ViewAllProps['ref']\n) {\n const [searchValue, setSearchValue] = useState<SearchInputProps['value']>('');\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\n onSearchChange={val => {\n searchInputProps.onSearchChange?.(val);\n setSearchValue(val);\n }}\n value={searchInputProps.value || searchValue}\n />\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\nexport default SearchableList;\n"]}
@@ -1,6 +1,6 @@
1
- import { ChangeEvent, FunctionComponent, Ref } from 'react';
1
+ import type { ChangeEvent, FunctionComponent, Ref } from 'react';
2
2
  import type { BaseProps, ForwardProps, NoChildrenProp } from '../../types';
3
- import { FormControlProps } from '../FormControl';
3
+ import type { FormControlProps } from '../FormControl';
4
4
  export interface SwitchProps extends BaseProps, NoChildrenProp {
5
5
  /**
6
6
  * Sets DOM id for the control and associates label element via 'for' attribute.
@@ -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,KAAK,EAAE,SAAS,EAAE,YAAY,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAE3E,OAAO,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AAUlD,MAAM,WAAW,WAAY,SAAQ,SAAS,EAAE,cAAc;IAC5D;;;OAGG;IACH,EAAE,CAAC,EAAE,gBAAgB,CAAC,IAAI,CAAC,CAAC;IAC5B,2DAA2D;IAC3D,KAAK,CAAC,EAAE,gBAAgB,CAAC,OAAO,CAAC,CAAC;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,CA0BxD,CAAC;AAEH,eAAe,MAAM,CAAC"}
1
+ {"version":3,"file":"Switch.d.ts","sourceRoot":"","sources":["../../../src/components/Switch/Switch.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,WAAW,EAAE,iBAAiB,EAAmB,GAAG,EAAE,MAAM,OAAO,CAAC;AAIlF,OAAO,KAAK,EAA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P,MAAM;;;qBAGP,WAAW;mBACb,IAAI,CAAC,kBAAkB,CAAC;;KAEtC,CAAC;AACJ,CAAC,CACF,CAAC;AAEF,WAAW,CAAC,YAAY,GAAG,gBAAgB,CAAC;AAE5C,MAAM,CAAC,MAAM,YAAY,GAAG,MAAM,CAAC,GAAG,CAAA,EAAE,CAAC;AAEzC,MAAM,MAAM,GAAkD,UAAU,CAAC,SAAS,MAAM,CACtF,KAAmC,EACnC,GAAuB;IAEvB,MAAM,GAAG,GAAG,MAAM,EAAE,CAAC;IACrB,MAAM,EAAE,EAAE,GAAG,GAAG,EAAE,KAAK,EAAE,QAAQ,GAAG,KAAK,EAAE,EAAE,GAAG,KAAK,EAAE,QAAQ,EAAE,GAAG,SAAS,EAAE,GAAG,KAAK,CAAC;IAExF,OAAO,CACL,MAAC,YAAY,eACX,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,GACR,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,GAAG,IACvB,IACM,CAChB,CAAC;AACJ,CAAC,CAAC,CAAC;AAEH,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(function Switch(\n props: PropsWithoutRef<SwitchProps>,\n ref: SwitchProps['ref']\n) {\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\nexport default Switch;\n"]}
1
+ {"version":3,"file":"Switch.js","sourceRoot":"","sources":["../../../src/components/Switch/Switch.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,OAAO,CAAC;AAEnC,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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G,EAAE,KAAK,EAAE,QAAQ,GAAG,KAAK,EAAE,EAAE,GAAG,KAAK,EAAE,QAAQ,EAAE,GAAG,SAAS,EAAE,GAAG,KAAK,CAAC;IAExF,OAAO,CACL,MAAC,YAAY,eACX,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,GACR,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,GAAG,IACvB,IACM,CAChB,CAAC;AACJ,CAAC,CAAC,CAAC;AAEH,eAAe,MAAM,CAAC","sourcesContent":["import { forwardRef } from 'react';\nimport type { ChangeEvent, 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 type { 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(function Switch(\n props: PropsWithoutRef<SwitchProps>,\n ref: SwitchProps['ref']\n) {\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\nexport default Switch;\n"]}
@@ -1,4 +1,4 @@
1
- import { Ref, ReactNode, ReactElement, ComponentType } from 'react';
1
+ import type { Ref, ReactNode, ReactElement, ComponentType } from 'react';
2
2
  import type { BaseProps, ForwardProps, NoChildrenProp } from '../../types';
3
3
  export interface DefaultRowData {
4
4
  id: string | number;
@@ -1 +1 @@
1
- {"version":3,"file":"Table.d.ts","sourceRoot":"","sources":["../../../src/components/Table/Table.tsx"],"names":[],"mappings":"AAAA,OAAO,EAA+B,GAAG,EAAE,SAAS,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AAIjG,OAAO,KAAK,EAAE,SAAS,EAAE,YAAY,EAAE,cAAc,EAAqB,MAAM,aAAa,CAAC;AAQ9F,MAAM,WAAW,cAAc;IAC7B,EAAE,EAAE,MAAM,GAAG,MAAM,CAAC;CACrB;AAED,MAAM,WAAW,WAAW,CAAC,OAAO,SAAS,cAAc,GAAG,cAAc;IAC1E,gIAAgI;IAChI,QAAQ,EAAE,aAAa,CAAC,OAAO,CAAC,GAAG,MAAM,OAAO,CAAC;IACjD,uCAAuC;IACvC,KAAK,EAAE,MAAM,CAAC;IACd;;;OAGG;IACH,KAAK,CAAC,EAAE,MAAM,GAAG,QAAQ,GAAG,OAAO,CAAC;IACpC;;;OAGG;IACH,MAAM,CAAC,EAAE,OAAO,CAAC;CAClB;AAED,MAAM,WAAW,UAAU,CAAC,OAAO,SAAS,cAAc,GAAG,cAAc,CACzE,SAAQ,SAAS,EACf,cAAc;IAChB,wDAAwD;IACxD,OAAO,EAAE,WAAW,CAAC,OAAO,CAAC,EAAE,CAAC;IAChC;;;OAGG;IACH,IAAI,CAAC,EAAE,OAAO,EAAE,CAAC;IACjB;;;OAGG;IACH,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB;;;OAGG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,IAAC,EAAE,EAAE,gBAAgB,KAAM,GAAG,EAAE,KAAK,EAAC,KAAK,EAAC,GAAG,EAAE,GAAG,CAAC,KAAK,IAClE,GAAG,CAAC,KAAK,CACC,CACd,CAAC,GACC,GACC,EACR,4BACG,OAAO,IAAI,CACV,uBACE,KAAC,iBAAiB,IAAC,OAAO,EAAE,OAAO,CAAC,MAAM,YACxC,KAAC,QAAQ,IAAC,SAAS,EAAC,OAAO,EAAC,OAAO,EAAE,cAAc,GAAI,GACrC,GACjB,CACN,EACA,IAAI,CAAC,MAAM,GAAG,CAAC;wCACd,CAAC,OAAO;wCACR,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC,EAAE,CAAC,CACd,uBACG,OAAO,CAAC,GAAG,CAAC,CAAC,EAAE,QAAQ,EAAE,QAAQ,EAAE,GAAG,GAAG,EAAE,EAAE,EAAE,CAAC,CAC/C,eAAC,UAAU,IAAC,EAAE,EAAE,cAAc,KAAM,GAAG,EAAE,GAAG,EAAE,GAAG,GAAG,CAAC,KAAK,IAAI,GAAG,CAAC,EAAE,EAAE,IACnE,OAAO,QAAQ,KAAK,UAAU,CAAC,CAAC,CAAC,KAAC,QAAQ,OAAK,GAAG,GAAI,CAAC,CAAC,CAAC,GAAG,CAAC,QAAQ,CAAC,CAC5D,CACd,CAAC,IALK,GAAG,CAAC,EAAE,CAMV,CACN,CAAC,EACH,IAAI,CAAC,MAAM,KAAK,CAAC,IAAI,CAAC,OAAO,IAAI,CAChC,uBACE,KAAC,eAAe,IAAC,OAAO,EAAE,OAAO,CAAC,MAAM,YACtC,KAAC,UAAU,KAAG,GACE,GACf,CACN,IACK,IACI,GACK,IACT,GACT,CACR,CAAC;AACJ,CAAC,CAEuB,CAAC;AAEzB,eAAe,KAAK,CAAC","sourcesContent":["import { forwardRef, PropsWithoutRef, Ref, ReactNode, ReactElement, ComponentType } from 'react';\nimport styled, { css } from 'styled-components';\nimport { hideVisually } from 'polished';\n\nimport type { BaseProps, ForwardProps, NoChildrenProp, PropsWithDefaults } from '../../types';\nimport { defaultThemeProp } from '../../theme';\nimport { calculateFontSize, FontSize } from '../../styles';\nimport Progress from '../Progress';\nimport Text from '../Text';\nimport EmptyState from '../EmptyState';\nimport Card, { CardContent } from '../Card';\n\nexport interface DefaultRowData {\n id: string | number;\n}\n\nexport interface ColumnProps<RowData extends DefaultRowData = DefaultRowData> {\n /** Render cell content for a column with a component or by passing a property key on the row object to serve as an accessor. */\n renderer: ComponentType<RowData> | keyof RowData;\n /** The visual label for the column. */\n label: string;\n /**\n * The text alignment of the column header and the row contents for the column.\n * @default 'left'\n */\n align?: 'left' | 'center' | 'right';\n /**\n * If true, this column will not wrap text on overflow.\n * @default false\n */\n noWrap?: boolean;\n}\n\nexport interface TableProps<RowData extends DefaultRowData = DefaultRowData>\n extends BaseProps,\n NoChildrenProp {\n /** The column headers that will structure the Table. */\n columns: ColumnProps<RowData>[];\n /**\n * The content of the Table, represented as an array of objects with key value pairs.\n * @default []\n */\n data?: RowData[];\n /**\n * Should the data rows highlight when the mouse hovers over them.\n * @default false\n */\n hoverHighlight?: boolean;\n /**\n * Indicates if the data to populate the Table is still loading.\n * @default false\n */\n loading?: boolean;\n /** A message to be displayed when Table data is loading. */\n loadingMessage?: string;\n /** The title that will render above the Table if provided. */\n title?: ReactNode;\n /** Ref for the wrapping element. */\n ref?: Ref<HTMLTableElement>;\n}\n\ntype TablePropsWithDefaults = PropsWithDefaults<TableProps, 'hoverHighlight' | 'loading'>;\n\nconst StyledTable = styled.table<Pick<TablePropsWithDefaults, 'hoverHighlight'>>(props => {\n const {\n hoverHighlight,\n theme: {\n base: {\n palette: { 'secondary-background': hoverBg },\n spacing\n },\n components: { table }\n }\n } = props;\n\n const verticalSpacingHeader = `calc(${table.header['vertical-spacing']} * ${spacing})`;\n const verticalSpacingBody = `calc(${table.body['vertical-spacing']} * ${spacing})`;\n const horizontalSpacing = `calc(max(${table.header['horizontal-spacing']}, ${table.body['horizontal-spacing']}) * ${spacing})`;\n\n const borderHeader = `${table.header['border-width']} solid ${table.header['border-color']}`;\n const borderBody = `${table.body['border-width']} solid ${table.body['border-color']}`;\n\n return css`\n border-collapse: collapse;\n width: 100%;\n background-color: transparent;\n\n thead {\n tr th {\n padding: ${`${table.spacing['vertical-inner'] ? verticalSpacingHeader : '0'} ${\n table.spacing['horizontal-inner'] ? horizontalSpacing : '0'\n }`};\n border-bottom: ${table.border['horizontal-inner'] ? borderHeader : 'none'};\n border-inline-end: ${table.border['vertical-inner'] ? borderHeader : 'none'};\n }\n\n tr:first-of-type th {\n padding-top: ${table.spacing['vertical-outer'] ? verticalSpacingHeader : '0'};\n border-top: ${table.border['horizontal-outer'] ? borderHeader : 'none'};\n }\n\n tr th:first-of-type {\n padding-inline-start: ${table.spacing['horizontal-outer'] ? horizontalSpacing : '0'};\n border-inline-start: ${table.border['vertical-outer'] ? borderHeader : 'none'};\n }\n\n tr th:last-of-type {\n padding-inline-end: ${table.spacing['horizontal-outer'] ? horizontalSpacing : '0'};\n border-inline-end: ${table.border['vertical-outer'] ? borderHeader : 'none'};\n }\n }\n\n tbody {\n tr td {\n padding: ${`${table.spacing['vertical-inner'] ? verticalSpacingBody : '0'} ${\n table.spacing['horizontal-inner'] ? horizontalSpacing : '0'\n }`};\n border-bottom: ${table.border['horizontal-inner'] ? borderBody : 'none'};\n border-inline-end: ${table.border['vertical-inner'] ? borderBody : 'none'};\n }\n\n tr:last-of-type td {\n padding-bottom: ${table.spacing['vertical-outer'] ? verticalSpacingBody : '0'};\n border-bottom: ${table.border['horizontal-outer'] ? borderBody : 'none'};\n }\n\n tr td:first-of-type {\n padding-inline-start: ${table.spacing['horizontal-outer'] ? horizontalSpacing : '0'};\n border-inline-start: ${table.border['vertical-outer'] ? borderBody : 'none'};\n }\n\n tr td:last-of-type {\n padding-inline-end: ${table.spacing['horizontal-outer'] ? horizontalSpacing : '0'};\n border-inline-end: ${table.border['vertical-outer'] ? borderBody : 'none'};\n }\n }\n\n ${hoverHighlight &&\n css`\n tbody tr:hover td,\n tbody tr:focus-within td {\n background-color: ${hoverBg};\n }\n `}\n `;\n});\n\nStyledTable.defaultProps = defaultThemeProp;\n\nconst StyledCell = styled.td<Pick<ColumnProps, 'align' | 'noWrap'>>(\n ({ align, noWrap = false }) => css`\n text-align: ${align || 'left'};\n white-space: ${noWrap ? 'nowrap' : null};\n `\n);\n\nStyledCell.defaultProps = defaultThemeProp;\n\nconst StyledHeaderCell = styled.th(\n ({\n theme: {\n base: { 'font-size': fontSize, 'font-scale': fontScale },\n components: {\n table: { header }\n }\n }\n }) => {\n const fontSizes = calculateFontSize(fontSize, fontScale);\n\n return css`\n font-size: ${fontSizes[header['font-size'] as FontSize]};\n font-weight: ${header['font-weight']};\n color: ${header['foreground-color']};\n background-color: ${header['background-color']};\n `;\n }\n);\n\nStyledHeaderCell.defaultProps = defaultThemeProp;\n\nconst StyledBodyCell = styled.td(\n ({\n theme: {\n components: {\n table: { body }\n }\n }\n }) => css`\n color: ${body['foreground-color']};\n background-color: ${body['background-color']};\n `\n);\n\nStyledBodyCell.defaultProps = defaultThemeProp;\n\nconst StyledEmptyCell = styled.td`\n padding: calc(2 * ${props => props.theme.base.spacing});\n`;\n\nStyledEmptyCell.defaultProps = defaultThemeProp;\n\nconst StyledLoadingCell = styled.td`\n position: relative;\n height: 6rem;\n`;\n\nexport const StyledTableWrapper = styled.div`\n /* Setting it on a table element requires 'display: block' which breaks a11y. */\n overflow-x: auto;\n`;\n\nStyledTableWrapper.defaultProps = defaultThemeProp;\n\nconst StyledTableCaption = styled.caption`\n ${hideVisually}\n`;\n\nStyledTableCaption.defaultProps = defaultThemeProp;\n\nconst Table = forwardRef(function Table(\n props: PropsWithoutRef<TableProps>,\n ref: Ref<HTMLTableElement>\n) {\n const {\n columns,\n data = [],\n hoverHighlight = false,\n loading = false,\n loadingMessage = '',\n title,\n ...restProps\n } = props;\n\n return (\n <Card>\n <CardContent container={{ rowGap: 1 }}>\n {title && (\n <Text variant='h2' as='span' aria-hidden>\n {title}\n </Text>\n )}\n <StyledTableWrapper>\n <StyledTable ref={ref} hoverHighlight={hoverHighlight} {...restProps}>\n {title && <StyledTableCaption>{title}</StyledTableCaption>}\n <thead>\n <tr>\n {columns.map(col => (\n <StyledCell as={StyledHeaderCell} {...col} scope='col' key={col.label}>\n {col.label}\n </StyledCell>\n ))}\n </tr>\n </thead>\n <tbody>\n {loading && (\n <tr>\n <StyledLoadingCell colSpan={columns.length}>\n <Progress placement='local' message={loadingMessage} />\n </StyledLoadingCell>\n </tr>\n )}\n {data.length > 0 &&\n !loading &&\n data.map(row => (\n <tr key={row.id}>\n {columns.map(({ renderer: Renderer, ...col }) => (\n <StyledCell as={StyledBodyCell} {...col} key={`${col.label}-${row.id}`}>\n {typeof Renderer === 'function' ? <Renderer {...row} /> : row[Renderer]}\n </StyledCell>\n ))}\n </tr>\n ))}\n {data.length === 0 && !loading && (\n <tr>\n <StyledEmptyCell colSpan={columns.length}>\n <EmptyState />\n </StyledEmptyCell>\n </tr>\n )}\n </tbody>\n </StyledTable>\n </StyledTableWrapper>\n </CardContent>\n </Card>\n );\n}) as <RowData extends DefaultRowData = DefaultRowData>(\n props: TableProps<RowData> & ForwardProps\n) => ReactElement | null;\n\nexport default Table;\n"]}
1
+ {"version":3,"file":"Table.js","sourceRoot":"","sources":["../../../src/components/Table/Table.tsx"],"names":[],"mappings":";;AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,OAAO,CAAC;AAEnC,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;AAC/C,OAAO,EAAE,iBAAiB,EAAE,MAAM,cAAc,CAAC;AAEjD,OAAO,QAAQ,MAAM,aAAa,CAAC;AACnC,OAAO,IAAI,MAAM,SAAS,CAAC;AAC3B,OAAO,UAAU,MAAM,eAAe,CAAC;AACvC,OAAO,IAAI,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ACH,IAAI,CAAC,MAAM,KAAK,CAAC,IAAI,CAAC,OAAO,IAAI,CAChC,uBACE,KAAC,eAAe,IAAC,OAAO,EAAE,OAAO,CAAC,MAAM,YACtC,KAAC,UAAU,KAAG,GACE,GACf,CACN,IACK,IACI,GACK,IACT,GACT,CACR,CAAC;AACJ,CAAC,CAEuB,CAAC;AAEzB,eAAe,KAAK,CAAC","sourcesContent":["import { forwardRef } from 'react';\nimport type { PropsWithoutRef, Ref, ReactNode, ReactElement, ComponentType } from 'react';\nimport styled, { css } from 'styled-components';\nimport { hideVisually } from 'polished';\n\nimport type { BaseProps, ForwardProps, NoChildrenProp, PropsWithDefaults } from '../../types';\nimport { defaultThemeProp } from '../../theme';\nimport { calculateFontSize } from '../../styles';\nimport type { FontSize } from '../../styles';\nimport Progress from '../Progress';\nimport Text from '../Text';\nimport EmptyState from '../EmptyState';\nimport Card, { CardContent } from '../Card';\n\nexport interface DefaultRowData {\n id: string | number;\n}\n\nexport interface ColumnProps<RowData extends DefaultRowData = DefaultRowData> {\n /** Render cell content for a column with a component or by passing a property key on the row object to serve as an accessor. */\n renderer: ComponentType<RowData> | keyof RowData;\n /** The visual label for the column. */\n label: string;\n /**\n * The text alignment of the column header and the row contents for the column.\n * @default 'left'\n */\n align?: 'left' | 'center' | 'right';\n /**\n * If true, this column will not wrap text on overflow.\n * @default false\n */\n noWrap?: boolean;\n}\n\nexport interface TableProps<RowData extends DefaultRowData = DefaultRowData>\n extends BaseProps,\n NoChildrenProp {\n /** The column headers that will structure the Table. */\n columns: ColumnProps<RowData>[];\n /**\n * The content of the Table, represented as an array of objects with key value pairs.\n * @default []\n */\n data?: RowData[];\n /**\n * Should the data rows highlight when the mouse hovers over them.\n * @default false\n */\n hoverHighlight?: boolean;\n /**\n * Indicates if the data to populate the Table is still loading.\n * @default false\n */\n loading?: boolean;\n /** A message to be displayed when Table data is loading. */\n loadingMessage?: string;\n /** The title that will render above the Table if provided. */\n title?: ReactNode;\n /** Ref for the wrapping element. */\n ref?: Ref<HTMLTableElement>;\n}\n\ntype TablePropsWithDefaults = PropsWithDefaults<TableProps, 'hoverHighlight' | 'loading'>;\n\nconst StyledTable = styled.table<Pick<TablePropsWithDefaults, 'hoverHighlight'>>(props => {\n const {\n hoverHighlight,\n theme: {\n base: {\n palette: { 'secondary-background': hoverBg },\n spacing\n },\n components: { table }\n }\n } = props;\n\n const verticalSpacingHeader = `calc(${table.header['vertical-spacing']} * ${spacing})`;\n const verticalSpacingBody = `calc(${table.body['vertical-spacing']} * ${spacing})`;\n const horizontalSpacing = `calc(max(${table.header['horizontal-spacing']}, ${table.body['horizontal-spacing']}) * ${spacing})`;\n\n const borderHeader = `${table.header['border-width']} solid ${table.header['border-color']}`;\n const borderBody = `${table.body['border-width']} solid ${table.body['border-color']}`;\n\n return css`\n border-collapse: collapse;\n width: 100%;\n background-color: transparent;\n\n thead {\n tr th {\n padding: ${`${table.spacing['vertical-inner'] ? verticalSpacingHeader : '0'} ${\n table.spacing['horizontal-inner'] ? horizontalSpacing : '0'\n }`};\n border-bottom: ${table.border['horizontal-inner'] ? borderHeader : 'none'};\n border-inline-end: ${table.border['vertical-inner'] ? borderHeader : 'none'};\n }\n\n tr:first-of-type th {\n padding-top: ${table.spacing['vertical-outer'] ? verticalSpacingHeader : '0'};\n border-top: ${table.border['horizontal-outer'] ? borderHeader : 'none'};\n }\n\n tr th:first-of-type {\n padding-inline-start: ${table.spacing['horizontal-outer'] ? horizontalSpacing : '0'};\n border-inline-start: ${table.border['vertical-outer'] ? borderHeader : 'none'};\n }\n\n tr th:last-of-type {\n padding-inline-end: ${table.spacing['horizontal-outer'] ? horizontalSpacing : '0'};\n border-inline-end: ${table.border['vertical-outer'] ? borderHeader : 'none'};\n }\n }\n\n tbody {\n tr td {\n padding: ${`${table.spacing['vertical-inner'] ? verticalSpacingBody : '0'} ${\n table.spacing['horizontal-inner'] ? horizontalSpacing : '0'\n }`};\n border-bottom: ${table.border['horizontal-inner'] ? borderBody : 'none'};\n border-inline-end: ${table.border['vertical-inner'] ? borderBody : 'none'};\n }\n\n tr:last-of-type td {\n padding-bottom: ${table.spacing['vertical-outer'] ? verticalSpacingBody : '0'};\n border-bottom: ${table.border['horizontal-outer'] ? borderBody : 'none'};\n }\n\n tr td:first-of-type {\n padding-inline-start: ${table.spacing['horizontal-outer'] ? horizontalSpacing : '0'};\n border-inline-start: ${table.border['vertical-outer'] ? borderBody : 'none'};\n }\n\n tr td:last-of-type {\n padding-inline-end: ${table.spacing['horizontal-outer'] ? horizontalSpacing : '0'};\n border-inline-end: ${table.border['vertical-outer'] ? borderBody : 'none'};\n }\n }\n\n ${hoverHighlight &&\n css`\n tbody tr:hover td,\n tbody tr:focus-within td {\n background-color: ${hoverBg};\n }\n `}\n `;\n});\n\nStyledTable.defaultProps = defaultThemeProp;\n\nconst StyledCell = styled.td<Pick<ColumnProps, 'align' | 'noWrap'>>(\n ({ align, noWrap = false }) => css`\n text-align: ${align || 'left'};\n white-space: ${noWrap ? 'nowrap' : null};\n `\n);\n\nStyledCell.defaultProps = defaultThemeProp;\n\nconst StyledHeaderCell = styled.th(\n ({\n theme: {\n base: { 'font-size': fontSize, 'font-scale': fontScale },\n components: {\n table: { header }\n }\n }\n }) => {\n const fontSizes = calculateFontSize(fontSize, fontScale);\n\n return css`\n font-size: ${fontSizes[header['font-size'] as FontSize]};\n font-weight: ${header['font-weight']};\n color: ${header['foreground-color']};\n background-color: ${header['background-color']};\n `;\n }\n);\n\nStyledHeaderCell.defaultProps = defaultThemeProp;\n\nconst StyledBodyCell = styled.td(\n ({\n theme: {\n components: {\n table: { body }\n }\n }\n }) => css`\n color: ${body['foreground-color']};\n background-color: ${body['background-color']};\n `\n);\n\nStyledBodyCell.defaultProps = defaultThemeProp;\n\nconst StyledEmptyCell = styled.td`\n padding: calc(2 * ${props => props.theme.base.spacing});\n`;\n\nStyledEmptyCell.defaultProps = defaultThemeProp;\n\nconst StyledLoadingCell = styled.td`\n position: relative;\n height: 6rem;\n`;\n\nexport const StyledTableWrapper = styled.div`\n /* Setting it on a table element requires 'display: block' which breaks a11y. */\n overflow-x: auto;\n`;\n\nStyledTableWrapper.defaultProps = defaultThemeProp;\n\nconst StyledTableCaption = styled.caption`\n ${hideVisually}\n`;\n\nStyledTableCaption.defaultProps = defaultThemeProp;\n\nconst Table = forwardRef(function Table(\n props: PropsWithoutRef<TableProps>,\n ref: Ref<HTMLTableElement>\n) {\n const {\n columns,\n data = [],\n hoverHighlight = false,\n loading = false,\n loadingMessage = '',\n title,\n ...restProps\n } = props;\n\n return (\n <Card>\n <CardContent container={{ rowGap: 1 }}>\n {title && (\n <Text variant='h2' as='span' aria-hidden>\n {title}\n </Text>\n )}\n <StyledTableWrapper>\n <StyledTable ref={ref} hoverHighlight={hoverHighlight} {...restProps}>\n {title && <StyledTableCaption>{title}</StyledTableCaption>}\n <thead>\n <tr>\n {columns.map(col => (\n <StyledCell as={StyledHeaderCell} {...col} scope='col' key={col.label}>\n {col.label}\n </StyledCell>\n ))}\n </tr>\n </thead>\n <tbody>\n {loading && (\n <tr>\n <StyledLoadingCell colSpan={columns.length}>\n <Progress placement='local' message={loadingMessage} />\n </StyledLoadingCell>\n </tr>\n )}\n {data.length > 0 &&\n !loading &&\n data.map(row => (\n <tr key={row.id}>\n {columns.map(({ renderer: Renderer, ...col }) => (\n <StyledCell as={StyledBodyCell} {...col} key={`${col.label}-${row.id}`}>\n {typeof Renderer === 'function' ? <Renderer {...row} /> : row[Renderer]}\n </StyledCell>\n ))}\n </tr>\n ))}\n {data.length === 0 && !loading && (\n <tr>\n <StyledEmptyCell colSpan={columns.length}>\n <EmptyState />\n </StyledEmptyCell>\n </tr>\n )}\n </tbody>\n </StyledTable>\n </StyledTableWrapper>\n </CardContent>\n </Card>\n );\n}) as <RowData extends DefaultRowData = DefaultRowData>(\n props: TableProps<RowData> & ForwardProps\n) => ReactElement | null;\n\nexport default Table;\n"]}
@@ -1,6 +1,6 @@
1
- import { FC, ReactNode } from 'react';
2
- import { ForwardProps } from '../../types';
3
- import { TabsProps } from './Tabs.types';
1
+ import type { FC, ReactNode } from 'react';
2
+ import type { ForwardProps } from '../../types';
3
+ import type { TabsProps } from './Tabs.types';
4
4
  interface TabProps {
5
5
  /** Indicates if this Tab is active. */
6
6
  selected: boolean;
@@ -1 +1 @@
1
- {"version":3,"file":"Tab.d.ts","sourceRoot":"","sources":["../../../src/components/Tabs/Tab.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,EAAE,EAAE,SAAS,EAAoC,MAAM,OAAO,CAAC;AAWxE,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAG3C,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAIzC,UAAU,QAAQ;IAChB,uCAAuC;IACvC,QAAQ,EAAE,OAAO,CAAC;IAClB,kDAAkD;IAClD,OAAO,EAAE,MAAM,CAAC;IAChB,0CAA0C;IAC1C,KAAK,CAAC,EAAE,SAAS,CAAC;IAClB,6DAA6D;IAC7D,IAAI,EAAE,SAAS,CAAC,MAAM,CAAC,CAAC;IACxB,+BAA+B;IAC/B,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,0CAA0C;IAC1C,MAAM,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC;CAC3B;AAED,MAAM,WAAW,cAAc;IAC7B,QAAQ,EAAE,QAAQ,CAAC,UAAU,CAAC,CAAC;IAC/B,OAAO,EAAE,QAAQ,CAAC,MAAM,CAAC,CAAC;CAC3B;AAoID,eAAO,MAAM,SAAS,gNAiCrB,CAAC;AAIF,QAAA,MAAM,GAAG,EAAE,EAAE,CAAC,QAAQ,GAAG,YAAY,CAwBnC,CAAC;AAEH,eAAe,GAAG,CAAC"}
1
+ {"version":3,"file":"Tab.d.ts","sourceRoot":"","sources":["../../../src/components/Tabs/Tab.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,EAAE,EAAE,SAAS,EAAwB,MAAM,OAAO,CAAC;AAYjE,OAAO,KAAK,EAAE,YAAY,EAA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AE,KAAK,EAAE,QAAQ,EAAE,CAAC;;MAExC,eAAe;sCACiB,KAAK,CAAC,IAAI,CAAC,OAAO;;GAErD,CACF,CAAC;AAEF,SAAS,CAAC,YAAY,GAAG,gBAAgB,CAAC;AAE1C,MAAM,GAAG,GAAgC,UAAU,CAAC,SAAS,GAAG,CAC9D,EAAE,QAAQ,EAAE,OAAO,EAAE,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,EAAE,GAAG,SAAS,EAA6B,EAC7F,GAA2B;IAE3B,MAAM,CAAC,GAAG,OAAO,EAAE,CAAC;IACpB,MAAM,CAAC,KAAK,EAAE,QAAQ,CAAC,GAAG,UAAU,EAAE,CAAC;IACvC,MAAM,MAAM,GAAG,kBAAkB,CAAoB,GAAG,EAAE,QAAQ,CAAC,CAAC;IAEpE,OAAO,CACL,MAAC,SAAS,IAAC,GAAG,EAAE,MAAM,EAAE,QAAQ,EAAE,QAAQ,EAAE,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,QAAQ,KAAM,SAAS,aAC1F,2BACG,CAAC,CAAC,MAAM,IAAI,CACX,8BACE,KAAC,eAAe,IAAC,IAAI,EAAC,YAAY,GAAG,EACrC,KAAC,OAAO,IAAC,MAAM,EAAE,KAAK,EAAE,SAAS,EAAC,MAAM,EAAC,SAAS,EAAC,MAAM,YACtD,CAAC,CAAC,mBAAmB,EAAE,CAAC,OAAO,CAAC,CAAC,GAC1B,IACT,CACJ,EACD,+BAAoB,OAAO,YAAG,OAAO,GAAQ,IACxC,EACN,KAAK,IACI,CACb,CAAC;AACJ,CAAC,CAAC,CAAC;AAEH,eAAe,GAAG,CAAC","sourcesContent":["import { FC, ReactNode, forwardRef, PropsWithoutRef, Ref } from 'react';\nimport styled, { StyledProps, css } from 'styled-components';\nimport { transparentize } from 'polished';\n\nimport * as warnSolidIcon from '../Icon/icons/warn-solid.icon';\nimport Icon, { registerIcon } from '../Icon';\nimport { useConsolidatedRef, useElement, useI18n } from '../../hooks';\nimport Tooltip from '../Tooltip';\nimport { defaultThemeProp } from '../../theme';\nimport { tryCatch } from '../../utils';\nimport { StyledCount } from '../Badges/Count';\nimport { ForwardProps } from '../../types';\nimport BareButton from '../Button/BareButton';\n\nimport { TabsProps } from './Tabs.types';\n\nregisterIcon(warnSolidIcon);\n\ninterface TabProps {\n /** Indicates if this Tab is active. */\n selected: boolean;\n /** The text to display as the name of the Tab. */\n content: string;\n /** A number to associate with the Tab. */\n count?: ReactNode;\n /** Determines the direction in which the Tab will render. */\n type: TabsProps['type'];\n /** Disables the tab if true */\n disabled?: boolean;\n /** An error to associate with the Tab. */\n errors?: number | boolean;\n}\n\nexport interface StyledTabProps {\n selected: TabProps['selected'];\n tabType: TabProps['type'];\n}\n\nconst activeStyle = (color: string) => css`\n ::after {\n display: block;\n background-color: ${color};\n }\n`;\n\nconst StyledErrorIcon = styled(Icon)(\n ({ theme }) => css`\n color: ${theme.base.palette.urgent};\n `\n);\n\nStyledErrorIcon.defaultProps = defaultThemeProp;\n\nconst getHorizontalStyles = ({\n selected,\n theme\n}: Pick<StyledProps<StyledTabProps>, 'theme' | 'selected'>) => {\n const primaryColor = theme.base.palette.interactive;\n const lightenedColor = tryCatch(() => transparentize(0.3, primaryColor)) ?? '';\n const { spacing } = theme.base;\n\n return css`\n align-items: center;\n display: flex;\n flex-direction: row;\n height: calc(4 * ${spacing});\n padding: 0 calc(2 * ${spacing});\n border: none;\n text-decoration: none;\n\n span:first-of-type {\n color: ${selected ? primaryColor : theme.base.palette['foreground-color']};\n display: inline-block;\n\n ::before {\n content: attr(data-content);\n display: block;\n font-weight: bold;\n height: 0;\n overflow: hidden;\n visibility: hidden;\n }\n }\n\n &:first-child {\n margin-left: 0;\n }\n\n ::after {\n background: ${selected ? primaryColor : lightenedColor};\n display: ${selected ? 'block' : 'none'};\n content: '';\n position: absolute;\n height: 0.125rem;\n bottom: 0;\n left: 0;\n right: 0;\n }\n\n &:hover&:not(:disabled) {\n ${activeStyle(lightenedColor)}\n text-decoration: none;\n }\n\n &:focus,\n &:not([disabled]):focus {\n ${activeStyle(lightenedColor)}\n box-shadow: ${theme.base.shadow['focus-inset']};\n text-decoration: none;\n }\n\n ${StyledCount} {\n margin-inline-start: calc(0.5 * ${spacing});\n }\n `;\n};\n\nconst getVerticalStyles = ({\n selected,\n theme\n}: Pick<StyledProps<StyledTabProps>, 'theme' | 'selected'>) => {\n const borderColor = theme.base.palette['border-line'];\n const primaryColor = theme.base.palette.interactive;\n const lightenedColor = tryCatch(() => transparentize(0.5, primaryColor)) ?? '';\n const { spacing } = theme.base;\n\n return css`\n display: flex;\n justify-content: space-between;\n align-items: center;\n border-style: solid;\n color: ${theme.base.palette['foreground-color']};\n border-width: 0.0625rem 0;\n border-color: ${borderColor};\n height: calc(5.5 * ${spacing});\n margin-top: -0.0625rem;\n padding: 0 calc(2 * ${spacing});\n text-decoration: none;\n\n &:first-child {\n border-top: 0.0625rem solid ${borderColor};\n }\n\n ::after {\n content: '';\n position: absolute;\n display: ${selected ? 'block' : 'none'};\n top: 0;\n bottom: 0;\n right: 0;\n width: 0.25rem;\n background: ${primaryColor};\n }\n\n &:hover&:not(:disabled) {\n ${activeStyle(lightenedColor)}\n text-decoration: none;\n }\n\n &:focus,\n &:not([disabled]):focus {\n ${activeStyle(primaryColor)}\n box-shadow: inset 0 0 0 0.0625rem ${primaryColor};\n text-decoration: none;\n }\n `;\n};\n\nexport const StyledTab = styled(BareButton)<StyledTabProps>(\n ({ theme, tabType, selected }) => css`\n position: relative;\n background: none;\n cursor: pointer;\n white-space: nowrap;\n\n ${selected &&\n css`\n font-weight: bold;\n `}\n\n & + & {\n margin-inline-start: 0;\n }\n\n &:focus {\n outline: none;\n }\n\n &:disabled {\n cursor: not-allowed;\n opacity: ${theme.base['disabled-opacity']};\n }\n\n ${tabType === 'horizontal'\n ? getHorizontalStyles({ theme, selected })\n : getVerticalStyles({ theme, selected })}\n\n ${StyledErrorIcon} {\n margin-inline-end: calc(0.5 * ${theme.base.spacing});\n }\n `\n);\n\nStyledTab.defaultProps = defaultThemeProp;\n\nconst Tab: FC<TabProps & ForwardProps> = forwardRef(function Tab(\n { selected, content, count, type, disabled, errors, ...restProps }: PropsWithoutRef<TabProps>,\n ref: Ref<HTMLButtonElement>\n) {\n const t = useI18n();\n const [tabEl, setTabEl] = useElement();\n const tabRef = useConsolidatedRef<HTMLButtonElement>(ref, setTabEl);\n\n return (\n <StyledTab ref={tabRef} selected={selected} tabType={type} disabled={disabled} {...restProps}>\n <span>\n {!!errors && (\n <>\n <StyledErrorIcon name='warn-solid' />\n <Tooltip target={tabEl} hideDelay='none' showDelay='none'>\n {t('tab_error_tooltip', [content])}\n </Tooltip>\n </>\n )}\n <span data-content={content}>{content}</span>\n </span>\n {count}\n </StyledTab>\n );\n});\n\nexport default Tab;\n"]}
1
+ {"version":3,"file":"Tab.js","sourceRoot":"","sources":["../../../src/components/Tabs/Tab.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,OAAO,CAAC;AAEnC,OAAO,MAAM,EAAE,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;AAEhD,OAAO,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC;AAE1C,OAAO,KAAK,aAAa,MAAM,+BAA+B,CAAC;AAC/D,OAAO,IAAI,EAAE,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAC7C,OAAO,EAAE,kBAAkB,EAAE,UAAU,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AACtE,OAAO,OAAO,MAAM,YAAY,CAAC;AACjC,OAAO,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAC/C,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AACvC,OAAO,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAE9C,OAAO,UAAU,MAAM,sBAAsB,CAAC;AAI9C,YAAY,CAAC,aAAa,CAAC,CAAC;AAsB5B,MAAM,WAAW,GAAG,CAAC,KAAa,EAAE,E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Q,EAAE,OAAO,EAAE,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,EAAE,GAAG,SAAS,EAA6B,EAC7F,GAA2B;IAE3B,MAAM,CAAC,GAAG,OAAO,EAAE,CAAC;IACpB,MAAM,CAAC,KAAK,EAAE,QAAQ,CAAC,GAAG,UAAU,EAAE,CAAC;IACvC,MAAM,MAAM,GAAG,kBAAkB,CAAoB,GAAG,EAAE,QAAQ,CAAC,CAAC;IAEpE,OAAO,CACL,MAAC,SAAS,IAAC,GAAG,EAAE,MAAM,EAAE,QAAQ,EAAE,QAAQ,EAAE,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,QAAQ,KAAM,SAAS,aAC1F,2BACG,CAAC,CAAC,MAAM,IAAI,CACX,8BACE,KAAC,eAAe,IAAC,IAAI,EAAC,YAAY,GAAG,EACrC,KAAC,OAAO,IAAC,MAAM,EAAE,KAAK,EAAE,SAAS,EAAC,MAAM,EAAC,SAAS,EAAC,MAAM,YACtD,CAAC,CAAC,mBAAmB,EAAE,CAAC,OAAO,CAAC,CAAC,GAC1B,IACT,CACJ,EACD,+BAAoB,OAAO,YAAG,OAAO,GAAQ,IACxC,EACN,KAAK,IACI,CACb,CAAC;AACJ,CAAC,CAAC,CAAC;AAEH,eAAe,GAAG,CAAC","sourcesContent":["import { forwardRef } from 'react';\nimport type { FC, ReactNode, PropsWithoutRef, Ref } from 'react';\nimport styled, { css } from 'styled-components';\nimport type { StyledProps } from 'styled-components';\nimport { transparentize } from 'polished';\n\nimport * as warnSolidIcon from '../Icon/icons/warn-solid.icon';\nimport Icon, { registerIcon } from '../Icon';\nimport { useConsolidatedRef, useElement, useI18n } from '../../hooks';\nimport Tooltip from '../Tooltip';\nimport { defaultThemeProp } from '../../theme';\nimport { tryCatch } from '../../utils';\nimport { StyledCount } from '../Badges/Count';\nimport type { ForwardProps } from '../../types';\nimport BareButton from '../Button/BareButton';\n\nimport type { TabsProps } from './Tabs.types';\n\nregisterIcon(warnSolidIcon);\n\ninterface TabProps {\n /** Indicates if this Tab is active. */\n selected: boolean;\n /** The text to display as the name of the Tab. */\n content: string;\n /** A number to associate with the Tab. */\n count?: ReactNode;\n /** Determines the direction in which the Tab will render. */\n type: TabsProps['type'];\n /** Disables the tab if true */\n disabled?: boolean;\n /** An error to associate with the Tab. */\n errors?: number | boolean;\n}\n\nexport interface StyledTabProps {\n selected: TabProps['selected'];\n tabType: TabProps['type'];\n}\n\nconst activeStyle = (color: string) => css`\n ::after {\n display: block;\n background-color: ${color};\n }\n`;\n\nconst StyledErrorIcon = styled(Icon)(\n ({ theme }) => css`\n color: ${theme.base.palette.urgent};\n `\n);\n\nStyledErrorIcon.defaultProps = defaultThemeProp;\n\nconst getHorizontalStyles = ({\n selected,\n theme\n}: Pick<StyledProps<StyledTabProps>, 'theme' | 'selected'>) => {\n const primaryColor = theme.base.palette.interactive;\n const lightenedColor = tryCatch(() => transparentize(0.3, primaryColor)) ?? '';\n const { spacing } = theme.base;\n\n return css`\n align-items: center;\n display: flex;\n flex-direction: row;\n height: calc(4 * ${spacing});\n padding: 0 calc(2 * ${spacing});\n border: none;\n text-decoration: none;\n\n span:first-of-type {\n color: ${selected ? primaryColor : theme.base.palette['foreground-color']};\n display: inline-block;\n\n ::before {\n content: attr(data-content);\n display: block;\n font-weight: bold;\n height: 0;\n overflow: hidden;\n visibility: hidden;\n }\n }\n\n &:first-child {\n margin-left: 0;\n }\n\n ::after {\n background: ${selected ? primaryColor : lightenedColor};\n display: ${selected ? 'block' : 'none'};\n content: '';\n position: absolute;\n height: 0.125rem;\n bottom: 0;\n left: 0;\n right: 0;\n }\n\n &:hover&:not(:disabled) {\n ${activeStyle(lightenedColor)}\n text-decoration: none;\n }\n\n &:focus,\n &:not([disabled]):focus {\n ${activeStyle(lightenedColor)}\n box-shadow: ${theme.base.shadow['focus-inset']};\n text-decoration: none;\n }\n\n ${StyledCount} {\n margin-inline-start: calc(0.5 * ${spacing});\n }\n `;\n};\n\nconst getVerticalStyles = ({\n selected,\n theme\n}: Pick<StyledProps<StyledTabProps>, 'theme' | 'selected'>) => {\n const borderColor = theme.base.palette['border-line'];\n const primaryColor = theme.base.palette.interactive;\n const lightenedColor = tryCatch(() => transparentize(0.5, primaryColor)) ?? '';\n const { spacing } = theme.base;\n\n return css`\n display: flex;\n justify-content: space-between;\n align-items: center;\n border-style: solid;\n color: ${theme.base.palette['foreground-color']};\n border-width: 0.0625rem 0;\n border-color: ${borderColor};\n height: calc(5.5 * ${spacing});\n margin-top: -0.0625rem;\n padding: 0 calc(2 * ${spacing});\n text-decoration: none;\n\n &:first-child {\n border-top: 0.0625rem solid ${borderColor};\n }\n\n ::after {\n content: '';\n position: absolute;\n display: ${selected ? 'block' : 'none'};\n top: 0;\n bottom: 0;\n right: 0;\n width: 0.25rem;\n background: ${primaryColor};\n }\n\n &:hover&:not(:disabled) {\n ${activeStyle(lightenedColor)}\n text-decoration: none;\n }\n\n &:focus,\n &:not([disabled]):focus {\n ${activeStyle(primaryColor)}\n box-shadow: inset 0 0 0 0.0625rem ${primaryColor};\n text-decoration: none;\n }\n `;\n};\n\nexport const StyledTab = styled(BareButton)<StyledTabProps>(\n ({ theme, tabType, selected }) => css`\n position: relative;\n background: none;\n cursor: pointer;\n white-space: nowrap;\n\n ${selected &&\n css`\n font-weight: bold;\n `}\n\n & + & {\n margin-inline-start: 0;\n }\n\n &:focus {\n outline: none;\n }\n\n &:disabled {\n cursor: not-allowed;\n opacity: ${theme.base['disabled-opacity']};\n }\n\n ${tabType === 'horizontal'\n ? getHorizontalStyles({ theme, selected })\n : getVerticalStyles({ theme, selected })}\n\n ${StyledErrorIcon} {\n margin-inline-end: calc(0.5 * ${theme.base.spacing});\n }\n `\n);\n\nStyledTab.defaultProps = defaultThemeProp;\n\nconst Tab: FC<TabProps & ForwardProps> = forwardRef(function Tab(\n { selected, content, count, type, disabled, errors, ...restProps }: PropsWithoutRef<TabProps>,\n ref: Ref<HTMLButtonElement>\n) {\n const t = useI18n();\n const [tabEl, setTabEl] = useElement();\n const tabRef = useConsolidatedRef<HTMLButtonElement>(ref, setTabEl);\n\n return (\n <StyledTab ref={tabRef} selected={selected} tabType={type} disabled={disabled} {...restProps}>\n <span>\n {!!errors && (\n <>\n <StyledErrorIcon name='warn-solid' />\n <Tooltip target={tabEl} hideDelay='none' showDelay='none'>\n {t('tab_error_tooltip', [content])}\n </Tooltip>\n </>\n )}\n <span data-content={content}>{content}</span>\n </span>\n {count}\n </StyledTab>\n );\n});\n\nexport default Tab;\n"]}
@@ -1,5 +1,5 @@
1
- import { FunctionComponent, ReactNode, Ref } from 'react';
2
- import { ForwardProps } from '../../types';
1
+ import type { FunctionComponent, ReactNode, Ref } from 'react';
2
+ import type { ForwardProps } from '../../types';
3
3
  interface TabPanelProps {
4
4
  /** The id of the Tab that the tab panel is related to. */
5
5
  tabId: string;
@@ -1 +1 @@
1
- {"version":3,"file":"TabPanel.d.ts","sourceRoot":"","sources":["../../../src/components/Tabs/TabPanel.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAc,iBAAiB,EAAE,SAAS,EAAE,GAAG,EAAmB,MAAM,OAAO,CAAC;AAGvF,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAE3C,UAAU,aAAa;IACrB,0DAA0D;IAC1D,KAAK,EAAE,MAAM,CAAC;IACd;;;OAGG;IACH,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,gCAAgC;IAChC,QAAQ,EAAE,SAAS,CAAC;IACpB,oCAAoC;IACpC,GAAG,CAAC,EAAE,GAAG,CAAC,cAAc,CAAC,CAAC;CAC3B;AAMD,eAAO,MAAM,cAAc;aAChB,OAAO;SAehB,CAAC;AAEH,QAAA,MAAM,QAAQ,EAAE,iBAAiB,CAAC,aAAa,GAAG,YAAY,CAgB5D,CAAC;AAIH,eAAe,QAAQ,CAAC"}
1
+ {"version":3,"file":"TabPanel.d.ts","sourceRoot":"","sources":["../../../src/components/Tabs/TabPanel.tsx"],"names":[],"mappings":"AACA,OAAO,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,KAAK,CAAC,CAAC,CAAC,IAAI,EAC9D,IAAI,EAAC,UAAU,qBACE,GAAG,KAAK,EAAE,EAC3B,EAAE,EAAE,GAAG,KAAK,QAAQ,EACpB,GAAG,EAAE,GAAG,YAEP,QAAQ,GACM,CAClB,CAAC;AACJ,CAAC,CAAC,CAAC;AAEH,QAAQ,CAAC,YAAY,GAAG,YAAY,CAAC;AAErC,eAAe,QAAQ,CAAC","sourcesContent":["import { forwardRef, FunctionComponent, ReactNode, Ref, PropsWithoutRef } from 'react';\nimport styled, { css } from 'styled-components';\n\nimport { ForwardProps } from '../../types';\n\ninterface TabPanelProps {\n /** The id of the Tab that the tab panel is related to. */\n tabId: string;\n /**\n * The current selected value of the tabs. Controls the visibility of the tab panel.\n * The tabsValue must match the tabId in order for the TabPanel to show itself.\n */\n currentTabId?: string;\n /** Content of the tab panel. */\n children: ReactNode;\n /** Ref for the wrapping element. */\n ref?: Ref<HTMLDivElement>;\n}\n\nconst defaultProps: Partial<TabPanelProps> = {\n tabId: ''\n};\n\nexport const StyledTabPanel = styled.div<{\n current: boolean;\n}>(({ current }) => {\n return css`\n min-width: 0;\n max-width: 100%;\n\n :focus {\n outline: none;\n }\n\n ${!current &&\n css`\n display: none;\n `}\n `;\n});\n\nconst TabPanel: FunctionComponent<TabPanelProps & ForwardProps> = forwardRef(function TabPanel(\n { tabId, currentTabId, children, ...restProps }: PropsWithoutRef<TabPanelProps>,\n ref: TabPanelProps['ref']\n) {\n return (\n <StyledTabPanel\n {...restProps}\n current={currentTabId && tabId ? currentTabId === tabId : true}\n role='tabpanel'\n aria-labelledby={`${tabId}`}\n id={`${tabId}-panel`}\n ref={ref}\n >\n {children}\n </StyledTabPanel>\n );\n});\n\nTabPanel.defaultProps = defaultProps;\n\nexport default TabPanel;\n"]}
1
+ {"version":3,"file":"TabPanel.js","sourceRoot":"","sources":["../../../src/components/Tabs/TabPanel.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,OAAO,CAAC;AAEnC,OAAO,MAAM,EAAE,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;AAkBhD,MAAM,YAAY,GAA2B;IAC3C,KAAK,EAAE,EAAE;CACV,CAAC;AAEF,MAAM,CAAC,MAAM,cAAc,GAAG,MAAM,CAAC,GAAG,CAErC,CAAC,EAAE,OAAO,EAAE,EAAE,EAAE;IACjB,OAAO,GAAG,CAAA;;;;;;;;MAQN,CAAC,OAAO;QACV,GAAG,CAAA;;KAEF;GACF,CAAC;AACJ,CAAC,CAAC,CAAC;AAEH,MAAM,QAAQ,GAAoD,UAAU,CAAC,SAAS,QAAQ,CAC5F,EAAE,KAAK,EAAE,YAAY,EAAE,QAAQ,EAAE,GAAG,SAAS,EAAkC,EAC/E,GAAyB;IAEzB,OAAO,CACL,KAAC,cAAc,OACT,SAAS,EACb,OAAO,EAAE,YAAY,IAAI,KAAK,CAAC,CAAC,CAAC,YAAY,KAAK,KAAK,CAAC,CAAC,CAAC,IAAI,EAC9D,IAAI,EAAC,UAAU,qBACE,GAAG,KAAK,EAAE,EAC3B,EAAE,EAAE,GAAG,KAAK,QAAQ,EACpB,GAAG,EAAE,GAAG,YAEP,QAAQ,GACM,CAClB,CAAC;AACJ,CAAC,CAAC,CAAC;AAEH,QAAQ,CAAC,YAAY,GAAG,YAAY,CAAC;AAErC,eAAe,QAAQ,CAAC","sourcesContent":["import { forwardRef } from 'react';\nimport type { FunctionComponent, ReactNode, Ref, PropsWithoutRef } from 'react';\nimport styled, { css } from 'styled-components';\n\nimport type { ForwardProps } from '../../types';\n\ninterface TabPanelProps {\n /** The id of the Tab that the tab panel is related to. */\n tabId: string;\n /**\n * The current selected value of the tabs. Controls the visibility of the tab panel.\n * The tabsValue must match the tabId in order for the TabPanel to show itself.\n */\n currentTabId?: string;\n /** Content of the tab panel. */\n children: ReactNode;\n /** Ref for the wrapping element. */\n ref?: Ref<HTMLDivElement>;\n}\n\nconst defaultProps: Partial<TabPanelProps> = {\n tabId: ''\n};\n\nexport const StyledTabPanel = styled.div<{\n current: boolean;\n}>(({ current }) => {\n return css`\n min-width: 0;\n max-width: 100%;\n\n :focus {\n outline: none;\n }\n\n ${!current &&\n css`\n display: none;\n `}\n `;\n});\n\nconst TabPanel: FunctionComponent<TabPanelProps & ForwardProps> = forwardRef(function TabPanel(\n { tabId, currentTabId, children, ...restProps }: PropsWithoutRef<TabPanelProps>,\n ref: TabPanelProps['ref']\n) {\n return (\n <StyledTabPanel\n {...restProps}\n current={currentTabId && tabId ? currentTabId === tabId : true}\n role='tabpanel'\n aria-labelledby={`${tabId}`}\n id={`${tabId}-panel`}\n ref={ref}\n >\n {children}\n </StyledTabPanel>\n );\n});\n\nTabPanel.defaultProps = defaultProps;\n\nexport default TabPanel;\n"]}
@@ -1,6 +1,6 @@
1
- import { FunctionComponent } from 'react';
2
- import { ForwardProps } from '../../types';
3
- import { TabsProps } from './Tabs.types';
1
+ import type { FunctionComponent } from 'react';
2
+ import type { ForwardProps } from '../../types';
3
+ import type { TabsProps } from './Tabs.types';
4
4
  export declare const StyledTabs: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, Partial<TabsProps>, never>;
5
5
  /**
6
6
  * The tabs component will take a list of tab data objects and render out a list of tabs in either vertical or horizontal direction.
@@ -1 +1 @@
1
- {"version":3,"file":"Tabs.d.ts","sourceRoot":"","sources":["../../../src/components/Tabs/Tabs.tsx"],"names":[],"mappings":"AAAA,OAAO,EACL,iBAAiB,EAOlB,MAAM,OAAO,CAAC;AAOf,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAI3C,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAIzC,eAAO,MAAM,UAAU,yHAgBtB,CAAC;AAIF;;;GAGG;AACH,QAAA,MAAM,IAAI,EAAE,iBAAiB,CAAC,SAAS,GAAG,YAAY,CAgGpD,CAAC;AAEH,eAAe,IAAI,CAAC"}
1
+ {"version":3,"file":"Tabs.d.ts","sourceRoot":"","sources":["../../../src/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AK,GAAS,EAC1D,IAAI,EAAE,IAAI,EACV,QAAQ,EAAE,QAAQ,EAClB,OAAO,EAAE,CAAC,KAAwD,EAAE,EAAE;oBACpE,UAAU,EAAE,CAAC,EAAE,EAAE,KAAK,CAAC,CAAC;gBAC1B,CAAC,EACD,IAAI,EAAC,KAAK,EACV,GAAG,EAAE,CAAC,EAAyC,EAAE,EAAE;oBACjD,OAAO,CAAC,OAAO,CAAC,CAAC,CAAC,GAAG,EAAE,CAAC;gBAC1B,CAAC,EACD,SAAS,EAAE,CAAC,CAAgB,EAAE,EAAE;oBAC9B,IAAI,CAAC,YAAY,EAAE,WAAW,EAAE,WAAW,EAAE,SAAS,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,GAAG,CAAC,EAAE;wBACvE,CAAC,CAAC,cAAc,EAAE,CAAC;wBACnB,cAAc,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;qBACtB;gBACH,CAAC,EAED,EAAE,EAAE,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,SAAS,EAC3B,QAAQ,EAAE,QAAQ,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,CAAC,gBACvB,IAAI,EAChB,IAAI,EAAE,IAAI,EACV,QAAQ,EAAE,QAAQ,EAClB,MAAM,EAAE,MAAM,IANT,EAAE,CAOP,CACH,CAAC;QACJ,CAAC,CAAC,GACG,CACR,CAAC;AACJ,CAAC,CAAC,CAAC;AAEH,eAAe,IAAI,CAAC","sourcesContent":["import {\n FunctionComponent,\n MouseEvent,\n KeyboardEvent,\n forwardRef,\n PropsWithoutRef,\n Ref,\n useRef\n} from 'react';\nimport styled, { css } from 'styled-components';\n\nimport { defaultThemeProp } from '../../theme';\nimport Flex from '../Flex';\nimport Link from '../Link';\nimport Count from '../Badges/Count';\nimport { ForwardProps } from '../../types';\nimport { useAfterInitialEffect, useConsolidatedRef } from '../../hooks';\n\nimport Tab from './Tab';\nimport { TabsProps } from './Tabs.types';\n\ntype TabItem = TabsProps['tabs'][number];\n\nexport const StyledTabs = styled.div<Partial<TabsProps>>(\n ({ type, theme }) => css`\n position: relative;\n overflow: ${type === 'horizontal' ? 'auto' : 'visible'};\n ${type === 'horizontal' &&\n css`\n border-bottom: 0.0625rem solid ${theme.base.palette['border-line']};\n height: max-content;\n `}\n\n &:has(:focus-visible) {\n box-shadow: ${type === 'vertical'\n ? theme.base.shadow['focus-group-inset']\n : theme.base.shadow['focus-group']};\n }\n `\n);\n\nStyledTabs.defaultProps = defaultThemeProp;\n\n/**\n * The tabs component will take a list of tab data objects and render out a list of tabs in either vertical or horizontal direction.\n * The tabs component handles which tab is active but will give you a callback function that allows you to make changes when a new tab is activated\n */\nconst Tabs: FunctionComponent<TabsProps & ForwardProps> = forwardRef(function Tabs(\n {\n tabs = [],\n type = 'horizontal',\n currentTabId,\n onTabClick,\n ...restProps\n }: PropsWithoutRef<TabsProps>,\n ref: Ref<HTMLElement>\n) {\n const wrapperRef = useConsolidatedRef(ref);\n\n // Used to keep a reference for every tab in order to focus them with key presses\n const tabRefs = useRef<(HTMLButtonElement | HTMLAnchorElement)[]>([]);\n\n // Handles arrow keypresses for changing the focus\n const changeTabFocus = (event: KeyboardEvent, index: number): void => {\n if (tabRefs.current?.length) {\n const { key } = event;\n if (key === 'ArrowRight' || key === 'ArrowDown') {\n const nextIndex = index + 1 < tabs.length ? index + 1 : 0;\n const nextTab = tabRefs.current[nextIndex] as HTMLButtonElement;\n\n if (!nextTab?.disabled) {\n nextTab?.focus();\n } else {\n changeTabFocus(event, nextIndex);\n }\n } else if (key === 'ArrowLeft' || key === 'ArrowUp') {\n const prevIndex = index === 0 ? tabs.length - 1 : index - 1;\n const prevTab = tabRefs.current[prevIndex] as HTMLButtonElement;\n if (!prevTab?.disabled) {\n prevTab?.focus();\n } else {\n changeTabFocus(event, prevIndex);\n }\n }\n }\n };\n\n useAfterInitialEffect(() => {\n const event = new Event('cosmos-tab-changed', { bubbles: true, composed: true });\n wrapperRef.current?.dispatchEvent(event);\n }, [currentTabId]);\n\n return (\n <Flex\n {...restProps}\n container={{\n direction: type !== 'horizontal' ? 'column' : undefined\n }}\n item={{ shrink: 0 }}\n as={StyledTabs}\n ref={wrapperRef}\n type={type}\n role='tablist'\n aria-orientation={type}\n >\n {tabs.map((tab: TabItem, i) => {\n const { href, name, count, id, disabled, errors } = tab;\n const selected = id === currentTabId;\n\n return (\n <Tab\n id={id}\n aria-selected={selected}\n aria-controls={`${id}-panel`}\n content={name}\n count={typeof count === 'number' && <Count>{count}</Count>}\n href={href}\n selected={selected}\n onClick={(event: MouseEvent<HTMLButtonElement | HTMLAnchorElement>) => {\n onTabClick?.(id, event);\n }}\n role='tab'\n ref={(el: HTMLButtonElement | HTMLAnchorElement) => {\n tabRefs.current[i] = el;\n }}\n onKeyDown={(e: KeyboardEvent) => {\n if (['ArrowRight', 'ArrowDown', 'ArrowLeft', 'ArrowUp'].includes(e.key)) {\n e.preventDefault();\n changeTabFocus(e, i);\n }\n }}\n key={id}\n as={href ? Link : undefined}\n tabIndex={selected ? undefined : -1}\n aria-label={name}\n type={type}\n disabled={disabled}\n errors={errors}\n />\n );\n })}\n </Flex>\n );\n});\n\nexport default Tabs;\n"]}
1
+ {"version":3,"file":"Tabs.js","sourceRoot":"","sources":["../../../src/components/Tabs/Tabs.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC;AAE3C,OAAO,MAAM,EAAE,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;AAEhD,OAAO,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAC/C,OAAO,IAAI,MAAM,SAAS,CAAC;AAC3B,OAAO,IAAI,MAAM,SAAS,CAAC;AAC3B,OAAO,KAAK,MAAM,iBAAiB,CAAC;AAEpC,OAAO,EAAE,qBAAqB,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAC;AAExE,OAAO,GAAG,MAAM,OAAO,CAAC;AAKxB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QACJ,CAAC,CAAC,GACG,CACR,CAAC;AACJ,CAAC,CAAC,CAAC;AAEH,eAAe,IAAI,CAAC","sourcesContent":["import { forwardRef, useRef } from 'react';\nimport type { FunctionComponent, MouseEvent, KeyboardEvent, PropsWithoutRef, Ref } from 'react';\nimport styled, { css } from 'styled-components';\n\nimport { defaultThemeProp } from '../../theme';\nimport Flex from '../Flex';\nimport Link from '../Link';\nimport Count from '../Badges/Count';\nimport type { ForwardProps } from '../../types';\nimport { useAfterInitialEffect, useConsolidatedRef } from '../../hooks';\n\nimport Tab from './Tab';\nimport type { TabsProps } from './Tabs.types';\n\ntype TabItem = TabsProps['tabs'][number];\n\nexport const StyledTabs = styled.div<Partial<TabsProps>>(\n ({ type, theme }) => css`\n position: relative;\n overflow: ${type === 'horizontal' ? 'auto' : 'visible'};\n ${type === 'horizontal' &&\n css`\n border-bottom: 0.0625rem solid ${theme.base.palette['border-line']};\n height: max-content;\n `}\n\n &:has(:focus-visible) {\n box-shadow: ${type === 'vertical'\n ? theme.base.shadow['focus-group-inset']\n : theme.base.shadow['focus-group']};\n }\n `\n);\n\nStyledTabs.defaultProps = defaultThemeProp;\n\n/**\n * The tabs component will take a list of tab data objects and render out a list of tabs in either vertical or horizontal direction.\n * The tabs component handles which tab is active but will give you a callback function that allows you to make changes when a new tab is activated\n */\nconst Tabs: FunctionComponent<TabsProps & ForwardProps> = forwardRef(function Tabs(\n {\n tabs = [],\n type = 'horizontal',\n currentTabId,\n onTabClick,\n ...restProps\n }: PropsWithoutRef<TabsProps>,\n ref: Ref<HTMLElement>\n) {\n const wrapperRef = useConsolidatedRef(ref);\n\n // Used to keep a reference for every tab in order to focus them with key presses\n const tabRefs = useRef<(HTMLButtonElement | HTMLAnchorElement)[]>([]);\n\n // Handles arrow keypresses for changing the focus\n const changeTabFocus = (event: KeyboardEvent, index: number): void => {\n if (tabRefs.current?.length) {\n const { key } = event;\n if (key === 'ArrowRight' || key === 'ArrowDown') {\n const nextIndex = index + 1 < tabs.length ? index + 1 : 0;\n const nextTab = tabRefs.current[nextIndex] as HTMLButtonElement;\n\n if (!nextTab?.disabled) {\n nextTab?.focus();\n } else {\n changeTabFocus(event, nextIndex);\n }\n } else if (key === 'ArrowLeft' || key === 'ArrowUp') {\n const prevIndex = index === 0 ? tabs.length - 1 : index - 1;\n const prevTab = tabRefs.current[prevIndex] as HTMLButtonElement;\n if (!prevTab?.disabled) {\n prevTab?.focus();\n } else {\n changeTabFocus(event, prevIndex);\n }\n }\n }\n };\n\n useAfterInitialEffect(() => {\n const event = new Event('cosmos-tab-changed', { bubbles: true, composed: true });\n wrapperRef.current?.dispatchEvent(event);\n }, [currentTabId]);\n\n return (\n <Flex\n {...restProps}\n container={{\n direction: type !== 'horizontal' ? 'column' : undefined\n }}\n item={{ shrink: 0 }}\n as={StyledTabs}\n ref={wrapperRef}\n type={type}\n role='tablist'\n aria-orientation={type}\n >\n {tabs.map((tab: TabItem, i) => {\n const { href, name, count, id, disabled, errors } = tab;\n const selected = id === currentTabId;\n\n return (\n <Tab\n id={id}\n aria-selected={selected}\n aria-controls={`${id}-panel`}\n content={name}\n count={typeof count === 'number' && <Count>{count}</Count>}\n href={href}\n selected={selected}\n onClick={(event: MouseEvent<HTMLButtonElement | HTMLAnchorElement>) => {\n onTabClick?.(id, event);\n }}\n role='tab'\n ref={(el: HTMLButtonElement | HTMLAnchorElement) => {\n tabRefs.current[i] = el;\n }}\n onKeyDown={(e: KeyboardEvent) => {\n if (['ArrowRight', 'ArrowDown', 'ArrowLeft', 'ArrowUp'].includes(e.key)) {\n e.preventDefault();\n changeTabFocus(e, i);\n }\n }}\n key={id}\n as={href ? Link : undefined}\n tabIndex={selected ? undefined : -1}\n aria-label={name}\n type={type}\n disabled={disabled}\n errors={errors}\n />\n );\n })}\n </Flex>\n );\n});\n\nexport default Tabs;\n"]}
@@ -1,4 +1,4 @@
1
- import { MouseEvent } from 'react';
1
+ import type { MouseEvent } from 'react';
2
2
  import type { BaseProps, NoChildrenProp } from '../../types';
3
3
  export interface Tab {
4
4
  /** The name that will be displayed on the Tab. */