@trellixio/roaster-react 1.1.0 → 2.0.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 (815) hide show
  1. package/README.md +31 -17
  2. package/cjs/components/ActionCard/ActionCard.js +20 -4
  3. package/cjs/components/ActionCard/ActionCard.js.map +1 -1
  4. package/cjs/components/ActionCard/ActionCardGroup.js +42 -0
  5. package/cjs/components/ActionCard/ActionCardGroup.js.map +1 -0
  6. package/cjs/components/ActionList/ActionList.context.js.map +1 -1
  7. package/cjs/components/ActionList/ActionList.js +20 -23
  8. package/cjs/components/ActionList/ActionList.js.map +1 -1
  9. package/cjs/components/ActionList/components/ActionListDivider.js +6 -3
  10. package/cjs/components/ActionList/components/ActionListDivider.js.map +1 -1
  11. package/cjs/components/ActionList/components/ActionListDropdown.js +30 -15
  12. package/cjs/components/ActionList/components/ActionListDropdown.js.map +1 -1
  13. package/cjs/components/ActionList/components/ActionListGroup.js +25 -4
  14. package/cjs/components/ActionList/components/ActionListGroup.js.map +1 -1
  15. package/cjs/components/ActionList/components/ActionListItem.js +54 -4
  16. package/cjs/components/ActionList/components/ActionListItem.js.map +1 -1
  17. package/cjs/components/ActionList/components/ActionListSearch.js +67 -0
  18. package/cjs/components/ActionList/components/ActionListSearch.js.map +1 -0
  19. package/cjs/components/ActionList/components/ActionListSubmenu.js +125 -0
  20. package/cjs/components/ActionList/components/ActionListSubmenu.js.map +1 -0
  21. package/cjs/components/ActionList/components/ActionListSwitchItem.js +64 -0
  22. package/cjs/components/ActionList/components/ActionListSwitchItem.js.map +1 -0
  23. package/cjs/components/ActionList/components/ActionListTrigger.js +2 -36
  24. package/cjs/components/ActionList/components/ActionListTrigger.js.map +1 -1
  25. package/cjs/components/Alert/Alert.js +19 -2
  26. package/cjs/components/Alert/Alert.js.map +1 -1
  27. package/cjs/components/AppFrame/AppFrame.js +56 -0
  28. package/cjs/components/AppFrame/AppFrame.js.map +1 -0
  29. package/cjs/components/Avatar/Avatar.js +31 -8
  30. package/cjs/components/Avatar/Avatar.js.map +1 -1
  31. package/cjs/components/BlockCard/BlockCard.js +98 -4
  32. package/cjs/components/BlockCard/BlockCard.js.map +1 -1
  33. package/cjs/components/Button/Button.js +36 -15
  34. package/cjs/components/Button/Button.js.map +1 -1
  35. package/cjs/components/ButtonIcon/ButtonIcon.js +8 -9
  36. package/cjs/components/ButtonIcon/ButtonIcon.js.map +1 -1
  37. package/cjs/components/Chart/Chart.js +185 -0
  38. package/cjs/components/Chart/Chart.js.map +1 -0
  39. package/cjs/components/Checkbox/Checkbox.js +65 -38
  40. package/cjs/components/Checkbox/Checkbox.js.map +1 -1
  41. package/cjs/components/Checkbox/CheckboxGroup/CheckboxGroup.context.js.map +1 -1
  42. package/cjs/components/Checkbox/CheckboxGroup/CheckboxGroup.js +45 -11
  43. package/cjs/components/Checkbox/CheckboxGroup/CheckboxGroup.js.map +1 -1
  44. package/cjs/components/Checkbox/ChoiceText.js +49 -0
  45. package/cjs/components/Checkbox/ChoiceText.js.map +1 -0
  46. package/cjs/components/ColorField/ColorField.js +69 -18
  47. package/cjs/components/ColorField/ColorField.js.map +1 -1
  48. package/cjs/components/DatePicker/DatePicker.js +86 -48
  49. package/cjs/components/DatePicker/DatePicker.js.map +1 -1
  50. package/cjs/components/DatePicker/components/Calendar/Calendar.js +65 -35
  51. package/cjs/components/DatePicker/components/Calendar/Calendar.js.map +1 -1
  52. package/cjs/components/DatePicker/components/Day/Day.js +16 -31
  53. package/cjs/components/DatePicker/components/Day/Day.js.map +1 -1
  54. package/cjs/components/DatePicker/components/Month/Month.js +92 -29
  55. package/cjs/components/DatePicker/components/Month/Month.js.map +1 -1
  56. package/cjs/components/DatePicker/components/MonthGrid/MonthGrid.js +97 -0
  57. package/cjs/components/DatePicker/components/MonthGrid/MonthGrid.js.map +1 -0
  58. package/cjs/components/DatePicker/components/Weekday/Weekday.js +3 -15
  59. package/cjs/components/DatePicker/components/Weekday/Weekday.js.map +1 -1
  60. package/cjs/components/DatePicker/utils/index.js +43 -25
  61. package/cjs/components/DatePicker/utils/index.js.map +1 -1
  62. package/cjs/components/DescriptiveList/DescriptiveList.js +14 -5
  63. package/cjs/components/DescriptiveList/DescriptiveList.js.map +1 -1
  64. package/cjs/components/DescriptiveList/DescriptiveListItem.js +15 -3
  65. package/cjs/components/DescriptiveList/DescriptiveListItem.js.map +1 -1
  66. package/cjs/components/DropdownCard/DropdownCard.context.js.map +1 -1
  67. package/cjs/components/DropdownCard/DropdownCard.js +17 -22
  68. package/cjs/components/DropdownCard/DropdownCard.js.map +1 -1
  69. package/cjs/components/DropdownCard/components/DropdownCardActions.js +5 -3
  70. package/cjs/components/DropdownCard/components/DropdownCardActions.js.map +1 -1
  71. package/cjs/components/DropdownCard/components/DropdownCardContent.js +5 -3
  72. package/cjs/components/DropdownCard/components/DropdownCardContent.js.map +1 -1
  73. package/cjs/components/DropdownCard/components/DropdownCardDropdown.js +18 -13
  74. package/cjs/components/DropdownCard/components/DropdownCardDropdown.js.map +1 -1
  75. package/cjs/components/DropdownCard/components/DropdownCardTabs.js +136 -0
  76. package/cjs/components/DropdownCard/components/DropdownCardTabs.js.map +1 -0
  77. package/cjs/components/DropdownCard/components/DropdownCardTrigger.js +2 -34
  78. package/cjs/components/DropdownCard/components/DropdownCardTrigger.js.map +1 -1
  79. package/cjs/components/Field/Field.js +27 -0
  80. package/cjs/components/Field/Field.js.map +1 -0
  81. package/cjs/components/FileField/FileField.js +64 -24
  82. package/cjs/components/FileField/FileField.js.map +1 -1
  83. package/cjs/components/FormActions/FormActions.js +27 -0
  84. package/cjs/components/FormActions/FormActions.js.map +1 -0
  85. package/cjs/components/HyperlinkCard/HyperlinkCard.js +22 -6
  86. package/cjs/components/HyperlinkCard/HyperlinkCard.js.map +1 -1
  87. package/cjs/components/Icon/Icon.js +10 -12
  88. package/cjs/components/Icon/Icon.js.map +1 -1
  89. package/cjs/components/IconBadge/IconBadge.js +40 -0
  90. package/cjs/components/IconBadge/IconBadge.js.map +1 -0
  91. package/cjs/components/Loader/Loader.js +35 -2
  92. package/cjs/components/Loader/Loader.js.map +1 -1
  93. package/cjs/components/Modal/Modal.js +91 -4
  94. package/cjs/components/Modal/Modal.js.map +1 -1
  95. package/cjs/components/Modal/ModalProvider/ModalProviderFooter.js +7 -4
  96. package/cjs/components/Modal/ModalProvider/ModalProviderFooter.js.map +1 -1
  97. package/cjs/components/Modal/ModalProvider/index.js +16 -17
  98. package/cjs/components/Modal/ModalProvider/index.js.map +1 -1
  99. package/cjs/components/Modal/utils/reducer.js +4 -1
  100. package/cjs/components/Modal/utils/reducer.js.map +1 -1
  101. package/cjs/components/Modal/utils/useModal.js +1 -1
  102. package/cjs/components/Modal/utils/useModal.js.map +1 -1
  103. package/cjs/components/Page/Breadcrumbs.js +43 -0
  104. package/cjs/components/Page/Breadcrumbs.js.map +1 -0
  105. package/cjs/components/Page/Page.js +73 -8
  106. package/cjs/components/Page/Page.js.map +1 -1
  107. package/cjs/components/Pagination/Pagination.js +23 -12
  108. package/cjs/components/Pagination/Pagination.js.map +1 -1
  109. package/cjs/components/Progress/Progress.js +48 -3
  110. package/cjs/components/Progress/Progress.js.map +1 -1
  111. package/cjs/components/Radio/Radio.js +35 -25
  112. package/cjs/components/Radio/Radio.js.map +1 -1
  113. package/cjs/components/Radio/RadioGroup/RadioGroup.context.js.map +1 -1
  114. package/cjs/components/Radio/RadioGroup/RadioGroup.js +37 -24
  115. package/cjs/components/Radio/RadioGroup/RadioGroup.js.map +1 -1
  116. package/cjs/components/RangeField/RangeField.js +31 -27
  117. package/cjs/components/RangeField/RangeField.js.map +1 -1
  118. package/cjs/components/Select/Select.js +75 -31
  119. package/cjs/components/Select/Select.js.map +1 -1
  120. package/cjs/components/Sidebar/Sidebar.js +122 -110
  121. package/cjs/components/Sidebar/Sidebar.js.map +1 -1
  122. package/cjs/components/Sidebar/components/Back.js +38 -0
  123. package/cjs/components/Sidebar/components/Back.js.map +1 -0
  124. package/cjs/components/Sidebar/components/Menu.js +17 -6
  125. package/cjs/components/Sidebar/components/Menu.js.map +1 -1
  126. package/cjs/components/Sidebar/components/MenuItem.js +37 -6
  127. package/cjs/components/Sidebar/components/MenuItem.js.map +1 -1
  128. package/cjs/components/Sidebar/components/Section.js +15 -3
  129. package/cjs/components/Sidebar/components/Section.js.map +1 -1
  130. package/cjs/components/Sidebar/components/SubMenu.js +15 -2
  131. package/cjs/components/Sidebar/components/SubMenu.js.map +1 -1
  132. package/cjs/components/Spinner/Spinner.js +20 -2
  133. package/cjs/components/Spinner/Spinner.js.map +1 -1
  134. package/cjs/components/StatCard/StatCard.js +47 -10
  135. package/cjs/components/StatCard/StatCard.js.map +1 -1
  136. package/cjs/components/Switch/Switch.js +42 -20
  137. package/cjs/components/Switch/Switch.js.map +1 -1
  138. package/cjs/components/Table/Table.js +95 -31
  139. package/cjs/components/Table/Table.js.map +1 -1
  140. package/cjs/components/Table/components/Checkbox/index.js +8 -8
  141. package/cjs/components/Table/components/Checkbox/index.js.map +1 -1
  142. package/cjs/components/Table/components/TableBody.js +3 -3
  143. package/cjs/components/Table/components/TableBody.js.map +1 -1
  144. package/cjs/components/Table/components/TableCell.js +3 -4
  145. package/cjs/components/Table/components/TableCell.js.map +1 -1
  146. package/cjs/components/Table/components/TableGroup.js +30 -0
  147. package/cjs/components/Table/components/TableGroup.js.map +1 -0
  148. package/cjs/components/Table/components/TableHead.js +19 -16
  149. package/cjs/components/Table/components/TableHead.js.map +1 -1
  150. package/cjs/components/Table/components/TableHeadCell.js +23 -5
  151. package/cjs/components/Table/components/TableHeadCell.js.map +1 -1
  152. package/cjs/components/Table/components/TablePagination.js +6 -16
  153. package/cjs/components/Table/components/TablePagination.js.map +1 -1
  154. package/cjs/components/Table/components/TableProvider/TableProvider.js +4 -4
  155. package/cjs/components/Table/components/TableProvider/TableProvider.js.map +1 -1
  156. package/cjs/components/Table/components/TableRow.js +12 -9
  157. package/cjs/components/Table/components/TableRow.js.map +1 -1
  158. package/cjs/components/Table/labels.js +34 -0
  159. package/cjs/components/Table/labels.js.map +1 -0
  160. package/cjs/components/Table/utils/rows/context.js.map +1 -1
  161. package/cjs/components/Table/utils/table/context.js.map +1 -1
  162. package/cjs/components/Table/utils/table/hooks.js +3 -3
  163. package/cjs/components/Table/utils/table/hooks.js.map +1 -1
  164. package/cjs/components/Table/utils/table/types.js +0 -7
  165. package/cjs/components/Table/utils/table/types.js.map +1 -1
  166. package/cjs/components/Table/utils/useSelectableResourceState/index.js +4 -5
  167. package/cjs/components/Table/utils/useSelectableResourceState/index.js.map +1 -1
  168. package/cjs/components/Tag/Tag.js +36 -5
  169. package/cjs/components/Tag/Tag.js.map +1 -1
  170. package/cjs/components/Tag/TagGroup.js +3 -2
  171. package/cjs/components/Tag/TagGroup.js.map +1 -1
  172. package/cjs/components/TextField/TextField.js +41 -38
  173. package/cjs/components/TextField/TextField.js.map +1 -1
  174. package/cjs/components/Textarea/Textarea.js +10 -26
  175. package/cjs/components/Textarea/Textarea.js.map +1 -1
  176. package/cjs/components/Thumbnail/Thumbnail.js +22 -8
  177. package/cjs/components/Thumbnail/Thumbnail.js.map +1 -1
  178. package/cjs/components/Timeline/Timeline.js +40 -0
  179. package/cjs/components/Timeline/Timeline.js.map +1 -0
  180. package/cjs/components/Timeline/TimelineGroup.js +42 -0
  181. package/cjs/components/Timeline/TimelineGroup.js.map +1 -0
  182. package/cjs/components/Timeline/TimelineItem.js +38 -0
  183. package/cjs/components/Timeline/TimelineItem.js.map +1 -0
  184. package/cjs/components/Toast/Toast.js +18 -2
  185. package/cjs/components/Toast/Toast.js.map +1 -1
  186. package/cjs/components/Toast/Toasts.context.js +31 -3
  187. package/cjs/components/Toast/Toasts.context.js.map +1 -1
  188. package/cjs/components/Toast/ToastsContainer/index.js +43 -19
  189. package/cjs/components/Toast/ToastsContainer/index.js.map +1 -1
  190. package/cjs/components/Toast/ToastsProvider/index.js +11 -15
  191. package/cjs/components/Toast/ToastsProvider/index.js.map +1 -1
  192. package/cjs/components/Toast/store.js +49 -0
  193. package/cjs/components/Toast/store.js.map +1 -0
  194. package/cjs/components/Tooltip/Tooltip.js +34 -53
  195. package/cjs/components/Tooltip/Tooltip.js.map +1 -1
  196. package/cjs/components/Tooltip/TooltipCallout.js +60 -0
  197. package/cjs/components/Tooltip/TooltipCallout.js.map +1 -0
  198. package/cjs/components/Tooltip/useTooltip.js +11 -45
  199. package/cjs/components/Tooltip/useTooltip.js.map +1 -1
  200. package/cjs/components/Visualizer/Visualizer.js +70 -10
  201. package/cjs/components/Visualizer/Visualizer.js.map +1 -1
  202. package/cjs/index.js +68 -66
  203. package/cjs/index.js.map +1 -1
  204. package/cjs/tokens/tokens.js +1532 -0
  205. package/cjs/tokens/tokens.js.map +1 -0
  206. package/cjs/utils/Slot/index.js +52 -0
  207. package/cjs/utils/Slot/index.js.map +1 -0
  208. package/cjs/utils/classNames/index.js +3 -3
  209. package/cjs/utils/classNames/index.js.map +1 -1
  210. package/cjs/utils/getElementRef/index.js +16 -0
  211. package/cjs/utils/getElementRef/index.js.map +1 -0
  212. package/cjs/utils/guid/index.js.map +1 -1
  213. package/cjs/utils/toPercent/index.js +9 -0
  214. package/cjs/utils/toPercent/index.js.map +1 -0
  215. package/cjs/utils/useControllableState/index.js +39 -0
  216. package/cjs/utils/useControllableState/index.js.map +1 -0
  217. package/cjs/utils/useDropdown/DropdownTrigger.js +33 -0
  218. package/cjs/utils/useDropdown/DropdownTrigger.js.map +1 -0
  219. package/cjs/utils/useDropdown/index.js +54 -23
  220. package/cjs/utils/useDropdown/index.js.map +1 -1
  221. package/cjs/utils/useImageFallback/index.js +26 -0
  222. package/cjs/utils/useImageFallback/index.js.map +1 -0
  223. package/cjs/utils/useUid/index.js.map +1 -1
  224. package/esm/components/ActionCard/ActionCard.js +20 -4
  225. package/esm/components/ActionCard/ActionCard.js.map +1 -1
  226. package/esm/components/ActionCard/ActionCardGroup.js +26 -0
  227. package/esm/components/ActionCard/ActionCardGroup.js.map +1 -0
  228. package/esm/components/ActionList/ActionList.context.js.map +1 -1
  229. package/esm/components/ActionList/ActionList.js +21 -11
  230. package/esm/components/ActionList/ActionList.js.map +1 -1
  231. package/esm/components/ActionList/components/ActionListDivider.js +6 -3
  232. package/esm/components/ActionList/components/ActionListDivider.js.map +1 -1
  233. package/esm/components/ActionList/components/ActionListDropdown.js +31 -16
  234. package/esm/components/ActionList/components/ActionListDropdown.js.map +1 -1
  235. package/esm/components/ActionList/components/ActionListGroup.js +24 -3
  236. package/esm/components/ActionList/components/ActionListGroup.js.map +1 -1
  237. package/esm/components/ActionList/components/ActionListItem.js +53 -3
  238. package/esm/components/ActionList/components/ActionListItem.js.map +1 -1
  239. package/esm/components/ActionList/components/ActionListSearch.js +52 -0
  240. package/esm/components/ActionList/components/ActionListSearch.js.map +1 -0
  241. package/esm/components/ActionList/components/ActionListSubmenu.js +110 -0
  242. package/esm/components/ActionList/components/ActionListSubmenu.js.map +1 -0
  243. package/esm/components/ActionList/components/ActionListSwitchItem.js +49 -0
  244. package/esm/components/ActionList/components/ActionListSwitchItem.js.map +1 -0
  245. package/esm/components/ActionList/components/ActionListTrigger.js +2 -23
  246. package/esm/components/ActionList/components/ActionListTrigger.js.map +1 -1
  247. package/esm/components/Alert/Alert.js +19 -2
  248. package/esm/components/Alert/Alert.js.map +1 -1
  249. package/esm/components/AppFrame/AppFrame.js +37 -0
  250. package/esm/components/AppFrame/AppFrame.js.map +1 -0
  251. package/esm/components/Avatar/Avatar.js +31 -8
  252. package/esm/components/Avatar/Avatar.js.map +1 -1
  253. package/esm/components/BlockCard/BlockCard.js +98 -4
  254. package/esm/components/BlockCard/BlockCard.js.map +1 -1
  255. package/esm/components/Button/Button.js +36 -15
  256. package/esm/components/Button/Button.js.map +1 -1
  257. package/esm/components/ButtonIcon/ButtonIcon.js +8 -9
  258. package/esm/components/ButtonIcon/ButtonIcon.js.map +1 -1
  259. package/esm/components/Chart/Chart.js +170 -0
  260. package/esm/components/Chart/Chart.js.map +1 -0
  261. package/esm/components/Checkbox/Checkbox.js +64 -37
  262. package/esm/components/Checkbox/Checkbox.js.map +1 -1
  263. package/esm/components/Checkbox/CheckboxGroup/CheckboxGroup.context.js.map +1 -1
  264. package/esm/components/Checkbox/CheckboxGroup/CheckboxGroup.js +45 -11
  265. package/esm/components/Checkbox/CheckboxGroup/CheckboxGroup.js.map +1 -1
  266. package/esm/components/Checkbox/ChoiceText.js +33 -0
  267. package/esm/components/Checkbox/ChoiceText.js.map +1 -0
  268. package/esm/components/ColorField/ColorField.js +69 -18
  269. package/esm/components/ColorField/ColorField.js.map +1 -1
  270. package/esm/components/DatePicker/DatePicker.js +86 -48
  271. package/esm/components/DatePicker/DatePicker.js.map +1 -1
  272. package/esm/components/DatePicker/components/Calendar/Calendar.js +60 -18
  273. package/esm/components/DatePicker/components/Calendar/Calendar.js.map +1 -1
  274. package/esm/components/DatePicker/components/Day/Day.js +18 -20
  275. package/esm/components/DatePicker/components/Day/Day.js.map +1 -1
  276. package/esm/components/DatePicker/components/Month/Month.js +93 -30
  277. package/esm/components/DatePicker/components/Month/Month.js.map +1 -1
  278. package/esm/components/DatePicker/components/MonthGrid/MonthGrid.js +82 -0
  279. package/esm/components/DatePicker/components/MonthGrid/MonthGrid.js.map +1 -0
  280. package/esm/components/DatePicker/components/Weekday/Weekday.js +4 -3
  281. package/esm/components/DatePicker/components/Weekday/Weekday.js.map +1 -1
  282. package/esm/components/DatePicker/utils/index.js +37 -25
  283. package/esm/components/DatePicker/utils/index.js.map +1 -1
  284. package/esm/components/DescriptiveList/DescriptiveList.js +14 -5
  285. package/esm/components/DescriptiveList/DescriptiveList.js.map +1 -1
  286. package/esm/components/DescriptiveList/DescriptiveListItem.js +15 -3
  287. package/esm/components/DescriptiveList/DescriptiveListItem.js.map +1 -1
  288. package/esm/components/DropdownCard/DropdownCard.context.js.map +1 -1
  289. package/esm/components/DropdownCard/DropdownCard.js +18 -10
  290. package/esm/components/DropdownCard/DropdownCard.js.map +1 -1
  291. package/esm/components/DropdownCard/components/DropdownCardActions.js +5 -3
  292. package/esm/components/DropdownCard/components/DropdownCardActions.js.map +1 -1
  293. package/esm/components/DropdownCard/components/DropdownCardContent.js +5 -3
  294. package/esm/components/DropdownCard/components/DropdownCardContent.js.map +1 -1
  295. package/esm/components/DropdownCard/components/DropdownCardDropdown.js +19 -14
  296. package/esm/components/DropdownCard/components/DropdownCardDropdown.js.map +1 -1
  297. package/esm/components/DropdownCard/components/DropdownCardTabs.js +118 -0
  298. package/esm/components/DropdownCard/components/DropdownCardTabs.js.map +1 -0
  299. package/esm/components/DropdownCard/components/DropdownCardTrigger.js +2 -21
  300. package/esm/components/DropdownCard/components/DropdownCardTrigger.js.map +1 -1
  301. package/esm/components/Field/Field.js +24 -0
  302. package/esm/components/Field/Field.js.map +1 -0
  303. package/esm/components/FileField/FileField.js +64 -24
  304. package/esm/components/FileField/FileField.js.map +1 -1
  305. package/esm/components/FormActions/FormActions.js +12 -0
  306. package/esm/components/FormActions/FormActions.js.map +1 -0
  307. package/esm/components/HyperlinkCard/HyperlinkCard.js +10 -7
  308. package/esm/components/HyperlinkCard/HyperlinkCard.js.map +1 -1
  309. package/esm/components/Icon/Icon.js +10 -12
  310. package/esm/components/Icon/Icon.js.map +1 -1
  311. package/esm/components/IconBadge/IconBadge.js +25 -0
  312. package/esm/components/IconBadge/IconBadge.js.map +1 -0
  313. package/esm/components/Loader/Loader.js +24 -4
  314. package/esm/components/Loader/Loader.js.map +1 -1
  315. package/esm/components/Modal/Modal.js +90 -3
  316. package/esm/components/Modal/Modal.js.map +1 -1
  317. package/esm/components/Modal/ModalProvider/ModalProviderFooter.js +7 -4
  318. package/esm/components/Modal/ModalProvider/ModalProviderFooter.js.map +1 -1
  319. package/esm/components/Modal/ModalProvider/index.js +16 -17
  320. package/esm/components/Modal/ModalProvider/index.js.map +1 -1
  321. package/esm/components/Modal/utils/reducer.js +4 -1
  322. package/esm/components/Modal/utils/reducer.js.map +1 -1
  323. package/esm/components/Modal/utils/useModal.js +1 -1
  324. package/esm/components/Modal/utils/useModal.js.map +1 -1
  325. package/esm/components/Page/Breadcrumbs.js +28 -0
  326. package/esm/components/Page/Breadcrumbs.js.map +1 -0
  327. package/esm/components/Page/Page.js +73 -9
  328. package/esm/components/Page/Page.js.map +1 -1
  329. package/esm/components/Pagination/Pagination.js +23 -12
  330. package/esm/components/Pagination/Pagination.js.map +1 -1
  331. package/esm/components/Progress/Progress.js +35 -3
  332. package/esm/components/Progress/Progress.js.map +1 -1
  333. package/esm/components/Radio/Radio.js +35 -25
  334. package/esm/components/Radio/Radio.js.map +1 -1
  335. package/esm/components/Radio/RadioGroup/RadioGroup.context.js.map +1 -1
  336. package/esm/components/Radio/RadioGroup/RadioGroup.js +37 -24
  337. package/esm/components/Radio/RadioGroup/RadioGroup.js.map +1 -1
  338. package/esm/components/RangeField/RangeField.js +31 -27
  339. package/esm/components/RangeField/RangeField.js.map +1 -1
  340. package/esm/components/Select/Select.js +75 -31
  341. package/esm/components/Select/Select.js.map +1 -1
  342. package/esm/components/Sidebar/Sidebar.js +121 -109
  343. package/esm/components/Sidebar/Sidebar.js.map +1 -1
  344. package/esm/components/Sidebar/components/Back.js +23 -0
  345. package/esm/components/Sidebar/components/Back.js.map +1 -0
  346. package/esm/components/Sidebar/components/Menu.js +5 -7
  347. package/esm/components/Sidebar/components/Menu.js.map +1 -1
  348. package/esm/components/Sidebar/components/MenuItem.js +25 -7
  349. package/esm/components/Sidebar/components/MenuItem.js.map +1 -1
  350. package/esm/components/Sidebar/components/Section.js +4 -5
  351. package/esm/components/Sidebar/components/Section.js.map +1 -1
  352. package/esm/components/Sidebar/components/SubMenu.js +4 -4
  353. package/esm/components/Sidebar/components/SubMenu.js.map +1 -1
  354. package/esm/components/Spinner/Spinner.js +9 -4
  355. package/esm/components/Spinner/Spinner.js.map +1 -1
  356. package/esm/components/StatCard/StatCard.js +46 -10
  357. package/esm/components/StatCard/StatCard.js.map +1 -1
  358. package/esm/components/Switch/Switch.js +42 -20
  359. package/esm/components/Switch/Switch.js.map +1 -1
  360. package/esm/components/Table/Table.js +95 -31
  361. package/esm/components/Table/Table.js.map +1 -1
  362. package/esm/components/Table/components/Checkbox/index.js +8 -8
  363. package/esm/components/Table/components/Checkbox/index.js.map +1 -1
  364. package/esm/components/Table/components/TableBody.js +3 -3
  365. package/esm/components/Table/components/TableBody.js.map +1 -1
  366. package/esm/components/Table/components/TableCell.js +3 -4
  367. package/esm/components/Table/components/TableCell.js.map +1 -1
  368. package/esm/components/Table/components/TableGroup.js +15 -0
  369. package/esm/components/Table/components/TableGroup.js.map +1 -0
  370. package/esm/components/Table/components/TableHead.js +19 -16
  371. package/esm/components/Table/components/TableHead.js.map +1 -1
  372. package/esm/components/Table/components/TableHeadCell.js +23 -6
  373. package/esm/components/Table/components/TableHeadCell.js.map +1 -1
  374. package/esm/components/Table/components/TablePagination.js +6 -3
  375. package/esm/components/Table/components/TablePagination.js.map +1 -1
  376. package/esm/components/Table/components/TableProvider/TableProvider.js +5 -5
  377. package/esm/components/Table/components/TableProvider/TableProvider.js.map +1 -1
  378. package/esm/components/Table/components/TableRow.js +11 -8
  379. package/esm/components/Table/components/TableRow.js.map +1 -1
  380. package/esm/components/Table/labels.js +18 -0
  381. package/esm/components/Table/labels.js.map +1 -0
  382. package/esm/components/Table/utils/rows/context.js.map +1 -1
  383. package/esm/components/Table/utils/table/context.js.map +1 -1
  384. package/esm/components/Table/utils/table/hooks.js +4 -4
  385. package/esm/components/Table/utils/table/hooks.js.map +1 -1
  386. package/esm/components/Table/utils/table/types.js +1 -7
  387. package/esm/components/Table/utils/table/types.js.map +1 -1
  388. package/esm/components/Table/utils/useSelectableResourceState/index.js +4 -5
  389. package/esm/components/Table/utils/useSelectableResourceState/index.js.map +1 -1
  390. package/esm/components/Tag/Tag.js +36 -5
  391. package/esm/components/Tag/Tag.js.map +1 -1
  392. package/esm/components/Tag/TagGroup.js +3 -2
  393. package/esm/components/Tag/TagGroup.js.map +1 -1
  394. package/esm/components/TextField/TextField.js +41 -38
  395. package/esm/components/TextField/TextField.js.map +1 -1
  396. package/esm/components/Textarea/Textarea.js +10 -26
  397. package/esm/components/Textarea/Textarea.js.map +1 -1
  398. package/esm/components/Thumbnail/Thumbnail.js +22 -8
  399. package/esm/components/Thumbnail/Thumbnail.js.map +1 -1
  400. package/esm/components/Timeline/Timeline.js +25 -0
  401. package/esm/components/Timeline/Timeline.js.map +1 -0
  402. package/esm/components/Timeline/TimelineGroup.js +27 -0
  403. package/esm/components/Timeline/TimelineGroup.js.map +1 -0
  404. package/esm/components/Timeline/TimelineItem.js +23 -0
  405. package/esm/components/Timeline/TimelineItem.js.map +1 -0
  406. package/esm/components/Toast/Toast.js +18 -2
  407. package/esm/components/Toast/Toast.js.map +1 -1
  408. package/esm/components/Toast/Toasts.context.js +17 -4
  409. package/esm/components/Toast/Toasts.context.js.map +1 -1
  410. package/esm/components/Toast/ToastsContainer/index.js +44 -20
  411. package/esm/components/Toast/ToastsContainer/index.js.map +1 -1
  412. package/esm/components/Toast/ToastsProvider/index.js +10 -14
  413. package/esm/components/Toast/ToastsProvider/index.js.map +1 -1
  414. package/esm/components/Toast/store.js +47 -0
  415. package/esm/components/Toast/store.js.map +1 -0
  416. package/esm/components/Tooltip/Tooltip.js +34 -53
  417. package/esm/components/Tooltip/Tooltip.js.map +1 -1
  418. package/esm/components/Tooltip/TooltipCallout.js +45 -0
  419. package/esm/components/Tooltip/TooltipCallout.js.map +1 -0
  420. package/esm/components/Tooltip/useTooltip.js +12 -33
  421. package/esm/components/Tooltip/useTooltip.js.map +1 -1
  422. package/esm/components/Visualizer/Visualizer.js +69 -9
  423. package/esm/components/Visualizer/Visualizer.js.map +1 -1
  424. package/esm/index.js +31 -27
  425. package/esm/index.js.map +1 -1
  426. package/esm/tokens/tokens.js +1530 -0
  427. package/esm/tokens/tokens.js.map +1 -0
  428. package/esm/utils/Slot/index.js +37 -0
  429. package/esm/utils/Slot/index.js.map +1 -0
  430. package/esm/utils/classNames/index.js +3 -3
  431. package/esm/utils/classNames/index.js.map +1 -1
  432. package/esm/utils/getElementRef/index.js +14 -0
  433. package/esm/utils/getElementRef/index.js.map +1 -0
  434. package/esm/utils/guid/index.js.map +1 -1
  435. package/esm/utils/toPercent/index.js +7 -0
  436. package/esm/utils/toPercent/index.js.map +1 -0
  437. package/esm/utils/useControllableState/index.js +24 -0
  438. package/esm/utils/useControllableState/index.js.map +1 -0
  439. package/esm/utils/useDropdown/DropdownTrigger.js +18 -0
  440. package/esm/utils/useDropdown/DropdownTrigger.js.map +1 -0
  441. package/esm/utils/useDropdown/index.js +55 -25
  442. package/esm/utils/useDropdown/index.js.map +1 -1
  443. package/esm/utils/useImageFallback/index.js +11 -0
  444. package/esm/utils/useImageFallback/index.js.map +1 -0
  445. package/esm/utils/useUid/index.js.map +1 -1
  446. package/fonts/dm-sans/LICENSE +93 -0
  447. package/fonts/dm-sans/dm-sans-latin-400-italic.woff2 +0 -0
  448. package/fonts/dm-sans/dm-sans-latin-400-normal.woff2 +0 -0
  449. package/fonts/dm-sans/dm-sans-latin-700-italic.woff2 +0 -0
  450. package/fonts/dm-sans/dm-sans-latin-700-normal.woff2 +0 -0
  451. package/fonts/inter/LICENSE +93 -0
  452. package/fonts/inter/inter-latin-opsz-italic.woff2 +0 -0
  453. package/fonts/inter/inter-latin-opsz-normal.woff2 +0 -0
  454. package/fonts/roboto-mono/LICENSE +93 -0
  455. package/fonts/roboto-mono/roboto-mono-latin-wght-normal.woff2 +0 -0
  456. package/lib/components/ActionCard/ActionCard.d.ts +14 -13
  457. package/lib/components/ActionCard/ActionCard.d.ts.map +1 -1
  458. package/lib/components/ActionCard/ActionCardGroup.d.ts +22 -0
  459. package/lib/components/ActionCard/ActionCardGroup.d.ts.map +1 -0
  460. package/lib/components/ActionCard/index.d.ts +1 -0
  461. package/lib/components/ActionCard/index.d.ts.map +1 -1
  462. package/lib/components/ActionList/ActionList.context.d.ts +6 -3
  463. package/lib/components/ActionList/ActionList.context.d.ts.map +1 -1
  464. package/lib/components/ActionList/ActionList.d.ts +18 -18
  465. package/lib/components/ActionList/ActionList.d.ts.map +1 -1
  466. package/lib/components/ActionList/components/ActionListDivider.d.ts +4 -5
  467. package/lib/components/ActionList/components/ActionListDivider.d.ts.map +1 -1
  468. package/lib/components/ActionList/components/ActionListDropdown.d.ts +4 -1
  469. package/lib/components/ActionList/components/ActionListDropdown.d.ts.map +1 -1
  470. package/lib/components/ActionList/components/ActionListGroup.d.ts +7 -5
  471. package/lib/components/ActionList/components/ActionListGroup.d.ts.map +1 -1
  472. package/lib/components/ActionList/components/ActionListItem.d.ts +32 -7
  473. package/lib/components/ActionList/components/ActionListItem.d.ts.map +1 -1
  474. package/lib/components/ActionList/components/ActionListSearch.d.ts +21 -0
  475. package/lib/components/ActionList/components/ActionListSearch.d.ts.map +1 -0
  476. package/lib/components/ActionList/components/ActionListSubmenu.d.ts +22 -0
  477. package/lib/components/ActionList/components/ActionListSubmenu.d.ts.map +1 -0
  478. package/lib/components/ActionList/components/ActionListSwitchItem.d.ts +17 -0
  479. package/lib/components/ActionList/components/ActionListSwitchItem.d.ts.map +1 -0
  480. package/lib/components/ActionList/components/ActionListTrigger.d.ts +4 -6
  481. package/lib/components/ActionList/components/ActionListTrigger.d.ts.map +1 -1
  482. package/lib/components/Alert/Alert.d.ts +25 -11
  483. package/lib/components/Alert/Alert.d.ts.map +1 -1
  484. package/lib/components/AppFrame/AppFrame.d.ts +48 -0
  485. package/lib/components/AppFrame/AppFrame.d.ts.map +1 -0
  486. package/lib/components/AppFrame/index.d.ts +3 -0
  487. package/lib/components/AppFrame/index.d.ts.map +1 -0
  488. package/lib/components/Avatar/Avatar.d.ts +20 -8
  489. package/lib/components/Avatar/Avatar.d.ts.map +1 -1
  490. package/lib/components/BlockCard/BlockCard.d.ts +77 -11
  491. package/lib/components/BlockCard/BlockCard.d.ts.map +1 -1
  492. package/lib/components/BlockCard/index.d.ts +1 -1
  493. package/lib/components/BlockCard/index.d.ts.map +1 -1
  494. package/lib/components/Button/Button.d.ts +45 -26
  495. package/lib/components/Button/Button.d.ts.map +1 -1
  496. package/lib/components/ButtonIcon/ButtonIcon.d.ts +18 -17
  497. package/lib/components/ButtonIcon/ButtonIcon.d.ts.map +1 -1
  498. package/lib/components/Chart/Chart.d.ts +142 -0
  499. package/lib/components/Chart/Chart.d.ts.map +1 -0
  500. package/lib/components/Chart/index.d.ts +3 -0
  501. package/lib/components/Chart/index.d.ts.map +1 -0
  502. package/lib/components/Checkbox/Checkbox.d.ts +25 -33
  503. package/lib/components/Checkbox/Checkbox.d.ts.map +1 -1
  504. package/lib/components/Checkbox/CheckboxGroup/CheckboxGroup.context.d.ts +2 -0
  505. package/lib/components/Checkbox/CheckboxGroup/CheckboxGroup.context.d.ts.map +1 -1
  506. package/lib/components/Checkbox/CheckboxGroup/CheckboxGroup.d.ts +23 -5
  507. package/lib/components/Checkbox/CheckboxGroup/CheckboxGroup.d.ts.map +1 -1
  508. package/lib/components/Checkbox/ChoiceText.d.ts +17 -0
  509. package/lib/components/Checkbox/ChoiceText.d.ts.map +1 -0
  510. package/lib/components/Checkbox/index.d.ts +0 -1
  511. package/lib/components/Checkbox/index.d.ts.map +1 -1
  512. package/lib/components/ColorField/ColorField.d.ts +15 -13
  513. package/lib/components/ColorField/ColorField.d.ts.map +1 -1
  514. package/lib/components/ColorField/index.d.ts +1 -1
  515. package/lib/components/ColorField/index.d.ts.map +1 -1
  516. package/lib/components/DatePicker/DatePicker.d.ts +13 -5
  517. package/lib/components/DatePicker/DatePicker.d.ts.map +1 -1
  518. package/lib/components/DatePicker/components/Calendar/Calendar.d.ts +24 -3
  519. package/lib/components/DatePicker/components/Calendar/Calendar.d.ts.map +1 -1
  520. package/lib/components/DatePicker/components/Day/Day.d.ts +11 -10
  521. package/lib/components/DatePicker/components/Day/Day.d.ts.map +1 -1
  522. package/lib/components/DatePicker/components/Month/Month.d.ts +21 -17
  523. package/lib/components/DatePicker/components/Month/Month.d.ts.map +1 -1
  524. package/lib/components/DatePicker/components/MonthGrid/MonthGrid.d.ts +32 -0
  525. package/lib/components/DatePicker/components/MonthGrid/MonthGrid.d.ts.map +1 -0
  526. package/lib/components/DatePicker/components/MonthGrid/index.d.ts +3 -0
  527. package/lib/components/DatePicker/components/MonthGrid/index.d.ts.map +1 -0
  528. package/lib/components/DatePicker/components/Weekday/Weekday.d.ts +4 -3
  529. package/lib/components/DatePicker/components/Weekday/Weekday.d.ts.map +1 -1
  530. package/lib/components/DatePicker/components/index.d.ts +1 -0
  531. package/lib/components/DatePicker/components/index.d.ts.map +1 -1
  532. package/lib/components/DatePicker/utils/index.d.ts +339 -17
  533. package/lib/components/DatePicker/utils/index.d.ts.map +1 -1
  534. package/lib/components/DatePicker/utils/types.d.ts +4 -2
  535. package/lib/components/DatePicker/utils/types.d.ts.map +1 -1
  536. package/lib/components/DescriptiveList/DescriptiveList.d.ts +10 -11
  537. package/lib/components/DescriptiveList/DescriptiveList.d.ts.map +1 -1
  538. package/lib/components/DescriptiveList/DescriptiveListItem.d.ts +10 -4
  539. package/lib/components/DescriptiveList/DescriptiveListItem.d.ts.map +1 -1
  540. package/lib/components/DropdownCard/DropdownCard.context.d.ts +5 -2
  541. package/lib/components/DropdownCard/DropdownCard.context.d.ts.map +1 -1
  542. package/lib/components/DropdownCard/DropdownCard.d.ts +15 -13
  543. package/lib/components/DropdownCard/DropdownCard.d.ts.map +1 -1
  544. package/lib/components/DropdownCard/components/DropdownCardActions.d.ts +4 -3
  545. package/lib/components/DropdownCard/components/DropdownCardActions.d.ts.map +1 -1
  546. package/lib/components/DropdownCard/components/DropdownCardContent.d.ts +4 -3
  547. package/lib/components/DropdownCard/components/DropdownCardContent.d.ts.map +1 -1
  548. package/lib/components/DropdownCard/components/DropdownCardDropdown.d.ts +12 -3
  549. package/lib/components/DropdownCard/components/DropdownCardDropdown.d.ts.map +1 -1
  550. package/lib/components/DropdownCard/components/DropdownCardTabs.d.ts +44 -0
  551. package/lib/components/DropdownCard/components/DropdownCardTabs.d.ts.map +1 -0
  552. package/lib/components/DropdownCard/components/DropdownCardTrigger.d.ts +4 -6
  553. package/lib/components/DropdownCard/components/DropdownCardTrigger.d.ts.map +1 -1
  554. package/lib/components/DropdownCard/components/index.d.ts +1 -0
  555. package/lib/components/DropdownCard/components/index.d.ts.map +1 -1
  556. package/lib/components/Field/Field.d.ts +47 -0
  557. package/lib/components/Field/Field.d.ts.map +1 -0
  558. package/lib/components/Field/index.d.ts +3 -0
  559. package/lib/components/Field/index.d.ts.map +1 -0
  560. package/lib/components/FileField/FileField.d.ts +20 -11
  561. package/lib/components/FileField/FileField.d.ts.map +1 -1
  562. package/lib/components/FileField/index.d.ts +1 -1
  563. package/lib/components/FileField/index.d.ts.map +1 -1
  564. package/lib/components/FormActions/FormActions.d.ts +9 -0
  565. package/lib/components/FormActions/FormActions.d.ts.map +1 -0
  566. package/lib/components/FormActions/index.d.ts +3 -0
  567. package/lib/components/FormActions/index.d.ts.map +1 -0
  568. package/lib/components/HyperlinkCard/HyperlinkCard.d.ts +11 -8
  569. package/lib/components/HyperlinkCard/HyperlinkCard.d.ts.map +1 -1
  570. package/lib/components/Icon/Icon.d.ts +14 -13
  571. package/lib/components/Icon/Icon.d.ts.map +1 -1
  572. package/lib/components/IconBadge/IconBadge.d.ts +24 -0
  573. package/lib/components/IconBadge/IconBadge.d.ts.map +1 -0
  574. package/lib/components/IconBadge/index.d.ts +3 -0
  575. package/lib/components/IconBadge/index.d.ts.map +1 -0
  576. package/lib/components/Loader/Loader.d.ts +17 -6
  577. package/lib/components/Loader/Loader.d.ts.map +1 -1
  578. package/lib/components/Loader/index.d.ts +1 -1
  579. package/lib/components/Loader/index.d.ts.map +1 -1
  580. package/lib/components/Modal/Modal.d.ts +4 -6
  581. package/lib/components/Modal/Modal.d.ts.map +1 -1
  582. package/lib/components/Modal/ModalProvider/ModalProviderFooter.d.ts.map +1 -1
  583. package/lib/components/Modal/ModalProvider/index.d.ts.map +1 -1
  584. package/lib/components/Modal/index.d.ts +1 -1
  585. package/lib/components/Modal/index.d.ts.map +1 -1
  586. package/lib/components/Modal/types/index.d.ts +36 -15
  587. package/lib/components/Modal/types/index.d.ts.map +1 -1
  588. package/lib/components/Modal/utils/index.d.ts +0 -1
  589. package/lib/components/Modal/utils/index.d.ts.map +1 -1
  590. package/lib/components/Modal/utils/reducer.d.ts +286 -6
  591. package/lib/components/Modal/utils/reducer.d.ts.map +1 -1
  592. package/lib/components/Modal/utils/useModal.d.ts +3 -2
  593. package/lib/components/Modal/utils/useModal.d.ts.map +1 -1
  594. package/lib/components/Page/Breadcrumbs.d.ts +20 -0
  595. package/lib/components/Page/Breadcrumbs.d.ts.map +1 -0
  596. package/lib/components/Page/Page.d.ts +61 -27
  597. package/lib/components/Page/Page.d.ts.map +1 -1
  598. package/lib/components/Page/index.d.ts +3 -1
  599. package/lib/components/Page/index.d.ts.map +1 -1
  600. package/lib/components/Pagination/Pagination.d.ts +22 -20
  601. package/lib/components/Pagination/Pagination.d.ts.map +1 -1
  602. package/lib/components/Pagination/index.d.ts +1 -1
  603. package/lib/components/Pagination/index.d.ts.map +1 -1
  604. package/lib/components/Progress/Progress.d.ts +29 -6
  605. package/lib/components/Progress/Progress.d.ts.map +1 -1
  606. package/lib/components/Progress/index.d.ts +1 -1
  607. package/lib/components/Progress/index.d.ts.map +1 -1
  608. package/lib/components/Radio/Radio.d.ts +19 -33
  609. package/lib/components/Radio/Radio.d.ts.map +1 -1
  610. package/lib/components/Radio/RadioGroup/RadioGroup.context.d.ts +2 -0
  611. package/lib/components/Radio/RadioGroup/RadioGroup.context.d.ts.map +1 -1
  612. package/lib/components/Radio/RadioGroup/RadioGroup.d.ts +22 -18
  613. package/lib/components/Radio/RadioGroup/RadioGroup.d.ts.map +1 -1
  614. package/lib/components/RangeField/RangeField.d.ts +8 -15
  615. package/lib/components/RangeField/RangeField.d.ts.map +1 -1
  616. package/lib/components/Select/Select.d.ts +45 -43
  617. package/lib/components/Select/Select.d.ts.map +1 -1
  618. package/lib/components/Sidebar/Sidebar.d.ts +48 -25
  619. package/lib/components/Sidebar/Sidebar.d.ts.map +1 -1
  620. package/lib/components/Sidebar/components/Back.d.ts +14 -0
  621. package/lib/components/Sidebar/components/Back.d.ts.map +1 -0
  622. package/lib/components/Sidebar/components/Menu.d.ts +9 -14
  623. package/lib/components/Sidebar/components/Menu.d.ts.map +1 -1
  624. package/lib/components/Sidebar/components/MenuItem.d.ts +18 -15
  625. package/lib/components/Sidebar/components/MenuItem.d.ts.map +1 -1
  626. package/lib/components/Sidebar/components/Section.d.ts +6 -6
  627. package/lib/components/Sidebar/components/Section.d.ts.map +1 -1
  628. package/lib/components/Sidebar/components/SubMenu.d.ts +6 -8
  629. package/lib/components/Sidebar/components/SubMenu.d.ts.map +1 -1
  630. package/lib/components/Sidebar/index.d.ts +1 -1
  631. package/lib/components/Sidebar/index.d.ts.map +1 -1
  632. package/lib/components/Spinner/Spinner.d.ts +12 -5
  633. package/lib/components/Spinner/Spinner.d.ts.map +1 -1
  634. package/lib/components/Spinner/index.d.ts +1 -1
  635. package/lib/components/Spinner/index.d.ts.map +1 -1
  636. package/lib/components/StatCard/StatCard.d.ts +31 -11
  637. package/lib/components/StatCard/StatCard.d.ts.map +1 -1
  638. package/lib/components/StatCard/index.d.ts +1 -1
  639. package/lib/components/StatCard/index.d.ts.map +1 -1
  640. package/lib/components/Switch/Switch.d.ts +14 -15
  641. package/lib/components/Switch/Switch.d.ts.map +1 -1
  642. package/lib/components/Table/Table.d.ts +54 -25
  643. package/lib/components/Table/Table.d.ts.map +1 -1
  644. package/lib/components/Table/Table.types.d.ts +1 -1
  645. package/lib/components/Table/Table.types.d.ts.map +1 -1
  646. package/lib/components/Table/components/Checkbox/index.d.ts +7 -3
  647. package/lib/components/Table/components/Checkbox/index.d.ts.map +1 -1
  648. package/lib/components/Table/components/TableBody.d.ts +2 -2
  649. package/lib/components/Table/components/TableBody.d.ts.map +1 -1
  650. package/lib/components/Table/components/TableCell.d.ts +7 -3
  651. package/lib/components/Table/components/TableCell.d.ts.map +1 -1
  652. package/lib/components/Table/components/TableGroup.d.ts +16 -0
  653. package/lib/components/Table/components/TableGroup.d.ts.map +1 -0
  654. package/lib/components/Table/components/TableHead.d.ts +8 -2
  655. package/lib/components/Table/components/TableHead.d.ts.map +1 -1
  656. package/lib/components/Table/components/TableHeadCell.d.ts +24 -5
  657. package/lib/components/Table/components/TableHeadCell.d.ts.map +1 -1
  658. package/lib/components/Table/components/TablePagination.d.ts +3 -1
  659. package/lib/components/Table/components/TablePagination.d.ts.map +1 -1
  660. package/lib/components/Table/components/TableProvider/TableProvider.d.ts +1 -2
  661. package/lib/components/Table/components/TableProvider/TableProvider.d.ts.map +1 -1
  662. package/lib/components/Table/components/TableRow.d.ts +8 -2
  663. package/lib/components/Table/components/TableRow.d.ts.map +1 -1
  664. package/lib/components/Table/index.d.ts +3 -3
  665. package/lib/components/Table/index.d.ts.map +1 -1
  666. package/lib/components/Table/labels.d.ts +23 -0
  667. package/lib/components/Table/labels.d.ts.map +1 -0
  668. package/lib/components/Table/utils/table/types.d.ts +6 -11
  669. package/lib/components/Table/utils/table/types.d.ts.map +1 -1
  670. package/lib/components/Table/utils/useSelectableResourceState/index.d.ts +1 -2
  671. package/lib/components/Table/utils/useSelectableResourceState/index.d.ts.map +1 -1
  672. package/lib/components/Tag/Tag.d.ts +42 -15
  673. package/lib/components/Tag/Tag.d.ts.map +1 -1
  674. package/lib/components/Tag/TagGroup.d.ts +3 -3
  675. package/lib/components/Tag/TagGroup.d.ts.map +1 -1
  676. package/lib/components/Tag/index.d.ts +1 -1
  677. package/lib/components/Tag/index.d.ts.map +1 -1
  678. package/lib/components/TextField/TextField.d.ts +11 -27
  679. package/lib/components/TextField/TextField.d.ts.map +1 -1
  680. package/lib/components/Textarea/Textarea.d.ts +10 -26
  681. package/lib/components/Textarea/Textarea.d.ts.map +1 -1
  682. package/lib/components/Thumbnail/Thumbnail.d.ts +11 -7
  683. package/lib/components/Thumbnail/Thumbnail.d.ts.map +1 -1
  684. package/lib/components/Timeline/Timeline.d.ts +26 -0
  685. package/lib/components/Timeline/Timeline.d.ts.map +1 -0
  686. package/lib/components/Timeline/TimelineGroup.d.ts +15 -0
  687. package/lib/components/Timeline/TimelineGroup.d.ts.map +1 -0
  688. package/lib/components/Timeline/TimelineItem.d.ts +19 -0
  689. package/lib/components/Timeline/TimelineItem.d.ts.map +1 -0
  690. package/lib/components/Timeline/index.d.ts +5 -0
  691. package/lib/components/Timeline/index.d.ts.map +1 -0
  692. package/lib/components/Toast/Toast.d.ts +20 -10
  693. package/lib/components/Toast/Toast.d.ts.map +1 -1
  694. package/lib/components/Toast/Toasts.context.d.ts +15 -2
  695. package/lib/components/Toast/Toasts.context.d.ts.map +1 -1
  696. package/lib/components/Toast/ToastsContainer/index.d.ts.map +1 -1
  697. package/lib/components/Toast/ToastsProvider/index.d.ts +1 -3
  698. package/lib/components/Toast/ToastsProvider/index.d.ts.map +1 -1
  699. package/lib/components/Toast/index.d.ts +3 -5
  700. package/lib/components/Toast/index.d.ts.map +1 -1
  701. package/lib/components/Toast/store.d.ts +30 -0
  702. package/lib/components/Toast/store.d.ts.map +1 -0
  703. package/lib/components/Toast/types.d.ts +8 -5
  704. package/lib/components/Toast/types.d.ts.map +1 -1
  705. package/lib/components/Tooltip/Tooltip.d.ts +29 -23
  706. package/lib/components/Tooltip/Tooltip.d.ts.map +1 -1
  707. package/lib/components/Tooltip/TooltipCallout.d.ts +31 -0
  708. package/lib/components/Tooltip/TooltipCallout.d.ts.map +1 -0
  709. package/lib/components/Tooltip/useTooltip.d.ts +16 -27
  710. package/lib/components/Tooltip/useTooltip.d.ts.map +1 -1
  711. package/lib/components/Visualizer/Visualizer.d.ts +19 -8
  712. package/lib/components/Visualizer/Visualizer.d.ts.map +1 -1
  713. package/lib/components/Visualizer/index.d.ts +1 -1
  714. package/lib/components/Visualizer/index.d.ts.map +1 -1
  715. package/lib/index.d.ts +134 -1
  716. package/lib/index.d.ts.map +1 -1
  717. package/lib/showcase/chartData.d.ts +29 -0
  718. package/lib/showcase/chartData.d.ts.map +1 -0
  719. package/lib/tokens/tokens.d.ts +1528 -0
  720. package/lib/tokens/tokens.d.ts.map +1 -0
  721. package/lib/types.d.ts +4 -29
  722. package/lib/types.d.ts.map +1 -1
  723. package/lib/utils/Slot/index.d.ts +11 -0
  724. package/lib/utils/Slot/index.d.ts.map +1 -0
  725. package/lib/utils/classNames/index.d.ts +3 -1
  726. package/lib/utils/classNames/index.d.ts.map +1 -1
  727. package/lib/utils/getElementRef/index.d.ts +9 -0
  728. package/lib/utils/getElementRef/index.d.ts.map +1 -0
  729. package/lib/utils/index.d.ts +4 -7
  730. package/lib/utils/index.d.ts.map +1 -1
  731. package/lib/utils/toPercent/index.d.ts +3 -0
  732. package/lib/utils/toPercent/index.d.ts.map +1 -0
  733. package/lib/utils/useControllableState/index.d.ts +19 -0
  734. package/lib/utils/useControllableState/index.d.ts.map +1 -0
  735. package/lib/utils/useDropdown/DropdownTrigger.d.ts +12 -0
  736. package/lib/utils/useDropdown/DropdownTrigger.d.ts.map +1 -0
  737. package/lib/utils/useDropdown/index.d.ts +30 -6
  738. package/lib/utils/useDropdown/index.d.ts.map +1 -1
  739. package/lib/utils/useImageFallback/index.d.ts +15 -0
  740. package/lib/utils/useImageFallback/index.d.ts.map +1 -0
  741. package/package.json +19 -11
  742. package/theme.css +1 -1
  743. package/theme.css.d.ts +2 -0
  744. package/cjs/components/ActionList/useDropdown.js +0 -47
  745. package/cjs/components/ActionList/useDropdown.js.map +0 -1
  746. package/cjs/components/Modal/utils/events.js +0 -19
  747. package/cjs/components/Modal/utils/events.js.map +0 -1
  748. package/cjs/components/Toast/ToastsProvider/useToastsState/useToastsState.js +0 -55
  749. package/cjs/components/Toast/ToastsProvider/useToastsState/useToastsState.js.map +0 -1
  750. package/cjs/components/Toast/events.js +0 -20
  751. package/cjs/components/Toast/events.js.map +0 -1
  752. package/cjs/components/Visualizer/Visualizer.context.js +0 -12
  753. package/cjs/components/Visualizer/Visualizer.context.js.map +0 -1
  754. package/cjs/components/Visualizer/VisualizerMobileOpener.js +0 -28
  755. package/cjs/components/Visualizer/VisualizerMobileOpener.js.map +0 -1
  756. package/cjs/utils/createUseExternalEvents/index.js +0 -32
  757. package/cjs/utils/createUseExternalEvents/index.js.map +0 -1
  758. package/cjs/utils/useIsomorphicEffect/index.js +0 -22
  759. package/cjs/utils/useIsomorphicEffect/index.js.map +0 -1
  760. package/cjs/utils/useQueue/index.js +0 -36
  761. package/cjs/utils/useQueue/index.js.map +0 -1
  762. package/cjs/utils/useUncontrolled/index.js +0 -25
  763. package/cjs/utils/useUncontrolled/index.js.map +0 -1
  764. package/esm/components/ActionList/useDropdown.js +0 -45
  765. package/esm/components/ActionList/useDropdown.js.map +0 -1
  766. package/esm/components/Modal/utils/events.js +0 -13
  767. package/esm/components/Modal/utils/events.js.map +0 -1
  768. package/esm/components/Toast/ToastsProvider/useToastsState/useToastsState.js +0 -51
  769. package/esm/components/Toast/ToastsProvider/useToastsState/useToastsState.js.map +0 -1
  770. package/esm/components/Toast/events.js +0 -12
  771. package/esm/components/Toast/events.js.map +0 -1
  772. package/esm/components/Visualizer/Visualizer.context.js +0 -9
  773. package/esm/components/Visualizer/Visualizer.context.js.map +0 -1
  774. package/esm/components/Visualizer/VisualizerMobileOpener.js +0 -13
  775. package/esm/components/Visualizer/VisualizerMobileOpener.js.map +0 -1
  776. package/esm/utils/createUseExternalEvents/index.js +0 -30
  777. package/esm/utils/createUseExternalEvents/index.js.map +0 -1
  778. package/esm/utils/useIsomorphicEffect/index.js +0 -7
  779. package/esm/utils/useIsomorphicEffect/index.js.map +0 -1
  780. package/esm/utils/useQueue/index.js +0 -34
  781. package/esm/utils/useQueue/index.js.map +0 -1
  782. package/esm/utils/useUncontrolled/index.js +0 -23
  783. package/esm/utils/useUncontrolled/index.js.map +0 -1
  784. package/lib/components/ActionList/useDropdown.d.ts +0 -57
  785. package/lib/components/ActionList/useDropdown.d.ts.map +0 -1
  786. package/lib/components/CodeBlock/CodeBlock.d.ts +0 -16
  787. package/lib/components/CodeBlock/CodeBlock.d.ts.map +0 -1
  788. package/lib/components/CodeBlock/index.d.ts +0 -2
  789. package/lib/components/CodeBlock/index.d.ts.map +0 -1
  790. package/lib/components/Modal/utils/events.d.ts +0 -9
  791. package/lib/components/Modal/utils/events.d.ts.map +0 -1
  792. package/lib/components/Toast/ToastsProvider/useToastsState/useToastsState.d.ts +0 -13
  793. package/lib/components/Toast/ToastsProvider/useToastsState/useToastsState.d.ts.map +0 -1
  794. package/lib/components/Toast/events.d.ts +0 -37
  795. package/lib/components/Toast/events.d.ts.map +0 -1
  796. package/lib/components/Visualizer/Visualizer.context.d.ts +0 -14
  797. package/lib/components/Visualizer/Visualizer.context.d.ts.map +0 -1
  798. package/lib/components/Visualizer/VisualizerMobileOpener.d.ts +0 -7
  799. package/lib/components/Visualizer/VisualizerMobileOpener.d.ts.map +0 -1
  800. package/lib/components/index.d.ts +0 -36
  801. package/lib/components/index.d.ts.map +0 -1
  802. package/lib/utils/createUseExternalEvents/index.d.ts +0 -14
  803. package/lib/utils/createUseExternalEvents/index.d.ts.map +0 -1
  804. package/lib/utils/useDidUpdate/index.d.ts +0 -30
  805. package/lib/utils/useDidUpdate/index.d.ts.map +0 -1
  806. package/lib/utils/useEventListener/index.d.ts +0 -7
  807. package/lib/utils/useEventListener/index.d.ts.map +0 -1
  808. package/lib/utils/useForceUpdate/index.d.ts +0 -28
  809. package/lib/utils/useForceUpdate/index.d.ts.map +0 -1
  810. package/lib/utils/useIsomorphicEffect/index.d.ts +0 -21
  811. package/lib/utils/useIsomorphicEffect/index.d.ts.map +0 -1
  812. package/lib/utils/useQueue/index.d.ts +0 -65
  813. package/lib/utils/useQueue/index.d.ts.map +0 -1
  814. package/lib/utils/useUncontrolled/index.d.ts +0 -38
  815. package/lib/utils/useUncontrolled/index.d.ts.map +0 -1
@@ -1,19 +1,20 @@
1
1
  'use client';
2
+ import { jsx, jsxs } from 'react/jsx-runtime';
2
3
  import * as React from 'react';
3
4
  import { RowContext } from '../utils/rows/context.js';
4
5
  import { useTableRow, useTableSelectionChange, useTableValue } from '../utils/table/hooks.js';
5
6
  import '../utils/table/context.js';
6
- import { SelectionType } from '../utils/table/types.js';
7
+ import { TableLabelsContext } from '../labels.js';
7
8
  import { Checkbox } from './Checkbox/index.js';
8
- import { classNames } from '../../../utils/classNames/index.js';
9
9
 
10
- function TableRow({ children, className, selected, id, disabled, ...props }) {
10
+ const TableRow = React.forwardRef(function TableRow2({ children, selected, id, disabled, ...props }, ref) {
11
11
  const { selectable } = useTableRow();
12
12
  const onSelectionChange = useTableSelectionChange();
13
13
  const { selectedItemsCount } = useTableValue();
14
+ const text = React.useContext(TableLabelsContext);
14
15
  const handleInteraction = React.useCallback(() => {
15
- onSelectionChange(SelectionType.Single, id);
16
- }, [id, onSelectionChange, selected]);
16
+ onSelectionChange("single", id);
17
+ }, [id, onSelectionChange]);
17
18
  const contextValue = React.useMemo(
18
19
  () => ({
19
20
  itemId: id,
@@ -23,9 +24,11 @@ function TableRow({ children, className, selected, id, disabled, ...props }) {
23
24
  }),
24
25
  [id, selected, selectedItemsCount, disabled, handleInteraction]
25
26
  );
26
- const checkboxMarkup = selectable ? /* @__PURE__ */ React.createElement("td", { className: "selector" }, /* @__PURE__ */ React.createElement(Checkbox, { onChange: handleInteraction })) : null;
27
- return /* @__PURE__ */ React.createElement(RowContext.Provider, { value: contextValue }, /* @__PURE__ */ React.createElement("tr", { className: classNames(className, { selected: contextValue.selected }), ...props }, checkboxMarkup, children));
28
- }
27
+ return /* @__PURE__ */ jsx(RowContext.Provider, { value: contextValue, children: /* @__PURE__ */ jsxs("tr", { ...props, ref, children: [
28
+ selectable && /* @__PURE__ */ jsx("td", { className: "roaster-table__select", children: /* @__PURE__ */ jsx(Checkbox, { onChange: handleInteraction, "aria-label": text.selectRow }) }),
29
+ children
30
+ ] }) });
31
+ });
29
32
 
30
33
  export { TableRow };
31
34
  //# sourceMappingURL=TableRow.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"TableRow.js","sources":["../../../../../src/components/Table/components/TableRow.tsx"],"sourcesContent":["import * as React from 'react';\nimport { classNames } from '@/utils';\nimport { RowContext } from '../utils/rows';\nimport { SelectionType, useTableRow, useTableSelectionChange, useTableValue } from '../utils/table';\nimport { Checkbox } from './Checkbox';\n\nexport interface TableRowProps extends React.ComponentProps<'tr'> {\n children?: React.ReactNode;\n selected?: boolean;\n disabled?: boolean;\n id?: string;\n}\n\nexport function TableRow({ children, className, selected, id, disabled, ...props }: TableRowProps) {\n const { selectable } = useTableRow();\n const onSelectionChange = useTableSelectionChange();\n const { selectedItemsCount } = useTableValue();\n\n const handleInteraction = React.useCallback(() => {\n onSelectionChange(SelectionType.Single, id);\n }, [id, onSelectionChange, selected]);\n\n const contextValue = React.useMemo(\n () => ({\n itemId: id,\n selected: selected || selectedItemsCount === 'All',\n onInteraction: handleInteraction,\n disabled,\n }),\n [id, selected, selectedItemsCount, disabled, handleInteraction]\n );\n\n const checkboxMarkup = selectable ? (\n <td className=\"selector\">\n <Checkbox onChange={handleInteraction} />\n </td>\n ) : null;\n\n return (\n <RowContext.Provider value={contextValue}>\n <tr className={classNames(className, { selected: contextValue.selected })} {...props}>\n {checkboxMarkup}\n {children}\n </tr>\n </RowContext.Provider>\n );\n}\n"],"names":[],"mappings":";;;;;;;;;AAKO,SAAS,QAAQ,CAAC,EAAE,QAAQ,EAAE,SAAS,EAAE,QAAQ,EAAE,EAAE,EAAE,QAAQ,EAAE,GAAG,KAAK,EAAE,EAAE;AACpF,EAAE,MAAM,EAAE,UAAU,EAAE,GAAG,WAAW,EAAE;AACtC,EAAE,MAAM,iBAAiB,GAAG,uBAAuB,EAAE;AACrD,EAAE,MAAM,EAAE,kBAAkB,EAAE,GAAG,aAAa,EAAE;AAChD,EAAE,MAAM,iBAAiB,GAAG,KAAK,CAAC,WAAW,CAAC,MAAM;AACpD,IAAI,iBAAiB,CAAC,aAAa,CAAC,MAAM,EAAE,EAAE,CAAC;AAC/C,EAAE,CAAC,EAAE,CAAC,EAAE,EAAE,iBAAiB,EAAE,QAAQ,CAAC,CAAC;AACvC,EAAE,MAAM,YAAY,GAAG,KAAK,CAAC,OAAO;AACpC,IAAI,OAAO;AACX,MAAM,MAAM,EAAE,EAAE;AAChB,MAAM,QAAQ,EAAE,QAAQ,IAAI,kBAAkB,KAAK,KAAK;AACxD,MAAM,aAAa,EAAE,iBAAiB;AACtC,MAAM;AACN,KAAK,CAAC;AACN,IAAI,CAAC,EAAE,EAAE,QAAQ,EAAE,kBAAkB,EAAE,QAAQ,EAAE,iBAAiB;AAClE,GAAG;AACH,EAAE,MAAM,cAAc,GAAG,UAAU,mBAAmB,KAAK,CAAC,aAAa,CAAC,IAAI,EAAE,EAAE,SAAS,EAAE,UAAU,EAAE,kBAAkB,KAAK,CAAC,aAAa,CAAC,QAAQ,EAAE,EAAE,QAAQ,EAAE,iBAAiB,EAAE,CAAC,CAAC,GAAG,IAAI;AACjM,EAAE,uBAAuB,KAAK,CAAC,aAAa,CAAC,UAAU,CAAC,QAAQ,EAAE,EAAE,KAAK,EAAE,YAAY,EAAE,kBAAkB,KAAK,CAAC,aAAa,CAAC,IAAI,EAAE,EAAE,SAAS,EAAE,UAAU,CAAC,SAAS,EAAE,EAAE,QAAQ,EAAE,YAAY,CAAC,QAAQ,EAAE,CAAC,EAAE,GAAG,KAAK,EAAE,EAAE,cAAc,EAAE,QAAQ,CAAC,CAAC;AACpP;;"}
1
+ {"version":3,"file":"TableRow.js","sources":["../../../../../src/components/Table/components/TableRow.tsx"],"sourcesContent":["import * as React from 'react';\nimport { RowContext } from '../utils/rows';\nimport { useTableRow, useTableSelectionChange, useTableValue } from '../utils/table';\nimport { TableLabelsContext } from '../labels';\nimport { Checkbox } from './Checkbox';\n\n/** Every native `<tr>` prop is accepted and forwarded to it. */\nexport interface TableRowProps extends React.ComponentPropsWithoutRef<'tr'> {\n /** The cells: Table.Cell. */\n children?: React.ReactNode;\n /** Whether the row is selected. A selected row is highlighted (CSS reads its checkbox). */\n selected?: boolean;\n /** Whether the row can't be selected. */\n disabled?: boolean;\n /** The row's item id, passed to `onSelectionChange`. */\n id?: string;\n}\n\n/** A row, with its checkbox in a selectable table. */\nexport const TableRow = React.forwardRef<HTMLTableRowElement, TableRowProps>(function TableRow(\n { children, selected, id, disabled, ...props },\n ref\n) {\n const { selectable } = useTableRow();\n const onSelectionChange = useTableSelectionChange();\n const { selectedItemsCount } = useTableValue();\n const text = React.useContext(TableLabelsContext);\n\n const handleInteraction = React.useCallback(() => {\n onSelectionChange('single', id);\n }, [id, onSelectionChange]);\n\n const contextValue = React.useMemo(\n () => ({\n itemId: id,\n selected: selected || selectedItemsCount === 'All',\n onInteraction: handleInteraction,\n disabled,\n }),\n [id, selected, selectedItemsCount, disabled, handleInteraction]\n );\n\n return (\n <RowContext.Provider value={contextValue}>\n <tr {...props} ref={ref}>\n {selectable && (\n <td className=\"roaster-table__select\">\n <Checkbox onChange={handleInteraction} aria-label={text.selectRow} />\n </td>\n )}\n {children}\n </tr>\n </RowContext.Provider>\n );\n});\n"],"names":[],"mappings":";;;;;;;;;AAOY,MAAC,QAAQ,GAAG,KAAK,CAAC,UAAU,CAAC,SAAS,SAAS,CAAC,EAAE,QAAQ,EAAE,QAAQ,EAAE,EAAE,EAAE,QAAQ,EAAE,GAAG,KAAK,EAAE,EAAE,GAAG,EAAE;AACjH,EAAE,MAAM,EAAE,UAAU,EAAE,GAAG,WAAW,EAAE;AACtC,EAAE,MAAM,iBAAiB,GAAG,uBAAuB,EAAE;AACrD,EAAE,MAAM,EAAE,kBAAkB,EAAE,GAAG,aAAa,EAAE;AAChD,EAAE,MAAM,IAAI,GAAG,KAAK,CAAC,UAAU,CAAC,kBAAkB,CAAC;AACnD,EAAE,MAAM,iBAAiB,GAAG,KAAK,CAAC,WAAW,CAAC,MAAM;AACpD,IAAI,iBAAiB,CAAC,QAAQ,EAAE,EAAE,CAAC;AACnC,EAAE,CAAC,EAAE,CAAC,EAAE,EAAE,iBAAiB,CAAC,CAAC;AAC7B,EAAE,MAAM,YAAY,GAAG,KAAK,CAAC,OAAO;AACpC,IAAI,OAAO;AACX,MAAM,MAAM,EAAE,EAAE;AAChB,MAAM,QAAQ,EAAE,QAAQ,IAAI,kBAAkB,KAAK,KAAK;AACxD,MAAM,aAAa,EAAE,iBAAiB;AACtC,MAAM;AACN,KAAK,CAAC;AACN,IAAI,CAAC,EAAE,EAAE,QAAQ,EAAE,kBAAkB,EAAE,QAAQ,EAAE,iBAAiB;AAClE,GAAG;AACH,EAAE,uBAAuB,GAAG,CAAC,UAAU,CAAC,QAAQ,EAAE,EAAE,KAAK,EAAE,YAAY,EAAE,QAAQ,kBAAkB,IAAI,CAAC,IAAI,EAAE,EAAE,GAAG,KAAK,EAAE,GAAG,EAAE,QAAQ,EAAE;AACzI,IAAI,UAAU,oBAAoB,GAAG,CAAC,IAAI,EAAE,EAAE,SAAS,EAAE,uBAAuB,EAAE,QAAQ,kBAAkB,GAAG,CAAC,QAAQ,EAAE,EAAE,QAAQ,EAAE,iBAAiB,EAAE,YAAY,EAAE,IAAI,CAAC,SAAS,EAAE,CAAC,EAAE,CAAC;AAC3L,IAAI;AACJ,GAAG,EAAE,CAAC,EAAE,CAAC;AACT,CAAC;;"}
@@ -0,0 +1,18 @@
1
+ 'use client';
2
+ import * as React from 'react';
3
+ import { SELECT_ALL_ITEMS } from './utils/table/types.js';
4
+ import './utils/table/context.js';
5
+
6
+ const defaultTableLabels = {
7
+ selectedCount: (count) => `${count} ${count === SELECT_ALL_ITEMS || count > 1 ? "items" : "item"} selected`,
8
+ selectAll: "Select all items",
9
+ selectPage: "Select the rows of this page",
10
+ selectRow: "Select this row",
11
+ columnInfo: "More information",
12
+ previousPage: "Previous page",
13
+ nextPage: "Next page"
14
+ };
15
+ const TableLabelsContext = React.createContext(defaultTableLabels);
16
+
17
+ export { TableLabelsContext, defaultTableLabels };
18
+ //# sourceMappingURL=labels.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"labels.js","sources":["../../../../src/components/Table/labels.ts"],"sourcesContent":["import * as React from 'react';\nimport { SELECT_ALL_ITEMS } from './utils/table';\n\n/** The text of the table, for other languages. */\nexport interface TableLabels {\n /** The count of selected rows, from a number or `'All'`: \"3 items selected\". */\n selectedCount(count: number | typeof SELECT_ALL_ITEMS): React.ReactNode;\n /** The button that selects every item, beyond this page. */\n selectAll: React.ReactNode;\n /** The name of the checkbox that selects the rows of this page, read by screen readers. */\n selectPage: string;\n /** The name of a row's checkbox, read by screen readers. */\n selectRow: string;\n /** The name of a column title's info button, which shows its description. */\n columnInfo: string;\n /** The name of the previous page button, read by screen readers. */\n previousPage: string;\n /** The name of the next page button, read by screen readers. */\n nextPage: string;\n}\n\nexport const defaultTableLabels: TableLabels = {\n selectedCount: (count) => `${count} ${count === SELECT_ALL_ITEMS || count > 1 ? 'items' : 'item'} selected`,\n selectAll: 'Select all items',\n selectPage: 'Select the rows of this page',\n selectRow: 'Select this row',\n columnInfo: 'More information',\n previousPage: 'Previous page',\n nextPage: 'Next page',\n};\n\n/** The table's text, for its parts (the header and row checkboxes, the column info buttons). */\nexport const TableLabelsContext = React.createContext<TableLabels>(defaultTableLabels);\n"],"names":[],"mappings":";;;;;AAGY,MAAC,kBAAkB,GAAG;AAClC,EAAE,aAAa,EAAE,CAAC,KAAK,KAAK,CAAC,EAAE,KAAK,CAAC,CAAC,EAAE,KAAK,KAAK,gBAAgB,IAAI,KAAK,GAAG,CAAC,GAAG,OAAO,GAAG,MAAM,CAAC,SAAS,CAAC;AAC7G,EAAE,SAAS,EAAE,kBAAkB;AAC/B,EAAE,UAAU,EAAE,8BAA8B;AAC5C,EAAE,SAAS,EAAE,iBAAiB;AAC9B,EAAE,UAAU,EAAE,kBAAkB;AAChC,EAAE,YAAY,EAAE,eAAe;AAC/B,EAAE,QAAQ,EAAE;AACZ;AACY,MAAC,kBAAkB,GAAG,KAAK,CAAC,aAAa,CAAC,kBAAkB;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"context.js","sources":["../../../../../../src/components/Table/utils/rows/context.ts"],"sourcesContent":["import { createContext } from 'react';\n\ninterface RowContextType {\n /** The unique identifier of the row item. */\n itemId?: string;\n /** Indicates whether the row is selected. */\n selected?: boolean;\n /** Indicates whether the row is disabled. */\n disabled?: boolean;\n /**\n * A callback function that is called when the row is interacted with.\n * The function receives the `event` object as an argument.\n */\n onInteraction?: (event: React.MouseEvent) => void;\n}\n\nexport const RowContext = createContext<RowContextType>({});\n"],"names":[],"mappings":";;;AACY,MAAC,UAAU,GAAG,aAAa,CAAC,EAAE;;"}
1
+ {"version":3,"file":"context.js","sources":["../../../../../../src/components/Table/utils/rows/context.ts"],"sourcesContent":["import { createContext } from 'react';\n\ninterface RowContextType {\n /** The unique identifier of the row item. */\n itemId?: string;\n /** Indicates whether the row is selected. */\n selected?: boolean;\n /** Indicates whether the row is disabled. */\n disabled?: boolean;\n /**\n * A callback function that is called when the row is interacted with.\n * The function receives the `event` object as an argument.\n */\n onInteraction?: (event: React.MouseEvent) => void;\n}\n\nexport const RowContext = createContext<RowContextType>({});\n"],"names":[],"mappings":";;;AAEY,MAAC,UAAU,GAAG,aAAa,CAAC,EAAE;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"context.js","sources":["../../../../../../src/components/Table/utils/table/context.ts"],"sourcesContent":["import { createContext } from 'react';\n\nimport type { SelectionType, SELECT_ALL_ITEMS } from './types';\n\nexport interface TableContextType {\n /**\n * Indicates the bulk selection state of the table.\n * It can be a boolean or the string 'indeterminate'.\n */\n bulkSelectState?: boolean | 'indeterminate';\n /**\n * The number of selected items in the table.\n * This can be a number or the string 'All' (which means that all items are selected).\n */\n selectedItemsCount: typeof SELECT_ALL_ITEMS | number;\n /** Indicates whether the table is in select mode. */\n selectMode: boolean;\n /** The total number of items in the table. */\n itemCount: number;\n /** Indicates whether the table is selectable. */\n selectable?: boolean;\n}\n\nexport const TableContext = createContext<TableContextType | undefined>(undefined);\n\nexport const TableSelectionChangeContext = createContext<\n ((selectionType: SelectionType, selection?: string) => void) | undefined\n>(undefined);\n\nexport interface TableRowContextType {\n /** Indicates whether the table is selectable. */\n selectable: boolean;\n /** Indicates whether the table is in select mode. */\n selectMode: boolean;\n}\n\nexport const TableRowContext = createContext<TableRowContextType | undefined>(undefined);\n"],"names":[],"mappings":";;;AACY,MAAC,YAAY,GAAG,aAAa,CAAC,MAAM;AACpC,MAAC,2BAA2B,GAAG,aAAa,CAAC,MAAM;AACnD,MAAC,eAAe,GAAG,aAAa,CAAC,MAAM;;"}
1
+ {"version":3,"file":"context.js","sources":["../../../../../../src/components/Table/utils/table/context.ts"],"sourcesContent":["import { createContext } from 'react';\n\nimport type { SelectionType, SELECT_ALL_ITEMS } from './types';\n\nexport interface TableContextType {\n /**\n * Indicates the bulk selection state of the table.\n * It can be a boolean or the string 'indeterminate'.\n */\n bulkSelectState?: boolean | 'indeterminate';\n /**\n * The number of selected items in the table.\n * This can be a number or the string 'All' (which means that all items are selected).\n */\n selectedItemsCount: typeof SELECT_ALL_ITEMS | number;\n /** Indicates whether the table is in select mode. */\n selectMode: boolean;\n /** The total number of items in the table. */\n itemCount: number;\n /** Indicates whether the table is selectable. */\n selectable?: boolean;\n}\n\nexport const TableContext = createContext<TableContextType | undefined>(undefined);\n\nexport const TableSelectionChangeContext = createContext<\n ((selectionType: SelectionType, selection?: string) => void) | undefined\n>(undefined);\n\nexport interface TableRowContextType {\n /** Indicates whether the table is selectable. */\n selectable: boolean;\n /** Indicates whether the table is in select mode. */\n selectMode: boolean;\n}\n\nexport const TableRowContext = createContext<TableRowContextType | undefined>(undefined);\n"],"names":[],"mappings":";;;AAEY,MAAC,YAAY,GAAG,aAAa,CAAC,MAAM;AACpC,MAAC,2BAA2B,GAAG,aAAa,CAAC,MAAM;AACnD,MAAC,eAAe,GAAG,aAAa,CAAC,MAAM;;"}
@@ -1,6 +1,6 @@
1
1
  'use client';
2
2
  import { useContext, useCallback } from 'react';
3
- import { SelectionType, SELECT_ALL_ITEMS } from './types.js';
3
+ import { SELECT_ALL_ITEMS } from './types.js';
4
4
  import { TableContext, TableSelectionChangeContext, TableRowContext } from './context.js';
5
5
 
6
6
  function useTableSelectionChange() {
@@ -43,9 +43,9 @@ function useHandleBulkSelection({ onSelectionChange = () => {
43
43
  } }) {
44
44
  const handleSelectionChange = useCallback(
45
45
  (selectionType, selection) => {
46
- if (selectionType === SelectionType.Single) {
47
- onSelectionChange(SelectionType.Single, selection);
48
- } else if (selectionType === SelectionType.Page || selectionType === SelectionType.All) {
46
+ if (selectionType === "single") {
47
+ onSelectionChange("single", selection);
48
+ } else if (selectionType === "page" || selectionType === "all") {
49
49
  onSelectionChange(selectionType, SELECT_ALL_ITEMS);
50
50
  }
51
51
  },
@@ -1 +1 @@
1
- {"version":3,"file":"hooks.js","sources":["../../../../../../src/components/Table/utils/table/hooks.ts"],"sourcesContent":["import { useContext, useCallback } from 'react';\n\nimport {\n SELECT_ALL_ITEMS,\n SelectionType,\n HandleSelectionChange,\n BulkSelectionDataOptions,\n HandleBulkSelectionOptions,\n} from './types';\nimport { TableContext, TableRowContext, TableSelectionChangeContext } from './context';\n\nexport function useTableSelectionChange() {\n const onSelectionChange = useContext(TableSelectionChangeContext);\n if (!onSelectionChange) {\n throw new Error(`Missing TableProvider context`);\n }\n return onSelectionChange;\n}\n\nexport function useTableRow() {\n const tableRow = useContext(TableRowContext);\n if (!tableRow) {\n throw new Error(`Missing TableProvider context`);\n }\n return tableRow;\n}\n\nexport function useTableValue() {\n const table = useContext(TableContext);\n if (!table) {\n throw new Error(`Missing TableProvider context`);\n }\n return table;\n}\n\nexport function useBulkSelectionData({ selectedItemsCount, itemCount }: BulkSelectionDataOptions) {\n const selectable = Boolean(selectedItemsCount);\n const selectMode = selectedItemsCount === 'All' || selectedItemsCount > 0;\n\n let bulkSelectState: boolean | 'indeterminate' | undefined = 'indeterminate';\n if (!selectedItemsCount || selectedItemsCount === 0) {\n bulkSelectState = undefined;\n } else if (selectedItemsCount === SELECT_ALL_ITEMS || selectedItemsCount === itemCount) {\n bulkSelectState = true;\n }\n\n return {\n selectMode,\n bulkSelectState,\n selectable,\n };\n}\n\nexport function useHandleBulkSelection({ onSelectionChange = () => {} }: HandleBulkSelectionOptions) {\n const handleSelectionChange: HandleSelectionChange = useCallback(\n (selectionType: SelectionType, selection?: string) => {\n if (selectionType === SelectionType.Single) {\n onSelectionChange(SelectionType.Single, selection);\n } else if (selectionType === SelectionType.Page || selectionType === SelectionType.All) {\n onSelectionChange(selectionType, SELECT_ALL_ITEMS);\n }\n },\n [onSelectionChange]\n );\n\n return handleSelectionChange;\n}\n"],"names":[],"mappings":";;;;;AAMO,SAAS,uBAAuB,GAAG;AAC1C,EAAE,MAAM,iBAAiB,GAAG,UAAU,CAAC,2BAA2B,CAAC;AACnE,EAAE,IAAI,CAAC,iBAAiB,EAAE;AAC1B,IAAI,MAAM,IAAI,KAAK,CAAC,CAAC,6BAA6B,CAAC,CAAC;AACpD,EAAE;AACF,EAAE,OAAO,iBAAiB;AAC1B;AACO,SAAS,WAAW,GAAG;AAC9B,EAAE,MAAM,QAAQ,GAAG,UAAU,CAAC,eAAe,CAAC;AAC9C,EAAE,IAAI,CAAC,QAAQ,EAAE;AACjB,IAAI,MAAM,IAAI,KAAK,CAAC,CAAC,6BAA6B,CAAC,CAAC;AACpD,EAAE;AACF,EAAE,OAAO,QAAQ;AACjB;AACO,SAAS,aAAa,GAAG;AAChC,EAAE,MAAM,KAAK,GAAG,UAAU,CAAC,YAAY,CAAC;AACxC,EAAE,IAAI,CAAC,KAAK,EAAE;AACd,IAAI,MAAM,IAAI,KAAK,CAAC,CAAC,6BAA6B,CAAC,CAAC;AACpD,EAAE;AACF,EAAE,OAAO,KAAK;AACd;AACO,SAAS,oBAAoB,CAAC,EAAE,kBAAkB,EAAE,SAAS,EAAE,EAAE;AACxE,EAAE,MAAM,UAAU,GAAG,OAAO,CAAC,kBAAkB,CAAC;AAChD,EAAE,MAAM,UAAU,GAAG,kBAAkB,KAAK,KAAK,IAAI,kBAAkB,GAAG,CAAC;AAC3E,EAAE,IAAI,eAAe,GAAG,eAAe;AACvC,EAAE,IAAI,CAAC,kBAAkB,IAAI,kBAAkB,KAAK,CAAC,EAAE;AACvD,IAAI,eAAe,GAAG,MAAM;AAC5B,EAAE,CAAC,MAAM,IAAI,kBAAkB,KAAK,gBAAgB,IAAI,kBAAkB,KAAK,SAAS,EAAE;AAC1F,IAAI,eAAe,GAAG,IAAI;AAC1B,EAAE;AACF,EAAE,OAAO;AACT,IAAI,UAAU;AACd,IAAI,eAAe;AACnB,IAAI;AACJ,GAAG;AACH;AACO,SAAS,sBAAsB,CAAC,EAAE,iBAAiB,GAAG,MAAM;AACnE,CAAC,EAAE,EAAE;AACL,EAAE,MAAM,qBAAqB,GAAG,WAAW;AAC3C,IAAI,CAAC,aAAa,EAAE,SAAS,KAAK;AAClC,MAAM,IAAI,aAAa,KAAK,aAAa,CAAC,MAAM,EAAE;AAClD,QAAQ,iBAAiB,CAAC,aAAa,CAAC,MAAM,EAAE,SAAS,CAAC;AAC1D,MAAM,CAAC,MAAM,IAAI,aAAa,KAAK,aAAa,CAAC,IAAI,IAAI,aAAa,KAAK,aAAa,CAAC,GAAG,EAAE;AAC9F,QAAQ,iBAAiB,CAAC,aAAa,EAAE,gBAAgB,CAAC;AAC1D,MAAM;AACN,IAAI,CAAC;AACL,IAAI,CAAC,iBAAiB;AACtB,GAAG;AACH,EAAE,OAAO,qBAAqB;AAC9B;;"}
1
+ {"version":3,"file":"hooks.js","sources":["../../../../../../src/components/Table/utils/table/hooks.ts"],"sourcesContent":["import { useContext, useCallback } from 'react';\n\nimport {\n SELECT_ALL_ITEMS,\n SelectionType,\n HandleSelectionChange,\n BulkSelectionDataOptions,\n HandleBulkSelectionOptions,\n} from './types';\nimport { TableContext, TableRowContext, TableSelectionChangeContext } from './context';\n\nexport function useTableSelectionChange() {\n const onSelectionChange = useContext(TableSelectionChangeContext);\n if (!onSelectionChange) {\n throw new Error(`Missing TableProvider context`);\n }\n return onSelectionChange;\n}\n\nexport function useTableRow() {\n const tableRow = useContext(TableRowContext);\n if (!tableRow) {\n throw new Error(`Missing TableProvider context`);\n }\n return tableRow;\n}\n\nexport function useTableValue() {\n const table = useContext(TableContext);\n if (!table) {\n throw new Error(`Missing TableProvider context`);\n }\n return table;\n}\n\nexport function useBulkSelectionData({ selectedItemsCount, itemCount }: BulkSelectionDataOptions) {\n const selectable = Boolean(selectedItemsCount);\n const selectMode = selectedItemsCount === 'All' || selectedItemsCount > 0;\n\n let bulkSelectState: boolean | 'indeterminate' | undefined = 'indeterminate';\n if (!selectedItemsCount || selectedItemsCount === 0) {\n bulkSelectState = undefined;\n } else if (selectedItemsCount === SELECT_ALL_ITEMS || selectedItemsCount === itemCount) {\n bulkSelectState = true;\n }\n\n return {\n selectMode,\n bulkSelectState,\n selectable,\n };\n}\n\nexport function useHandleBulkSelection({ onSelectionChange = () => {} }: HandleBulkSelectionOptions) {\n const handleSelectionChange: HandleSelectionChange = useCallback(\n (selectionType: SelectionType, selection?: string) => {\n if (selectionType === 'single') {\n onSelectionChange('single', selection);\n } else if (selectionType === 'page' || selectionType === 'all') {\n onSelectionChange(selectionType, SELECT_ALL_ITEMS);\n }\n },\n [onSelectionChange]\n );\n\n return handleSelectionChange;\n}\n"],"names":[],"mappings":";;;;;AAMO,SAAS,uBAAuB,GAAG;AAC1C,EAAE,MAAM,iBAAiB,GAAG,UAAU,CAAC,2BAA2B,CAAC;AACnE,EAAE,IAAI,CAAC,iBAAiB,EAAE;AAC1B,IAAI,MAAM,IAAI,KAAK,CAAC,CAAC,6BAA6B,CAAC,CAAC;AACpD,EAAE;AACF,EAAE,OAAO,iBAAiB;AAC1B;AACO,SAAS,WAAW,GAAG;AAC9B,EAAE,MAAM,QAAQ,GAAG,UAAU,CAAC,eAAe,CAAC;AAC9C,EAAE,IAAI,CAAC,QAAQ,EAAE;AACjB,IAAI,MAAM,IAAI,KAAK,CAAC,CAAC,6BAA6B,CAAC,CAAC;AACpD,EAAE;AACF,E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AACH,EAAE,OAAO,qBAAqB;AAC9B;;"}
@@ -1,11 +1,5 @@
1
1
  'use client';
2
2
  const SELECT_ALL_ITEMS = "All";
3
- var SelectionType = /* @__PURE__ */ ((SelectionType2) => {
4
- SelectionType2["All"] = "all";
5
- SelectionType2["Page"] = "page";
6
- SelectionType2["Single"] = "single";
7
- return SelectionType2;
8
- })(SelectionType || {});
9
3
 
10
- export { SELECT_ALL_ITEMS, SelectionType };
4
+ export { SELECT_ALL_ITEMS };
11
5
  //# sourceMappingURL=types.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"types.js","sources":["../../../../../../src/components/Table/utils/table/types.ts"],"sourcesContent":["/** This constant defines the value of the 'All' option used in the `TableSelectedItems` type. */\nexport const SELECT_ALL_ITEMS = 'All';\n\n/**\n * This type defines the possible values for the selected items in the table.\n * It can be an array of strings, or the string 'All' (which means that all items are selected).\n */\nexport type TableSelectedItems = string[] | 'All';\n\n/**\n * This enum defines the possible types of selection in the table.\n */\nexport enum SelectionType {\n All = 'all',\n Page = 'page',\n Single = 'single',\n}\n\nexport interface TableProviderProps {\n /** The children to be rendered within the table provider. */\n children?: React.ReactNode;\n /** Indicates whether the table is selectable. */\n selectable?: boolean;\n /** The total number of items in the table. */\n itemCount?: number;\n /**\n * The number of selected items in the table.\n * This can be a number or the string 'All' (which means that all items are selected).\n */\n selectedItemsCount?: typeof SELECT_ALL_ITEMS | number;\n /** Indicates whether there are more items that can be loaded in the table. */\n hasMoreItems?: boolean;\n /**\n * A callback function that is called when the selection changes in the table.\n * The function receives the `selectionType` and `selection` as arguments.\n */\n onSelectionChange?(selectionType: SelectionType, selection?: string): void;\n}\n\n/* This type defines the signature of the `onSelectionChange` callback function */\nexport type HandleSelectionChange = (selectionType: SelectionType, selection?: string) => void;\n\nexport interface BulkSelectionDataOptions {\n /**\n * The number of selected items in the table.\n * This can be a number or the string 'All' (which means that all items are selected).\n */\n selectedItemsCount: number | typeof SELECT_ALL_ITEMS;\n /** The total number of items in the table. */\n itemCount: number;\n}\n\nexport interface HandleBulkSelectionOptions {\n /**\n * A callback function that is called when the selection changes in the table.\n * The function receives the `selectionType` and `selection` as arguments.\n */\n onSelectionChange?(selectionType: SelectionType, selection?: string): void;\n}\n"],"names":[],"mappings":";AAAY,MAAC,gBAAgB,GAAG;AACtB,IAAC,aAAa,mBAAmB,CAAC,CAAC,cAAc,KAAK;AAChE,EAAE,cAAc,CAAC,KAAK,CAAC,GAAG,KAAK;AAC/B,EAAE,cAAc,CAAC,MAAM,CAAC,GAAG,MAAM;AACjC,EAAE,cAAc,CAAC,QAAQ,CAAC,GAAG,QAAQ;AACrC,EAAE,OAAO,cAAc;AACvB,CAAC,EAAE,aAAa,IAAI,EAAE;;"}
1
+ {"version":3,"file":"types.js","sources":["../../../../../../src/components/Table/utils/table/types.ts"],"sourcesContent":["/** This constant defines the value of the 'All' option used in the `TableSelectedItems` type. */\nexport const SELECT_ALL_ITEMS = 'All';\n\n/**\n * This type defines the possible values for the selected items in the table.\n * It can be an array of strings, or the string 'All' (which means that all items are selected).\n */\nexport type TableSelectedItems = string[] | 'All';\n\n/** What a selection change applies to: every item, the current page, or one row. */\nexport type SelectionType = 'all' | 'page' | 'single';\n\nexport interface TableProviderProps {\n /** The children to be rendered within the table provider. */\n children?: React.ReactNode;\n /**\n * Whether rows can be selected, with a checkbox column and a bulk-action bar.\n * @defaultValue false\n */\n selectable?: boolean;\n /** The total number of items in the table. */\n itemCount?: number;\n /**\n * The number of selected items in the table.\n * This can be a number or the string 'All' (which means that all items are selected).\n */\n selectedItemsCount?: typeof SELECT_ALL_ITEMS | number;\n /**\n * A callback function that is called when the selection changes in the table.\n * The function receives the `selectionType` and `selection` as arguments.\n */\n onSelectionChange?(selectionType: SelectionType, selection?: string): void;\n}\n\n/* This type defines the signature of the `onSelectionChange` callback function */\nexport type HandleSelectionChange = (selectionType: SelectionType, selection?: string) => void;\n\nexport interface BulkSelectionDataOptions {\n /**\n * The number of selected items in the table.\n * This can be a number or the string 'All' (which means that all items are selected).\n */\n selectedItemsCount: number | typeof SELECT_ALL_ITEMS;\n /** The total number of items in the table. */\n itemCount: number;\n}\n\nexport interface HandleBulkSelectionOptions {\n /**\n * A callback function that is called when the selection changes in the table.\n * The function receives the `selectionType` and `selection` as arguments.\n */\n onSelectionChange?(selectionType: SelectionType, selection?: string): void;\n}\n"],"names":[],"mappings":";AACY,MAAC,gBAAgB,GAAG;;"}
@@ -1,10 +1,9 @@
1
1
  'use client';
2
2
  import * as React from 'react';
3
- import { SelectionType } from '../table/types.js';
4
3
 
5
4
  function defaultResourceIDResolver(resource) {
6
5
  if ("id" in resource) {
7
- return resource.id.toString();
6
+ return String(resource.id);
8
7
  }
9
8
  throw new Error(
10
9
  "Your resource does not directly contain an `id`. Pass a `resourceIDResolver` to `useSelectableResourceState`"
@@ -42,10 +41,10 @@ function useSelectableResourceState(resources, {
42
41
  removeResource(selection);
43
42
  setAllResourcesSelected(false);
44
43
  } else {
45
- if (selectionType === SelectionType.Single && selection !== void 0) {
44
+ if (selectionType === "single" && selection !== void 0) {
46
45
  setSelectedResources((newSelectedResources) => [...newSelectedResources, selection.toString()]);
47
46
  }
48
- if (selectionType === SelectionType.All || selectionType === SelectionType.Page) {
47
+ if (selectionType === "all" || selectionType === "page") {
49
48
  if (allResourcesSelected) {
50
49
  clearSelection();
51
50
  } else {
@@ -55,7 +54,7 @@ function useSelectableResourceState(resources, {
55
54
  }
56
55
  }
57
56
  },
58
- [allResourcesSelected, selectedResources.length, resources, resourceIDResolver]
57
+ [allResourcesSelected, selectedResources, removeResource, clearSelection, resources, resourceIDResolver]
59
58
  );
60
59
  return {
61
60
  selectedResources,
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":["../../../../../../src/components/Table/utils/useSelectableResourceState/index.ts"],"sourcesContent":["import * as React from 'react';\nimport { SelectionType } from '../table/types';\n\n/** A type alias for a function that takes a resource of type `T` and returns a string representing its ID. */\ntype ResourceIDResolver<T extends { [key: string]: unknown }> = (resource: T) => string;\n\nfunction defaultResourceIDResolver(resource: { [key: string]: any }): string {\n if ('id' in resource) {\n return resource.id.toString();\n }\n\n throw new Error(\n 'Your resource does not directly contain an `id`. Pass a `resourceIDResolver` to `useSelectableResourceState`'\n );\n}\n\nexport function useSelectableResourceState<T extends { [key: string]: unknown }>(\n resources: T[],\n {\n selectedResources: initSelectedResources = [],\n allResourcesSelected: initAllResourcesSelected = false,\n resourceIDResolver = defaultResourceIDResolver,\n }: {\n selectedResources?: string[];\n allResourcesSelected?: boolean;\n resourceIDResolver?: ResourceIDResolver<T>;\n } = {\n selectedResources: [],\n allResourcesSelected: false,\n resourceIDResolver: defaultResourceIDResolver,\n }\n) {\n const [selectedResources, setSelectedResources] = React.useState(initSelectedResources);\n const [allResourcesSelected, setAllResourcesSelected] = React.useState(initAllResourcesSelected);\n\n const removeResource = React.useCallback(\n (resource: string) => {\n const selectedResourcesCopy = [...selectedResources];\n\n const newSelectedResources = selectedResourcesCopy.filter((currentResource) => currentResource !== resource);\n\n setSelectedResources(newSelectedResources);\n\n if (newSelectedResources.length === 0) {\n setAllResourcesSelected(false);\n }\n },\n [selectedResources]\n );\n\n const clearSelection = React.useCallback(() => {\n setSelectedResources([]);\n setAllResourcesSelected(false);\n }, []);\n\n const handleSelectionChange = React.useCallback(\n (selectionType: SelectionType, selection?: string) => {\n if (selection !== undefined && selectedResources.includes(selection)) {\n removeResource(selection);\n setAllResourcesSelected(false);\n } else {\n if (selectionType === SelectionType.Single && selection !== undefined) {\n setSelectedResources((newSelectedResources) => [...newSelectedResources, selection.toString()]);\n }\n\n if (selectionType === SelectionType.All || selectionType === SelectionType.Page) {\n if (allResourcesSelected) {\n clearSelection();\n } else {\n setSelectedResources(resources.map(resourceIDResolver));\n setAllResourcesSelected(true);\n }\n }\n }\n },\n [allResourcesSelected, selectedResources.length, resources, resourceIDResolver]\n );\n\n return {\n selectedResources,\n allResourcesSelected,\n handleSelectionChange,\n clearSelection,\n removeResource,\n };\n}\n"],"names":[],"mappings":";;;;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,CAAC;AAC5B,IAAI,uBAAuB,CAAC,KAAK,CAAC;AAClC,EAAE,CAAC,EAAE,EAAE,CAAC;AACR,EAAE,MAAM,qBAAqB,GAAG,KAAK,CAAC,WAAW;AACjD,IAAI,CAAC,aAAa,EAAE,SAAS,KAAK;AAClC,MAAM,IAAI,SAAS,KAAK,MAAM,IAAI,iBAAiB,CAAC,QAAQ,CAAC,SAAS,CAAC,EAAE;AACzE,QAAQ,cAAc,CAAC,SAAS,CAAC;AACjC,QAAQ,uBAAuB,CAAC,KAAK,CAAC;AACtC,MAAM,CAAC,MAAM;AACb,QAAQ,IAAI,aAAa,KAAK,aAAa,CAAC,MAAM,IAAI,SAAS,KAAK,MAAM,EAAE;AAC5E,UAAU,oBAAoB,CAAC,CAAC,oBAAoB,KAAK,CAAC,GAAG,oBAAoB,EAAE,SAAS,CAAC,QAAQ,EAAE,CAAC,CAAC;AACzG,QAAQ;AACR,QAAQ,IAAI,aAAa,KAAK,aAAa,CAAC,GAAG,IAAI,aAAa,KAAK,aAAa,CAAC,IAAI,EAAE;AACzF,UAAU,IAAI,oBAAoB,EAAE;AACpC,YAAY,cAAc,EAAE;AAC5B,UAAU,CAAC,MAAM;AACjB,YAAY,oBAAoB,CAAC,SAAS,CAAC,GAAG,CAAC,kBAAkB,CAAC,CAAC;AACnE,YAAY,uBAAuB,CAAC,IAAI,CAAC;AACzC,UAAU;AACV,QAAQ;AACR,MAAM;AACN,IAAI,CAAC;AACL,IAAI,CAAC,oBAAoB,EAAE,iBAAiB,CAAC,MAAM,EAAE,SAAS,EAAE,kBAAkB;AAClF,GAAG;AACH,EAAE,OAAO;AACT,IAAI,iBAAiB;AACrB,IAAI,oBAAoB;AACxB,IAAI,qBAAqB;AACzB,IAAI,cAAc;AAClB,IAAI;AACJ,GAAG;AACH;;"}
1
+ {"version":3,"file":"index.js","sources":["../../../../../../src/components/Table/utils/useSelectableResourceState/index.ts"],"sourcesContent":["import * as React from 'react';\nimport { SelectionType } from '../table/types';\n\n/** A type alias for a function that takes a resource of type `T` and returns a string representing its ID. */\nexport type ResourceIDResolver<T extends { [key: string]: unknown }> = (resource: T) => string;\n\nfunction defaultResourceIDResolver(resource: { [key: string]: unknown }): string {\n if ('id' in resource) {\n return String(resource.id);\n }\n\n throw new Error(\n 'Your resource does not directly contain an `id`. Pass a `resourceIDResolver` to `useSelectableResourceState`'\n );\n}\n\nexport function useSelectableResourceState<T extends { [key: string]: unknown }>(\n resources: T[],\n {\n selectedResources: initSelectedResources = [],\n allResourcesSelected: initAllResourcesSelected = false,\n resourceIDResolver = defaultResourceIDResolver,\n }: {\n selectedResources?: string[];\n allResourcesSelected?: boolean;\n resourceIDResolver?: ResourceIDResolver<T>;\n } = {\n selectedResources: [],\n allResourcesSelected: false,\n resourceIDResolver: defaultResourceIDResolver,\n }\n) {\n const [selectedResources, setSelectedResources] = React.useState(initSelectedResources);\n const [allResourcesSelected, setAllResourcesSelected] = React.useState(initAllResourcesSelected);\n\n const removeResource = React.useCallback(\n (resource: string) => {\n const selectedResourcesCopy = [...selectedResources];\n\n const newSelectedResources = selectedResourcesCopy.filter((currentResource) => currentResource !== resource);\n\n setSelectedResources(newSelectedResources);\n\n if (newSelectedResources.length === 0) {\n setAllResourcesSelected(false);\n }\n },\n [selectedResources]\n );\n\n const clearSelection = React.useCallback(() => {\n setSelectedResources([]);\n setAllResourcesSelected(false);\n }, []);\n\n const handleSelectionChange = React.useCallback(\n (selectionType: SelectionType, selection?: string) => {\n if (selection !== undefined && selectedResources.includes(selection)) {\n removeResource(selection);\n setAllResourcesSelected(false);\n } else {\n if (selectionType === 'single' && selection !== undefined) {\n setSelectedResources((newSelectedResources) => [...newSelectedResources, selection.toString()]);\n }\n\n if (selectionType === 'all' || selectionType === 'page') {\n if (allResourcesSelected) {\n clearSelection();\n } else {\n setSelectedResources(resources.map(resourceIDResolver));\n setAllResourcesSelected(true);\n }\n }\n }\n },\n [allResourcesSelected, selectedResources, removeResource, clearSelection, resources, resourceIDResolver]\n );\n\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 'react/jsx-runtime';
2
3
  import * as React from 'react';
3
4
  import { TagGroup } from './TagGroup.js';
4
5
  import { ButtonIcon } from '../ButtonIcon/ButtonIcon.js';
6
+ import { Icon } from '../Icon/Icon.js';
5
7
  import { classNames } from '../../utils/classNames/index.js';
6
8
 
7
- const Tag = React.forwardRef(
8
- ({ children, onRemove, color = "grey", className }, ref) => {
9
- return /* @__PURE__ */ React.createElement("em", { ref, className: classNames("tag", color === "default" ? "grey" : color, className) }, children, onRemove && /* @__PURE__ */ React.createElement(ButtonIcon, { variant: "close-tag", onClick: onRemove }, /* @__PURE__ */ React.createElement("i", { className: "fa-regular fa-xmark" })));
9
+ const TagBase = React.forwardRef(
10
+ ({ children, onRemove, tone = "neutral", variant, size, labels, className, ...others }, ref) => {
11
+ const text = typeof children === "string" || typeof children === "number" ? ` ${children}` : "";
12
+ const removeLabel = labels?.remove ?? `Remove${text}`;
13
+ return /* @__PURE__ */ jsxs(
14
+ "span",
15
+ {
16
+ ...others,
17
+ ref,
18
+ className: classNames(
19
+ "roaster-tag",
20
+ `roaster-tag--${tone}`,
21
+ variant && `roaster-tag--${variant}`,
22
+ size && `roaster-tag--${size}`,
23
+ className
24
+ ),
25
+ children: [
26
+ children,
27
+ onRemove && /* @__PURE__ */ jsx(ButtonIcon, { className: "roaster-tag__remove", "aria-label": removeLabel, onClick: onRemove, children: /* @__PURE__ */ jsx(Icon, { name: "xmark" }) })
28
+ ]
29
+ }
30
+ );
10
31
  }
11
32
  );
12
- Tag.displayName = "Tag";
13
- Tag.Group = TagGroup;
33
+ TagBase.displayName = "Tag";
34
+ const TagDot = React.forwardRef(({ tone, className, ...others }, ref) => /* @__PURE__ */ jsx(
35
+ "span",
36
+ {
37
+ "aria-hidden": "true",
38
+ ...others,
39
+ ref,
40
+ className: classNames("roaster-tag__dot", tone && `roaster-icon-${tone === "neutral" ? "muted" : tone}`, className)
41
+ }
42
+ ));
43
+ TagDot.displayName = "Tag.Dot";
44
+ const Tag = Object.assign(TagBase, { Group: TagGroup, Dot: TagDot });
14
45
 
15
46
  export { Tag };
16
47
  //# sourceMappingURL=Tag.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Tag.js","sources":["../../../../src/components/Tag/Tag.tsx"],"sourcesContent":["import * as React from 'react';\nimport { classNames } from '@/utils';\nimport { ForwardRefWithStaticComponents } from '@/types';\nimport { TagGroup } from './TagGroup';\nimport { ButtonIcon } from '../ButtonIcon';\n\nexport interface TagProps {\n /** The content of the tag. */\n children: React.ReactNode;\n /** A callback function that is called when the tag's remove button is clicked. */\n onRemove?(): void;\n /** The color of the tag. `default` is the same as `grey`. */\n color?: 'default' | 'grey' | 'info' | 'success' | 'danger';\n /** CSS class names to apply to the tag root element. */\n className?: string;\n}\n\ntype TagComponent = ForwardRefWithStaticComponents<\n TagProps,\n {\n Group: typeof TagGroup;\n }\n>;\n\n/**\n * A small label in the grey, info, success or danger color, optionally removable. Group tags with Tag.Group.\n */\nexport const Tag: TagComponent = React.forwardRef<HTMLElement, TagProps>(\n ({ children, onRemove, color = 'grey', className }, ref) => {\n return (\n <em ref={ref} className={classNames('tag', color === 'default' ? 'grey' : color, className)}>\n {children}\n {onRemove && (\n <ButtonIcon variant=\"close-tag\" onClick={onRemove}>\n <i className=\"fa-regular fa-xmark\" />\n </ButtonIcon>\n )}\n </em>\n );\n }\n) as any;\n\nTag.displayName = 'Tag';\nTag.Group = TagGroup;\n"],"names":[],"mappings":";;;;;;AAIY,MAAC,GAAG,GAAG,KAAK,CAAC,UAAU;AACnC,EAAE,CAAC,EAAE,QAAQ,EAAE,QAAQ,EAAE,KAAK,GAAG,MAAM,EAAE,SAAS,EAAE,EAAE,GAAG,KAAK;AAC9D,IAAI,uBAAuB,KAAK,CAAC,aAAa,CAAC,IAAI,EAAE,EAAE,GAAG,EAAE,SAAS,EAAE,UAAU,CAAC,KAAK,EAAE,KAAK,KAAK,SAAS,GAAG,MAAM,GAAG,KAAK,EAAE,SAAS,CAAC,EAAE,EAAE,QAAQ,EAAE,QAAQ,oBAAoB,KAAK,CAAC,aAAa,CAAC,UAAU,EAAE,EAAE,OAAO,EAAE,WAAW,EAAE,OAAO,EAAE,QAAQ,EAAE,kBAAkB,KAAK,CAAC,aAAa,CAAC,GAAG,EAAE,EAAE,SAAS,EAAE,qBAAqB,EAAE,CAAC,CAAC,CAAC;AAChV,EAAE;AACF;AACA,GAAG,CAAC,WAAW,GAAG,KAAK;AACvB,GAAG,CAAC,KAAK,GAAG,QAAQ;;"}
1
+ {"version":3,"file":"Tag.js","sources":["../../../../src/components/Tag/Tag.tsx"],"sourcesContent":["import * as React from 'react';\nimport { classNames } from '@/utils';\nimport { TagGroup } from './TagGroup';\nimport { ButtonIcon } from '../ButtonIcon';\nimport { Icon } from '@/components/Icon';\n\n/** The tones of a tag. */\nexport type TagTone = 'neutral' | 'info' | 'success' | 'warning' | 'danger';\n\n/** The text of the tag, for other languages. */\nexport interface TagLabels {\n /** The name of the remove button, read by screen readers. By default \"Remove\" and the tag's text, when it is text. */\n remove: string;\n}\n\n/**\n * Every native `<span>` prop (`id`, `aria-*`, `data-*`, ...) is accepted and forwarded to it, except the obsolete\n * `color`, left out so that v1's `color` prop is an error rather than ignored: use `tone`.\n */\nexport interface TagProps extends Omit<React.ComponentPropsWithoutRef<'span'>, 'color'> {\n /** The content of the tag: text, with an optional icon. */\n children: React.ReactNode;\n /** Shows a remove button, which calls it. */\n onRemove?(): void;\n /**\n * The tone of the tag.\n * @defaultValue 'neutral'\n */\n tone?: TagTone;\n /**\n * `outline` draws an edge instead of a fill, such as for a role (\"Admin\") or a state that asks for nothing; `solid`\n * fills it with the inverted color, such as for a plan name (\"Pro\"); `inline` is a soft pill in a sentence, at the\n * text's own size, such as what the sentence counts.\n */\n variant?: 'outline' | 'solid' | 'inline';\n /** `small` is a lower tag, such as beside a name in a comment's header. */\n size?: 'small';\n /** The text of the tag, in English by default. */\n labels?: Partial<TagLabels>;\n}\n\nconst TagBase = React.forwardRef<HTMLSpanElement, TagProps>(\n ({ children, onRemove, tone = 'neutral', variant, size, labels, className, ...others }, ref) => {\n const text = typeof children === 'string' || typeof children === 'number' ? ` ${children}` : '';\n const removeLabel = labels?.remove ?? `Remove${text}`;\n return (\n <span\n {...others}\n ref={ref}\n className={classNames(\n 'roaster-tag',\n `roaster-tag--${tone}`,\n variant && `roaster-tag--${variant}`,\n size && `roaster-tag--${size}`,\n className\n )}\n >\n {children}\n {onRemove && (\n <ButtonIcon className=\"roaster-tag__remove\" aria-label={removeLabel} onClick={onRemove}>\n <Icon name=\"xmark\" />\n </ButtonIcon>\n )}\n </span>\n );\n }\n);\n\nTagBase.displayName = 'Tag';\n\n/** Every native `<span>` prop is accepted and forwarded to it. */\nexport interface TagDotProps extends React.ComponentPropsWithoutRef<'span'> {\n /**\n * The dot's color, such as a label's: a tone, or `primary`. By default the text's color.\n */\n tone?: TagTone | 'primary';\n}\n\n/** A colored dot before a tag's text, such as a label's color. Hidden from screen readers: the text says it. */\nconst TagDot = React.forwardRef<HTMLSpanElement, TagDotProps>(({ tone, className, ...others }, ref) => (\n <span\n aria-hidden=\"true\"\n {...others}\n ref={ref}\n className={classNames('roaster-tag__dot', tone && `roaster-icon-${tone === 'neutral' ? 'muted' : tone}`, className)}\n />\n));\n\nTagDot.displayName = 'Tag.Dot';\n\n/**\n * A small label in a tone (neutral, info, success, warning or danger), optionally removable with a labelled button.\n * Group tags with Tag.Group; Tag.Dot is a colored dot before the text.\n */\nexport const Tag = Object.assign(TagBase, { Group: TagGroup, Dot: TagDot });\n"],"names":[],"mappings":";;;;;;;;AAOA,MAAM,OAAO,GAAG,KAAK,CAAC,UAAU;AAChC,EAAE,CAAC,EAAE,QAAQ,EAAE,QAAQ,EAAE,IAAI,GAAG,SAAS,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,EAAE,SAAS,EAAE,GAAG,MAAM,EAAE,EAAE,GAAG,KAAK;AAClG,IAAI,MAAM,IAAI,GAAG,OAAO,QAAQ,KAAK,QAAQ,IAAI,OAAO,QAAQ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C,CAAC;AACF,MAAM,CAAC,WAAW,GAAG,SAAS;AAClB,MAAC,GAAG,GAAG,MAAM,CAAC,MAAM,CAAC,OAAO,EAAE,EAAE,KAAK,EAAE,QAAQ,EAAE,GAAG,EAAE,MAAM,EAAE;;"}
@@ -1,10 +1,11 @@
1
1
  'use client';
2
+ import { jsx } from 'react/jsx-runtime';
2
3
  import * as React from 'react';
3
4
  import { classNames } from '../../utils/classNames/index.js';
4
5
 
5
6
  const TagGroup = React.forwardRef((props, ref) => {
6
- const { className, children } = props;
7
- return /* @__PURE__ */ React.createElement("div", { ref, className: classNames("tags-container", className) }, children);
7
+ const { className, children, ...others } = props;
8
+ return /* @__PURE__ */ jsx("div", { ...others, ref, className: classNames("roaster-tag-group", className), children });
8
9
  });
9
10
  TagGroup.displayName = "TagGroup";
10
11
 
@@ -1 +1 @@
1
- {"version":3,"file":"TagGroup.js","sources":["../../../../src/components/Tag/TagGroup.tsx"],"sourcesContent":["import * as React from 'react';\nimport { classNames } from '@/utils';\n\nexport interface TagGroupProps {\n /** The tags to be displayed inside the group. */\n children: React.ReactNode;\n /** CSS class names to apply to the tag group. */\n className?: string;\n}\n\nexport const TagGroup = React.forwardRef<HTMLDivElement, TagGroupProps>((props: TagGroupProps, ref) => {\n const { className, children } = props;\n\n return (\n <div ref={ref} className={classNames('tags-container', className)}>\n {children}\n </div>\n );\n});\n\nTagGroup.displayName = 'TagGroup';\n"],"names":[],"mappings":";;;;AAEY,MAAC,QAAQ,GAAG,KAAK,CAAC,UAAU,CAAC,CAAC,KAAK,EAAE,GAAG,KAAK;AACzD,EAAE,MAAM,EAAE,SAAS,EAAE,QAAQ,EAAE,GAAG,KAAK;AACvC,EAAE,uBAAuB,KAAK,CAAC,aAAa,CAAC,KAAK,EAAE,EAAE,GAAG,EAAE,SAAS,EAAE,UAAU,CAAC,gBAAgB,EAAE,SAAS,CAAC,EAAE,EAAE,QAAQ,CAAC;AAC1H,CAAC;AACD,QAAQ,CAAC,WAAW,GAAG,UAAU;;"}
1
+ {"version":3,"file":"TagGroup.js","sources":["../../../../src/components/Tag/TagGroup.tsx"],"sourcesContent":["import * as React from 'react';\nimport { classNames } from '@/utils';\n\n/** Every native `<div>` prop (`id`, `aria-*`, `data-*`, ...) is accepted and forwarded to it. */\nexport interface TagGroupProps extends React.ComponentPropsWithoutRef<'div'> {\n /** The tags to be displayed inside the group. */\n children: React.ReactNode;\n}\n\n/** A row of tags that wraps. */\nexport const TagGroup = React.forwardRef<HTMLDivElement, TagGroupProps>((props, ref) => {\n const { className, children, ...others } = props;\n\n return (\n <div {...others} ref={ref} className={classNames('roaster-tag-group', className)}>\n {children}\n </div>\n );\n});\n\nTagGroup.displayName = 'TagGroup';\n"],"names":[],"mappings":";;;;;AAIY,MAAC,QAAQ,GAAG,KAAK,CAAC,UAAU,CAAC,CAAC,KAAK,EAAE,GAAG,KAAK;AACzD,EAAE,MAAM,EAAE,SAAS,EAAE,QAAQ,EAAE,GAAG,MAAM,EAAE,GAAG,KAAK;AAClD,EAAE,uBAAuB,GAAG,CAAC,KAAK,EAAE,EAAE,GAAG,MAAM,EAAE,GAAG,EAAE,SAAS,EAAE,UAAU,CAAC,mBAAmB,EAAE,SAAS,CAAC,EAAE,QAAQ,EAAE,CAAC;AACxH,CAAC;AACD,QAAQ,CAAC,WAAW,GAAG,UAAU;;"}
@@ -1,7 +1,10 @@
1
1
  'use client';
2
+ import { jsx, jsxs } from 'react/jsx-runtime';
2
3
  import * as React from 'react';
4
+ import { fieldControlProps, Field } from '../Field/Field.js';
3
5
  import { useUid } from '../../utils/useUid/index.js';
4
6
  import { classNames } from '../../utils/classNames/index.js';
7
+ import { Slot } from '../../utils/Slot/index.js';
5
8
 
6
9
  const TextField = React.forwardRef((props, ref) => {
7
10
  const {
@@ -11,58 +14,58 @@ const TextField = React.forwardRef((props, ref) => {
11
14
  prefix,
12
15
  suffix,
13
16
  onChange,
14
- helpText,
15
- disabled,
16
- inputStyle,
17
+ onValueChange,
18
+ description,
17
19
  rightSection,
18
- placeholder,
19
- defaultValue,
20
20
  type = "text",
21
- labelClassName,
22
- inputClassName,
21
+ variant,
22
+ inline,
23
+ className,
24
+ style,
23
25
  ...others
24
26
  } = props;
25
27
  const uid = useUid(id);
26
- let rightSectionComponent = null;
27
- const rightSectionRef = React.useRef(null);
28
+ const hasRightSection = rightSection != null && rightSection !== false && rightSection !== "";
28
29
  const handleChange = (event) => {
29
- onChange?.(event.currentTarget.value, event);
30
+ onChange?.(event);
31
+ onValueChange?.(event.currentTarget.value);
30
32
  };
31
- if (React.isValidElement(rightSection)) {
32
- const element = rightSection;
33
- rightSectionComponent = React.cloneElement(element, {
34
- className: classNames(element.props.className, "merge-left"),
35
- ref: rightSectionRef
36
- });
37
- } else if (rightSection != null && rightSection !== false && rightSection !== "") {
38
- rightSectionComponent = /* @__PURE__ */ React.createElement("span", { className: "merge-left", ref: rightSectionRef }, rightSection);
39
- }
40
- return /* @__PURE__ */ React.createElement("label", { htmlFor: uid, className: classNames({ error }, labelClassName) }, /* @__PURE__ */ React.createElement("p", null, label), /* @__PURE__ */ React.createElement("div", { className: classNames({ "merged-inputs": rightSection, "prefixed-input-container": prefix || suffix }) }, prefix && /* @__PURE__ */ React.createElement("span", { className: "input-prefix" }, prefix), /* @__PURE__ */ React.createElement(
33
+ const input = /* @__PURE__ */ jsx(
41
34
  "input",
42
35
  {
43
- id: uid,
36
+ ...others,
37
+ ...fieldControlProps(uid, { description, error }, others),
44
38
  ref,
45
39
  type,
46
- style: inputStyle,
47
- disabled,
48
40
  onChange: handleChange,
49
- placeholder,
50
- defaultValue,
51
- className: classNames({ "merge-right": rightSection, prefixed: prefix, suffixed: suffix }, inputClassName),
52
- ...others
41
+ className: classNames("roaster-input", variant && `roaster-input--${variant}`, {
42
+ "roaster-merged-inputs__start": hasRightSection,
43
+ "roaster-input--prefixed": prefix,
44
+ "roaster-input--suffixed": suffix
45
+ })
53
46
  }
54
- ), suffix && /* @__PURE__ */ React.createElement(
55
- "span",
47
+ );
48
+ const control = prefix || suffix ? /* @__PURE__ */ jsxs("div", { className: "roaster-input-group", children: [
49
+ prefix && /* @__PURE__ */ jsx("span", { className: "roaster-input-group__prefix", children: prefix }),
50
+ input,
51
+ suffix && /* @__PURE__ */ jsx("span", { className: "roaster-input-group__suffix", children: suffix })
52
+ ] }) : input;
53
+ return /* @__PURE__ */ jsx(
54
+ Field,
56
55
  {
57
- className: "input-suffix",
58
- style: {
59
- ...rightSection ? {
60
- paddingRight: rightSectionRef.current?.getBoundingClientRect().width
61
- } : {}
62
- }
63
- },
64
- suffix
65
- ), rightSectionComponent), /* @__PURE__ */ React.createElement("small", null, error || helpText));
56
+ controlId: uid,
57
+ label,
58
+ description,
59
+ error,
60
+ inline,
61
+ className,
62
+ style,
63
+ children: hasRightSection ? /* @__PURE__ */ jsxs("div", { className: "roaster-merged-inputs", children: [
64
+ control,
65
+ /* @__PURE__ */ jsx(Slot, { className: "roaster-merged-inputs__end", children: React.isValidElement(rightSection) ? rightSection : /* @__PURE__ */ jsx("span", { children: rightSection }) })
66
+ ] }) : control
67
+ }
68
+ );
66
69
  });
67
70
  TextField.displayName = "TextField";
68
71
 
@@ -1 +1 @@
1
- {"version":3,"file":"TextField.js","sources":["../../../../src/components/TextField/TextField.tsx"],"sourcesContent":["import * as React from 'react';\nimport { classNames, useUid } from '@/utils';\n\nexport interface TextFieldProps extends Omit<React.ComponentProps<'input'>, 'onChange' | 'prefix'> {\n /** The ID of the input element. */\n id?: string;\n /** An error message to display below the input, if applicable. */\n error?: string;\n /** Whether the input should be disabled. */\n disabled?: boolean;\n /** Placeholder text to display in the input. */\n placeholder?: string;\n /** The default value of the input. */\n defaultValue?: string;\n /** CSS class names to apply to the label. */\n labelClassName?: string;\n /** CSS class names to apply to the input. */\n inputClassName?: string;\n /** The label to display above the input. */\n label?: React.ReactNode;\n /** A prefix to display before the input. */\n prefix?: React.ReactNode;\n /** A suffix to display after the input. */\n suffix?: React.ReactNode;\n /** Help text to display below the input. */\n helpText?: React.ReactNode;\n /** A section to display on the right side of the input. */\n rightSection?: React.ReactNode;\n /**\n * A callback function that is called when the value of the input changes.\n * It receives the new value, and the originating change event as a second argument.\n */\n onChange?(value: string, event: React.ChangeEvent<HTMLInputElement>): void;\n /** CSS styles to apply to the input. */\n inputStyle?: React.CSSProperties;\n /** The type of the input element, such as text, email, tel, url, number, or password. */\n type?: 'text' | 'email' | 'tel' | 'url' | 'number' | 'password';\n}\n\n/**\n * A single-line text field with a label, help text, error message, and an optional prefix, suffix or right-hand\n * section.\n */\nexport const TextField = React.forwardRef<HTMLInputElement, TextFieldProps>((props, ref) => {\n const {\n id,\n label,\n error,\n prefix,\n suffix,\n onChange,\n helpText,\n disabled,\n inputStyle,\n rightSection,\n placeholder,\n defaultValue,\n type = 'text',\n labelClassName,\n inputClassName,\n ...others\n } = props;\n\n const uid = useUid(id);\n let rightSectionComponent = null;\n const rightSectionRef = React.useRef<HTMLElement>(null);\n\n const handleChange = (event: React.ChangeEvent<HTMLInputElement>) => {\n onChange?.(event.currentTarget.value, event);\n };\n\n if (React.isValidElement(rightSection)) {\n const element = rightSection as React.ReactElement<{ className?: string }>;\n rightSectionComponent = React.cloneElement(element, {\n className: classNames(element.props.className, 'merge-left'),\n ref: rightSectionRef,\n } as React.Attributes & { className?: string });\n } else if (rightSection != null && rightSection !== false && rightSection !== '') {\n // Text and numbers can't be cloned with a class: wrap them instead.\n rightSectionComponent = (\n <span className=\"merge-left\" ref={rightSectionRef}>\n {rightSection}\n </span>\n );\n }\n\n return (\n <label htmlFor={uid} className={classNames({ error }, labelClassName)}>\n <p>{label}</p>\n <div className={classNames({ 'merged-inputs': rightSection, 'prefixed-input-container': prefix || suffix })}>\n {prefix && <span className=\"input-prefix\">{prefix}</span>}\n <input\n id={uid}\n ref={ref}\n type={type}\n style={inputStyle}\n disabled={disabled}\n onChange={handleChange}\n placeholder={placeholder}\n defaultValue={defaultValue}\n className={classNames({ 'merge-right': rightSection, prefixed: prefix, suffixed: suffix }, inputClassName)}\n {...others}\n />\n {suffix && (\n <span\n className=\"input-suffix\"\n style={{\n ...(rightSection\n ? {\n paddingRight: rightSectionRef.current?.getBoundingClientRect().width,\n }\n : {}),\n }}\n >\n {suffix}\n </span>\n )}\n {rightSectionComponent}\n </div>\n <small>{error || helpText}</small>\n </label>\n );\n});\n\nTextField.displayName = 'TextField';\n"],"names":[],"mappings":";;;;;AAEY,MAAC,SAAS,GAAG,KAAK,CAAC,UAAU,CAAC,CAAC,KAAK,EAAE,GAAG,KAAK;AAC1D,EAAE,MAAM;AACR,IAAI,EAAE;AACN,IAAI,KAAK;AACT,IAAI,KAAK;AACT,IAAI,MAAM;AACV,IAAI,MAAM;AACV,IAAI,QAAQ;AACZ,IAAI,QAAQ;AACZ,IAAI,QAAQ;AACZ,IAAI,UAAU;AACd,IAAI,YAAY;AAChB,IAAI,WAAW;AACf,IAAI,YAAY;AAChB,IAAI,IAAI,GAAG,MAAM;AACjB,IAAI,cAAc;AAClB,IAAI,cAAc;AAClB,IAAI,GAAG;AACP,GAAG,GAAG,KAAK;AACX,EAAE,MAAM,GAAG,GAAG,MAAM,CAAC,EAAE,CAAC;AACxB,EAAE,IAAI,qBAAqB,GAAG,IAAI;AAClC,EAAE,MAAM,eAAe,GAAG,KAAK,CAAC,MAAM,CAAC,IAAI,CAAC;AAC5C,EAAE,MAAM,YAAY,GAAG,CAAC,KAAK,KAAK;AAClC,IAAI,QAAQ,GAAG,KAAK,CAAC,aAAa,CAAC,KAAK,EAAE,KAAK,CAAC;AAChD,EAAE,CAAC;AACH,EAAE,IAAI,KAAK,CAAC,cAAc,CAAC,YAAY,CAAC,EAAE;AAC1C,IAAI,MAAM,OAAO,GAAG,YAAY;AAChC,IAAI,qBAAqB,GAAG,KAAK,CAAC,YAAY,CAAC,OAAO,EAAE;AACxD,MAAM,SAAS,EAAE,UAAU,CAAC,OAAO,CAAC,KAAK,CAAC,SAAS,EAAE,YAAY,CAAC;AAClE,MAAM,GAAG,EAAE;AACX,KAAK,CAAC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AAC/B,MAAM,KAAK,EAAE;AACb,QAAQ,GAAG,YAAY,GAAG;AAC1B,UAAU,YAAY,EAAE,eAAe,CAAC,OAAO,EAAE,qBAAqB,EAAE,CAAC;AACzE,SAAS,GAAG;AACZ;AACA,KAAK;AACL,IAAI;AACJ,GAAG,EAAE,qBAAqB,CAAC,kBAAkB,KAAK,CAAC,aAAa,CAAC,OAAO,EAAE,IAAI,EAAE,KAAK,IAAI,QAAQ,CAAC,CAAC;AACnG,CAAC;AACD,SAAS,CAAC,WAAW,GAAG,WAAW;;"}
1
+ {"version":3,"file":"TextField.js","sources":["../../../../src/components/TextField/TextField.tsx"],"sourcesContent":["import * as React from 'react';\nimport { classNames, Slot, useUid } from '@/utils';\nimport { Field, fieldControlProps, type FieldBaseProps, type InlineFieldProps } from '../Field';\n\n/**\n * Every native `<input>` prop (`name`, `required`, `aria-*`, ...) is accepted and forwarded to the input, with the\n * ref. `className` and `style` go to the field's wrapper.\n */\nexport interface TextFieldProps\n extends\n FieldBaseProps,\n InlineFieldProps,\n Omit<React.ComponentPropsWithoutRef<'input'>, 'prefix' | 'className' | 'style'> {\n /** `plain` has no edge or fill, such as a reply's field in a card's footer. The focus ring stays. */\n variant?: 'plain';\n /** A prefix to display before the input. */\n prefix?: React.ReactNode;\n /** A suffix to display after the input. */\n suffix?: React.ReactNode;\n /** A section to display on the right side of the input. */\n rightSection?: React.ReactNode;\n /** Called with the new value when the user changes it. The native `onChange` gets the event. */\n onValueChange?(value: string): void;\n /** The type of the input element, such as text, email, tel, url, number, or password. */\n type?: 'text' | 'email' | 'tel' | 'url' | 'number' | 'password';\n}\n\n/**\n * A single-line text field with a label, help text, error message, and an optional prefix, suffix or right-hand\n * section.\n */\nexport const TextField = React.forwardRef<HTMLInputElement, TextFieldProps>((props, ref) => {\n const {\n id,\n label,\n error,\n prefix,\n suffix,\n onChange,\n onValueChange,\n description,\n rightSection,\n type = 'text',\n variant,\n inline,\n className,\n style,\n ...others\n } = props;\n\n const uid = useUid(id);\n const hasRightSection = rightSection != null && rightSection !== false && rightSection !== '';\n\n const handleChange = (event: React.ChangeEvent<HTMLInputElement>) => {\n onChange?.(event);\n onValueChange?.(event.currentTarget.value);\n };\n\n const input = (\n <input\n {...others}\n {...fieldControlProps(uid, { label, description, error }, others)}\n ref={ref}\n type={type}\n onChange={handleChange}\n className={classNames('roaster-input', variant && `roaster-input--${variant}`, {\n 'roaster-merged-inputs__start': hasRightSection,\n 'roaster-input--prefixed': prefix,\n 'roaster-input--suffixed': suffix,\n })}\n />\n );\n // The prefix and suffix sit over the input, in a group as wide as it.\n const control =\n prefix || suffix ? (\n <div className=\"roaster-input-group\">\n {prefix && <span className=\"roaster-input-group__prefix\">{prefix}</span>}\n {input}\n {suffix && <span className=\"roaster-input-group__suffix\">{suffix}</span>}\n </div>\n ) : (\n input\n );\n\n return (\n <Field\n controlId={uid}\n label={label}\n description={description}\n error={error}\n inline={inline}\n className={className}\n style={style}\n >\n {hasRightSection ? (\n <div className=\"roaster-merged-inputs\">\n {control}\n {/* An element (a Button) takes the class; text is wrapped first. */}\n <Slot className=\"roaster-merged-inputs__end\">\n {React.isValidElement(rightSection) ? rightSection : <span>{rightSection}</span>}\n </Slot>\n </div>\n ) : (\n control\n )}\n </Field>\n );\n});\n\nTextField.displayName = 'TextField';\n"],"names":[],"mappings":";;;;;;;;AAKY,MAAC,SAAS,GAAG,KAAK,CAAC,UAAU,CAAC,CAAC,KAAK,EAAE,GAAG,KAAK;AAC1D,EAAE,MAAM;AACR,IAAI,EAAE;AACN,IAAI,KAAK;AACT,IAAI,KAAK;AACT,IAAI,MAAM;AACV,IAAI,MAAM;AACV,IAAI,QAAQ;AACZ,IAAI,aAAa;AACjB,IAAI,WAAW;AACf,IAAI,YAAY;AAChB,IAAI,IAAI,GAAG,MAAM;AACjB,IAAI,OAAO;AACX,IAAI,MAAM;AACV,IAAI,SAAS;AACb,IAAI,KAAK;AACT,IAAI,GAAG;AACP,GAAG,GAAG,KAAK;AACX,EAAE,M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;AACJ,MAAM,SAAS,EAAE,GAAG;AACpB,MAAM,KAAK;AACX,MAAM,WAAW;AACjB,MAAM,KAAK;AACX,MAAM,MAAM;AACZ,MAAM,SAAS;AACf,MAAM,KAAK;AACX,MAAM,QAAQ,EAAE,eAAe,mBAAmB,IAAI,CAAC,KAAK,EAAE,EAAE,SAAS,EAAE,uBAAuB,EAAE,QAAQ,EAAE;AAC9G,QAAQ,OAAO;AACf,wBAAwB,GAAG,CAAC,IAAI,EAAE,EAAE,SAAS,EAAE,4BAA4B,EAAE,QAAQ,EAAE,KAAK,CAAC,cAAc,CAAC,YAAY,CAAC,GAAG,YAAY,mBAAmB,GAAG,CAAC,MAAM,EAAE,EAAE,QAAQ,EAAE,YAAY,EAAE,CAAC,EAAE;AACpM,OAAO,EAAE,CAAC,GAAG;AACb;AACA,GAAG;AACH,CAAC;AACD,SAAS,CAAC,WAAW,GAAG,WAAW;;"}
@@ -1,43 +1,27 @@
1
1
  'use client';
2
+ import { jsx } from 'react/jsx-runtime';
2
3
  import * as React from 'react';
4
+ import { Field, fieldControlProps } from '../Field/Field.js';
3
5
  import { useUid } from '../../utils/useUid/index.js';
4
6
  import { classNames } from '../../utils/classNames/index.js';
5
7
 
6
8
  const Textarea = React.forwardRef((props, ref) => {
7
- const {
8
- label,
9
- error,
10
- id,
11
- style,
12
- helpText,
13
- disabled,
14
- labelClassName,
15
- inputClassName,
16
- rows,
17
- onChange,
18
- defaultValue,
19
- placeholder,
20
- ...others
21
- } = props;
9
+ const { label, error, id, description, onChange, onValueChange, variant, className, style, ...others } = props;
22
10
  const uid = useUid(id);
23
11
  const handleChange = (event) => {
24
- onChange?.(event.currentTarget.value);
12
+ onChange?.(event);
13
+ onValueChange?.(event.currentTarget.value);
25
14
  };
26
- return /* @__PURE__ */ React.createElement("label", { htmlFor: uid, className: classNames({ error }, labelClassName) }, /* @__PURE__ */ React.createElement("p", null, label), /* @__PURE__ */ React.createElement(
15
+ return /* @__PURE__ */ jsx(Field, { controlId: uid, label, description, error, className, style, children: /* @__PURE__ */ jsx(
27
16
  "textarea",
28
17
  {
29
18
  ...others,
30
- id: uid,
19
+ ...fieldControlProps(uid, { description, error }, others),
31
20
  ref,
32
- rows,
33
- style,
34
- disabled,
35
- onChange: handleChange,
36
- placeholder,
37
- defaultValue,
38
- className: classNames(inputClassName)
21
+ className: classNames("roaster-textarea", variant && `roaster-input--${variant}`),
22
+ onChange: handleChange
39
23
  }
40
- ), /* @__PURE__ */ React.createElement("small", null, error || helpText));
24
+ ) });
41
25
  });
42
26
  Textarea.displayName = "Textarea";
43
27
 
@@ -1 +1 @@
1
- {"version":3,"file":"Textarea.js","sources":["../../../../src/components/Textarea/Textarea.tsx"],"sourcesContent":["import * as React from 'react';\nimport { classNames, useUid } from '@/utils';\n\n/** Every native `<textarea>` prop (`name`, `value`, `aria-*`, `data-*`, ...) is accepted and forwarded to it. */\nexport interface TextareaProps extends Omit<React.ComponentPropsWithoutRef<'textarea'>, 'onChange'> {\n /** The ID of the textarea element. */\n id?: string;\n /** The number of rows to display in the textarea. */\n rows?: number;\n /** An error message to display below the textarea, if applicable. */\n error?: string;\n /** Whether the textarea should be disabled. */\n disabled?: boolean;\n /** Placeholder text to display in the textarea. */\n placeholder?: string;\n /** The default value of the textarea. */\n defaultValue?: string;\n /** The label to display above the textarea. */\n label?: React.ReactNode;\n /** CSS class names to apply to the label. */\n labelClassName?: string;\n /** CSS class names to apply to the textarea. */\n inputClassName?: string;\n /** Help text to display below the textarea. */\n helpText?: React.ReactNode;\n /** Additional styles to apply to the textarea. */\n style?: React.CSSProperties;\n /** A callback function that is called when the value of the textarea changes. */\n onChange?(value: string): void;\n}\n\n/** A multiline text field with a label, help text and error message. */\nexport const Textarea = React.forwardRef<HTMLTextAreaElement, TextareaProps>((props, ref) => {\n const {\n label,\n error,\n id,\n style,\n helpText,\n disabled,\n labelClassName,\n inputClassName,\n rows,\n onChange,\n defaultValue,\n placeholder,\n ...others\n } = props;\n\n const uid = useUid(id);\n\n const handleChange = (event: React.ChangeEvent<HTMLTextAreaElement>) => {\n onChange?.(event.currentTarget.value);\n };\n\n return (\n <label htmlFor={uid} className={classNames({ error }, labelClassName)}>\n <p>{label}</p>\n <textarea\n {...others}\n id={uid}\n ref={ref}\n rows={rows}\n style={style}\n disabled={disabled}\n onChange={handleChange}\n placeholder={placeholder}\n defaultValue={defaultValue}\n className={classNames(inputClassName)}\n />\n <small>{error || helpText}</small>\n </label>\n );\n});\n\nTextarea.displayName = 'Textarea';\n"],"names":[],"mappings":";;;;;AAEY,MAAC,QAAQ,GAAG,KAAK,CAAC,UAAU,CAAC,CAAC,KAAK,EAAE,GAAG,KAAK;AACzD,EAAE,MAAM;AACR,IAAI,KAAK;AACT,IAAI,KAAK;AACT,IAAI,EAAE;AACN,IAAI,KAAK;AACT,IAAI,QAAQ;AACZ,IAAI,QAAQ;AACZ,IAAI,cAAc;AAClB,IAAI,cAAc;AAClB,IAAI,IAAI;AACR,IAAI,QAAQ;AACZ,IAAI,YAAY;AAChB,IAAI,WAAW;AACf,IAAI,GAAG;AACP,GAAG,GAAG,KAAK;AACX,EAAE,MAAM,GAAG,GAAG,MAAM,CAAC,EAAE,CAAC;AACxB,EAAE,MAAM,YAAY,GAAG,CAAC,KAAK,KAAK;AAClC,IAAI,QAAQ,GAAG,KAAK,CAAC,aAAa,CAAC,KAAK,CAAC;AACzC,EAAE,CAAC;AACH,EAAE,uBAAuB,KAAK,CAAC,aAAa,CAAC,OAAO,EAAE,EAAE,OAAO,EAAE,GAAG,EAAE,SAAS,EAAE,UAAU,CAAC,EAAE,KAAK,EAAE,EAAE,cAAc,CAAC,EAAE,kBAAkB,KAAK,CAAC,aAAa,CAAC,GAAG,EAAE,IAAI,EAAE,KAAK,CAAC,kBAAkB,KAAK,CAAC,aAAa;AACpN,IAAI,UAAU;AACd,IAAI;AACJ,MAAM,GAAG,MAAM;AACf,MAAM,EAAE,EAAE,GAAG;AACb,MAAM,GAAG;AACT,MAAM,IAAI;AACV,MAAM,KAAK;AACX,MAAM,QAAQ;AACd,MAAM,QAAQ,EAAE,YAAY;AAC5B,MAAM,WAAW;AACjB,MAAM,YAAY;AAClB,MAAM,SAAS,EAAE,UAAU,CAAC,cAAc;AAC1C;AACA,GAAG,kBAAkB,KAAK,CAAC,aAAa,CAAC,OAAO,EAAE,IAAI,EAAE,KAAK,IAAI,QAAQ,CAAC,CAAC;AAC3E,CAAC;AACD,QAAQ,CAAC,WAAW,GAAG,UAAU;;"}
1
+ {"version":3,"file":"Textarea.js","sources":["../../../../src/components/Textarea/Textarea.tsx"],"sourcesContent":["import * as React from 'react';\nimport { classNames, useUid } from '@/utils';\nimport { Field, fieldControlProps, type FieldBaseProps } from '../Field';\n\n/**\n * Every native `<textarea>` prop (`name`, `rows`, `required`, `aria-*`, ...) is accepted and forwarded to the\n * textarea, with the ref. `className` and `style` go to the field's wrapper.\n */\nexport interface TextareaProps\n extends FieldBaseProps, Omit<React.ComponentPropsWithoutRef<'textarea'>, 'className' | 'style'> {\n /** Called with the new value when the user changes it. The native `onChange` gets the event. */\n onValueChange?(value: string): void;\n /** `plain` has no edge or fill, such as a comment's text area in a card. The focus ring stays. */\n variant?: 'plain';\n}\n\n/** A multiline text field with a label, help text and error message. */\nexport const Textarea = React.forwardRef<HTMLTextAreaElement, TextareaProps>((props, ref) => {\n const { label, error, id, description, onChange, onValueChange, variant, className, style, ...others } = props;\n\n const uid = useUid(id);\n\n const handleChange = (event: React.ChangeEvent<HTMLTextAreaElement>) => {\n onChange?.(event);\n onValueChange?.(event.currentTarget.value);\n };\n\n return (\n <Field controlId={uid} label={label} description={description} error={error} className={className} style={style}>\n <textarea\n {...others}\n {...fieldControlProps(uid, { label, description, error }, others)}\n ref={ref}\n className={classNames('roaster-textarea', variant && `roaster-input--${variant}`)}\n onChange={handleChange}\n />\n </Field>\n );\n});\n\nTextarea.displayName = 'Textarea';\n"],"names":[],"mappings":";;;;;;;AAKY,MAAC,QAAQ,GAAG,KAAK,CAAC,UAAU,CAAC,CAAC,KAAK,EAAE,GAAG,KAAK;AACzD,EAAE,MAAM,EAAE,KAAK,EAAE,KAAK,EAAE,EAAE,EAAE,WAAW,EAAE,QAAQ,EAAE,aAAa,EAAE,OAAO,EAAE,SAAS,EAAE,KAAK,EAAE,GAAG,MAAM,EAAE,GAAG,KAAK;AAChH,EAAE,MAAM,GAAG,GAAG,MAAM,CAAC,EAAE,CAAC;AACxB,EAAE,MAAM,YAAY,GAAG,CAAC,KAAK,KAAK;AAClC,IAAI,QAAQ,GAAG,KAAK,CAAC;AACrB,IAAI,aAAa,GAAG,KAAK,CAAC,aAAa,CAAC,KAAK,CAAC;AAC9C,EAAE,CAAC;AACH,EAAE,uBAAuB,GAAG,CAAC,KAAK,EAAE,EAAE,SAAS,EAAE,GAAG,EAAE,KAAK,EAAE,WAAW,EAAE,KAAK,EAAE,SAAS,EAAE,KAAK,EAAE,QAAQ,kBAAkB,GAAG;AAChI,IAAI,UAAU;AACd,IAAI;AACJ,MAAM,GAAG,MAAM;AACf,MAAM,GAAG,iBAAiB,CAAC,GAAG,EAAE,EAAS,WAAW,EAAE,KAAK,EAAE,EAAE,MAAM,CAAC;AACtE,MAAM,GAAG;AACT,MAAM,SAAS,EAAE,UAAU,CAAC,kBAAkB,EAAE,OAAO,IAAI,CAAC,eAAe,EAAE,OAAO,CAAC,CAAC,CAAC;AACvF,MAAM,QAAQ,EAAE;AAChB;AACA,GAAG,EAAE,CAAC;AACN,CAAC;AACD,QAAQ,CAAC,WAAW,GAAG,UAAU;;"}