@workday/canvas-kit-react 9.0.0-alpha.419-next.21 → 9.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 (255) hide show
  1. package/breadcrumbs/lib/BreadcrumbsItem.tsx +1 -1
  2. package/collection/index.ts +2 -0
  3. package/collection/lib/ListBox.tsx +12 -10
  4. package/collection/lib/useBaseListModel.tsx +6 -4
  5. package/collection/lib/useCursorListModel.tsx +1 -1
  6. package/collection/lib/useListActiveDescendant.ts +24 -0
  7. package/collection/lib/useListItemAllowChildStrings.ts +2 -1
  8. package/collection/lib/useListItemRegister.tsx +10 -3
  9. package/collection/lib/useListItemSelect.tsx +1 -1
  10. package/collection/lib/useListKeyboardHandler.ts +28 -0
  11. package/collection/lib/useListLoader.ts +116 -54
  12. package/collection/lib/useOverflowListItemMeasure.tsx +2 -2
  13. package/collection/lib/useOverflowListMeasure.ts +11 -13
  14. package/collection/lib/useOverflowListTarget.tsx +28 -30
  15. package/collection/lib/useSelectionListModel.tsx +1 -0
  16. package/combobox/LICENSE +52 -0
  17. package/combobox/README.md +7 -0
  18. package/combobox/index.ts +8 -0
  19. package/combobox/lib/Combobox.tsx +32 -0
  20. package/combobox/lib/ComboboxCard.tsx +33 -0
  21. package/combobox/lib/ComboboxInput.tsx +104 -0
  22. package/combobox/lib/ComboboxMenu.tsx +67 -0
  23. package/combobox/lib/ComboboxMenuItem.tsx +74 -0
  24. package/combobox/lib/ComboboxMenuList.tsx +45 -0
  25. package/combobox/lib/useComboboxInputOpenWithArrowKeys.ts +21 -0
  26. package/combobox/lib/useComboboxLoader.ts +72 -0
  27. package/combobox/lib/useComboboxModel.tsx +85 -0
  28. package/combobox/package.json +6 -0
  29. package/common/lib/utils/components.ts +15 -16
  30. package/common/lib/utils/models.ts +2 -2
  31. package/dist/commonjs/action-bar/lib/ActionBar.d.ts +2 -2
  32. package/dist/commonjs/action-bar/lib/ActionBarList.d.ts +1 -1
  33. package/dist/commonjs/action-bar/lib/useActionBarModel.d.ts +2 -2
  34. package/dist/commonjs/breadcrumbs/lib/Breadcrumbs.d.ts +2 -2
  35. package/dist/commonjs/breadcrumbs/lib/BreadcrumbsMenu.d.ts +1 -1
  36. package/dist/commonjs/breadcrumbs/lib/hooks/useBreadcrumbsModel.d.ts +2 -2
  37. package/dist/commonjs/collection/index.d.ts +2 -0
  38. package/dist/commonjs/collection/index.d.ts.map +1 -1
  39. package/dist/commonjs/collection/index.js +2 -0
  40. package/dist/commonjs/collection/lib/ListBox.d.ts +7 -6
  41. package/dist/commonjs/collection/lib/ListBox.d.ts.map +1 -1
  42. package/dist/commonjs/collection/lib/ListBox.js +5 -3
  43. package/dist/commonjs/collection/lib/useBaseListModel.d.ts.map +1 -1
  44. package/dist/commonjs/collection/lib/useBaseListModel.js +4 -4
  45. package/dist/commonjs/collection/lib/useCursorListModel.d.ts +0 -34
  46. package/dist/commonjs/collection/lib/useCursorListModel.d.ts.map +1 -1
  47. package/dist/commonjs/collection/lib/useCursorListModel.js +1 -1
  48. package/dist/commonjs/collection/lib/useListActiveDescendant.d.ts +68 -0
  49. package/dist/commonjs/collection/lib/useListActiveDescendant.d.ts.map +1 -0
  50. package/dist/commonjs/collection/lib/useListActiveDescendant.js +25 -0
  51. package/dist/commonjs/collection/lib/useListItemAllowChildStrings.d.ts +2 -1
  52. package/dist/commonjs/collection/lib/useListItemAllowChildStrings.d.ts.map +1 -1
  53. package/dist/commonjs/collection/lib/useListItemAllowChildStrings.js +2 -1
  54. package/dist/commonjs/collection/lib/useListItemRegister.d.ts.map +1 -1
  55. package/dist/commonjs/collection/lib/useListItemRegister.js +5 -1
  56. package/dist/commonjs/collection/lib/useListKeyboardHandler.d.ts +66 -0
  57. package/dist/commonjs/collection/lib/useListKeyboardHandler.d.ts.map +1 -0
  58. package/dist/commonjs/collection/lib/useListKeyboardHandler.js +27 -0
  59. package/dist/commonjs/collection/lib/useListLoader.d.ts +46 -7
  60. package/dist/commonjs/collection/lib/useListLoader.d.ts.map +1 -1
  61. package/dist/commonjs/collection/lib/useListLoader.js +61 -35
  62. package/dist/commonjs/collection/lib/useOverflowListMeasure.d.ts +1 -1
  63. package/dist/commonjs/collection/lib/useOverflowListMeasure.d.ts.map +1 -1
  64. package/dist/commonjs/collection/lib/useOverflowListTarget.d.ts +5 -2
  65. package/dist/commonjs/collection/lib/useOverflowListTarget.d.ts.map +1 -1
  66. package/dist/commonjs/collection/lib/useOverflowListTarget.js +1 -1
  67. package/dist/commonjs/collection/lib/useSelectionListModel.d.ts.map +1 -1
  68. package/dist/commonjs/collection/lib/useSelectionListModel.js +1 -0
  69. package/dist/commonjs/combobox/index.d.ts +9 -0
  70. package/dist/commonjs/combobox/index.d.ts.map +1 -0
  71. package/dist/commonjs/combobox/index.js +19 -0
  72. package/dist/commonjs/combobox/lib/Combobox.d.ts +2075 -0
  73. package/dist/commonjs/combobox/lib/Combobox.d.ts.map +1 -0
  74. package/dist/commonjs/combobox/lib/Combobox.js +29 -0
  75. package/dist/commonjs/combobox/lib/ComboboxCard.d.ts +166 -0
  76. package/dist/commonjs/combobox/lib/ComboboxCard.d.ts.map +1 -0
  77. package/dist/commonjs/combobox/lib/ComboboxCard.js +25 -0
  78. package/dist/commonjs/combobox/lib/ComboboxInput.d.ts +186 -0
  79. package/dist/commonjs/combobox/lib/ComboboxInput.d.ts.map +1 -0
  80. package/dist/commonjs/combobox/lib/ComboboxInput.js +84 -0
  81. package/dist/commonjs/combobox/lib/ComboboxMenu.d.ts +428 -0
  82. package/dist/commonjs/combobox/lib/ComboboxMenu.d.ts.map +1 -0
  83. package/dist/commonjs/combobox/lib/ComboboxMenu.js +63 -0
  84. package/dist/commonjs/combobox/lib/ComboboxMenuItem.d.ts +178 -0
  85. package/dist/commonjs/combobox/lib/ComboboxMenuItem.d.ts.map +1 -0
  86. package/dist/commonjs/combobox/lib/ComboboxMenuItem.js +50 -0
  87. package/dist/commonjs/combobox/lib/ComboboxMenuList.d.ts +164 -0
  88. package/dist/commonjs/combobox/lib/ComboboxMenuList.d.ts.map +1 -0
  89. package/dist/commonjs/combobox/lib/ComboboxMenuList.js +31 -0
  90. package/dist/commonjs/combobox/lib/useComboboxInputOpenWithArrowKeys.d.ts +84 -0
  91. package/dist/commonjs/combobox/lib/useComboboxInputOpenWithArrowKeys.d.ts.map +1 -0
  92. package/dist/commonjs/combobox/lib/useComboboxInputOpenWithArrowKeys.js +20 -0
  93. package/dist/commonjs/combobox/lib/useComboboxLoader.d.ts +28 -0
  94. package/dist/commonjs/combobox/lib/useComboboxLoader.d.ts.map +1 -0
  95. package/dist/commonjs/combobox/lib/useComboboxLoader.js +65 -0
  96. package/dist/commonjs/combobox/lib/useComboboxModel.d.ts +1998 -0
  97. package/dist/commonjs/combobox/lib/useComboboxModel.d.ts.map +1 -0
  98. package/dist/commonjs/combobox/lib/useComboboxModel.js +82 -0
  99. package/dist/commonjs/common/lib/utils/components.d.ts +9 -23
  100. package/dist/commonjs/common/lib/utils/components.d.ts.map +1 -1
  101. package/dist/commonjs/common/lib/utils/components.js +2 -2
  102. package/dist/commonjs/common/lib/utils/models.js +2 -2
  103. package/dist/commonjs/index.d.ts +1 -0
  104. package/dist/commonjs/index.d.ts.map +1 -1
  105. package/dist/commonjs/index.js +1 -0
  106. package/dist/commonjs/menu/index.d.ts +1 -1
  107. package/dist/commonjs/menu/index.d.ts.map +1 -1
  108. package/dist/commonjs/menu/index.js +2 -1
  109. package/dist/commonjs/menu/lib/Menu.d.ts +7 -5
  110. package/dist/commonjs/menu/lib/Menu.d.ts.map +1 -1
  111. package/dist/commonjs/menu/lib/Menu.js +6 -4
  112. package/dist/commonjs/menu/lib/MenuContextTarget.d.ts +2 -2
  113. package/dist/commonjs/menu/lib/MenuItem.d.ts +7 -1
  114. package/dist/commonjs/menu/lib/MenuItem.d.ts.map +1 -1
  115. package/dist/commonjs/menu/lib/MenuItem.js +9 -11
  116. package/dist/commonjs/menu/lib/MenuList.d.ts +3 -3
  117. package/dist/commonjs/menu/lib/MenuList.d.ts.map +1 -1
  118. package/dist/commonjs/menu/lib/MenuList.js +3 -2
  119. package/dist/commonjs/menu/lib/MenuPopper.d.ts +1 -1
  120. package/dist/commonjs/menu/lib/MenuTarget.d.ts +2 -2
  121. package/dist/commonjs/menu/lib/useMenuModel.d.ts +2 -2
  122. package/dist/commonjs/menu/lib/useMenuModel.d.ts.map +1 -1
  123. package/dist/commonjs/menu/lib/useMenuModel.js +3 -5
  124. package/dist/commonjs/popup/lib/hooks/usePopupPopper.d.ts +1 -1
  125. package/dist/commonjs/popup/lib/hooks/usePopupTarget.d.ts +1 -1
  126. package/dist/commonjs/popup/lib/hooks/usePopupTargetContext.d.ts +1 -1
  127. package/dist/commonjs/tabs/lib/Tabs.d.ts +18 -120
  128. package/dist/commonjs/tabs/lib/Tabs.d.ts.map +1 -1
  129. package/dist/commonjs/tabs/lib/TabsItem.d.ts +0 -1
  130. package/dist/commonjs/tabs/lib/TabsItem.d.ts.map +1 -1
  131. package/dist/commonjs/tabs/lib/TabsItem.js +0 -1
  132. package/dist/commonjs/tabs/lib/TabsList.d.ts +1 -1
  133. package/dist/commonjs/tabs/lib/TabsMenuPopper.d.ts +1 -1
  134. package/dist/commonjs/tabs/lib/TabsPanel.d.ts.map +1 -1
  135. package/dist/commonjs/tabs/lib/useTabsModel.d.ts +8 -20
  136. package/dist/commonjs/tabs/lib/useTabsModel.d.ts.map +1 -1
  137. package/dist/commonjs/tabs/lib/useTabsModel.js +1 -0
  138. package/dist/es6/action-bar/lib/ActionBar.d.ts +2 -2
  139. package/dist/es6/action-bar/lib/ActionBarList.d.ts +1 -1
  140. package/dist/es6/action-bar/lib/useActionBarModel.d.ts +2 -2
  141. package/dist/es6/breadcrumbs/lib/Breadcrumbs.d.ts +2 -2
  142. package/dist/es6/breadcrumbs/lib/BreadcrumbsMenu.d.ts +1 -1
  143. package/dist/es6/breadcrumbs/lib/hooks/useBreadcrumbsModel.d.ts +2 -2
  144. package/dist/es6/collection/index.d.ts +2 -0
  145. package/dist/es6/collection/index.d.ts.map +1 -1
  146. package/dist/es6/collection/index.js +2 -0
  147. package/dist/es6/collection/lib/ListBox.d.ts +7 -6
  148. package/dist/es6/collection/lib/ListBox.d.ts.map +1 -1
  149. package/dist/es6/collection/lib/ListBox.js +6 -4
  150. package/dist/es6/collection/lib/useBaseListModel.d.ts.map +1 -1
  151. package/dist/es6/collection/lib/useBaseListModel.js +4 -4
  152. package/dist/es6/collection/lib/useCursorListModel.d.ts +0 -34
  153. package/dist/es6/collection/lib/useCursorListModel.d.ts.map +1 -1
  154. package/dist/es6/collection/lib/useCursorListModel.js +1 -1
  155. package/dist/es6/collection/lib/useListActiveDescendant.d.ts +68 -0
  156. package/dist/es6/collection/lib/useListActiveDescendant.d.ts.map +1 -0
  157. package/dist/es6/collection/lib/useListActiveDescendant.js +22 -0
  158. package/dist/es6/collection/lib/useListItemAllowChildStrings.d.ts +2 -1
  159. package/dist/es6/collection/lib/useListItemAllowChildStrings.d.ts.map +1 -1
  160. package/dist/es6/collection/lib/useListItemAllowChildStrings.js +2 -1
  161. package/dist/es6/collection/lib/useListItemRegister.d.ts.map +1 -1
  162. package/dist/es6/collection/lib/useListItemRegister.js +5 -1
  163. package/dist/es6/collection/lib/useListKeyboardHandler.d.ts +66 -0
  164. package/dist/es6/collection/lib/useListKeyboardHandler.d.ts.map +1 -0
  165. package/dist/es6/collection/lib/useListKeyboardHandler.js +24 -0
  166. package/dist/es6/collection/lib/useListLoader.d.ts +46 -7
  167. package/dist/es6/collection/lib/useListLoader.d.ts.map +1 -1
  168. package/dist/es6/collection/lib/useListLoader.js +61 -35
  169. package/dist/es6/collection/lib/useOverflowListMeasure.d.ts +1 -1
  170. package/dist/es6/collection/lib/useOverflowListMeasure.d.ts.map +1 -1
  171. package/dist/es6/collection/lib/useOverflowListTarget.d.ts +5 -2
  172. package/dist/es6/collection/lib/useOverflowListTarget.d.ts.map +1 -1
  173. package/dist/es6/collection/lib/useOverflowListTarget.js +1 -1
  174. package/dist/es6/collection/lib/useSelectionListModel.d.ts.map +1 -1
  175. package/dist/es6/collection/lib/useSelectionListModel.js +1 -0
  176. package/dist/es6/combobox/index.d.ts +9 -0
  177. package/dist/es6/combobox/index.d.ts.map +1 -0
  178. package/dist/es6/combobox/index.js +8 -0
  179. package/dist/es6/combobox/lib/Combobox.d.ts +2075 -0
  180. package/dist/es6/combobox/lib/Combobox.d.ts.map +1 -0
  181. package/dist/es6/combobox/lib/Combobox.js +23 -0
  182. package/dist/es6/combobox/lib/ComboboxCard.d.ts +166 -0
  183. package/dist/es6/combobox/lib/ComboboxCard.d.ts.map +1 -0
  184. package/dist/es6/combobox/lib/ComboboxCard.js +19 -0
  185. package/dist/es6/combobox/lib/ComboboxInput.d.ts +186 -0
  186. package/dist/es6/combobox/lib/ComboboxInput.d.ts.map +1 -0
  187. package/dist/es6/combobox/lib/ComboboxInput.js +78 -0
  188. package/dist/es6/combobox/lib/ComboboxMenu.d.ts +428 -0
  189. package/dist/es6/combobox/lib/ComboboxMenu.d.ts.map +1 -0
  190. package/dist/es6/combobox/lib/ComboboxMenu.js +57 -0
  191. package/dist/es6/combobox/lib/ComboboxMenuItem.d.ts +178 -0
  192. package/dist/es6/combobox/lib/ComboboxMenuItem.d.ts.map +1 -0
  193. package/dist/es6/combobox/lib/ComboboxMenuItem.js +44 -0
  194. package/dist/es6/combobox/lib/ComboboxMenuList.d.ts +164 -0
  195. package/dist/es6/combobox/lib/ComboboxMenuList.d.ts.map +1 -0
  196. package/dist/es6/combobox/lib/ComboboxMenuList.js +25 -0
  197. package/dist/es6/combobox/lib/useComboboxInputOpenWithArrowKeys.d.ts +84 -0
  198. package/dist/es6/combobox/lib/useComboboxInputOpenWithArrowKeys.d.ts.map +1 -0
  199. package/dist/es6/combobox/lib/useComboboxInputOpenWithArrowKeys.js +17 -0
  200. package/dist/es6/combobox/lib/useComboboxLoader.d.ts +28 -0
  201. package/dist/es6/combobox/lib/useComboboxLoader.d.ts.map +1 -0
  202. package/dist/es6/combobox/lib/useComboboxLoader.js +58 -0
  203. package/dist/es6/combobox/lib/useComboboxModel.d.ts +1998 -0
  204. package/dist/es6/combobox/lib/useComboboxModel.d.ts.map +1 -0
  205. package/dist/es6/combobox/lib/useComboboxModel.js +76 -0
  206. package/dist/es6/common/lib/utils/components.d.ts +9 -23
  207. package/dist/es6/common/lib/utils/components.d.ts.map +1 -1
  208. package/dist/es6/common/lib/utils/components.js +2 -2
  209. package/dist/es6/common/lib/utils/models.js +2 -2
  210. package/dist/es6/index.d.ts +1 -0
  211. package/dist/es6/index.d.ts.map +1 -1
  212. package/dist/es6/index.js +1 -0
  213. package/dist/es6/menu/index.d.ts +1 -1
  214. package/dist/es6/menu/index.d.ts.map +1 -1
  215. package/dist/es6/menu/index.js +1 -1
  216. package/dist/es6/menu/lib/Menu.d.ts +7 -5
  217. package/dist/es6/menu/lib/Menu.d.ts.map +1 -1
  218. package/dist/es6/menu/lib/Menu.js +6 -4
  219. package/dist/es6/menu/lib/MenuContextTarget.d.ts +2 -2
  220. package/dist/es6/menu/lib/MenuItem.d.ts +7 -1
  221. package/dist/es6/menu/lib/MenuItem.d.ts.map +1 -1
  222. package/dist/es6/menu/lib/MenuItem.js +8 -10
  223. package/dist/es6/menu/lib/MenuList.d.ts +3 -3
  224. package/dist/es6/menu/lib/MenuList.d.ts.map +1 -1
  225. package/dist/es6/menu/lib/MenuList.js +4 -3
  226. package/dist/es6/menu/lib/MenuPopper.d.ts +1 -1
  227. package/dist/es6/menu/lib/MenuTarget.d.ts +2 -2
  228. package/dist/es6/menu/lib/useMenuModel.d.ts +2 -2
  229. package/dist/es6/menu/lib/useMenuModel.d.ts.map +1 -1
  230. package/dist/es6/menu/lib/useMenuModel.js +4 -6
  231. package/dist/es6/popup/lib/hooks/usePopupPopper.d.ts +1 -1
  232. package/dist/es6/popup/lib/hooks/usePopupTarget.d.ts +1 -1
  233. package/dist/es6/popup/lib/hooks/usePopupTargetContext.d.ts +1 -1
  234. package/dist/es6/tabs/lib/Tabs.d.ts +18 -120
  235. package/dist/es6/tabs/lib/Tabs.d.ts.map +1 -1
  236. package/dist/es6/tabs/lib/TabsItem.d.ts +0 -1
  237. package/dist/es6/tabs/lib/TabsItem.d.ts.map +1 -1
  238. package/dist/es6/tabs/lib/TabsItem.js +0 -1
  239. package/dist/es6/tabs/lib/TabsList.d.ts +1 -1
  240. package/dist/es6/tabs/lib/TabsMenuPopper.d.ts +1 -1
  241. package/dist/es6/tabs/lib/TabsPanel.d.ts.map +1 -1
  242. package/dist/es6/tabs/lib/useTabsModel.d.ts +8 -20
  243. package/dist/es6/tabs/lib/useTabsModel.d.ts.map +1 -1
  244. package/dist/es6/tabs/lib/useTabsModel.js +1 -0
  245. package/index.ts +1 -0
  246. package/menu/index.ts +1 -1
  247. package/menu/lib/Menu.tsx +6 -4
  248. package/menu/lib/MenuItem.tsx +9 -12
  249. package/menu/lib/MenuList.tsx +16 -10
  250. package/menu/lib/useMenuModel.tsx +4 -7
  251. package/modal/lib/hooks/useModalHeading.ts +2 -2
  252. package/package.json +3 -3
  253. package/tabs/lib/TabsItem.tsx +10 -13
  254. package/tabs/lib/TabsPanel.tsx +1 -5
  255. package/tabs/lib/useTabsModel.tsx +1 -0
@@ -242,10 +242,10 @@ export const createContainer = <
242
242
  >(
243
243
  as?: E
244
244
  ) => <
245
- TModelHook extends ((config: any) => {state: any; events: any}) & {
245
+ TModelHook extends ((config: any) => Model<any, any>) & {
246
246
  Context?: React.Context<any>;
247
247
  } & {defaultConfig?: Record<string, any>},
248
- TDefaultContext extends {state: Record<string, any>; events: Record<string, any>},
248
+ TDefaultContext extends Model<any, any>,
249
249
  TElemPropsHook,
250
250
  SubComponents = {}
251
251
  >({
@@ -380,7 +380,7 @@ export const createSubcomponent = <
380
380
  as?: E
381
381
  ) => <
382
382
  TElemPropsHook, // normally we'd put a constraint here, but doing so causes the `infer` below to fail to infer the return props
383
- TModelHook extends ((config: any) => {state: any; events: any}) & {Context?: React.Context<any>},
383
+ TModelHook extends ((config: any) => Model<any, any>) & {Context?: React.Context<any>},
384
384
  SubComponents = {}
385
385
  >({
386
386
  displayName,
@@ -592,10 +592,8 @@ export const createElemPropsHook = <TModelHook extends (config: any) => Model<an
592
592
  modelHook: TModelHook
593
593
  ) => <PO extends {}, PI extends {}>(
594
594
  fn: (
595
- model: TModelHook extends (config: any) => infer TModel
596
- ? TModel
597
- : {state: Record<string, any>; events: Record<string, any>},
598
- ref?: React.Ref<any>,
595
+ model: TModelHook extends (config: any) => infer TModel ? TModel : Model<any, any>,
596
+ ref?: React.Ref<unknown>,
599
597
  elemProps?: PI
600
598
  ) => PO
601
599
  ): BehaviorHook<
@@ -633,10 +631,10 @@ export const createElemPropsHook = <TModelHook extends (config: any) => Model<an
633
631
  * });
634
632
  *
635
633
  * // Equivalent to:
636
- * const useMyHook = <P extends {}, R>(
634
+ * const useMyHook = <P extends {}>(
637
635
  * model: MyModel,
638
636
  * elemProps: P,
639
- * ref: React.Ref<R>
637
+ * ref: React.Ref<unknown>
640
638
  * ) => {
641
639
  * const { localRef, elementRef } = useLocalRef(ref);
642
640
  * // do whatever with `localRef` which is a RefObject
@@ -650,7 +648,7 @@ export const createElemPropsHook = <TModelHook extends (config: any) => Model<an
650
648
  * @param fn Function that takes a model and optional ref and returns props
651
649
  */
652
650
  export const createHook = <M extends Model<any, any>, PO extends {}, PI extends {}>(
653
- fn: (model: M, ref?: React.Ref<any>, elemProps?: PI) => PO
651
+ fn: (model: M, ref?: React.Ref<unknown>, elemProps?: PI) => PO
654
652
  ): BehaviorHook<M, PO> => {
655
653
  return ((model, elemProps, ref) => {
656
654
  const props = mergeProps(fn(model, ref, elemProps || ({} as any)), elemProps || ({} as any));
@@ -669,7 +667,7 @@ export const subModelHook = <M extends Model<any, any>, SM extends Model<any, an
669
667
  fn: (model: M) => SM,
670
668
  hook: BehaviorHook<SM, O>
671
669
  ): BehaviorHook<M, O> => {
672
- return ((model: M, props: any, ref: React.Ref<any>) => {
670
+ return ((model: M, props: any, ref: React.Ref<unknown>) => {
673
671
  return hook(fn(model), props, ref);
674
672
  }) as BehaviorHook<M, O>;
675
673
  };
@@ -704,7 +702,7 @@ export function createSubModelElemPropsHook<M extends () => Model<any, any>>(mod
704
702
  fn: (model: ReturnType<M>) => SM,
705
703
  elemPropsHook: BehaviorHook<SM, O>
706
704
  ): BehaviorHook<ReturnType<M>, O> => {
707
- return ((model: ReturnType<M>, props: any, ref: React.Ref<any>) => {
705
+ return ((model: ReturnType<M>, props: any, ref: React.Ref<unknown>) => {
708
706
  return elemPropsHook(fn(model), props, ref);
709
707
  }) as BehaviorHook<ReturnType<M>, O>;
710
708
  };
@@ -742,9 +740,7 @@ interface BaseHook<M extends Model<any, any>, O extends {}> {
742
740
  * attributes to apply to an element or component.
743
741
  */
744
742
  export interface BehaviorHook<M extends Model<any, any>, O extends {}> extends BaseHook<M, O> {
745
- <P extends {}, R>(model: M, elemProps?: P, ref?: React.Ref<R>): O &
746
- P &
747
- (R extends HTMLOrSVGElement ? {ref: React.Ref<R>} : {});
743
+ <P extends {}>(model: M, elemProps?: P, ref?: React.Ref<unknown>): O & P;
748
744
  }
749
745
 
750
746
  function setRef<T>(ref: React.Ref<T> | undefined, value: T): void {
@@ -923,7 +919,10 @@ export function composeHooks<
923
919
  hook3?: H3,
924
920
  hook4?: H4,
925
921
  hook5?: H5,
926
- hook6?: H6
922
+ hook6?: H6,
923
+ // TypeScript will only infer up to 6, but the types will still exist for those 6. The rest of the
924
+ // hooks won't add to the interface, but that seems to be an okay fallback
925
+ ...hooks: BehaviorHook<any, any>[]
927
926
  ): H1 extends BaseHook<infer M, infer O1>
928
927
  ? H2 extends BaseHook<any, infer O2>
929
928
  ? H3 extends BaseHook<any, infer O3>
@@ -513,10 +513,10 @@ export const createModelHook = <TDefaultConfig extends {}, TRequiredConfig exten
513
513
  const elemProps = {};
514
514
  for (const key in props) {
515
515
  if (
516
- !defaultConfig.hasOwnProperty(key) &&
516
+ (!defaultConfig.hasOwnProperty(key) &&
517
517
  !requiredConfig.hasOwnProperty(key) &&
518
518
  !callbacksRef.current.includes(key) &&
519
- !guardsRef.current.includes(key)
519
+ !guardsRef.current.includes(key)) || key === 'id'
520
520
  ) {
521
521
  // @ts-ignore Typescript complains about index signatures and this type is never exposed in definitions, so suppress the error
522
522
  elemProps[key] = props[key];
@@ -28,6 +28,7 @@ export declare const ActionBar: import("@workday/canvas-kit-react/common").Compo
28
28
  orientation: import("../../collection/lib/useBaseListModel").Orientation;
29
29
  menuConfig: Partial<{
30
30
  mode: "multiple" | "single";
31
+ shouldVirtualize: boolean;
31
32
  returnFocusRef: React.RefObject<any> | undefined;
32
33
  initialFocusRef: React.RefObject<any> | undefined;
33
34
  id: string;
@@ -44,7 +45,6 @@ export declare const ActionBar: import("@workday/canvas-kit-react/common").Compo
44
45
  nonInteractiveIds: string[];
45
46
  orientation: import("../../collection/lib/useBaseListModel").Orientation;
46
47
  defaultItemHeight: number;
47
- shouldVirtualize: boolean;
48
48
  items: any[];
49
49
  }>;
50
50
  initialHiddenIds: string[];
@@ -2557,6 +2557,7 @@ export declare const ActionBar: import("@workday/canvas-kit-react/common").Compo
2557
2557
  */
2558
2558
  Menu: import("@workday/canvas-kit-react/common").ComponentM<import("../../menu/lib/Menu").MenuProps & Partial<{
2559
2559
  mode: "multiple" | "single";
2560
+ shouldVirtualize: boolean;
2560
2561
  returnFocusRef: React.RefObject<any> | undefined;
2561
2562
  initialFocusRef: React.RefObject<any> | undefined;
2562
2563
  id: string;
@@ -2573,7 +2574,6 @@ export declare const ActionBar: import("@workday/canvas-kit-react/common").Compo
2573
2574
  nonInteractiveIds: string[];
2574
2575
  orientation: import("../../collection/lib/useBaseListModel").Orientation;
2575
2576
  defaultItemHeight: number;
2576
- shouldVirtualize: boolean;
2577
2577
  items: any[];
2578
2578
  }> & {
2579
2579
  onUpdatePlacement?: ((data: {
@@ -105,7 +105,7 @@ export declare const useActionBarList: import("@workday/canvas-kit-react/common"
105
105
  navigation: import("../../collection/lib/useCursorListModel").NavigationManager;
106
106
  getId: (item: any) => string;
107
107
  }, {
108
- ref: (instance: HTMLElement | null) => void;
108
+ ref: (instance: unknown) => void;
109
109
  }>;
110
110
  export declare const ActionBarList: import("@workday/canvas-kit-react/common").ElementComponentM<"div", ActionBarListProps<any>, {
111
111
  state: {
@@ -13,6 +13,7 @@ export declare const useActionBarModel: (<TT_Special_Generic>(config?: (Partial<
13
13
  orientation: import("../../collection/lib/useBaseListModel").Orientation;
14
14
  menuConfig: Partial<{
15
15
  mode: "multiple" | "single";
16
+ shouldVirtualize: boolean;
16
17
  returnFocusRef: React.RefObject<any> | undefined;
17
18
  initialFocusRef: React.RefObject<any> | undefined;
18
19
  id: string;
@@ -29,7 +30,6 @@ export declare const useActionBarModel: (<TT_Special_Generic>(config?: (Partial<
29
30
  nonInteractiveIds: string[];
30
31
  orientation: import("../../collection/lib/useBaseListModel").Orientation;
31
32
  defaultItemHeight: number;
32
- shouldVirtualize: boolean;
33
33
  items: any[];
34
34
  }>;
35
35
  initialHiddenIds: string[];
@@ -1600,6 +1600,7 @@ export declare const useActionBarModel: (<TT_Special_Generic>(config?: (Partial<
1600
1600
  orientation: import("../../collection/lib/useBaseListModel").Orientation;
1601
1601
  menuConfig: Partial<{
1602
1602
  mode: "multiple" | "single";
1603
+ shouldVirtualize: boolean;
1603
1604
  returnFocusRef: React.RefObject<any> | undefined;
1604
1605
  initialFocusRef: React.RefObject<any> | undefined;
1605
1606
  id: string;
@@ -1616,7 +1617,6 @@ export declare const useActionBarModel: (<TT_Special_Generic>(config?: (Partial<
1616
1617
  nonInteractiveIds: string[];
1617
1618
  orientation: import("../../collection/lib/useBaseListModel").Orientation;
1618
1619
  defaultItemHeight: number;
1619
- shouldVirtualize: boolean;
1620
1620
  items: any[];
1621
1621
  }>;
1622
1622
  initialHiddenIds: string[];
@@ -61,6 +61,7 @@ export declare const Breadcrumbs: import("@workday/canvas-kit-react/common").Ele
61
61
  orientation: import("../../collection/lib/useBaseListModel").Orientation;
62
62
  menuConfig: Partial<{
63
63
  mode: "multiple" | "single";
64
+ shouldVirtualize: boolean;
64
65
  returnFocusRef: React.RefObject<any> | undefined;
65
66
  initialFocusRef: React.RefObject<any> | undefined;
66
67
  id: string;
@@ -77,7 +78,6 @@ export declare const Breadcrumbs: import("@workday/canvas-kit-react/common").Ele
77
78
  nonInteractiveIds: string[];
78
79
  orientation: import("../../collection/lib/useBaseListModel").Orientation;
79
80
  defaultItemHeight: number;
80
- shouldVirtualize: boolean;
81
81
  items: any[];
82
82
  }>;
83
83
  initialHiddenIds: string[];
@@ -2343,6 +2343,7 @@ export declare const Breadcrumbs: import("@workday/canvas-kit-react/common").Ele
2343
2343
  */
2344
2344
  Menu: import("@workday/canvas-kit-react/common").ComponentM<import("../../menu/lib/Menu").MenuProps & Partial<{
2345
2345
  mode: "multiple" | "single";
2346
+ shouldVirtualize: boolean;
2346
2347
  returnFocusRef: React.RefObject<any> | undefined;
2347
2348
  initialFocusRef: React.RefObject<any> | undefined;
2348
2349
  id: string;
@@ -2359,7 +2360,6 @@ export declare const Breadcrumbs: import("@workday/canvas-kit-react/common").Ele
2359
2360
  nonInteractiveIds: string[];
2360
2361
  orientation: import("../../collection/lib/useBaseListModel").Orientation;
2361
2362
  defaultItemHeight: number;
2362
- shouldVirtualize: boolean;
2363
2363
  items: any[];
2364
2364
  }> & {
2365
2365
  onUpdatePlacement?: ((data: {
@@ -75,6 +75,7 @@ export declare const BreadcrumbsMenuItem: import("@workday/canvas-kit-react/comm
75
75
  }, {}>>;
76
76
  export declare const BreadcrumbsMenu: import("@workday/canvas-kit-react/common").ComponentM<import("../../menu/lib/Menu").MenuProps & Partial<{
77
77
  mode: "multiple" | "single";
78
+ shouldVirtualize: boolean;
78
79
  returnFocusRef: React.RefObject<any> | undefined;
79
80
  initialFocusRef: React.RefObject<any> | undefined;
80
81
  id: string;
@@ -91,7 +92,6 @@ export declare const BreadcrumbsMenu: import("@workday/canvas-kit-react/common")
91
92
  nonInteractiveIds: string[];
92
93
  orientation: import("../../collection/lib/useBaseListModel").Orientation;
93
94
  defaultItemHeight: number;
94
- shouldVirtualize: boolean;
95
95
  items: any[];
96
96
  }> & {
97
97
  onUpdatePlacement?: ((data: {
@@ -13,6 +13,7 @@ export declare const useBreadcrumbsModel: (<TT_Special_Generic>(config?: (Partia
13
13
  orientation: import("../../../collection/lib/useBaseListModel").Orientation;
14
14
  menuConfig: Partial<{
15
15
  mode: "multiple" | "single";
16
+ shouldVirtualize: boolean;
16
17
  returnFocusRef: React.RefObject<any> | undefined;
17
18
  initialFocusRef: React.RefObject<any> | undefined;
18
19
  id: string;
@@ -29,7 +30,6 @@ export declare const useBreadcrumbsModel: (<TT_Special_Generic>(config?: (Partia
29
30
  nonInteractiveIds: string[];
30
31
  orientation: import("../../../collection/lib/useBaseListModel").Orientation;
31
32
  defaultItemHeight: number;
32
- shouldVirtualize: boolean;
33
33
  items: any[];
34
34
  }>;
35
35
  initialHiddenIds: string[];
@@ -1600,6 +1600,7 @@ export declare const useBreadcrumbsModel: (<TT_Special_Generic>(config?: (Partia
1600
1600
  orientation: import("../../../collection/lib/useBaseListModel").Orientation;
1601
1601
  menuConfig: Partial<{
1602
1602
  mode: "multiple" | "single";
1603
+ shouldVirtualize: boolean;
1603
1604
  returnFocusRef: React.RefObject<any> | undefined;
1604
1605
  initialFocusRef: React.RefObject<any> | undefined;
1605
1606
  id: string;
@@ -1616,7 +1617,6 @@ export declare const useBreadcrumbsModel: (<TT_Special_Generic>(config?: (Partia
1616
1617
  nonInteractiveIds: string[];
1617
1618
  orientation: import("../../../collection/lib/useBaseListModel").Orientation;
1618
1619
  defaultItemHeight: number;
1619
- shouldVirtualize: boolean;
1620
1620
  items: any[];
1621
1621
  }>;
1622
1622
  initialHiddenIds: string[];
@@ -8,9 +8,11 @@ export * from './lib/useListRenderItem';
8
8
  export * from './lib/useListResetCursorOnBlur';
9
9
  export * from './lib/useListItemRovingFocus';
10
10
  export * from './lib/useListItemSelect';
11
+ export * from './lib/useListKeyboardHandler';
11
12
  export * from './lib/useListLoader';
12
13
  export * from './lib/useListModel';
13
14
  export * from './lib/useGridModel';
15
+ export * from './lib/useListActiveDescendant';
14
16
  export * from './lib/useListItemAllowChildStrings';
15
17
  export { ListBox, ListBoxProps } from './lib/ListBox';
16
18
  export { singleSelectionManager, multiSelectionManager, isSelected, } from './lib/useSelectionListModel';
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../collection/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,YAAY,EAAE,IAAI,EAAC,MAAM,wBAAwB,CAAC;AAC1D,cAAc,2BAA2B,CAAC;AAC1C,cAAc,8BAA8B,CAAC;AAC7C,cAAc,kCAAkC,CAAC;AACjD,cAAc,4BAA4B,CAAC;AAC3C,cAAc,6BAA6B,CAAC;AAC5C,cAAc,yBAAyB,CAAC;AACxC,cAAc,gCAAgC,CAAC;AAC/C,cAAc,8BAA8B,CAAC;AAC7C,cAAc,yBAAyB,CAAC;AACxC,cAAc,qBAAqB,CAAC;AACpC,cAAc,oBAAoB,CAAC;AACnC,cAAc,oBAAoB,CAAC;AACnC,cAAc,oCAAoC,CAAC;AACnD,OAAO,EAAC,OAAO,EAAE,YAAY,EAAC,MAAM,eAAe,CAAC;AACpD,OAAO,EACL,sBAAsB,EACtB,qBAAqB,EACrB,UAAU,GACX,MAAM,6BAA6B,CAAC;AACrC,OAAO,EAAC,yBAAyB,EAAE,iBAAiB,EAAC,MAAM,0BAA0B,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../collection/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,YAAY,EAAE,IAAI,EAAC,MAAM,wBAAwB,CAAC;AAC1D,cAAc,2BAA2B,CAAC;AAC1C,cAAc,8BAA8B,CAAC;AAC7C,cAAc,kCAAkC,CAAC;AACjD,cAAc,4BAA4B,CAAC;AAC3C,cAAc,6BAA6B,CAAC;AAC5C,cAAc,yBAAyB,CAAC;AACxC,cAAc,gCAAgC,CAAC;AAC/C,cAAc,8BAA8B,CAAC;AAC7C,cAAc,yBAAyB,CAAC;AACxC,cAAc,8BAA8B,CAAC;AAC7C,cAAc,qBAAqB,CAAC;AACpC,cAAc,oBAAoB,CAAC;AACnC,cAAc,oBAAoB,CAAC;AACnC,cAAc,+BAA+B,CAAC;AAC9C,cAAc,oCAAoC,CAAC;AACnD,OAAO,EAAC,OAAO,EAAE,YAAY,EAAC,MAAM,eAAe,CAAC;AACpD,OAAO,EACL,sBAAsB,EACtB,qBAAqB,EACrB,UAAU,GACX,MAAM,6BAA6B,CAAC;AACrC,OAAO,EAAC,yBAAyB,EAAE,iBAAiB,EAAC,MAAM,0BAA0B,CAAC"}
@@ -22,9 +22,11 @@ __exportStar(require("./lib/useListRenderItem"), exports);
22
22
  __exportStar(require("./lib/useListResetCursorOnBlur"), exports);
23
23
  __exportStar(require("./lib/useListItemRovingFocus"), exports);
24
24
  __exportStar(require("./lib/useListItemSelect"), exports);
25
+ __exportStar(require("./lib/useListKeyboardHandler"), exports);
25
26
  __exportStar(require("./lib/useListLoader"), exports);
26
27
  __exportStar(require("./lib/useListModel"), exports);
27
28
  __exportStar(require("./lib/useGridModel"), exports);
29
+ __exportStar(require("./lib/useListActiveDescendant"), exports);
28
30
  __exportStar(require("./lib/useListItemAllowChildStrings"), exports);
29
31
  var ListBox_1 = require("./lib/ListBox");
30
32
  Object.defineProperty(exports, "ListBox", { enumerable: true, get: function () { return ListBox_1.ListBox; } });
@@ -1,9 +1,10 @@
1
1
  import React from 'react';
2
- import { BoxProps } from '@workday/canvas-kit-react/layout';
3
- export interface ListBoxProps extends Omit<BoxProps, 'children'> {
4
- children?: React.ReactNode | ((item: any) => React.ReactNode);
2
+ import { ExtractProps } from '@workday/canvas-kit-react/common';
3
+ import { Flex } from '@workday/canvas-kit-react/layout';
4
+ export interface ListBoxProps<T = any> extends Omit<ExtractProps<typeof Flex, never>, 'children'> {
5
+ children?: React.ReactNode | ((item: T, index: number) => React.ReactNode);
5
6
  }
6
- export declare const ListBoxItem: import("@workday/canvas-kit-react/common").ElementComponentM<"li", BoxProps, {
7
+ export declare const ListBoxItem: import("@workday/canvas-kit-react/common").ElementComponentM<"li", Omit<import("@workday/canvas-kit-react/layout").BoxProps, "display"> & import("@workday/canvas-kit-react/layout").FlexStyleProps, {
7
8
  state: {
8
9
  selectedIds: string[] | "all";
9
10
  unselectedIds: string[];
@@ -145,7 +146,7 @@ export declare const useListBox: import("@workday/canvas-kit-react/common").Beha
145
146
  * - Inner Box: The element responsible for the virtual container. Height is controlled by the model
146
147
  * and cannot be changed by the developer. All props and ref will be spread to this element.
147
148
  */
148
- export declare const ListBox: import("@workday/canvas-kit-react/common").ElementComponentM<"ul", ListBoxProps & Partial<{
149
+ export declare const ListBox: import("@workday/canvas-kit-react/common").ElementComponentM<"ul", ListBoxProps<any> & Partial<{
149
150
  initialSelectedIds: import("./useSelectionListModel").SelectedIds;
150
151
  initialUnselectedIds: string[];
151
152
  selection: import("./useSelectionListModel").SelectionManager;
@@ -1104,7 +1105,7 @@ export declare const ListBox: import("@workday/canvas-kit-react/common").Element
1104
1105
  * functionality. `elemPropsHook` is provided on all compound components and is useful in the
1105
1106
  * example to add additional functionality without making a new component.
1106
1107
  */
1107
- Item: import("@workday/canvas-kit-react/common").ElementComponentM<"li", BoxProps, {
1108
+ Item: import("@workday/canvas-kit-react/common").ElementComponentM<"li", Omit<import("@workday/canvas-kit-react/layout").BoxProps, "display"> & import("@workday/canvas-kit-react/layout").FlexStyleProps, {
1108
1109
  state: {
1109
1110
  selectedIds: string[] | "all";
1110
1111
  unselectedIds: string[];
@@ -1 +1 @@
1
- {"version":3,"file":"ListBox.d.ts","sourceRoot":"","sources":["../../../../collection/lib/ListBox.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAM1B,OAAO,EAAM,QAAQ,EAAC,MAAM,kCAAkC,CAAC;AAM/D,MAAM,WAAW,YAAa,SAAQ,IAAI,CAAC,QAA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
@@ -58,8 +58,10 @@ exports.ListBox = common_1.createContainer('ul')({
58
58
  */
59
59
  Item: exports.ListBoxItem,
60
60
  },
61
- })(({ height, maxHeight, ...elemProps }, Element, model) => {
61
+ })(({ height, maxHeight, marginY, ...elemProps }, Element, model) => {
62
+ // We're moving `marginY` to the container to not interfere with the virtualization size. We set
63
+ // the `marginY` on the Flex to `0` to avoid inaccurate scrollbars
62
64
  // TODO figure out what style props should go to which `Box`
63
- return (react_1.default.createElement(layout_1.Box, { ref: model.state.containerRef, height: height || model.state.isVirtualized ? model.state.UNSTABLE_virtual.totalSize : undefined, maxHeight: maxHeight, overflowY: model.state.orientation === 'vertical' ? 'auto' : undefined },
64
- react_1.default.createElement(layout_1.Box, Object.assign({ as: Element }, elemProps), useListRenderItem_1.useListRenderItems(model, elemProps.children))));
65
+ return (react_1.default.createElement(layout_1.Box, { ref: model.state.containerRef, marginY: marginY, maxHeight: maxHeight, overflowY: model.state.orientation === 'vertical' ? 'auto' : undefined },
66
+ react_1.default.createElement(layout_1.Flex, Object.assign({ as: Element, flexDirection: "column" }, elemProps, { marginY: 0 }), useListRenderItem_1.useListRenderItems(model, elemProps.children))));
65
67
  });
@@ -1 +1 @@
1
- {"version":3,"file":"useBaseListModel.d.ts","sourceRoot":"","sources":["../../../../collection/lib/useBaseListModel.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAG1B,OAAO,EAA+B,OAAO,EAAC,MAAM,kCAAkC,CAAC;AAEvF,oBAAY,WAAW,GAAG,YAAY,GAAG,UAAU,CAAC;AAEpD,eAAO,MAAM,YAAY,SAAU,GAAG,KAAG,MAExC,CAAC;AAEF,eAAO,MAAM,mBAAmB,SAAU,GAAG,KAAG,MAE/C,CAAC;AAEF,MAAM,WAAW,IAAI,CAAC,CAAC;IACrB,KAAK,EAAE,MAAM,CAAC;IACd,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,CAAC,CAAC;IACT;;OAEG;IACH,SAAS,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
  const common_1 = require("@workday/canvas-kit-react/common");
10
10
  const defaultGetId = (item) => {
11
- return item.id || '';
11
+ return typeof item === 'string' ? item : item.id || '';
12
12
  };
13
13
  exports.defaultGetId = defaultGetId;
14
14
  const defaultGetTextValue = (item) => {
15
- return item.text || '';
15
+ return typeof item === 'string' ? item : item.text || '';
16
16
  };
17
17
  exports.defaultGetTextValue = defaultGetTextValue;
18
18
  // interface Collection<T> {
@@ -62,13 +62,13 @@ exports.useBaseListModel = common_1.createModelHook({
62
62
  * JSX, the list will create an internal array of items where `id` is the only property and the
63
63
  * default `getId` will return the desired result.
64
64
  */
65
- getId: (item) => item.id,
65
+ getId: (item) => typeof item === 'string' ? item : item === undefined ? '' : item.id,
66
66
  /**
67
67
  * Optional function to return the text representation of an item. If not provided, the default
68
68
  * function will return the `text` property of the object of each item or an empty string if
69
69
  * there is no `text` property. If you did not provide `items`, do not override this function.
70
70
  */
71
- getTextValue: (item) => (item.text || ''),
71
+ getTextValue: (item) => (typeof item === 'string' ? item : item === undefined ? '' : item.text || ''),
72
72
  /**
73
73
  * Array of all ids which are currently disabled. This is used for navigation to skip over items
74
74
  * which are not focusable.
@@ -139,23 +139,6 @@ export declare const useCursorListModel: (<TT_Special_Generic>(config?: (Partial
139
139
  pageSize: number;
140
140
  id: string;
141
141
  getId: (item: any) => string;
142
- /**
143
- * Factory function that does type checking to create navigation managers. Navigation managers
144
- * are expected to handle all methods of a grid. If your use-case isn't meant to handle a grid,
145
- * pick one of the existing navigation managers and override the methods you wish to implement.
146
- *
147
- * For example,
148
- * ```tsx
149
- * import {createNavigationManager, wrappingNavigationManager} from '@workday/canvas-kit-react/collection'
150
- *
151
- * const navigationManager = createNavigationManager({
152
- * ...wrappingNavigationManager,
153
- * getNext(id, {state}) {
154
- * //
155
- * }
156
- * })
157
- * ```
158
- */
159
142
  getTextValue: (item: any) => string;
160
143
  nonInteractiveIds: string[];
161
144
  orientation: import("./useBaseListModel").Orientation;
@@ -1425,23 +1408,6 @@ export declare const useCursorListModel: (<TT_Special_Generic>(config?: (Partial
1425
1408
  pageSize: number;
1426
1409
  id: string;
1427
1410
  getId: (item: any) => string;
1428
- /**
1429
- * Factory function that does type checking to create navigation managers. Navigation managers
1430
- * are expected to handle all methods of a grid. If your use-case isn't meant to handle a grid,
1431
- * pick one of the existing navigation managers and override the methods you wish to implement.
1432
- *
1433
- * For example,
1434
- * ```tsx
1435
- * import {createNavigationManager, wrappingNavigationManager} from '@workday/canvas-kit-react/collection'
1436
- *
1437
- * const navigationManager = createNavigationManager({
1438
- * ...wrappingNavigationManager,
1439
- * getNext(id, {state}) {
1440
- * //
1441
- * }
1442
- * })
1443
- * ```
1444
- */
1445
1411
  getTextValue: (item: any) => string;
1446
1412
  nonInteractiveIds: string[];
1447
1413
  orientation: import("./useBaseListModel").Orientation;
@@ -1 +1 @@
1
- {"version":3,"file":"useCursorListModel.d.ts","sourceRoot":"","sources":["../../../../collection/lib/useCursorListModel.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAA0B,OAAO,EAAC,MAAM,kCAAkC,CAAC;AAElF,OAAO,EAAmB,IAAI,EAAC,MAAM,oBAAoB,CAAC;AAE1D,aAAK,eAAe,GAAG,IAAI,CAAC,UAAU,CAAC,OAAO,kBAAkB,CAAC,EAAE,OAAO,CAAC,CAAC;AAE5E;;;;GAIG;AACH,MAAM,WAAW,iBAAiB;IAChC;0CACsC;IACtC,QAAQ,EAAE,mBAAmB,CAAC;IAC9B;mCAC+B;IAC/B,OAAO,EAAE,mBAAmB,CAAC;IAC7B,0CAA0C;IAC1C,OAAO,EAAE,CAAC,EAAE,EAAE,MAAM,EAAE,KAAK,EAAE,eAAe,KAAK,IAAI,CAAC,OAAO,CAAC,CAAC;IAC/D;2FACuF;IACvF,OAAO,EAAE,mBAAmB,CAAC;IAC7B;uCACmC;IACnC,UAAU,EAAE,mBAAmB,CAAC;IAChC;+FAC2F;IAC3F,WAAW,EAAE,mBAAm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ElD,wDAAwD;;QAExD;;;;WAIG;;QAEH;;;WAGG;;QAEH;;;;;;WAMG;;8BArCyD,MAAM;;;;;;;;;;;;;;;;;;;QA2ClE,mEAAmE;mBACxD;YAAC,EAAE,EAAE,MAAM,CAAA;SAAC;QAIvB;;;;;WAKG;;QAKH;;;WAGG;;QAKH;;;;;WAKG;;QAOH;;;;;WAKG;;QAKH,mDAAmD;;QAKnD,kDAAkD;;;;;;;;;;;;;;;;;;;EA0BpD,CAAC"}
1
+ {"version":3,"file":"useCursorListModel.d.ts","sourceRoot":"","sources":["../../../../collection/lib/useCursorListModel.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAA0B,OAAO,EAAC,MAAM,kCAAkC,CAAC;AAElF,OAAO,EAAmB,IAAI,EAAC,MAAM,oBAAoB,CAAC;AAE1D,aAAK,eAAe,GAAG,IAAI,CAAC,UAAU,CAAC,OAAO,kBAAkB,CAAC,EAAE,OAAO,CAAC,CAAC;AAE5E;;;;GAIG;AACH,MAAM,WAAW,iBAAiB;IAChC;0CACsC;IACtC,QAAQ,EAAE,mBAAmB,CAAC;IAC9B;mCAC+B;IAC/B,OAAO,EAAE,mBAAmB,CAAC;IAC7B,0CAA0C;IAC1C,OAAO,EAAE,CAAC,EAAE,EAAE,MAAM,EAAE,KAAK,EAAE,eAAe,KAAK,IAAI,CAAC,OAAO,CAAC,CAAC;IAC/D;2FACuF;IACvF,OAAO,EAAE,mBAAmB,CAAC;IAC7B;uCACmC;IACnC,UAAU,EAAE,mBAAmB,CAAC;IAChC;+FAC2F;IAC3F,WAAW,EAAE,mBAAmB,CAAC;IACjC;0CACsC;IACtC,cAAc,EAAE,mBAAmB,CAAC;IACpC;kBACc;IACd,aAAa,EAAE,mBAAmB,CAAC;IACnC;kBACc;IACd,YAAY,EAAE,mBAAmB,CAAC;IAClC;;yEAEqE;IACrE,WAAW,EAAE,mBAAmB,CAAC;IACjC;;gFAE4E;IAC5E,eAA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;;;EA0BpD,CAAC"}
@@ -135,7 +135,7 @@ const getWrappingOffsetItem = (offset) => (index, { state }, tries = state.items
135
135
  nextIndex = nextIndex - idealLength;
136
136
  }
137
137
  }
138
- if (state.nonInteractiveIds.includes(items[nextIndex].id) && tries > 0) {
138
+ if (items.length > 1 && state.nonInteractiveIds.includes(items[nextIndex].id) && tries > 0) {
139
139
  // The next item is disabled, try again, but only if we haven't already tried everything.
140
140
  // Avoid an infinite loop with `tries`
141
141
  return exports.getWrappingOffsetItem(offset)(nextIndex, { state }, tries - 1);
@@ -0,0 +1,68 @@
1
+ /**
2
+ * This elemProps hook is used for cursor navigation by using [Active
3
+ * Descendant](https://www.w3.org/WAI/ARIA/apg/practices/keyboard-interface/#kbd_focus_activedescendant).
4
+ * `aria-activedescendant` tells assistive technology which element has "focus" within the component
5
+ * while this single element maintains focus.
6
+ *
7
+ * ```ts
8
+ * const useMyItem = composeHooks(
9
+ * useListActiveDescendant, // adds `aria-activedescendant` support
10
+ * useListItemRegister
11
+ * );
12
+ ```
13
+ */
14
+ export declare const useListActiveDescendant: import("@workday/canvas-kit-react/common").BehaviorHook<{
15
+ state: {
16
+ cursorId: string;
17
+ columnCount: number;
18
+ pageSizeRef: import("react").MutableRefObject<number>;
19
+ cursorIndexRef: {
20
+ readonly current: number;
21
+ };
22
+ UNSTABLE_virtual: {
23
+ virtualItems: import("./react-virtual").VirtualItem[];
24
+ totalSize: number;
25
+ scrollToOffset: (index: number, options?: import("./react-virtual").ScrollToOffsetOptions | undefined) => void;
26
+ scrollToIndex: (index: number, options?: import("./react-virtual").ScrollToIndexOptions | undefined) => void;
27
+ measure: () => void;
28
+ };
29
+ UNSTABLE_defaultItemHeight: number;
30
+ containerRef: import("react").RefObject<HTMLDivElement>;
31
+ id: string;
32
+ orientation: "horizontal" | "vertical";
33
+ indexRef: import("react").MutableRefObject<number>;
34
+ nonInteractiveIds: string[];
35
+ isVirtualized: boolean;
36
+ items: import("./useBaseListModel").Item<any>[];
37
+ };
38
+ events: {
39
+ goTo(data: {
40
+ id: string;
41
+ }): void;
42
+ goToNext(): void;
43
+ goToPrevious(): void;
44
+ goToPreviousRow(): void;
45
+ goToNextRow(): void;
46
+ goToFirst(): void;
47
+ goToLast(): void;
48
+ goToFirstOfRow(): void;
49
+ goToLastOfRow(): void;
50
+ goToNextPage(): void;
51
+ goToPreviousPage(): void;
52
+ registerItem(data: {
53
+ item: any;
54
+ textValue: string;
55
+ }): void;
56
+ unregisterItem(data: {
57
+ id: string;
58
+ }): void;
59
+ updateItemHeight(data: {
60
+ value: number;
61
+ }): void;
62
+ };
63
+ navigation: import("./useCursorListModel").NavigationManager;
64
+ getId: (item: any) => string;
65
+ }, {
66
+ 'aria-activedescendant': string | undefined;
67
+ }>;
68
+ //# sourceMappingURL=useListActiveDescendant.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useListActiveDescendant.d.ts","sourceRoot":"","sources":["../../../../collection/lib/useListActiveDescendant.ts"],"names":[],"mappings":"AAIA;;;;;;;;;;;;GAYG;AACH,eAAO,MAAM,uBAAuB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAMlC,CAAC"}
@@ -0,0 +1,25 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.useListActiveDescendant = void 0;
4
+ const common_1 = require("@workday/canvas-kit-react/common");
5
+ const useCursorListModel_1 = require("./useCursorListModel");
6
+ /**
7
+ * This elemProps hook is used for cursor navigation by using [Active
8
+ * Descendant](https://www.w3.org/WAI/ARIA/apg/practices/keyboard-interface/#kbd_focus_activedescendant).
9
+ * `aria-activedescendant` tells assistive technology which element has "focus" within the component
10
+ * while this single element maintains focus.
11
+ *
12
+ * ```ts
13
+ * const useMyItem = composeHooks(
14
+ * useListActiveDescendant, // adds `aria-activedescendant` support
15
+ * useListItemRegister
16
+ * );
17
+ ```
18
+ */
19
+ exports.useListActiveDescendant = common_1.createElemPropsHook(useCursorListModel_1.useCursorListModel)(model => {
20
+ return {
21
+ 'aria-activedescendant': model.state.cursorId
22
+ ? common_1.slugify(`${model.state.id}-${model.state.cursorId}`)
23
+ : undefined,
24
+ };
25
+ });
@@ -5,12 +5,13 @@
5
5
  * attribute if one hasn't been defined by the application.
6
6
  *
7
7
  * An example might look like:
8
+ *
8
9
  * ```tsx
9
10
  * const useMyListItem = composeHooks(
10
11
  * // any other hooks here
11
12
  * useListItemSelect,
12
13
  * useListItemRegister,
13
- * useListItemAllowChildStrings
14
+ * useListItemAllowChildStrings // always the last in the list
14
15
  * )
15
16
  *
16
17
  *
@@ -1 +1 @@
1
- {"version":3,"file":"useListItemAllowChildStrings.d.ts","sourceRoot":"","sources":["../../../../collection/lib/useListItemAllowChildStrings.ts"],"names":[],"mappings":"AAGA;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,eAAO,MAAM,4BAA4B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EASxC,CAAC"}
1
+ {"version":3,"file":"useListItemAllowChildStrings.d.ts","sourceRoot":"","sources":["../../../../collection/lib/useListItemAllowChildStrings.ts"],"names":[],"mappings":"AAGA;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,eAAO,MAAM,4BAA4B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EASxC,CAAC"}
@@ -10,12 +10,13 @@ const collection_1 = require("@workday/canvas-kit-react/collection");
10
10
  * attribute if one hasn't been defined by the application.
11
11
  *
12
12
  * An example might look like:
13
+ *
13
14
  * ```tsx
14
15
  * const useMyListItem = composeHooks(
15
16
  * // any other hooks here
16
17
  * useListItemSelect,
17
18
  * useListItemRegister,
18
- * useListItemAllowChildStrings
19
+ * useListItemAllowChildStrings // always the last in the list
19
20
  * )
20
21
  *
21
22
  *
@@ -1 +1 @@
1
- {"version":3,"file":"useListItemRegister.d.ts","sourceRoot":"","sources":["../../../../collection/lib/useListItemRegister.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAsB,MAAM,OAAO,CAAC;AAU3C,OAAO,EAAC,IAAI,EAAC,MAAM,oBAAoB,CAAC;AACxC,OAAO,EAAC,WAAW,EAAC,MAAM,iBAAiB,CAAC;AAG5C;;;;;;;;;;;;GAYG;AACH,eAAO,MAAM,mBAAmB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAoE/B,CAAC"}
1
+ {"version":3,"file":"useListItemRegister.d.ts","sourceRoot":"","sources":["../../../../collection/lib/useListItemRegister.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAsB,MAAM,OAAO,CAAC;AAU3C,OAAO,EAAC,IAAI,EAAC,MAAM,oBAAoB,CAAC;AACxC,OAAO,EAAC,WAAW,EAAC,MAAM,iBAAiB,CAAC;AAG5C;;;;;;;;;;;;GAYG;AACH,eAAO,MAAM,mBAAmB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA2E/B,CAAC"}