@flipdish/ui-library 0.69.0 → 0.71.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 (415) hide show
  1. package/README.md +3 -3
  2. package/dist/components/__internal__/controlFill/controlFill.context.cjs +13 -0
  3. package/dist/components/__internal__/controlFill/controlFill.context.cjs.map +1 -0
  4. package/dist/components/__internal__/controlFill/controlFill.context.d.ts +7 -0
  5. package/dist/components/__internal__/controlFill/controlFill.context.d.ts.map +1 -0
  6. package/dist/components/__internal__/controlFill/controlFill.context.js +11 -0
  7. package/dist/components/__internal__/controlFill/controlFill.context.js.map +1 -0
  8. package/dist/components/__internal__/focusHandOff/focusHandOff.context.cjs +13 -0
  9. package/dist/components/__internal__/focusHandOff/focusHandOff.context.cjs.map +1 -0
  10. package/dist/components/__internal__/focusHandOff/focusHandOff.context.d.ts +8 -0
  11. package/dist/components/__internal__/focusHandOff/focusHandOff.context.d.ts.map +1 -0
  12. package/dist/components/__internal__/focusHandOff/focusHandOff.context.js +11 -0
  13. package/dist/components/__internal__/focusHandOff/focusHandOff.context.js.map +1 -0
  14. package/dist/components/atoms/Buttons/Button/hooks/useLoadingLinkPress.d.ts +1 -1
  15. package/dist/components/atoms/Buttons/IconButton/IconButton.cjs +1 -1
  16. package/dist/components/atoms/Buttons/IconButton/IconButton.cjs.map +1 -1
  17. package/dist/components/atoms/Buttons/IconButton/IconButton.d.ts.map +1 -1
  18. package/dist/components/atoms/Buttons/IconButton/IconButton.js +1 -1
  19. package/dist/components/atoms/Buttons/IconButton/IconButton.js.map +1 -1
  20. package/dist/components/atoms/LiveStatus/index.cjs +18 -0
  21. package/dist/components/atoms/LiveStatus/index.cjs.map +1 -0
  22. package/dist/components/atoms/LiveStatus/index.d.ts +17 -0
  23. package/dist/components/atoms/LiveStatus/index.d.ts.map +1 -0
  24. package/dist/components/atoms/LiveStatus/index.js +16 -0
  25. package/dist/components/atoms/LiveStatus/index.js.map +1 -0
  26. package/dist/components/forms/Form/index.cjs +1 -1
  27. package/dist/components/forms/Form/index.js +1 -1
  28. package/dist/components/molecules/Dropdown/index.d.ts +2 -2
  29. package/dist/components/molecules/EmptyState/index.cjs +9 -1
  30. package/dist/components/molecules/EmptyState/index.cjs.map +1 -1
  31. package/dist/components/molecules/EmptyState/index.d.ts.map +1 -1
  32. package/dist/components/molecules/EmptyState/index.js +11 -3
  33. package/dist/components/molecules/EmptyState/index.js.map +1 -1
  34. package/dist/components/molecules/EmptyState/utilities/emptyState.utils.cjs +13 -0
  35. package/dist/components/molecules/EmptyState/utilities/emptyState.utils.cjs.map +1 -1
  36. package/dist/components/molecules/EmptyState/utilities/emptyState.utils.d.ts +8 -0
  37. package/dist/components/molecules/EmptyState/utilities/emptyState.utils.d.ts.map +1 -1
  38. package/dist/components/molecules/EmptyState/utilities/emptyState.utils.js +13 -1
  39. package/dist/components/molecules/EmptyState/utilities/emptyState.utils.js.map +1 -1
  40. package/dist/components/molecules/Modals/Modal/Modal.cjs +6 -5
  41. package/dist/components/molecules/Modals/Modal/Modal.cjs.map +1 -1
  42. package/dist/components/molecules/Modals/Modal/Modal.d.ts.map +1 -1
  43. package/dist/components/molecules/Modals/Modal/Modal.js +6 -5
  44. package/dist/components/molecules/Modals/Modal/Modal.js.map +1 -1
  45. package/dist/components/molecules/Paginations/utilities/paginationScroll.utils.cjs +1 -1
  46. package/dist/components/molecules/Paginations/utilities/paginationScroll.utils.d.ts +1 -1
  47. package/dist/components/molecules/Paginations/utilities/paginationScroll.utils.d.ts.map +1 -1
  48. package/dist/components/molecules/Paginations/utilities/paginationScroll.utils.js +1 -1
  49. package/dist/components/molecules/Tags/TagGroup/TagGroup.d.ts +1 -1
  50. package/dist/components/molecules/Tags/TagGroup/TagGroup.d.ts.map +1 -1
  51. package/dist/components/organisms/DatePickers/DateRangePicker/DateRangePicker.cjs +4 -1
  52. package/dist/components/organisms/DatePickers/DateRangePicker/DateRangePicker.cjs.map +1 -1
  53. package/dist/components/organisms/DatePickers/DateRangePicker/DateRangePicker.d.ts.map +1 -1
  54. package/dist/components/organisms/DatePickers/DateRangePicker/DateRangePicker.js +5 -2
  55. package/dist/components/organisms/DatePickers/DateRangePicker/DateRangePicker.js.map +1 -1
  56. package/dist/components/organisms/FilterBar/components/FilterDropdownMenu.cjs +11 -6
  57. package/dist/components/organisms/FilterBar/components/FilterDropdownMenu.cjs.map +1 -1
  58. package/dist/components/organisms/FilterBar/components/FilterDropdownMenu.d.ts +4 -2
  59. package/dist/components/organisms/FilterBar/components/FilterDropdownMenu.d.ts.map +1 -1
  60. package/dist/components/organisms/FilterBar/components/FilterDropdownMenu.js +12 -7
  61. package/dist/components/organisms/FilterBar/components/FilterDropdownMenu.js.map +1 -1
  62. package/dist/components/organisms/FilterBar/hooks/useFilterDraft.cjs +53 -0
  63. package/dist/components/organisms/FilterBar/hooks/useFilterDraft.cjs.map +1 -0
  64. package/dist/components/organisms/FilterBar/hooks/useFilterDraft.d.ts +41 -0
  65. package/dist/components/organisms/FilterBar/hooks/useFilterDraft.d.ts.map +1 -0
  66. package/dist/components/organisms/FilterBar/hooks/useFilterDraft.js +51 -0
  67. package/dist/components/organisms/FilterBar/hooks/useFilterDraft.js.map +1 -0
  68. package/dist/components/organisms/FilterBar/index.cjs +19 -7
  69. package/dist/components/organisms/FilterBar/index.cjs.map +1 -1
  70. package/dist/components/organisms/FilterBar/index.d.ts +1 -0
  71. package/dist/components/organisms/FilterBar/index.d.ts.map +1 -1
  72. package/dist/components/organisms/FilterBar/index.js +18 -7
  73. package/dist/components/organisms/FilterBar/index.js.map +1 -1
  74. package/dist/components/organisms/SlideoutMenu/hooks/useSlideoutState.cjs +2 -0
  75. package/dist/components/organisms/SlideoutMenu/hooks/useSlideoutState.cjs.map +1 -1
  76. package/dist/components/organisms/SlideoutMenu/hooks/useSlideoutState.d.ts +10 -0
  77. package/dist/components/organisms/SlideoutMenu/hooks/useSlideoutState.d.ts.map +1 -1
  78. package/dist/components/organisms/SlideoutMenu/hooks/useSlideoutState.js +2 -0
  79. package/dist/components/organisms/SlideoutMenu/hooks/useSlideoutState.js.map +1 -1
  80. package/dist/components/organisms/SlideoutMenu/index.cjs +3 -1
  81. package/dist/components/organisms/SlideoutMenu/index.cjs.map +1 -1
  82. package/dist/components/organisms/SlideoutMenu/index.d.ts.map +1 -1
  83. package/dist/components/organisms/SlideoutMenu/index.js +3 -1
  84. package/dist/components/organisms/SlideoutMenu/index.js.map +1 -1
  85. package/dist/components/organisms/Table/index.cjs +14 -244
  86. package/dist/components/organisms/Table/index.cjs.map +1 -1
  87. package/dist/components/organisms/Table/index.d.ts +29 -124
  88. package/dist/components/organisms/Table/index.d.ts.map +1 -1
  89. package/dist/components/organisms/Table/index.js +13 -243
  90. package/dist/components/organisms/Table/index.js.map +1 -1
  91. package/dist/components/organisms/Tables/Table/Table.cjs +305 -0
  92. package/dist/components/organisms/Tables/Table/Table.cjs.map +1 -0
  93. package/dist/components/organisms/Tables/Table/Table.d.ts +146 -0
  94. package/dist/components/organisms/Tables/Table/Table.d.ts.map +1 -0
  95. package/dist/components/organisms/Tables/Table/Table.js +301 -0
  96. package/dist/components/organisms/Tables/Table/Table.js.map +1 -0
  97. package/dist/components/organisms/Tables/Table/Table.styles.cjs +29 -0
  98. package/dist/components/organisms/Tables/Table/Table.styles.cjs.map +1 -0
  99. package/dist/components/organisms/Tables/Table/Table.styles.d.ts +16 -0
  100. package/dist/components/organisms/Tables/Table/Table.styles.d.ts.map +1 -0
  101. package/dist/components/organisms/Tables/Table/Table.styles.js +27 -0
  102. package/dist/components/organisms/Tables/Table/Table.styles.js.map +1 -0
  103. package/dist/components/organisms/{Table → Tables/Table}/components/TableCardList.cjs +2 -2
  104. package/dist/components/organisms/Tables/Table/components/TableCardList.cjs.map +1 -0
  105. package/dist/components/organisms/{Table → Tables/Table}/components/TableCardList.d.ts +1 -1
  106. package/dist/components/organisms/Tables/Table/components/TableCardList.d.ts.map +1 -0
  107. package/dist/components/organisms/{Table → Tables/Table}/components/TableCardList.js +2 -2
  108. package/dist/components/organisms/Tables/Table/components/TableCardList.js.map +1 -0
  109. package/dist/components/organisms/{Table → Tables/Table}/components/TableCardRow.cjs +10 -5
  110. package/dist/components/organisms/Tables/Table/components/TableCardRow.cjs.map +1 -0
  111. package/dist/components/organisms/{Table → Tables/Table}/components/TableCardRow.d.ts +1 -1
  112. package/dist/components/organisms/Tables/Table/components/TableCardRow.d.ts.map +1 -0
  113. package/dist/components/organisms/{Table → Tables/Table}/components/TableCardRow.js +11 -6
  114. package/dist/components/organisms/Tables/Table/components/TableCardRow.js.map +1 -0
  115. package/dist/components/organisms/{Table → Tables/Table}/components/TableCardsSelectAll.cjs +2 -2
  116. package/dist/components/organisms/Tables/Table/components/TableCardsSelectAll.cjs.map +1 -0
  117. package/dist/components/organisms/{Table → Tables/Table}/components/TableCardsSelectAll.d.ts +3 -1
  118. package/dist/components/organisms/Tables/Table/components/TableCardsSelectAll.d.ts.map +1 -0
  119. package/dist/components/organisms/{Table → Tables/Table}/components/TableCardsSelectAll.js +2 -2
  120. package/dist/components/organisms/Tables/Table/components/TableCardsSelectAll.js.map +1 -0
  121. package/dist/components/organisms/Tables/Table/components/TableEmptyState.cjs +17 -0
  122. package/dist/components/organisms/Tables/Table/components/TableEmptyState.cjs.map +1 -0
  123. package/dist/components/organisms/Tables/Table/components/TableEmptyState.d.ts +5 -0
  124. package/dist/components/organisms/Tables/Table/components/TableEmptyState.d.ts.map +1 -0
  125. package/dist/components/organisms/Tables/Table/components/TableEmptyState.js +15 -0
  126. package/dist/components/organisms/Tables/Table/components/TableEmptyState.js.map +1 -0
  127. package/dist/components/organisms/Tables/Table/components/TableFallbackCard.cjs.map +1 -0
  128. package/dist/components/organisms/{Table → Tables/Table}/components/TableFallbackCard.d.ts +1 -1
  129. package/dist/components/organisms/Tables/Table/components/TableFallbackCard.d.ts.map +1 -0
  130. package/dist/components/organisms/Tables/Table/components/TableFallbackCard.js.map +1 -0
  131. package/dist/components/organisms/{Table → Tables/Table}/components/TableRowCard.cjs +6 -5
  132. package/dist/components/organisms/Tables/Table/components/TableRowCard.cjs.map +1 -0
  133. package/dist/components/organisms/{Table → Tables/Table}/components/TableRowCard.d.ts +1 -1
  134. package/dist/components/organisms/Tables/Table/components/TableRowCard.d.ts.map +1 -0
  135. package/dist/components/organisms/{Table → Tables/Table}/components/TableRowCard.js +6 -5
  136. package/dist/components/organisms/Tables/Table/components/TableRowCard.js.map +1 -0
  137. package/dist/components/organisms/Tables/Table/components/TableSortIcon.cjs.map +1 -0
  138. package/dist/components/organisms/Tables/Table/components/TableSortIcon.d.ts.map +1 -0
  139. package/dist/components/organisms/Tables/Table/components/TableSortIcon.js.map +1 -0
  140. package/dist/components/organisms/Tables/Table/hooks/useBusyCount.cjs +22 -0
  141. package/dist/components/organisms/Tables/Table/hooks/useBusyCount.cjs.map +1 -0
  142. package/dist/components/organisms/Tables/Table/hooks/useBusyCount.d.ts +12 -0
  143. package/dist/components/organisms/Tables/Table/hooks/useBusyCount.d.ts.map +1 -0
  144. package/dist/components/organisms/Tables/Table/hooks/useBusyCount.js +20 -0
  145. package/dist/components/organisms/Tables/Table/hooks/useBusyCount.js.map +1 -0
  146. package/dist/components/organisms/{Table → Tables/Table}/hooks/useFirstSortDirection.cjs +1 -1
  147. package/dist/components/organisms/Tables/Table/hooks/useFirstSortDirection.cjs.map +1 -0
  148. package/dist/components/organisms/Tables/Table/hooks/useFirstSortDirection.d.ts.map +1 -0
  149. package/dist/components/organisms/{Table → Tables/Table}/hooks/useFirstSortDirection.js +1 -1
  150. package/dist/components/organisms/Tables/Table/hooks/useFirstSortDirection.js.map +1 -0
  151. package/dist/components/organisms/Tables/Table/hooks/useIsPlaceholderPage.cjs +42 -0
  152. package/dist/components/organisms/Tables/Table/hooks/useIsPlaceholderPage.cjs.map +1 -0
  153. package/dist/components/organisms/Tables/Table/hooks/useIsPlaceholderPage.d.ts +14 -0
  154. package/dist/components/organisms/Tables/Table/hooks/useIsPlaceholderPage.d.ts.map +1 -0
  155. package/dist/components/organisms/Tables/Table/hooks/useIsPlaceholderPage.js +40 -0
  156. package/dist/components/organisms/Tables/Table/hooks/useIsPlaceholderPage.js.map +1 -0
  157. package/dist/components/organisms/{Table → Tables/Table}/hooks/usePlaceholderRows.cjs +8 -11
  158. package/dist/components/organisms/Tables/Table/hooks/usePlaceholderRows.cjs.map +1 -0
  159. package/dist/components/organisms/{Table → Tables/Table}/hooks/usePlaceholderRows.d.ts +10 -3
  160. package/dist/components/organisms/Tables/Table/hooks/usePlaceholderRows.d.ts.map +1 -0
  161. package/dist/components/organisms/{Table → Tables/Table}/hooks/usePlaceholderRows.js +9 -12
  162. package/dist/components/organisms/Tables/Table/hooks/usePlaceholderRows.js.map +1 -0
  163. package/dist/components/organisms/Tables/Table/hooks/useSelectableRowRegistry.cjs.map +1 -0
  164. package/dist/components/organisms/{Table → Tables/Table}/hooks/useSelectableRowRegistry.d.ts +1 -1
  165. package/dist/components/organisms/Tables/Table/hooks/useSelectableRowRegistry.d.ts.map +1 -0
  166. package/dist/components/organisms/Tables/Table/hooks/useSelectableRowRegistry.js.map +1 -0
  167. package/dist/components/organisms/Tables/Table/hooks/useTableFocusHandOff.cjs +83 -0
  168. package/dist/components/organisms/Tables/Table/hooks/useTableFocusHandOff.cjs.map +1 -0
  169. package/dist/components/organisms/Tables/Table/hooks/useTableFocusHandOff.d.ts +23 -0
  170. package/dist/components/organisms/Tables/Table/hooks/useTableFocusHandOff.d.ts.map +1 -0
  171. package/dist/components/organisms/Tables/Table/hooks/useTableFocusHandOff.js +81 -0
  172. package/dist/components/organisms/Tables/Table/hooks/useTableFocusHandOff.js.map +1 -0
  173. package/dist/components/organisms/{Table → Tables/Table}/hooks/useTableSelection.cjs +12 -4
  174. package/dist/components/organisms/Tables/Table/hooks/useTableSelection.cjs.map +1 -0
  175. package/dist/components/organisms/{Table → Tables/Table}/hooks/useTableSelection.d.ts +5 -3
  176. package/dist/components/organisms/Tables/Table/hooks/useTableSelection.d.ts.map +1 -0
  177. package/dist/components/organisms/{Table → Tables/Table}/hooks/useTableSelection.js +12 -4
  178. package/dist/components/organisms/Tables/Table/hooks/useTableSelection.js.map +1 -0
  179. package/dist/components/organisms/Tables/Table/providers/Table.context.cjs.map +1 -0
  180. package/dist/components/organisms/{Table → Tables/Table}/providers/Table.context.d.ts +14 -2
  181. package/dist/components/organisms/Tables/Table/providers/Table.context.d.ts.map +1 -0
  182. package/dist/components/organisms/Tables/Table/providers/Table.context.js.map +1 -0
  183. package/dist/components/organisms/Tables/Table/utilities/tableFocusHandOff.utils.cjs +55 -0
  184. package/dist/components/organisms/Tables/Table/utilities/tableFocusHandOff.utils.cjs.map +1 -0
  185. package/dist/components/organisms/Tables/Table/utilities/tableFocusHandOff.utils.d.ts +25 -0
  186. package/dist/components/organisms/Tables/Table/utilities/tableFocusHandOff.utils.d.ts.map +1 -0
  187. package/dist/components/organisms/Tables/Table/utilities/tableFocusHandOff.utils.js +51 -0
  188. package/dist/components/organisms/Tables/Table/utilities/tableFocusHandOff.utils.js.map +1 -0
  189. package/dist/components/organisms/Tables/Table/utilities/tableLoading.utils.cjs +57 -0
  190. package/dist/components/organisms/Tables/Table/utilities/tableLoading.utils.cjs.map +1 -0
  191. package/dist/components/organisms/Tables/Table/utilities/tableLoading.utils.d.ts +66 -0
  192. package/dist/components/organisms/Tables/Table/utilities/tableLoading.utils.d.ts.map +1 -0
  193. package/dist/components/organisms/Tables/Table/utilities/tableLoading.utils.js +52 -0
  194. package/dist/components/organisms/Tables/Table/utilities/tableLoading.utils.js.map +1 -0
  195. package/dist/components/organisms/{Table → Tables/Table}/utilities/tableSelection.utils.cjs +21 -21
  196. package/dist/components/organisms/Tables/Table/utilities/tableSelection.utils.cjs.map +1 -0
  197. package/dist/components/organisms/{Table → Tables/Table}/utilities/tableSelection.utils.d.ts +29 -19
  198. package/dist/components/organisms/Tables/Table/utilities/tableSelection.utils.d.ts.map +1 -0
  199. package/dist/components/organisms/{Table → Tables/Table}/utilities/tableSelection.utils.js +20 -21
  200. package/dist/components/organisms/Tables/Table/utilities/tableSelection.utils.js.map +1 -0
  201. package/dist/components/organisms/Tables/TableLayoutToggle/TableLayoutToggle.cjs +34 -0
  202. package/dist/components/organisms/Tables/TableLayoutToggle/TableLayoutToggle.cjs.map +1 -0
  203. package/dist/components/organisms/Tables/TableLayoutToggle/TableLayoutToggle.d.ts +37 -0
  204. package/dist/components/organisms/Tables/TableLayoutToggle/TableLayoutToggle.d.ts.map +1 -0
  205. package/dist/components/organisms/Tables/TableLayoutToggle/TableLayoutToggle.js +32 -0
  206. package/dist/components/organisms/Tables/TableLayoutToggle/TableLayoutToggle.js.map +1 -0
  207. package/dist/components/organisms/Tables/TableLayoutToggle/hooks/useTableLayoutToggle.cjs +32 -0
  208. package/dist/components/organisms/Tables/TableLayoutToggle/hooks/useTableLayoutToggle.cjs.map +1 -0
  209. package/dist/components/organisms/Tables/TableLayoutToggle/hooks/useTableLayoutToggle.d.ts +21 -0
  210. package/dist/components/organisms/Tables/TableLayoutToggle/hooks/useTableLayoutToggle.d.ts.map +1 -0
  211. package/dist/components/organisms/Tables/TableLayoutToggle/hooks/useTableLayoutToggle.js +30 -0
  212. package/dist/components/organisms/Tables/TableLayoutToggle/hooks/useTableLayoutToggle.js.map +1 -0
  213. package/dist/components/organisms/{Table/components → Tables/TableSortMenu}/TableSortMenu.cjs +12 -5
  214. package/dist/components/organisms/Tables/TableSortMenu/TableSortMenu.cjs.map +1 -0
  215. package/dist/components/organisms/Tables/TableSortMenu/TableSortMenu.d.ts +47 -0
  216. package/dist/components/organisms/Tables/TableSortMenu/TableSortMenu.d.ts.map +1 -0
  217. package/dist/components/organisms/{Table/components → Tables/TableSortMenu}/TableSortMenu.js +12 -5
  218. package/dist/components/organisms/Tables/TableSortMenu/TableSortMenu.js.map +1 -0
  219. package/dist/components/organisms/Tables/hooks/useIsAtLeastMd.cjs.map +1 -0
  220. package/dist/components/organisms/Tables/hooks/useIsAtLeastMd.d.ts.map +1 -0
  221. package/dist/components/organisms/Tables/hooks/useIsAtLeastMd.js.map +1 -0
  222. package/dist/components/organisms/Tables/hooks/useStoredTableLayout.cjs +84 -0
  223. package/dist/components/organisms/Tables/hooks/useStoredTableLayout.cjs.map +1 -0
  224. package/dist/components/organisms/Tables/hooks/useStoredTableLayout.d.ts +20 -0
  225. package/dist/components/organisms/Tables/hooks/useStoredTableLayout.d.ts.map +1 -0
  226. package/dist/components/organisms/Tables/hooks/useStoredTableLayout.js +81 -0
  227. package/dist/components/organisms/Tables/hooks/useStoredTableLayout.js.map +1 -0
  228. package/dist/components/organisms/Tables/index.cjs +14 -0
  229. package/dist/components/organisms/Tables/index.cjs.map +1 -0
  230. package/dist/components/organisms/Tables/index.d.ts +19 -0
  231. package/dist/components/organisms/Tables/index.d.ts.map +1 -0
  232. package/dist/components/organisms/Tables/index.js +4 -0
  233. package/dist/components/organisms/Tables/index.js.map +1 -0
  234. package/dist/components/organisms/{Table/table.types.d.ts → Tables/tables.types.d.ts} +12 -2
  235. package/dist/components/organisms/Tables/tables.types.d.ts.map +1 -0
  236. package/dist/components/organisms/Tables/utilities/tableCard.utils.cjs.map +1 -0
  237. package/dist/components/organisms/{Table → Tables}/utilities/tableCard.utils.d.ts +2 -2
  238. package/dist/components/organisms/Tables/utilities/tableCard.utils.d.ts.map +1 -0
  239. package/dist/components/organisms/Tables/utilities/tableCard.utils.js.map +1 -0
  240. package/dist/components/organisms/{Table → Tables}/utilities/tableChildren.utils.cjs +7 -4
  241. package/dist/components/organisms/Tables/utilities/tableChildren.utils.cjs.map +1 -0
  242. package/dist/components/organisms/{Table → Tables}/utilities/tableChildren.utils.d.ts +5 -3
  243. package/dist/components/organisms/Tables/utilities/tableChildren.utils.d.ts.map +1 -0
  244. package/dist/components/organisms/{Table → Tables}/utilities/tableChildren.utils.js +7 -4
  245. package/dist/components/organisms/Tables/utilities/tableChildren.utils.js.map +1 -0
  246. package/dist/components/organisms/Tables/utilities/tableIterable.utils.cjs +23 -0
  247. package/dist/components/organisms/Tables/utilities/tableIterable.utils.cjs.map +1 -0
  248. package/dist/components/organisms/Tables/utilities/tableIterable.utils.d.ts +8 -0
  249. package/dist/components/organisms/Tables/utilities/tableIterable.utils.d.ts.map +1 -0
  250. package/dist/components/organisms/Tables/utilities/tableIterable.utils.js +21 -0
  251. package/dist/components/organisms/Tables/utilities/tableIterable.utils.js.map +1 -0
  252. package/dist/components/organisms/{Table → Tables}/utilities/tableSort.utils.cjs +1 -1
  253. package/dist/components/organisms/Tables/utilities/tableSort.utils.cjs.map +1 -0
  254. package/dist/components/organisms/{Table → Tables}/utilities/tableSort.utils.d.ts +1 -1
  255. package/dist/components/organisms/Tables/utilities/tableSort.utils.d.ts.map +1 -0
  256. package/dist/components/organisms/{Table → Tables}/utilities/tableSort.utils.js +1 -1
  257. package/dist/components/organisms/Tables/utilities/tableSort.utils.js.map +1 -0
  258. package/dist/hooks/useFocusAfterRetry/index.cjs +21 -19
  259. package/dist/hooks/useFocusAfterRetry/index.cjs.map +1 -1
  260. package/dist/hooks/useFocusAfterRetry/index.d.ts +15 -5
  261. package/dist/hooks/useFocusAfterRetry/index.d.ts.map +1 -1
  262. package/dist/hooks/useFocusAfterRetry/index.js +21 -19
  263. package/dist/hooks/useFocusAfterRetry/index.js.map +1 -1
  264. package/dist/hooks/useFocusHandOff/index.cjs +67 -0
  265. package/dist/hooks/useFocusHandOff/index.cjs.map +1 -0
  266. package/dist/hooks/useFocusHandOff/index.d.ts +17 -0
  267. package/dist/hooks/useFocusHandOff/index.d.ts.map +1 -0
  268. package/dist/hooks/useFocusHandOff/index.js +65 -0
  269. package/dist/hooks/useFocusHandOff/index.js.map +1 -0
  270. package/dist/hooks/useListQueryParams/index.cjs +238 -0
  271. package/dist/hooks/useListQueryParams/index.cjs.map +1 -0
  272. package/dist/hooks/useListQueryParams/index.d.ts +77 -0
  273. package/dist/hooks/useListQueryParams/index.d.ts.map +1 -0
  274. package/dist/hooks/useListQueryParams/index.js +236 -0
  275. package/dist/hooks/useListQueryParams/index.js.map +1 -0
  276. package/dist/hooks/useLoadState/index.cjs +69 -0
  277. package/dist/hooks/useLoadState/index.cjs.map +1 -0
  278. package/dist/hooks/useLoadState/index.d.ts +44 -0
  279. package/dist/hooks/useLoadState/index.d.ts.map +1 -0
  280. package/dist/hooks/useLoadState/index.js +67 -0
  281. package/dist/hooks/useLoadState/index.js.map +1 -0
  282. package/dist/hooks/usePagedList/index.cjs +61 -0
  283. package/dist/hooks/usePagedList/index.cjs.map +1 -0
  284. package/dist/hooks/usePagedList/index.d.ts +56 -0
  285. package/dist/hooks/usePagedList/index.d.ts.map +1 -0
  286. package/dist/hooks/usePagedList/index.js +59 -0
  287. package/dist/hooks/usePagedList/index.js.map +1 -0
  288. package/dist/native/components/atoms/LiveStatus/index.d.ts +12 -0
  289. package/dist/native/components/organisms/Tables/index.d.ts +12 -0
  290. package/dist/native/hooks/useFocusHandOff/index.d.ts +12 -0
  291. package/dist/native/hooks/useListQueryParams/index.d.ts +12 -0
  292. package/dist/native/hooks/useLoadState/index.d.ts +12 -0
  293. package/dist/native/hooks/usePagedList/index.d.ts +12 -0
  294. package/dist/native/utilities/listQueryUtils/index.d.ts +12 -0
  295. package/dist/styles.css +12 -0
  296. package/dist/{components/forms/Form/utilities → utilities/__internal__/focusUtils}/focusFromCode.utils.cjs +9 -0
  297. package/dist/utilities/__internal__/focusUtils/focusFromCode.utils.cjs.map +1 -0
  298. package/dist/{components/forms/Form/utilities → utilities/__internal__/focusUtils}/focusFromCode.utils.d.ts +8 -0
  299. package/dist/utilities/__internal__/focusUtils/focusFromCode.utils.d.ts.map +1 -0
  300. package/dist/{components/forms/Form/utilities → utilities/__internal__/focusUtils}/focusFromCode.utils.js +9 -1
  301. package/dist/utilities/__internal__/focusUtils/focusFromCode.utils.js.map +1 -0
  302. package/dist/utilities/__internal__/listStateUtils/listState.utils.cjs +47 -0
  303. package/dist/utilities/__internal__/listStateUtils/listState.utils.cjs.map +1 -0
  304. package/dist/utilities/__internal__/listStateUtils/listState.utils.d.ts +51 -0
  305. package/dist/utilities/__internal__/listStateUtils/listState.utils.d.ts.map +1 -0
  306. package/dist/utilities/__internal__/listStateUtils/listState.utils.js +43 -0
  307. package/dist/utilities/__internal__/listStateUtils/listState.utils.js.map +1 -0
  308. package/dist/utilities/__internal__/stableKeyUtils/stableKey.utils.cjs +67 -0
  309. package/dist/utilities/__internal__/stableKeyUtils/stableKey.utils.cjs.map +1 -0
  310. package/dist/utilities/__internal__/stableKeyUtils/stableKey.utils.d.ts +27 -0
  311. package/dist/utilities/__internal__/stableKeyUtils/stableKey.utils.d.ts.map +1 -0
  312. package/dist/utilities/__internal__/stableKeyUtils/stableKey.utils.js +64 -0
  313. package/dist/utilities/__internal__/stableKeyUtils/stableKey.utils.js.map +1 -0
  314. package/dist/utilities/__internal__/webStorageUtils/webStorage.utils.cjs +28 -0
  315. package/dist/utilities/__internal__/webStorageUtils/webStorage.utils.cjs.map +1 -1
  316. package/dist/utilities/__internal__/webStorageUtils/webStorage.utils.d.ts +10 -0
  317. package/dist/utilities/__internal__/webStorageUtils/webStorage.utils.d.ts.map +1 -1
  318. package/dist/utilities/__internal__/webStorageUtils/webStorage.utils.js +28 -1
  319. package/dist/utilities/__internal__/webStorageUtils/webStorage.utils.js.map +1 -1
  320. package/dist/utilities/listQueryUtils/index.cjs +59 -0
  321. package/dist/utilities/listQueryUtils/index.cjs.map +1 -0
  322. package/dist/utilities/listQueryUtils/index.d.ts +46 -0
  323. package/dist/utilities/listQueryUtils/index.d.ts.map +1 -0
  324. package/dist/utilities/listQueryUtils/index.js +55 -0
  325. package/dist/utilities/listQueryUtils/index.js.map +1 -0
  326. package/dist/utilities/localStorageUtils/localStorageUtils.constants.cjs +2 -0
  327. package/dist/utilities/localStorageUtils/localStorageUtils.constants.cjs.map +1 -1
  328. package/dist/utilities/localStorageUtils/localStorageUtils.constants.d.ts +2 -0
  329. package/dist/utilities/localStorageUtils/localStorageUtils.constants.d.ts.map +1 -1
  330. package/dist/utilities/localStorageUtils/localStorageUtils.constants.js +2 -0
  331. package/dist/utilities/localStorageUtils/localStorageUtils.constants.js.map +1 -1
  332. package/package.json +9 -9
  333. package/dist/components/forms/Form/utilities/focusFromCode.utils.cjs.map +0 -1
  334. package/dist/components/forms/Form/utilities/focusFromCode.utils.d.ts.map +0 -1
  335. package/dist/components/forms/Form/utilities/focusFromCode.utils.js.map +0 -1
  336. package/dist/components/organisms/Table/components/TableCardList.cjs.map +0 -1
  337. package/dist/components/organisms/Table/components/TableCardList.d.ts.map +0 -1
  338. package/dist/components/organisms/Table/components/TableCardList.js.map +0 -1
  339. package/dist/components/organisms/Table/components/TableCardRow.cjs.map +0 -1
  340. package/dist/components/organisms/Table/components/TableCardRow.d.ts.map +0 -1
  341. package/dist/components/organisms/Table/components/TableCardRow.js.map +0 -1
  342. package/dist/components/organisms/Table/components/TableCardsSelectAll.cjs.map +0 -1
  343. package/dist/components/organisms/Table/components/TableCardsSelectAll.d.ts.map +0 -1
  344. package/dist/components/organisms/Table/components/TableCardsSelectAll.js.map +0 -1
  345. package/dist/components/organisms/Table/components/TableFallbackCard.cjs.map +0 -1
  346. package/dist/components/organisms/Table/components/TableFallbackCard.d.ts.map +0 -1
  347. package/dist/components/organisms/Table/components/TableFallbackCard.js.map +0 -1
  348. package/dist/components/organisms/Table/components/TableFocusGuard.cjs +0 -23
  349. package/dist/components/organisms/Table/components/TableFocusGuard.cjs.map +0 -1
  350. package/dist/components/organisms/Table/components/TableFocusGuard.d.ts +0 -2
  351. package/dist/components/organisms/Table/components/TableFocusGuard.d.ts.map +0 -1
  352. package/dist/components/organisms/Table/components/TableFocusGuard.js +0 -21
  353. package/dist/components/organisms/Table/components/TableFocusGuard.js.map +0 -1
  354. package/dist/components/organisms/Table/components/TableLayoutToggle.cjs +0 -27
  355. package/dist/components/organisms/Table/components/TableLayoutToggle.cjs.map +0 -1
  356. package/dist/components/organisms/Table/components/TableLayoutToggle.d.ts +0 -17
  357. package/dist/components/organisms/Table/components/TableLayoutToggle.d.ts.map +0 -1
  358. package/dist/components/organisms/Table/components/TableLayoutToggle.js +0 -25
  359. package/dist/components/organisms/Table/components/TableLayoutToggle.js.map +0 -1
  360. package/dist/components/organisms/Table/components/TableRowCard.cjs.map +0 -1
  361. package/dist/components/organisms/Table/components/TableRowCard.d.ts.map +0 -1
  362. package/dist/components/organisms/Table/components/TableRowCard.js.map +0 -1
  363. package/dist/components/organisms/Table/components/TableSortIcon.cjs.map +0 -1
  364. package/dist/components/organisms/Table/components/TableSortIcon.d.ts.map +0 -1
  365. package/dist/components/organisms/Table/components/TableSortIcon.js.map +0 -1
  366. package/dist/components/organisms/Table/components/TableSortMenu.cjs.map +0 -1
  367. package/dist/components/organisms/Table/components/TableSortMenu.d.ts +0 -35
  368. package/dist/components/organisms/Table/components/TableSortMenu.d.ts.map +0 -1
  369. package/dist/components/organisms/Table/components/TableSortMenu.js.map +0 -1
  370. package/dist/components/organisms/Table/hooks/useFirstSortDirection.cjs.map +0 -1
  371. package/dist/components/organisms/Table/hooks/useFirstSortDirection.d.ts.map +0 -1
  372. package/dist/components/organisms/Table/hooks/useFirstSortDirection.js.map +0 -1
  373. package/dist/components/organisms/Table/hooks/useIsAtLeastMd.cjs.map +0 -1
  374. package/dist/components/organisms/Table/hooks/useIsAtLeastMd.d.ts.map +0 -1
  375. package/dist/components/organisms/Table/hooks/useIsAtLeastMd.js.map +0 -1
  376. package/dist/components/organisms/Table/hooks/usePlaceholderRows.cjs.map +0 -1
  377. package/dist/components/organisms/Table/hooks/usePlaceholderRows.d.ts.map +0 -1
  378. package/dist/components/organisms/Table/hooks/usePlaceholderRows.js.map +0 -1
  379. package/dist/components/organisms/Table/hooks/useSelectableRowRegistry.cjs.map +0 -1
  380. package/dist/components/organisms/Table/hooks/useSelectableRowRegistry.d.ts.map +0 -1
  381. package/dist/components/organisms/Table/hooks/useSelectableRowRegistry.js.map +0 -1
  382. package/dist/components/organisms/Table/hooks/useTableSelection.cjs.map +0 -1
  383. package/dist/components/organisms/Table/hooks/useTableSelection.d.ts.map +0 -1
  384. package/dist/components/organisms/Table/hooks/useTableSelection.js.map +0 -1
  385. package/dist/components/organisms/Table/providers/Table.context.cjs.map +0 -1
  386. package/dist/components/organisms/Table/providers/Table.context.d.ts.map +0 -1
  387. package/dist/components/organisms/Table/providers/Table.context.js.map +0 -1
  388. package/dist/components/organisms/Table/table.types.d.ts.map +0 -1
  389. package/dist/components/organisms/Table/utilities/tableCard.utils.cjs.map +0 -1
  390. package/dist/components/organisms/Table/utilities/tableCard.utils.d.ts.map +0 -1
  391. package/dist/components/organisms/Table/utilities/tableCard.utils.js.map +0 -1
  392. package/dist/components/organisms/Table/utilities/tableChildren.utils.cjs.map +0 -1
  393. package/dist/components/organisms/Table/utilities/tableChildren.utils.d.ts.map +0 -1
  394. package/dist/components/organisms/Table/utilities/tableChildren.utils.js.map +0 -1
  395. package/dist/components/organisms/Table/utilities/tableSelection.utils.cjs.map +0 -1
  396. package/dist/components/organisms/Table/utilities/tableSelection.utils.d.ts.map +0 -1
  397. package/dist/components/organisms/Table/utilities/tableSelection.utils.js.map +0 -1
  398. package/dist/components/organisms/Table/utilities/tableSort.utils.cjs.map +0 -1
  399. package/dist/components/organisms/Table/utilities/tableSort.utils.d.ts.map +0 -1
  400. package/dist/components/organisms/Table/utilities/tableSort.utils.js.map +0 -1
  401. /package/dist/components/organisms/{Table → Tables/Table}/components/TableFallbackCard.cjs +0 -0
  402. /package/dist/components/organisms/{Table → Tables/Table}/components/TableFallbackCard.js +0 -0
  403. /package/dist/components/organisms/{Table → Tables/Table}/components/TableSortIcon.cjs +0 -0
  404. /package/dist/components/organisms/{Table → Tables/Table}/components/TableSortIcon.d.ts +0 -0
  405. /package/dist/components/organisms/{Table → Tables/Table}/components/TableSortIcon.js +0 -0
  406. /package/dist/components/organisms/{Table → Tables/Table}/hooks/useFirstSortDirection.d.ts +0 -0
  407. /package/dist/components/organisms/{Table → Tables/Table}/hooks/useSelectableRowRegistry.cjs +0 -0
  408. /package/dist/components/organisms/{Table → Tables/Table}/hooks/useSelectableRowRegistry.js +0 -0
  409. /package/dist/components/organisms/{Table → Tables/Table}/providers/Table.context.cjs +0 -0
  410. /package/dist/components/organisms/{Table → Tables/Table}/providers/Table.context.js +0 -0
  411. /package/dist/components/organisms/{Table → Tables}/hooks/useIsAtLeastMd.cjs +0 -0
  412. /package/dist/components/organisms/{Table → Tables}/hooks/useIsAtLeastMd.d.ts +0 -0
  413. /package/dist/components/organisms/{Table → Tables}/hooks/useIsAtLeastMd.js +0 -0
  414. /package/dist/components/organisms/{Table → Tables}/utilities/tableCard.utils.cjs +0 -0
  415. /package/dist/components/organisms/{Table → Tables}/utilities/tableCard.utils.js +0 -0
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tableCard.utils.cjs","sources":["../../../../../src/components/organisms/Tables/utilities/tableCard.utils.ts"],"sourcesContent":[null],"names":["filterDOMProps","joinTestId","slugifyTestId","isValidElement","findElement"],"mappings":";;;;;;;AAOA;;;;;;;AAOG;AACI,MAAM,aAAa,GAAG,CAAC,WAAoB,EAAE,YAAyB,EAAE,aAA0B,EAAE,aAAa,GAAG,KAAK,KAAiB;AAC/I,IAAA,IAAI,aAAa;AAAE,QAAA,OAAO,OAAO;IACjC,OAAO,WAAW,GAAG,aAAa,GAAG,YAAY;AACnD;AAKA;;;;;AAKG;AACI,MAAM,eAAe,GAAG,CAAmB,KAA2C,KAC3F;AAKF;;;;;AAKG;AACI,MAAM,eAAe,GAAG,CAAmB,KAA+C,KAC/F;AAEF;;;;;AAKG;AACI,MAAM,mBAAmB,GAAG,CAAC,EAClC,MAAM,EAAE,eAAe,EACvB,SAAS,EAAE,kBAAkB,EAC7B,KAAK,EAAE,cAAc,EACrB,GAAG,KAAK,EACe,KAAgC;AAgBzD;;;;;AAKG;AACI,MAAM,cAAc,GAAG,CAAmB,KAA8C,KAC7F;AAKF;;;;;;AAMG;AACI,MAAM,eAAe,GAAG,CAAmB,KAA+C;AAC/F;AACAA,6BAAc,CAAC,KAA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KAAK,KAAK,GAAG,UAAU,CAAC,IAAI,CAAC,EAAE,CAAC;AAE9I;;;;;;;AAOG;AACI,MAAM,iBAAiB,GAAG,CAC/B,OAAmC,EACnC,KAAmB,EACnB,SAA8B,MAAM,CAAC,KACb;IACxB,MAAM,WAAW,GAAG,IAAI,CAAC,GAAG,CAC1B,OAAO,CAAC,SAAS,CAAC,CAAC,MAAM,KAAK,MAAM,CAAC,WAAW,CAAC,EACjD,CAAC,CACF;IACD,MAAM,KAAK,GAAyB,EAAE,QAAQ,EAAE,EAAE,EAAE,KAAK,EAAE,EAAE,EAAE;IAE/D,IAAI,UAAU,GAAG,CAAC;IAClB,KAAK,CAAC,OAAO,CAAC,CAAC,IAAI,EAAE,KAAK,KAAI;QAC5B,MAAM,WAAW,GAAG,UAAU;AAC9B,QAAA,UAAU,IAAI,MAAM,CAAC,IAAI,CAAC;AAC1B,QAAA,IAAI,WAAW,KAAK,WAAW,EAAE;AAC/B,YAAA,KAAK,CAAC,KAAK,GAAG,IAAI;YAClB;QACF;AACA,QAAA,MAAM,MAAM,GAAG,OAAO,CAAC,WAAW,CAAC;AACnC,QAAA,IAAI,MAAM,IAAI,CAAC,MAAM,CAAC,KAAK;AAAE,YAAA,KAAK,CAAC,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC;;YACjD,KAAK,CAAC,KAAK,CAAC,IAAI,CAAC,EAAE,GAAG,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC;AAC1E,IAAA,CAAC,CAAC;AAEF,IAAA,OAAO,KAAK;AACd;;;;;;;;;;;;;;;;;"}
@@ -1,6 +1,6 @@
1
1
  import { type ReactElement, type ReactNode } from 'react';
2
2
  import type { GridListItemProps, GridListLoadMoreItemProps, Key, TableLoadMoreItemProps } from 'react-aria-components';
3
- import type { TableCardColumn, TableCardListProps, TableLayout } from '../table.types';
3
+ import type { TableCardColumn, TableCardListProps, TableLayout } from '../tables.types';
4
4
  /**
5
5
  * Picks the layout a table renders from the viewport, the two layout props, and whether react-aria virtualizes it.
6
6
  * @param isAtLeastMd - Whether the viewport is `md` or wider; `false` where `matchMedia` is missing or never matches.
@@ -36,7 +36,7 @@ export declare const cardBodyPropsOf: <P extends object>(props: P & { [K in Tabl
36
36
  */
37
37
  export declare const cardLoadMorePropsOf: ({ render: _tableRowRender, className: _tableRowClassName, style: _tableRowStyle, ...props }: TableLoadMoreItemProps) => GridListLoadMoreItemProps;
38
38
  /** Props written for the table's row alone, or that its card sets itself, which never reach the card's `GridListItem`. */
39
- export type TableRowOnlyProp = 'className' | 'style' | 'render' | 'children' | 'columns' | 'size' | 'highlightSelectedRow' | 'isHighlighted' | 'textValue' | 'data-testid';
39
+ export type TableRowOnlyProp = 'className' | 'style' | 'render' | 'children' | 'columns' | 'size' | 'highlightSelectedRow' | 'isHighlighted' | 'color' | 'textValue' | 'data-testid';
40
40
  /**
41
41
  * Hands a row's remaining props to its card's `GridListItem` unchanged; react-aria filters them there as it does for the row.
42
42
  * The parameter's type is the guard: props that still carry a row-only prop, such as `style`, fail typecheck.
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tableCard.utils.d.ts","sourceRoot":"","sources":["../../../../../src/components/organisms/Tables/utilities/tableCard.utils.ts"],"names":[],"mappings":"AACA,OAAO,EAAkB,KAAK,YAAY,EAAE,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAE1E,OAAO,KAAK,EAAE,iBAAiB,EAAE,yBAAyB,EAAE,GAAG,EAAE,sBAAsB,EAAE,MAAM,uBAAuB,CAAC;AACvH,OAAO,KAAK,EAAE,eAAe,EAAE,kBAAkB,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAGxF;;;;;;;GAOG;AACH,eAAO,MAAM,aAAa,GAAI,aAAa,OAAO,EAAE,cAAc,WAAW,EAAE,eAAe,WAAW,EAAE,uBAAqB,KAAG,WAGlI,CAAC;AAEF,0EAA0E;AAC1E,MAAM,MAAM,aAAa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AM,WAAW,gBAAgB,CAAC,CAAC;IACjC,oEAAoE;IACpE,GAAG,EAAE,MAAM,CAAC;IACZ,oFAAoF;IACpF,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,KAAK,EAAE,CAAC,CAAC;CACV;AAED,6DAA6D;AAC7D,MAAM,WAAW,iBAAiB,CAAC,CAAC;IAClC,qFAAqF;IACrF,KAAK,CAAC,EAAE,CAAC,CAAC;IACV,6FAA6F;IAC7F,QAAQ,EAAE,CAAC,EAAE,CAAC;IACd,KAAK,EAAE,gBAAgB,CAAC,CAAC,CAAC,EAAE,CAAC;CAC9B;AAED;;;;GAIG;AACH,eAAO,MAAM,UAAU,GAAI,MAAM,SAAS,KAAG,MAG5C,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,oBAAoB,GAAI,OAAO,SAAS,SAAS,EAAE,KAAG,MAA4E,CAAC;AAEhJ;;;;;;;GAOG;AACH,eAAO,MAAM,iBAAiB,GAAI,CAAC,EACjC,SAAS,SAAS,eAAe,EAAE,EACnC,OAAO,SAAS,CAAC,EAAE,EACnB,SAAQ,CAAC,IAAI,EAAE,CAAC,KAAK,MAAgB,KACpC,iBAAiB,CAAC,CAAC,CAqBrB,CAAC"}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tableCard.utils.js","sources":["../../../../../src/components/organisms/Tables/utilities/tableCard.utils.ts"],"sourcesContent":[null],"names":[],"mappings":";;;;;AAOA;;;;;;;AAOG;AACI,MAAM,aAAa,GAAG,CAAC,WAAoB,EAAE,YAAyB,EAAE,aAA0B,EAAE,aAAa,GAAG,KAAK,KAAiB;AAC/I,IAAA,IAAI,aAAa;AAAE,QAAA,OAAO,OAAO;IACjC,OAAO,WAAW,GAAG,aAAa,GAAG,YAAY;AACnD;AAKA;;;;;AAKG;AACI,MAAM,eAAe,GAAG,CAAmB,KAA2C,KAC3F;AAKF;;;;;AAKG;AACI,MAAM,eAAe,GAAG,CAAmB,KAA+C,KAC/F;AAEF;;;;;AAKG;AACI,M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,CAAC;AAEF,IAAA,OAAO,KAAK;AACd;;"}
@@ -2,6 +2,7 @@
2
2
 
3
3
  var React = require('react');
4
4
  var children_utils = require('../../../../utilities/__internal__/childrenUtils/children.utils.cjs');
5
+ var tableIterable_utils = require('./tableIterable.utils.cjs');
5
6
 
6
7
  /**
7
8
  * Finds the first element of a type among children, looking through fragments.
@@ -15,13 +16,14 @@ const findElement = (children, type) => children_utils.flattenChildren(children)
15
16
  * another element stays among the cells, so the row gets the fallback card, and the nested card renders nothing in either
16
17
  * layout (`Table.RowCard` checks where it sits). A row whose cells come from a column function has no card.
17
18
  * @param children - The row's children, as nodes or as a function of each column.
18
- * @param columns - The row's `columns`, which a function of each column is called with.
19
+ * @param columns - The row's `columns`, which a function of each column is called with; a one-shot iterator is read once, for
20
+ * every reader.
19
21
  * @param isCard - Tells a card element apart from a cell.
20
22
  * @returns The card, when the row declares one, and the cells.
21
23
  */
22
24
  const splitRowChildren = (children, columns, isCard) => {
23
25
  if (typeof children === 'function')
24
- return { cardCount: 0, cells: React.Children.toArray(Array.from(columns ?? [], children)) };
26
+ return { cardCount: 0, cells: React.Children.toArray(Array.from(tableIterable_utils.reusableIterableOf(columns) ?? [], children)) };
25
27
  const flat = children_utils.flattenChildren(children);
26
28
  const isCardChild = (child) => React.isValidElement(child) && isCard(child);
27
29
  const cards = flat.filter(isCardChild);
@@ -30,11 +32,12 @@ const splitRowChildren = (children, columns, isCard) => {
30
32
  /**
31
33
  * Reads each column a `Table.Header` declares, for a card, which has no header of its own to read them from.
32
34
  * @param children - The header's children: `Table.Head` elements, conditionals among them, or a function of each column.
33
- * @param columns - The header's `columns`, which a function of each column is called with.
35
+ * @param columns - The header's `columns`, which a function of each column is called with; a one-shot iterator is read once,
36
+ * so react-aria still gets every column.
34
37
  * @returns One entry per rendered column, in order; a string child stands in for a missing `label`.
35
38
  */
36
39
  const columnsOfHeader = (children, columns) => {
37
- const heads = typeof children === 'function' ? Array.from(columns ?? [], children) : children_utils.flattenChildren(children);
40
+ const heads = typeof children === 'function' ? Array.from(tableIterable_utils.reusableIterableOf(columns) ?? [], children) : children_utils.flattenChildren(children);
38
41
  return heads.filter((React.isValidElement)).map(({ props }) => ({
39
42
  label: props.label ?? (typeof props.children === 'string' ? props.children : undefined),
40
43
  isRowHeader: props.isRowHeader === true,
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tableChildren.utils.cjs","sources":["../../../../../src/components/organisms/Tables/utilities/tableChildren.utils.ts"],"sourcesContent":[null],"names":["flattenChildren","isValidElement","Children","reusableIterableOf"],"mappings":";;;;;;AAQA;;;;;AAKG;AACI,MAAM,WAAW,GAAG,CAAI,QAAmB,EAAE,IAAa,KAC/DA,8BAAe,CAAC,QAAQ,CAAC,CAAC,IAAI,CAAC,CAAC,KAAK,KAA+BC,oBAAc,CAAC,KAAK,CAAC,IAAI,KAAK,CAAC,IAAI,KAAK,IAAI;AAYlH;;;;;;;;;AASG;AACI,MAAM,gBAAgB,GAAG,CAC9B,QAA+B,EAC/B,OAAgC,EAChC,MAA0C,KAC3B;IACf,IAAI,OAAO,QAAQ,KAAK,UAAU;QAAE,OAAO,EAAE,SAAS,EAAE,CAAC,EAAE,KAAK,EAAEC,cAAQ,CAAC,OAAO,CAAC,KAAK,CAAC,IAAI,CAACC,sCAAkB,CAAC,OAAO,CAAC,IAAI,EAAE,EAAE,QAAQ,CAAC,CAAC,EAAE;AAC7I,IAAA,MAAM,IAAI,GAAGH,8BAAe,CAAC,QAAQ,CAAC;AACtC,IAAA,MAAM,WAAW,GAAG,CAAC,KAAgB,KAA4BC,oBAAc,CAAC,KAAK,CAAC,IAAI,MAAM,CAAC,KAAK,CAAC;IACvG,MAAM,KAAK,GAAG,IAAI,CAAC,MAAM,CAAC,WAAW,CAAC;AACtC,IAAA,OAAO,EAAE,IAAI,EAAE,KAAK,CAAC,CAAC,CAAC,EAAE,SAAS,EAAE,KAAK,CAAC,MAAM,EAAE,KAAK,EAAE,IAAI,CAAC,MAAM,CAAC,CAAC,KAAK,KAAK,CAAC,WAAW,CAAC,KAAK,CAAC,CAAC,EAAE;AACxG;AAQA;;;;;;AAMG;MACU,eAAe,GAAG,CAAI,QAA+B,EAAE,OAAqB,KAAuB;AAC9G,IAAA,MAAM,KAAK,GAAG,OAAO,QAAQ,KAAK,UAAU,GAAG,KAAK,CAAC,IAAI,CAACE,sCAAkB,CAAC,OAAO,CAAC,IAAI,EAAE,EAAE,QAAQ,CAAC,GAAGH,8BAAe,CAAC,QAAQ,CAAC;AAClI,IAAA,OAAO,KAAK,CAAC,MAAM,EAACC,oBAAyB,EAAC,CAAC,GAAG,CAAC,CAAC,EAAE,KAAK,EAAE,MAAM;QACjE,KAAK,EAAE,KAAK,CAAC,KAAK,KAAK,OAAO,KAAK,CAAC,QAAQ,KAAK,QAAQ,GAAG,KAAK,CAAC,QAAQ,GAAG,SAAS,CAAC;AACvF,QAAA,WAAW,EAAE,KAAK,CAAC,WAAW,KAAK,IAAI;AACxC,KAAA,CAAC,CAAC;AACL;;;;"}
@@ -1,5 +1,5 @@
1
1
  import { type ReactElement, type ReactNode } from 'react';
2
- import type { TableCardColumn } from '../table.types';
2
+ import type { TableCardColumn } from '../tables.types';
3
3
  /** Children as a row or header may take them: nodes, or a function called once per column. */
4
4
  type CollectionChildren<T> = ReactNode | ((column: T) => ReactElement);
5
5
  /**
@@ -23,7 +23,8 @@ export interface RowChildren {
23
23
  * another element stays among the cells, so the row gets the fallback card, and the nested card renders nothing in either
24
24
  * layout (`Table.RowCard` checks where it sits). A row whose cells come from a column function has no card.
25
25
  * @param children - The row's children, as nodes or as a function of each column.
26
- * @param columns - The row's `columns`, which a function of each column is called with.
26
+ * @param columns - The row's `columns`, which a function of each column is called with; a one-shot iterator is read once, for
27
+ * every reader.
27
28
  * @param isCard - Tells a card element apart from a cell.
28
29
  * @returns The card, when the row declares one, and the cells.
29
30
  */
@@ -31,7 +32,8 @@ export declare const splitRowChildren: <T>(children: CollectionChildren<T>, colu
31
32
  /**
32
33
  * Reads each column a `Table.Header` declares, for a card, which has no header of its own to read them from.
33
34
  * @param children - The header's children: `Table.Head` elements, conditionals among them, or a function of each column.
34
- * @param columns - The header's `columns`, which a function of each column is called with.
35
+ * @param columns - The header's `columns`, which a function of each column is called with; a one-shot iterator is read once,
36
+ * so react-aria still gets every column.
35
37
  * @returns One entry per rendered column, in order; a string child stands in for a missing `label`.
36
38
  */
37
39
  export declare const columnsOfHeader: <T>(children: CollectionChildren<T>, columns?: Iterable<T>) => TableCardColumn[];
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tableChildren.utils.d.ts","sourceRoot":"","sources":["../../../../../src/components/organisms/Tables/utilities/tableChildren.utils.ts"],"names":[],"mappings":"AAAA,OAAO,EAA4B,KAAK,YAAY,EAAE,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAEpF,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAGvD,8FAA8F;AAC9F,KAAK,kBAAkB,CAAC,CAAC,IAAI,SAAS,GAAG,CAAC,CAAC,MAAM,EAAE,CAAC,KAAK,YAAY,CAAC,CAAC;AAEvE;;;;;GAKG;AACH,eAAO,MAAM,WAAW,GAAI,CAAC,EAAE,UAAU,SAAS,EAAE,MAAM,OAAO,KAAG,YAAY,CAAC,CAAC,CAAC,GAAG,SAC6B,CAAC;AAEpH,wFAAwF;AACxF,MAAM,WAAW,WAAW;IAC1B,wDAAwD;IACxD,IAAI,CAAC,EAAE,YAAY,CAAC;IACpB,6EAA6E;IAC7E,SAAS,EAAE,MAAM,CAAC;IAClB,uDAAuD;IACvD,KAAK,EAAE,SAAS,EAAE,CAAC;CACpB;AAED;;;;;;;;;GASG;AACH,eAAO,MAAM,gBAAgB,GAAI,CAAC,EAChC,UAAU,kBAAkB,CAAC,CAAC,CAAC,EAC/B,SAAS,QAAQ,CAAC,CAAC,CAAC,GAAG,SAAS,EAChC,QAAQ,CAAC,OAAO,EAAE,YAAY,KAAK,OAAO,KACzC,WAMF,CAAC;AAQF;;;;;;GAMG;AACH,eAAO,MAAM,eAAe,GAAI,CAAC,EAAE,UAAU,kBAAkB,CAAC,CAAC,CAAC,EAAE,UAAU,QAAQ,CAAC,CAAC,CAAC,KAAG,eAAe,EAM1G,CAAC"}
@@ -1,5 +1,6 @@
1
1
  import { Children, isValidElement } from 'react';
2
2
  import { flattenChildren } from '../../../../utilities/__internal__/childrenUtils/children.utils.js';
3
+ import { reusableIterableOf } from './tableIterable.utils.js';
3
4
 
4
5
  /**
5
6
  * Finds the first element of a type among children, looking through fragments.
@@ -13,13 +14,14 @@ const findElement = (children, type) => flattenChildren(children).find((child) =
13
14
  * another element stays among the cells, so the row gets the fallback card, and the nested card renders nothing in either
14
15
  * layout (`Table.RowCard` checks where it sits). A row whose cells come from a column function has no card.
15
16
  * @param children - The row's children, as nodes or as a function of each column.
16
- * @param columns - The row's `columns`, which a function of each column is called with.
17
+ * @param columns - The row's `columns`, which a function of each column is called with; a one-shot iterator is read once, for
18
+ * every reader.
17
19
  * @param isCard - Tells a card element apart from a cell.
18
20
  * @returns The card, when the row declares one, and the cells.
19
21
  */
20
22
  const splitRowChildren = (children, columns, isCard) => {
21
23
  if (typeof children === 'function')
22
- return { cardCount: 0, cells: Children.toArray(Array.from(columns ?? [], children)) };
24
+ return { cardCount: 0, cells: Children.toArray(Array.from(reusableIterableOf(columns) ?? [], children)) };
23
25
  const flat = flattenChildren(children);
24
26
  const isCardChild = (child) => isValidElement(child) && isCard(child);
25
27
  const cards = flat.filter(isCardChild);
@@ -28,11 +30,12 @@ const splitRowChildren = (children, columns, isCard) => {
28
30
  /**
29
31
  * Reads each column a `Table.Header` declares, for a card, which has no header of its own to read them from.
30
32
  * @param children - The header's children: `Table.Head` elements, conditionals among them, or a function of each column.
31
- * @param columns - The header's `columns`, which a function of each column is called with.
33
+ * @param columns - The header's `columns`, which a function of each column is called with; a one-shot iterator is read once,
34
+ * so react-aria still gets every column.
32
35
  * @returns One entry per rendered column, in order; a string child stands in for a missing `label`.
33
36
  */
34
37
  const columnsOfHeader = (children, columns) => {
35
- const heads = typeof children === 'function' ? Array.from(columns ?? [], children) : flattenChildren(children);
38
+ const heads = typeof children === 'function' ? Array.from(reusableIterableOf(columns) ?? [], children) : flattenChildren(children);
36
39
  return heads.filter((isValidElement)).map(({ props }) => ({
37
40
  label: props.label ?? (typeof props.children === 'string' ? props.children : undefined),
38
41
  isRowHeader: props.isRowHeader === true,
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tableChildren.utils.js","sources":["../../../../../src/components/organisms/Tables/utilities/tableChildren.utils.ts"],"sourcesContent":[null],"names":[],"mappings":";;;;AAQA;;;;;AAKG;AACI,MAAM,WAAW,GAAG,CAAI,QAAmB,EAAE,IAAa,KAC/D,eAAe,CAAC,QAAQ,CAAC,CAAC,IAAI,CAAC,CAAC,KAAK,KAA+B,cAAc,CAAC,KAAK,CAAC,IAAI,KAAK,CAAC,IAAI,KAAK,IAAI;AAYlH;;;;;;;;;AASG;AACI,MAAM,gBAAgB,GAAG,CAC9B,QAA+B,EAC/B,OAAgC,EAChC,MAA0C,KAC3B;IACf,IAAI,OAAO,QAAQ,KAAK,UAAU;QAAE,OAAO,EAAE,SAAS,EAAE,CAAC,EAAE,KAAK,EAAE,QAAQ,CAAC,OAAO,CAAC,KAAK,CAAC,IAAI,CAAC,kBAAkB,CAAC,OAAO,CAAC,IAAI,EAAE,EAAE,QAAQ,CAAC,CAAC,EAAE;AAC7I,IAAA,MAAM,IAAI,GAAG,eAAe,CAAC,QAAQ,CAAC;AACtC,IAAA,MAAM,WAAW,GAAG,CAAC,KAAgB,KAA4B,cAAc,CAAC,KAAK,CAAC,IAAI,MAAM,CAAC,KAAK,CAAC;IACvG,MAAM,KAAK,GAAG,IAAI,CAAC,MAAM,CAAC,WAAW,CAAC;AACtC,IAAA,OAAO,EAAE,IAAI,EAAE,KAAK,CAAC,CAAC,CAAC,EAAE,SAAS,EAAE,KAAK,CAAC,MAAM,EAAE,KAAK,EAAE,IAAI,CAAC,MAAM,CAAC,CAAC,KAAK,KAAK,CAAC,WAAW,CAAC,KAAK,CAAC,CAAC,EAAE;AACxG;AAQA;;;;;;AAMG;MACU,eAAe,GAAG,CAAI,QAA+B,EAAE,OAAqB,KAAuB;AAC9G,IAAA,MAAM,KAAK,GAAG,OAAO,QAAQ,KAAK,UAAU,GAAG,KAAK,CAAC,IAAI,CAAC,kBAAkB,CAAC,OAAO,CAAC,IAAI,EAAE,EAAE,QAAQ,CAAC,GAAG,eAAe,CAAC,QAAQ,CAAC;AAClI,IAAA,OAAO,KAAK,CAAC,MAAM,EAAC,cAAyB,EAAC,CAAC,GAAG,CAAC,CAAC,EAAE,KAAK,EAAE,MAAM;QACjE,KAAK,EAAE,KAAK,CAAC,KAAK,KAAK,OAAO,KAAK,CAAC,QAAQ,KAAK,QAAQ,GAAG,KAAK,CAAC,QAAQ,GAAG,SAAS,CAAC;AACvF,QAAA,WAAW,EAAE,KAAK,CAAC,WAAW,KAAK,IAAI;AACxC,KAAA,CAAC,CAAC;AACL;;"}
@@ -0,0 +1,23 @@
1
+ 'use strict';
2
+
3
+ // One array per one-shot iterator, so every read of that iterator, in any render or layout, sees everything it yielded.
4
+ const readOnce = new WeakMap();
5
+ /**
6
+ * Makes an iterable the consumer passed safe to read more than once, as the table and react-aria both read `columns`, `items`
7
+ * and `disabledKeys`. A one-shot iterator, such as `array.values()`, yields its items to the first read alone.
8
+ * @param items - What the consumer passed; an array, a `Set` or any iterable that starts afresh on each read is left as it is.
9
+ * @returns The same iterable, or for a one-shot iterator the array of everything it yielded, the same array on every call.
10
+ */
11
+ const reusableIterableOf = (items) => {
12
+ if (items === undefined || items === null || typeof items !== 'object')
13
+ return items;
14
+ // An iterator is its own iterator, and reading it empties it; an array or a `Set` hands out a new one each time.
15
+ if (!Object.is(items[Symbol.iterator](), items))
16
+ return items;
17
+ const read = readOnce.get(items) ?? Array.from(items);
18
+ readOnce.set(items, read);
19
+ return read;
20
+ };
21
+
22
+ exports.reusableIterableOf = reusableIterableOf;
23
+ //# sourceMappingURL=tableIterable.utils.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tableIterable.utils.cjs","sources":["../../../../../src/components/organisms/Tables/utilities/tableIterable.utils.ts"],"sourcesContent":[null],"names":[],"mappings":";;AAAA;AACA,MAAM,QAAQ,GAAG,IAAI,OAAO,EAAqB;AAEjD;;;;;AAKG;AACI,MAAM,kBAAkB,GAAG,CAAI,KAA8B,KAA6B;IAC/F,IAAI,KAAK,KAAK,SAAS,IAAI,KAAK,KAAK,IAAI,IAAI,OAAO,KAAK,KAAK,QAAQ;AAAE,QAAA,OAAO,KAAK;;AAEpF,IAAA,IAAI,CAAC,MAAM,CAAC,EAAE,CAAC,KAAK,CAAC,MAAM,CAAC,QAAQ,CAAC,EAAE,EAAE,KAAK,CAAC;AAAE,QAAA,OAAO,KAAK;AAC7D,IAAA,MAAM,IAAI,GAAG,QAAQ,CAAC,GAAG,CAAC,KAAK,CAAC,IAAI,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC;AACrD,IAAA,QAAQ,CAAC,GAAG,CAAC,KAAK,EAAE,IAAI,CAAC;AACzB,IAAA,OAAO,IAAW;AACpB;;"}
@@ -0,0 +1,8 @@
1
+ /**
2
+ * Makes an iterable the consumer passed safe to read more than once, as the table and react-aria both read `columns`, `items`
3
+ * and `disabledKeys`. A one-shot iterator, such as `array.values()`, yields its items to the first read alone.
4
+ * @param items - What the consumer passed; an array, a `Set` or any iterable that starts afresh on each read is left as it is.
5
+ * @returns The same iterable, or for a one-shot iterator the array of everything it yielded, the same array on every call.
6
+ */
7
+ export declare const reusableIterableOf: <T>(items: Iterable<T> | undefined) => Iterable<T> | undefined;
8
+ //# sourceMappingURL=tableIterable.utils.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tableIterable.utils.d.ts","sourceRoot":"","sources":["../../../../../src/components/organisms/Tables/utilities/tableIterable.utils.ts"],"names":[],"mappings":"AAGA;;;;;GAKG;AACH,eAAO,MAAM,kBAAkB,GAAI,CAAC,EAAE,OAAO,QAAQ,CAAC,CAAC,CAAC,GAAG,SAAS,KAAG,QAAQ,CAAC,CAAC,CAAC,GAAG,SAOpF,CAAC"}
@@ -0,0 +1,21 @@
1
+ // One array per one-shot iterator, so every read of that iterator, in any render or layout, sees everything it yielded.
2
+ const readOnce = new WeakMap();
3
+ /**
4
+ * Makes an iterable the consumer passed safe to read more than once, as the table and react-aria both read `columns`, `items`
5
+ * and `disabledKeys`. A one-shot iterator, such as `array.values()`, yields its items to the first read alone.
6
+ * @param items - What the consumer passed; an array, a `Set` or any iterable that starts afresh on each read is left as it is.
7
+ * @returns The same iterable, or for a one-shot iterator the array of everything it yielded, the same array on every call.
8
+ */
9
+ const reusableIterableOf = (items) => {
10
+ if (items === undefined || items === null || typeof items !== 'object')
11
+ return items;
12
+ // An iterator is its own iterator, and reading it empties it; an array or a `Set` hands out a new one each time.
13
+ if (!Object.is(items[Symbol.iterator](), items))
14
+ return items;
15
+ const read = readOnce.get(items) ?? Array.from(items);
16
+ readOnce.set(items, read);
17
+ return read;
18
+ };
19
+
20
+ export { reusableIterableOf };
21
+ //# sourceMappingURL=tableIterable.utils.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tableIterable.utils.js","sources":["../../../../../src/components/organisms/Tables/utilities/tableIterable.utils.ts"],"sourcesContent":[null],"names":[],"mappings":"AAAA;AACA,MAAM,QAAQ,GAAG,IAAI,OAAO,EAAqB;AAEjD;;;;;AAKG;AACI,MAAM,kBAAkB,GAAG,CAAI,KAA8B,KAA6B;IAC/F,IAAI,KAAK,KAAK,SAAS,IAAI,KAAK,KAAK,IAAI,IAAI,OAAO,KAAK,KAAK,QAAQ;AAAE,QAAA,OAAO,KAAK;;AAEpF,IAAA,IAAI,CAAC,MAAM,CAAC,EAAE,CAAC,KAAK,CAAC,MAAM,CAAC,QAAQ,CAAC,EAAE,EAAE,KAAK,CAAC;AAAE,QAAA,OAAO,KAAK;AAC7D,IAAA,MAAM,IAAI,GAAG,QAAQ,CAAC,GAAG,CAAC,KAAK,CAAC,IAAI,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC;AACrD,IAAA,QAAQ,CAAC,GAAG,CAAC,KAAK,EAAE,IAAI,CAAC;AACzB,IAAA,OAAO,IAAW;AACpB;;"}
@@ -63,7 +63,7 @@ const sortOfColumnChoice = (current, column) => ({
63
63
  */
64
64
  const sortOfDirectionChoice = (current, direction) => current && { column: current.column, direction };
65
65
  /**
66
- * Keys a column's item in the sort menu, apart from the direction and "Clear sort" items and from every other column's.
66
+ * Keys a column's item in the sort menu, apart from the direction and "Reset sort" items and from every other column's.
67
67
  * @param id - The column's id, as its `Table.Head` has it.
68
68
  * @returns `col-<id>` for a string id and `colnum-<id>` for a number, so `'1'` and `1` stay apart; the item's test id
69
69
  * derives from it too.
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tableSort.utils.cjs","sources":["../../../../../src/components/organisms/Tables/utilities/tableSort.utils.ts"],"sourcesContent":[null],"names":[],"mappings":";;AAEA;;;;;AAKG;AACI,MAAM,UAAU,GAAG,CAAC,OAAmC,EAAE,KAAiC,KAC/F,OAAO,EAAE,MAAM,KAAK,KAAK,EAAE,MAAM,IAAI,OAAO,EAAE,SAAS,KAAK,KAAK,EAAE;AAUrE;;;;;;;;AAQG;AACI,MAAM,WAAW,GAAG,CACzB,QAA+B,EAC/B,cAA0C,EAC1C,OAAwB,KACC;AACzB,IAAA,IAAI,CAAC,cAAc;AAAE,QAAA,OAAO,SAAS;IACrC,MAAM,YAAY,GAAG,QAAQ,EAAE,MAAM,KAAK,cAAc,CAAC,MAAM;IAC/D,IAAI,YAAY,IAAI,CAAC,UAAU,CAAC,cAAc,EAAE,OAAO,CAAC;AAAE,QAAA,OAAO,QAAQ;;IAEzE,IAAI,YAAY,IAAI,QAAQ,EAAE,SAAS,KAAK,cAAc,CAAC,SAAS;AAAE,QAAA,OAAO,QAAQ;AACrF,IAAA,OAAO,EAAE,MAAM,EAAE,cAAc,CAAC,MAAM,EAAE,SAAS,EAAE,cAAc,CAAC,SAAS,EAAE;AAC/E;AAEA;;;;;;;;;AASG;AACI,MAAM,UAAU,GAAG,CAAC,OAAmC,EAAE,IAAoB,EAAE,cAA8B,KAAwB;IAC1I,IAAI,CAAC,OAAO,IAAI,OAAO,CAAC,MAAM,KAAK,IAAI,CAAC,MAAM;AAAE,QAAA,OAAO,QAAQ;;AAE/D,IAAA,IAAI,IAAI,CAAC,SAAS,KAAK,OAAO,CAAC,SAAS;AAAE,QAAA,OAAO,QAAQ;AACzD,IAAA,OAAO,OAAO,CAAC,SAAS,MAAM,cAAc,IAAI,OAAO,CAAC,SAAS,CAAC,GAAG,QAAQ,GAAG,OAAO;AACzF;AAEA;;;;;AAKG;AACI,MAAM,kBAAkB,GAAG,CAAC,OAAmC,EAAE,MAAW,MAAsB;IACvG,MAAM;AACN,IAAA,SAAS,EAAE,OAAO,EAAE,SAAS,IAAI,WAAW;AAC7C,CAAA;AAED;;;;;AAKG;MACU,qBAAqB,GAAG,CAAC,OAAmC,EAAE,SAAwB,KACjG,OAAO,IAAI,EAAE,MAAM,EAAE,OAAO,CAAC,MAAM,EAAE,SAAS;AAEhD;;;;;AAKG;AACI,MAAM,mBAAmB,GAAG,CAAC,EAAO,MAAc,OAAO,EAAE,KAAK,QAAQ,GAAG,CAAA,OAAA,EAAU,EAAE,CAAA,CAAE,GAAG,CAAA,IAAA,EAAO,EAAE,CAAA,CAAE;AAE9G;;;;;AAKG;AACI,MAAM,mBAAmB,GAAG,CAAwB,OAAqB,EAAE,GAAoB,KACpG,GAAG,KAAK,SAAS,GAAG,SAAS,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC,MAAM,KAAK,mBAAmB,CAAC,MAAM,CAAC,EAAE,CAAC,KAAK,GAAG;;;;;;;;"}
@@ -49,7 +49,7 @@ export declare const sortOfColumnChoice: (current: SortDescriptor | undefined, c
49
49
  */
50
50
  export declare const sortOfDirectionChoice: (current: SortDescriptor | undefined, direction: SortDirection) => SortDescriptor | undefined;
51
51
  /**
52
- * Keys a column's item in the sort menu, apart from the direction and "Clear sort" items and from every other column's.
52
+ * Keys a column's item in the sort menu, apart from the direction and "Reset sort" items and from every other column's.
53
53
  * @param id - The column's id, as its `Table.Head` has it.
54
54
  * @returns `col-<id>` for a string id and `colnum-<id>` for a number, so `'1'` and `1` stay apart; the item's test id
55
55
  * derives from it too.
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tableSort.utils.d.ts","sourceRoot":"","sources":["../../../../../src/components/organisms/Tables/utilities/tableSort.utils.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,GAAG,EAAE,cAAc,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AAEhF;;;;;GAKG;AACH,eAAO,MAAM,UAAU,GAAI,SAAS,cAAc,GAAG,SAAS,EAAE,OAAO,cAAc,GAAG,SAAS,KAAG,OACtB,CAAC;AAE/E,gGAAgG;AAChG,MAAM,WAAW,SAAS;IACxB,8BAA8B;IAC9B,MAAM,EAAE,GAAG,CAAC;IACZ,0GAA0G;IAC1G,SAAS,EAAE,aAAa,CAAC;CAC1B;AAED;;;;;;;;GAQG;AACH,eAAO,MAAM,WAAW,GACtB,UAAU,SAAS,GAAG,SAAS,EAC/B,gBAAgB,cAAc,GAAG,SAAS,EAC1C,UAAU,cAAc,KACvB,SAAS,GAAG,SAOd,CAAC;AAEF;;;;;;;;;GASG;AACH,eAAO,MAAM,UAAU,GAAI,SAAS,cAAc,GAAG,SAAS,EAAE,MAAM,cAAc,EAAE,iBAAiB,aAAa,KAAG,QAAQ,GAAG,OAKjI,CAAC;AAEF;;;;;GAKG;AACH,eAAO,MAAM,kBAAkB,GAAI,SAAS,cAAc,GAAG,SAAS,EAAE,QAAQ,GAAG,KAAG,cAGpF,CAAC;AAEH;;;;;GAKG;AACH,eAAO,MAAM,qBAAqB,GAAI,SAAS,cAAc,GAAG,SAAS,EAAE,WAAW,aAAa,KAAG,cAAc,GAAG,SACrE,CAAC;AAEnD;;;;;GAKG;AACH,eAAO,MAAM,mBAAmB,GAAI,IAAI,GAAG,KAAG,MAAiE,CAAC;AAEhH;;;;;GAKG;AACH,eAAO,MAAM,mBAAmB,GAAI,CAAC,SAAS;IAAE,EAAE,EAAE,GAAG,CAAA;CAAE,EAAE,SAAS,SAAS,CAAC,EAAE,EAAE,KAAK,GAAG,GAAG,SAAS,KAAG,CAAC,GAAG,SACX,CAAC"}
@@ -61,7 +61,7 @@ const sortOfColumnChoice = (current, column) => ({
61
61
  */
62
62
  const sortOfDirectionChoice = (current, direction) => current && { column: current.column, direction };
63
63
  /**
64
- * Keys a column's item in the sort menu, apart from the direction and "Clear sort" items and from every other column's.
64
+ * Keys a column's item in the sort menu, apart from the direction and "Reset sort" items and from every other column's.
65
65
  * @param id - The column's id, as its `Table.Head` has it.
66
66
  * @returns `col-<id>` for a string id and `colnum-<id>` for a number, so `'1'` and `1` stay apart; the item's test id
67
67
  * derives from it too.
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tableSort.utils.js","sources":["../../../../../src/components/organisms/Tables/utilities/tableSort.utils.ts"],"sourcesContent":[null],"names":[],"mappings":"AAEA;;;;;AAKG;AACI,MAAM,UAAU,GAAG,CAAC,OAAmC,EAAE,KAAiC,KAC/F,OAAO,EAAE,MAAM,KAAK,KAAK,EAAE,MAAM,IAAI,OAAO,EAAE,SAAS,KAAK,KAAK,EAAE;AAUrE;;;;;;;;AAQG;AACI,MAAM,WAAW,GAAG,CACzB,QAA+B,EAC/B,cAA0C,EAC1C,OAAwB,KACC;AACzB,IAAA,IAAI,CAAC,cAAc;AAAE,QAAA,OAAO,SAAS;IACrC,MAAM,YAAY,GAAG,QAAQ,EAAE,MAAM,KAAK,cAAc,CAAC,MAAM;IAC/D,IAAI,YAAY,IAAI,CAAC,UAAU,CAAC,cAAc,EAAE,OAAO,CAAC;AAAE,QAAA,OAAO,QAAQ;;IAEzE,IAAI,YAAY,IAAI,QAAQ,EAAE,SAAS,KAAK,cAAc,CAAC,SAAS;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+ var useFocusHandOff = require('@flipdish/ui-library/hooks/useFocusHandOff');
4
4
 
5
- // The ring shows for keyboard focus only, as on every other focus target in the library.
5
+ // The ring `contentProps` spreads, for the callers still on it.
6
6
  const FOCUS_TARGET_CLASSES = 'outline-focus-ring focus-visible:outline-2 focus-visible:outline-offset-2';
7
7
  /**
8
8
  * Keeps keyboard focus in place across a retry. A "Try again" button unmounts once the data arrives, and focus would
9
9
  * otherwise fall back to the top of the page; use it wherever a load error is replaced by the content it failed to load.
10
+ * It is `useFocusHandOff` for one action; for several controls that hand focus on, use that hook.
10
11
  *
11
12
  * @param retry Starts the failed request again.
12
- * @returns `retryLoad` for the retry button, and for the element that replaces the error either `contentProps` to spread
13
- * onto it (the ref, `tabIndex={-1}` and a focus ring) or `contentRef` alone when it already takes focus from code, as `Form` does.
14
- * That element takes focus when it mounts after a retry, unless the user has moved focus elsewhere.
13
+ * @returns `retryLoad` for the retry button, and `contentRef` for the element that replaces the error. That element takes
14
+ * focus when it mounts after a retry, unless the user has moved focus elsewhere; one that cannot take focus is made
15
+ * focusable from code only, so a click inside it does not give it focus, with the library's keyboard focus ring. `contentRef`
16
+ * is the same function on every render, so only a target that mounts after `retryLoad` is called spends the retry.
17
+ * `contentProps` is deprecated.
15
18
  */
16
19
  const useFocusAfterRetry = (retry) => {
17
- const hasRetried = React.useRef(false);
18
- const retryLoad = () => {
19
- hasRetried.current = true;
20
- retry();
20
+ const { handOff, targetRef } = useFocusHandOff.useFocusHandOff();
21
+ const retryLoad = handOff(retry);
22
+ return {
23
+ retryLoad,
24
+ contentRef: targetRef,
25
+ /**
26
+ * The ref, `tabIndex={-1}` and the focus ring as props to spread.
27
+ *
28
+ * @deprecated Pass `contentRef` as the target's `ref` instead: the hook makes the target focusable from code only and the
29
+ * library draws the ring, so the target keeps its own `className` without merging. The standing `tabIndex={-1}` spread
30
+ * here, unlike `contentRef`, also hands the target the focus of a click on anything inside it that cannot hold focus.
31
+ */
32
+ contentProps: { ref: targetRef, tabIndex: -1, className: FOCUS_TARGET_CLASSES },
21
33
  };
22
- const contentRef = (content) => {
23
- if (!content || !hasRetried.current)
24
- return;
25
- hasRetried.current = false;
26
- // Focus sits on `<body>` only when the button it was on is gone; anywhere else, the user chose it.
27
- if (content.ownerDocument.activeElement === content.ownerDocument.body)
28
- content.focus();
29
- };
30
- const contentProps = { ref: contentRef, tabIndex: -1, className: FOCUS_TARGET_CLASSES };
31
- return { retryLoad, contentRef, contentProps };
32
34
  };
33
35
 
34
36
  exports.useFocusAfterRetry = useFocusAfterRetry;
@@ -1 +1 @@
1
- {"version":3,"file":"index.cjs","sources":["../../../src/hooks/useFocusAfterRetry/index.ts"],"sourcesContent":[null],"names":["useRef"],"mappings":";;;;AAIA;AACA,MAAM,oBAAoB,GAAG,2EAA2E;AAExG;;;;;;;;AAQG;AACI,MAAM,kBAAkB,GAAG,CAAC,KAAoB,KAAI;AACzD,IAAA,MAAM,UAAU,GAAGA,YAAM,CAAC,KAAK,CAAC;IAEhC,MAAM,SAAS,GAAG,MAAK;AACrB,QAAA,UAAU,CAAC,OAAO,GAAG,IAAI;AACzB,QAAA,KAAK,EAAE;AACT,IAAA,CAAC;AAED,IAAA,MAAM,UAAU,GAAG,CAAC,OAA2B,KAAI;AACjD,QAAA,IAAI,CAAC,OAAO,IAAI,CAAC,UAAU,CAAC,OAAO;YAAE;AACrC,QAAA,UAAU,CAAC,OAAO,GAAG,KAAK;;QAE1B,IAAI,OAAO,CAAC,aAAa,CAAC,aAAa,KAAK,OAAO,CAAC,aAAa,CAAC,IAAI;YAAE,OAAO,CAAC,KAAK,EAAE;AACzF,IAAA,CAAC;AAED,IAAA,MAAM,YAAY,GAAG,EAAE,GAAG,EAAE,UAAU,EAAE,QAAQ,EAAE,EAAE,EAAE,SAAS,EAAE,oBAAoB,EAAW;AAEhG,IAAA,OAAO,EAAE,SAAS,EAAE,UAAU,EAAE,YAAY,EAAE;AAChD;;"}
1
+ {"version":3,"file":"index.cjs","sources":["../../../src/hooks/useFocusAfterRetry/index.ts"],"sourcesContent":[null],"names":["useFocusHandOff"],"mappings":";;;;AAIA;AACA,MAAM,oBAAoB,GAAG,2EAA2E;AAExG;;;;;;;;;;;AAWG;AACI,MAAM,kBAAkB,GAAG,CAAC,KAAoB,KAAI;IACzD,MAAM,EAAE,OAAO,EAAE,SAAS,EAAE,GAAGA,+BAAe,EAAE;AAEhD,IAAA,MAAM,SAAS,GAAe,OAAO,CAAC,KAAK,CAAC;IAE5C,OAAO;QACL,SAAS;AACT,QAAA,UAAU,EAAE,SAAS;AACrB;;;;;;AAMG;AACH,QAAA,YAAY,EAAE,EAAE,GAAG,EAAE,SAAS,EAAE,QAAQ,EAAE,EAAE,EAAE,SAAS,EAAE,oBAAoB,EAAW;KACzF;AACH;;"}
@@ -1,17 +1,27 @@
1
1
  /**
2
2
  * Keeps keyboard focus in place across a retry. A "Try again" button unmounts once the data arrives, and focus would
3
3
  * otherwise fall back to the top of the page; use it wherever a load error is replaced by the content it failed to load.
4
+ * It is `useFocusHandOff` for one action; for several controls that hand focus on, use that hook.
4
5
  *
5
6
  * @param retry Starts the failed request again.
6
- * @returns `retryLoad` for the retry button, and for the element that replaces the error either `contentProps` to spread
7
- * onto it (the ref, `tabIndex={-1}` and a focus ring) or `contentRef` alone when it already takes focus from code, as `Form` does.
8
- * That element takes focus when it mounts after a retry, unless the user has moved focus elsewhere.
7
+ * @returns `retryLoad` for the retry button, and `contentRef` for the element that replaces the error. That element takes
8
+ * focus when it mounts after a retry, unless the user has moved focus elsewhere; one that cannot take focus is made
9
+ * focusable from code only, so a click inside it does not give it focus, with the library's keyboard focus ring. `contentRef`
10
+ * is the same function on every render, so only a target that mounts after `retryLoad` is called spends the retry.
11
+ * `contentProps` is deprecated.
9
12
  */
10
13
  export declare const useFocusAfterRetry: (retry: () => unknown) => {
11
14
  retryLoad: () => void;
12
- contentRef: (content: HTMLElement | null) => void;
15
+ contentRef: (target: HTMLElement | null) => void;
16
+ /**
17
+ * The ref, `tabIndex={-1}` and the focus ring as props to spread.
18
+ *
19
+ * @deprecated Pass `contentRef` as the target's `ref` instead: the hook makes the target focusable from code only and the
20
+ * library draws the ring, so the target keeps its own `className` without merging. The standing `tabIndex={-1}` spread
21
+ * here, unlike `contentRef`, also hands the target the focus of a click on anything inside it that cannot hold focus.
22
+ */
13
23
  contentProps: {
14
- readonly ref: (content: HTMLElement | null) => void;
24
+ readonly ref: (target: HTMLElement | null) => void;
15
25
  readonly tabIndex: -1;
16
26
  readonly className: "outline-focus-ring focus-visible:outline-2 focus-visible:outline-offset-2";
17
27
  };
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/hooks/useFocusAfterRetry/index.ts"],"names":[],"mappings":"AAOA;;;;;;;;GAQG;AACH,eAAO,MAAM,kBAAkB,GAAI,OAAO,MAAM,OAAO;;0BAQxB,WAAW,GAAG,IAAI;;gCAAlB,WAAW,GAAG,IAAI;;;;CAUhD,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/hooks/useFocusAfterRetry/index.ts"],"names":[],"mappings":"AAOA;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,kBAAkB,GAAI,OAAO,MAAM,OAAO;qBAG9B,IAAI;;IAKzB;;;;;;OAMG;;;;;;CAGN,CAAC"}
@@ -1,32 +1,34 @@
1
- import { useRef } from 'react';
1
+ import { useFocusHandOff } from '@flipdish/ui-library/hooks/useFocusHandOff';
2
2
 
3
- // The ring shows for keyboard focus only, as on every other focus target in the library.
3
+ // The ring `contentProps` spreads, for the callers still on it.
4
4
  const FOCUS_TARGET_CLASSES = 'outline-focus-ring focus-visible:outline-2 focus-visible:outline-offset-2';
5
5
  /**
6
6
  * Keeps keyboard focus in place across a retry. A "Try again" button unmounts once the data arrives, and focus would
7
7
  * otherwise fall back to the top of the page; use it wherever a load error is replaced by the content it failed to load.
8
+ * It is `useFocusHandOff` for one action; for several controls that hand focus on, use that hook.
8
9
  *
9
10
  * @param retry Starts the failed request again.
10
- * @returns `retryLoad` for the retry button, and for the element that replaces the error either `contentProps` to spread
11
- * onto it (the ref, `tabIndex={-1}` and a focus ring) or `contentRef` alone when it already takes focus from code, as `Form` does.
12
- * That element takes focus when it mounts after a retry, unless the user has moved focus elsewhere.
11
+ * @returns `retryLoad` for the retry button, and `contentRef` for the element that replaces the error. That element takes
12
+ * focus when it mounts after a retry, unless the user has moved focus elsewhere; one that cannot take focus is made
13
+ * focusable from code only, so a click inside it does not give it focus, with the library's keyboard focus ring. `contentRef`
14
+ * is the same function on every render, so only a target that mounts after `retryLoad` is called spends the retry.
15
+ * `contentProps` is deprecated.
13
16
  */
14
17
  const useFocusAfterRetry = (retry) => {
15
- const hasRetried = useRef(false);
16
- const retryLoad = () => {
17
- hasRetried.current = true;
18
- retry();
18
+ const { handOff, targetRef } = useFocusHandOff();
19
+ const retryLoad = handOff(retry);
20
+ return {
21
+ retryLoad,
22
+ contentRef: targetRef,
23
+ /**
24
+ * The ref, `tabIndex={-1}` and the focus ring as props to spread.
25
+ *
26
+ * @deprecated Pass `contentRef` as the target's `ref` instead: the hook makes the target focusable from code only and the
27
+ * library draws the ring, so the target keeps its own `className` without merging. The standing `tabIndex={-1}` spread
28
+ * here, unlike `contentRef`, also hands the target the focus of a click on anything inside it that cannot hold focus.
29
+ */
30
+ contentProps: { ref: targetRef, tabIndex: -1, className: FOCUS_TARGET_CLASSES },
19
31
  };
20
- const contentRef = (content) => {
21
- if (!content || !hasRetried.current)
22
- return;
23
- hasRetried.current = false;
24
- // Focus sits on `<body>` only when the button it was on is gone; anywhere else, the user chose it.
25
- if (content.ownerDocument.activeElement === content.ownerDocument.body)
26
- content.focus();
27
- };
28
- const contentProps = { ref: contentRef, tabIndex: -1, className: FOCUS_TARGET_CLASSES };
29
- return { retryLoad, contentRef, contentProps };
30
32
  };
31
33
 
32
34
  export { useFocusAfterRetry };
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":["../../../src/hooks/useFocusAfterRetry/index.ts"],"sourcesContent":[null],"names":[],"mappings":";;AAIA;AACA,MAAM,oBAAoB,GAAG,2EAA2E;AAExG;;;;;;;;AAQG;AACI,MAAM,kBAAkB,GAAG,CAAC,KAAoB,KAAI;AACzD,IAAA,MAAM,UAAU,GAAG,MAAM,CAAC,KAAK,CAAC;IAEhC,MAAM,SAAS,GAAG,MAAK;AACrB,QAAA,UAAU,CAAC,OAAO,GAAG,IAAI;AACzB,QAAA,KAAK,EAAE;AACT,IAAA,CAAC;AAED,IAAA,MAAM,UAAU,GAAG,CAAC,OAA2B,KAAI;AACjD,QAAA,IAAI,CAAC,OAAO,IAAI,CAAC,UAAU,CAAC,OAAO;YAAE;AACrC,QAAA,UAAU,CAAC,OAAO,GAAG,KAAK;;QAE1B,IAAI,OAAO,CAAC,aAAa,CAAC,aAAa,KAAK,OAAO,CAAC,aAAa,CAAC,IAAI;YAAE,OAAO,CAAC,KAAK,EAAE;AACzF,IAAA,CAAC;AAED,IAAA,MAAM,YAAY,GAAG,EAAE,GAAG,EAAE,UAAU,EAAE,QAAQ,EAAE,EAAE,EAAE,SAAS,EAAE,oBAAoB,EAAW;AAEhG,IAAA,OAAO,EAAE,SAAS,EAAE,UAAU,EAAE,YAAY,EAAE;AAChD;;"}
1
+ {"version":3,"file":"index.js","sources":["../../../src/hooks/useFocusAfterRetry/index.ts"],"sourcesContent":[null],"names":[],"mappings":";;AAIA;AACA,MAAM,oBAAoB,GAAG,2EAA2E;AAExG;;;;;;;;;;;AAWG;AACI,MAAM,kBAAkB,GAAG,CAAC,KAAoB,KAAI;IACzD,MAAM,EAAE,OAAO,EAAE,SAAS,EAAE,GAAG,eAAe,EAAE;AAEhD,IAAA,MAAM,SAAS,GAAe,OAAO,CAAC,KAAK,CAAC;IAE5C,OAAO;QACL,SAAS;AACT,QAAA,UAAU,EAAE,SAAS;AACrB;;;;;;AAMG;AACH,QAAA,YAAY,EAAE,EAAE,GAAG,EAAE,SAAS,EAAE,QAAQ,EAAE,EAAE,EAAE,SAAS,EAAE,oBAAoB,EAAW;KACzF;AACH;;"}
@@ -0,0 +1,67 @@
1
+ 'use strict';
2
+
3
+ var React = require('react');
4
+ var focusFromCode_utils = require('../../utilities/__internal__/focusUtils/focusFromCode.utils.cjs');
5
+
6
+ // What `styles.css` draws the keyboard-only focus ring from; also spelled there.
7
+ const FOCUS_TARGET_ATTRIBUTE = 'data-focus-hand-off-target';
8
+ // An editing host takes focus, and a place in the Tab order, with no `tabindex`, yet its `tabIndex` reads -1. The attribute
9
+ // is read because jsdom has no `isContentEditable`; `false` and any other value leave the element as it is.
10
+ const EDITING_HOST_STATES = new Set(['', 'true', 'plaintext-only']);
11
+ const isEditingHost = (element) => {
12
+ const state = element.getAttribute('contenteditable');
13
+ return state !== null && EDITING_HOST_STATES.has(state.toLowerCase());
14
+ };
15
+ // A target that can take focus already, natively, as an editing host, by a `tabindex` of its own or from code as a `Form`
16
+ // does, keeps its own focus handling and ring. Any other takes focus from code only, never as a standing `tabindex`, which
17
+ // would hand it the focus of a click inside it; the ring's attribute is set, not a prop, so React never writes over it.
18
+ const makeFocusTarget = (element) => {
19
+ if (element.hasAttribute('tabindex') || element.tabIndex >= 0 || isEditingHost(element) || focusFromCode_utils.isFocusableFromCodeOnly(element))
20
+ return;
21
+ focusFromCode_utils.takeFocusFromCodeOnly(element);
22
+ element.setAttribute(FOCUS_TARGET_ATTRIBUTE, '');
23
+ };
24
+ /**
25
+ * Hands keyboard focus on when a control unmounts as a result of its own press, such as "Try again", "Clear filters" or
26
+ * "Go to page 6" in an empty state, so it lands on what replaces the control instead of the top of the page. Use it for any
27
+ * number of such controls with one shared target ref; for a single retry, `useFocusAfterRetry` is the same thing.
28
+ *
29
+ * @returns `handOff`, which wraps an action so that calling it first marks a hand-off as pending, and `targetRef`, the one
30
+ * `ref` for every element that can replace those controls. While a hand-off is pending and focus has fallen to the page,
31
+ * each target that mounts is given focus, until one holds it, so a disabled button mounting first leaves it for the next;
32
+ * focus elsewhere ends the hand-off where the user put it. One that cannot take focus is made focusable from code only, so
33
+ * a click inside it does not give it focus, with the library's keyboard focus ring. Both are the same functions on every
34
+ * render, so a target already on screen never spends a hand-off.
35
+ */
36
+ const useFocusHandOff = () => {
37
+ const isPending = React.useRef(false);
38
+ const handOff = React.useCallback((action) => (...args) => {
39
+ isPending.current = true;
40
+ try {
41
+ return action(...args);
42
+ }
43
+ catch (error) {
44
+ // An action that throws has replaced nothing, so nothing should take focus for it later.
45
+ isPending.current = false;
46
+ throw error;
47
+ }
48
+ }, []);
49
+ const targetRef = React.useCallback((target) => {
50
+ if (!target)
51
+ return;
52
+ makeFocusTarget(target);
53
+ if (!isPending.current)
54
+ return;
55
+ const { ownerDocument } = target;
56
+ // Focus sits on `<body>` only when the control it was on is gone; anywhere else, the user chose it, and that ends it.
57
+ if (ownerDocument.activeElement === ownerDocument.body)
58
+ target.focus();
59
+ // Spent only once focus is held: a target that could not take it, such as a disabled button, leaves it for the next.
60
+ if (ownerDocument.activeElement !== ownerDocument.body)
61
+ isPending.current = false;
62
+ }, []);
63
+ return { handOff, targetRef };
64
+ };
65
+
66
+ exports.useFocusHandOff = useFocusHandOff;
67
+ //# sourceMappingURL=index.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.cjs","sources":["../../../src/hooks/useFocusHandOff/index.ts"],"sourcesContent":[null],"names":["isFocusableFromCodeOnly","takeFocusFromCodeOnly","useRef","useCallback"],"mappings":";;;;;AAKA;AACA,MAAM,sBAAsB,GAAG,4BAA4B;AAE3D;AACA;AACA,MAAM,mBAAmB,GAAG,IAAI,GAAG,CAAC,CAAC,EAAE,EAAE,MAAM,EAAE,gBAAgB,CAAC,CAAC;AAEnE,MAAM,aAAa,GAAG,CAAC,OAAoB,KAAI;IAC7C,MAAM,KAAK,GAAG,OAAO,CAAC,YAAY,CAAC,iBAAiB,CAAC;AACrD,IAAA,OAAO,KAAK,KAAK,IAAI,IAAI,mBAAmB,CAAC,GAAG,CAAC,KAAK,CAAC,WAAW,EAAE,CAAC;A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EAAE,OAAO,EAAE,SAAS,EAAE;AAC/B;;"}
@@ -0,0 +1,17 @@
1
+ /**
2
+ * Hands keyboard focus on when a control unmounts as a result of its own press, such as "Try again", "Clear filters" or
3
+ * "Go to page 6" in an empty state, so it lands on what replaces the control instead of the top of the page. Use it for any
4
+ * number of such controls with one shared target ref; for a single retry, `useFocusAfterRetry` is the same thing.
5
+ *
6
+ * @returns `handOff`, which wraps an action so that calling it first marks a hand-off as pending, and `targetRef`, the one
7
+ * `ref` for every element that can replace those controls. While a hand-off is pending and focus has fallen to the page,
8
+ * each target that mounts is given focus, until one holds it, so a disabled button mounting first leaves it for the next;
9
+ * focus elsewhere ends the hand-off where the user put it. One that cannot take focus is made focusable from code only, so
10
+ * a click inside it does not give it focus, with the library's keyboard focus ring. Both are the same functions on every
11
+ * render, so a target already on screen never spends a hand-off.
12
+ */
13
+ export declare const useFocusHandOff: () => {
14
+ handOff: <Args extends unknown[], Result>(action: (...args: Args) => Result) => (...args: Args) => Result;
15
+ targetRef: (target: HTMLElement | null) => void;
16
+ };
17
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/hooks/useFocusHandOff/index.ts"],"names":[],"mappings":"AA0BA;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,eAAe;cAIvB,IAAI,SAAS,OAAO,EAAE,EAAE,MAAM,UAAU,CAAC,GAAG,IAAI,EAAE,IAAI,KAAK,MAAM,eACtD,IAAI,KAAG,MAAM;wBAaY,WAAW,GAAG,IAAI;CAY1D,CAAC"}