@redsift/design-system 11.5.0 → 11.6.0-muiv5-alpha.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 (710) hide show
  1. package/_virtual/_rollupPluginBabelHelpers.js +133 -0
  2. package/_virtual/_rollupPluginBabelHelpers.js.map +1 -0
  3. package/_virtual/jsx-runtime.js +4 -0
  4. package/_virtual/jsx-runtime.js.map +1 -0
  5. package/_virtual/react-jsx-runtime.development.js +4 -0
  6. package/_virtual/react-jsx-runtime.development.js.map +1 -0
  7. package/_virtual/react-jsx-runtime.production.min.js +4 -0
  8. package/_virtual/react-jsx-runtime.production.min.js.map +1 -0
  9. package/components/alert/Alert.d.ts +9 -0
  10. package/components/alert/Alert.js +117 -0
  11. package/components/alert/Alert.js.map +1 -0
  12. package/components/alert/intl/en-US.json.js +7 -0
  13. package/components/alert/intl/en-US.json.js.map +1 -0
  14. package/components/alert/intl/fr-FR.json.js +7 -0
  15. package/components/alert/intl/fr-FR.json.js.map +1 -0
  16. package/components/alert/intl/index.js +10 -0
  17. package/components/alert/intl/index.js.map +1 -0
  18. package/components/alert/styles.js +54 -0
  19. package/components/alert/styles.js.map +1 -0
  20. package/components/alert/types.d.ts +49 -0
  21. package/components/alert/types.js +20 -0
  22. package/components/alert/types.js.map +1 -0
  23. package/components/app-bar/AppBar.d.ts +9 -0
  24. package/components/app-bar/AppBar.js +95 -0
  25. package/components/app-bar/AppBar.js.map +1 -0
  26. package/components/app-bar/intl/en-US.json.js +9 -0
  27. package/components/app-bar/intl/en-US.json.js.map +1 -0
  28. package/components/app-bar/intl/fr-FR.json.js +9 -0
  29. package/components/app-bar/intl/fr-FR.json.js.map +1 -0
  30. package/components/app-bar/intl/index.js +10 -0
  31. package/components/app-bar/intl/index.js.map +1 -0
  32. package/components/app-bar/styles.js +139 -0
  33. package/components/app-bar/styles.js.map +1 -0
  34. package/components/app-bar/types.d.ts +31 -0
  35. package/components/app-container/AppContainer.d.ts +11 -0
  36. package/components/app-container/AppContainer.js +117 -0
  37. package/components/app-container/AppContainer.js.map +1 -0
  38. package/components/app-container/context.d.ts +6 -0
  39. package/components/app-container/context.js +6 -0
  40. package/components/app-container/context.js.map +1 -0
  41. package/components/app-container/styles.js +30 -0
  42. package/components/app-container/styles.js.map +1 -0
  43. package/components/app-container/types.d.ts +51 -0
  44. package/components/app-content/AppContent.d.ts +9 -0
  45. package/components/app-content/AppContent.js +42 -0
  46. package/components/app-content/AppContent.js.map +1 -0
  47. package/components/app-content/styles.js +54 -0
  48. package/components/app-content/styles.js.map +1 -0
  49. package/components/app-content/types.d.ts +19 -0
  50. package/components/app-side-panel/AppSidePanel.d.ts +9 -0
  51. package/components/app-side-panel/AppSidePanel.js +86 -0
  52. package/components/app-side-panel/AppSidePanel.js.map +1 -0
  53. package/components/app-side-panel/intl/en-US.json.js +9 -0
  54. package/components/app-side-panel/intl/en-US.json.js.map +1 -0
  55. package/components/app-side-panel/intl/fr-FR.json.js +9 -0
  56. package/components/app-side-panel/intl/fr-FR.json.js.map +1 -0
  57. package/components/app-side-panel/intl/index.js +10 -0
  58. package/components/app-side-panel/intl/index.js.map +1 -0
  59. package/components/app-side-panel/styles.js +183 -0
  60. package/components/app-side-panel/styles.js.map +1 -0
  61. package/components/app-side-panel/types.d.ts +39 -0
  62. package/components/app-side-panel/types.js +15 -0
  63. package/components/app-side-panel/types.js.map +1 -0
  64. package/components/app-side-panel/useAppSidePanel.d.ts +6 -0
  65. package/components/app-side-panel/useAppSidePanel.js +23 -0
  66. package/components/app-side-panel/useAppSidePanel.js.map +1 -0
  67. package/components/badge/Badge.d.ts +9 -0
  68. package/components/badge/Badge.js +44 -0
  69. package/components/badge/Badge.js.map +1 -0
  70. package/components/badge/styles.js +93 -0
  71. package/components/badge/styles.js.map +1 -0
  72. package/components/badge/types.d.ts +37 -0
  73. package/components/badge/types.js +14 -0
  74. package/components/badge/types.js.map +1 -0
  75. package/components/breadcrumb-item/BreadcrumbItem.d.ts +9 -0
  76. package/components/breadcrumb-item/BreadcrumbItem.js +47 -0
  77. package/components/breadcrumb-item/BreadcrumbItem.js.map +1 -0
  78. package/components/breadcrumb-item/styles.js +48 -0
  79. package/components/breadcrumb-item/styles.js.map +1 -0
  80. package/components/breadcrumb-item/types.d.ts +23 -0
  81. package/components/breadcrumbs/Breadcrumbs.d.ts +13 -0
  82. package/components/breadcrumbs/Breadcrumbs.js +61 -0
  83. package/components/breadcrumbs/Breadcrumbs.js.map +1 -0
  84. package/components/breadcrumbs/styles.js +38 -0
  85. package/components/breadcrumbs/styles.js.map +1 -0
  86. package/components/breadcrumbs/types.d.ts +19 -0
  87. package/components/button/Button.d.ts +13 -0
  88. package/components/button/Button.js +92 -0
  89. package/components/button/Button.js.map +1 -0
  90. package/components/button/styles.d.ts +20 -0
  91. package/components/button/styles.js +219 -0
  92. package/components/button/styles.js.map +1 -0
  93. package/components/button/types.d.ts +67 -0
  94. package/components/button/types.js +19 -0
  95. package/components/button/types.js.map +1 -0
  96. package/components/button-group/ButtonGroup.d.ts +9 -0
  97. package/components/button-group/ButtonGroup.js +67 -0
  98. package/components/button-group/ButtonGroup.js.map +1 -0
  99. package/components/button-group/styles.js +103 -0
  100. package/components/button-group/styles.js.map +1 -0
  101. package/components/button-group/types.d.ts +36 -0
  102. package/components/button-group/types.js +19 -0
  103. package/components/button-group/types.js.map +1 -0
  104. package/components/button-link/ButtonLink.d.ts +13 -0
  105. package/components/button-link/ButtonLink.js +85 -0
  106. package/components/button-link/ButtonLink.js.map +1 -0
  107. package/components/button-link/types.d.ts +18 -0
  108. package/components/card/Card.d.ts +13 -0
  109. package/components/card/Card.js +81 -0
  110. package/components/card/Card.js.map +1 -0
  111. package/components/card/intl/en-US.json.js +9 -0
  112. package/components/card/intl/en-US.json.js.map +1 -0
  113. package/components/card/intl/fr-FR.json.js +9 -0
  114. package/components/card/intl/fr-FR.json.js.map +1 -0
  115. package/components/card/intl/index.js +10 -0
  116. package/components/card/intl/index.js.map +1 -0
  117. package/components/card/styles.js +63 -0
  118. package/components/card/styles.js.map +1 -0
  119. package/components/card/types.d.ts +25 -0
  120. package/components/card-actions/CardActions.d.ts +9 -0
  121. package/components/card-actions/CardActions.js +33 -0
  122. package/components/card-actions/CardActions.js.map +1 -0
  123. package/components/card-actions/styles.js +15 -0
  124. package/components/card-actions/styles.js.map +1 -0
  125. package/components/card-actions/types.d.ts +11 -0
  126. package/components/card-body/CardBody.d.ts +9 -0
  127. package/components/card-body/CardBody.js +28 -0
  128. package/components/card-body/CardBody.js.map +1 -0
  129. package/components/card-body/styles.js +18 -0
  130. package/components/card-body/styles.js.map +1 -0
  131. package/components/card-body/types.d.ts +11 -0
  132. package/components/card-header/CardHeader.d.ts +9 -0
  133. package/components/card-header/CardHeader.js +56 -0
  134. package/components/card-header/CardHeader.js.map +1 -0
  135. package/components/card-header/styles.js +31 -0
  136. package/components/card-header/styles.js.map +1 -0
  137. package/components/card-header/types.d.ts +28 -0
  138. package/components/checkbox/Checkbox.d.ts +11 -0
  139. package/components/checkbox/Checkbox.js +135 -0
  140. package/components/checkbox/Checkbox.js.map +1 -0
  141. package/components/checkbox/styles.js +113 -0
  142. package/components/checkbox/styles.js.map +1 -0
  143. package/components/checkbox/types.d.ts +60 -0
  144. package/components/checkbox-group/CheckboxGroup.d.ts +10 -0
  145. package/components/checkbox-group/CheckboxGroup.js +101 -0
  146. package/components/checkbox-group/CheckboxGroup.js.map +1 -0
  147. package/components/checkbox-group/context.js +6 -0
  148. package/components/checkbox-group/context.js.map +1 -0
  149. package/components/checkbox-group/styles.js +78 -0
  150. package/components/checkbox-group/styles.js.map +1 -0
  151. package/components/checkbox-group/types.d.ts +72 -0
  152. package/components/checkbox-group/types.js +18 -0
  153. package/components/checkbox-group/types.js.map +1 -0
  154. package/components/conditional-wrapper/ConditionalWrapper.d.ts +6 -0
  155. package/components/conditional-wrapper/ConditionalWrapper.js +13 -0
  156. package/components/conditional-wrapper/ConditionalWrapper.js.map +1 -0
  157. package/components/conditional-wrapper/types.d.ts +10 -0
  158. package/components/detailed-card/DetailedCard.d.ts +15 -0
  159. package/components/detailed-card/DetailedCard.js +170 -0
  160. package/components/detailed-card/DetailedCard.js.map +1 -0
  161. package/components/detailed-card/intl/en-US.json.js +7 -0
  162. package/components/detailed-card/intl/en-US.json.js.map +1 -0
  163. package/components/detailed-card/intl/fr-FR.json.js +7 -0
  164. package/components/detailed-card/intl/fr-FR.json.js.map +1 -0
  165. package/components/detailed-card/intl/index.js +10 -0
  166. package/components/detailed-card/intl/index.js.map +1 -0
  167. package/components/detailed-card/styles.js +49 -0
  168. package/components/detailed-card/styles.js.map +1 -0
  169. package/components/detailed-card/types.d.ts +40 -0
  170. package/components/detailed-card-collapsible-section-items/DetailedCardCollapsibleSectionItems.d.ts +9 -0
  171. package/components/detailed-card-collapsible-section-items/DetailedCardCollapsibleSectionItems.js +33 -0
  172. package/components/detailed-card-collapsible-section-items/DetailedCardCollapsibleSectionItems.js.map +1 -0
  173. package/components/detailed-card-collapsible-section-items/styles.js +35 -0
  174. package/components/detailed-card-collapsible-section-items/styles.js.map +1 -0
  175. package/components/detailed-card-collapsible-section-items/types.d.ts +16 -0
  176. package/components/detailed-card-header/DetailedCardHeader.d.ts +9 -0
  177. package/components/detailed-card-header/DetailedCardHeader.js +45 -0
  178. package/components/detailed-card-header/DetailedCardHeader.js.map +1 -0
  179. package/components/detailed-card-header/styles.js +26 -0
  180. package/components/detailed-card-header/styles.js.map +1 -0
  181. package/components/detailed-card-header/types.d.ts +20 -0
  182. package/components/detailed-card-section/DetailedCardSection.d.ts +9 -0
  183. package/components/detailed-card-section/DetailedCardSection.js +90 -0
  184. package/components/detailed-card-section/DetailedCardSection.js.map +1 -0
  185. package/components/detailed-card-section/intl/en-US.json.js +9 -0
  186. package/components/detailed-card-section/intl/en-US.json.js.map +1 -0
  187. package/components/detailed-card-section/intl/fr-FR.json.js +9 -0
  188. package/components/detailed-card-section/intl/fr-FR.json.js.map +1 -0
  189. package/components/detailed-card-section/intl/index.js +10 -0
  190. package/components/detailed-card-section/intl/index.js.map +1 -0
  191. package/components/detailed-card-section/styles.js +69 -0
  192. package/components/detailed-card-section/styles.js.map +1 -0
  193. package/components/detailed-card-section/types.d.ts +27 -0
  194. package/components/detailed-card-section-item/DetailedCardSectionItem.d.ts +9 -0
  195. package/components/detailed-card-section-item/DetailedCardSectionItem.js +64 -0
  196. package/components/detailed-card-section-item/DetailedCardSectionItem.js.map +1 -0
  197. package/components/detailed-card-section-item/styles.js +34 -0
  198. package/components/detailed-card-section-item/styles.js.map +1 -0
  199. package/components/detailed-card-section-item/types.d.ts +35 -0
  200. package/components/flexbox/Flexbox.d.ts +9 -0
  201. package/components/flexbox/Flexbox.js +44 -0
  202. package/components/flexbox/Flexbox.js.map +1 -0
  203. package/components/flexbox/styles.js +54 -0
  204. package/components/flexbox/styles.js.map +1 -0
  205. package/components/flexbox/types.d.ts +24 -0
  206. package/components/focus-within-group/FocusWithinGroup.d.ts +41 -0
  207. package/components/focus-within-group/FocusWithinGroup.js +91 -0
  208. package/components/focus-within-group/FocusWithinGroup.js.map +1 -0
  209. package/components/focus-within-group/context.d.ts +7 -0
  210. package/components/focus-within-group/context.js +21 -0
  211. package/components/focus-within-group/context.js.map +1 -0
  212. package/components/focus-within-group/reducer.d.ts +5 -0
  213. package/components/focus-within-group/reducer.js +419 -0
  214. package/components/focus-within-group/reducer.js.map +1 -0
  215. package/components/focus-within-group/types.d.ts +143 -0
  216. package/components/focus-within-group/types.js +42 -0
  217. package/components/focus-within-group/types.js.map +1 -0
  218. package/components/focus-within-group/useFocusOnList.d.ts +5 -0
  219. package/components/focus-within-group/useFocusOnList.js +44 -0
  220. package/components/focus-within-group/useFocusOnList.js.map +1 -0
  221. package/components/focus-within-group/useFocusOnListItem.d.ts +39 -0
  222. package/components/focus-within-group/useFocusOnListItem.js +148 -0
  223. package/components/focus-within-group/useFocusOnListItem.js.map +1 -0
  224. package/components/gradient-border/index.d.ts +14 -0
  225. package/components/gradient-border/index.js +38 -0
  226. package/components/gradient-border/index.js.map +1 -0
  227. package/components/grid/Grid.d.ts +13 -0
  228. package/components/grid/Grid.js +45 -0
  229. package/components/grid/Grid.js.map +1 -0
  230. package/components/grid/styles.js +55 -0
  231. package/components/grid/styles.js.map +1 -0
  232. package/components/grid/types.d.ts +22 -0
  233. package/components/grid-item/GridItem.d.ts +9 -0
  234. package/components/grid-item/GridItem.js +28 -0
  235. package/components/grid-item/GridItem.js.map +1 -0
  236. package/components/grid-item/styles.js +16 -0
  237. package/components/grid-item/styles.js.map +1 -0
  238. package/components/grid-item/types.d.ts +11 -0
  239. package/components/heading/Heading.d.ts +9 -0
  240. package/components/heading/Heading.js +50 -0
  241. package/components/heading/Heading.js.map +1 -0
  242. package/components/heading/styles.js +67 -0
  243. package/components/heading/styles.js.map +1 -0
  244. package/components/heading/types.d.ts +62 -0
  245. package/components/heading/types.js +26 -0
  246. package/components/heading/types.js.map +1 -0
  247. package/components/icon/Icon.d.ts +10 -0
  248. package/components/icon/Icon.js +116 -0
  249. package/components/icon/Icon.js.map +1 -0
  250. package/components/icon/styles.js +84 -0
  251. package/components/icon/styles.js.map +1 -0
  252. package/components/icon/types.d.ts +57 -0
  253. package/components/icon/types.js +18 -0
  254. package/components/icon/types.js.map +1 -0
  255. package/components/icon-button/IconButton.d.ts +12 -0
  256. package/components/icon-button/IconButton.js +81 -0
  257. package/components/icon-button/IconButton.js.map +1 -0
  258. package/components/icon-button/styles.js +31 -0
  259. package/components/icon-button/styles.js.map +1 -0
  260. package/components/icon-button/types.d.ts +56 -0
  261. package/components/icon-button/types.js +19 -0
  262. package/components/icon-button/types.js.map +1 -0
  263. package/components/icon-button-link/IconButtonLink.d.ts +13 -0
  264. package/components/icon-button-link/IconButtonLink.js +76 -0
  265. package/components/icon-button-link/IconButtonLink.js.map +1 -0
  266. package/components/icon-button-link/types.d.ts +18 -0
  267. package/components/item/Item.d.ts +10 -0
  268. package/components/item/Item.js +225 -0
  269. package/components/item/Item.js.map +1 -0
  270. package/components/item/styles.d.ts +20 -0
  271. package/components/item/styles.js +129 -0
  272. package/components/item/styles.js.map +1 -0
  273. package/components/item/types.d.ts +59 -0
  274. package/components/item/useMenuItem.js +55 -0
  275. package/components/item/useMenuItem.js.map +1 -0
  276. package/components/link/Link.d.ts +14 -0
  277. package/components/link/Link.js +67 -0
  278. package/components/link/Link.js.map +1 -0
  279. package/components/link/styles.d.ts +15 -0
  280. package/components/link/styles.js +145 -0
  281. package/components/link/styles.js.map +1 -0
  282. package/components/link/types.d.ts +40 -0
  283. package/components/link-button/LinkButton.d.ts +13 -0
  284. package/components/link-button/LinkButton.js +66 -0
  285. package/components/link-button/LinkButton.js.map +1 -0
  286. package/components/link-button/types.d.ts +13 -0
  287. package/components/listbox/ActiveDescendantListbox.d.ts +8 -0
  288. package/components/listbox/ActiveDescendantListbox.js +74 -0
  289. package/components/listbox/ActiveDescendantListbox.js.map +1 -0
  290. package/components/listbox/Listbox.d.ts +10 -0
  291. package/components/listbox/Listbox.js +110 -0
  292. package/components/listbox/Listbox.js.map +1 -0
  293. package/components/listbox/RovingTabindexListbox.d.ts +8 -0
  294. package/components/listbox/RovingTabindexListbox.js +30 -0
  295. package/components/listbox/RovingTabindexListbox.js.map +1 -0
  296. package/components/listbox/context.d.ts +7 -0
  297. package/components/listbox/context.js +15 -0
  298. package/components/listbox/context.js.map +1 -0
  299. package/components/listbox/reducer.d.ts +5 -0
  300. package/components/listbox/reducer.js +45 -0
  301. package/components/listbox/reducer.js.map +1 -0
  302. package/components/listbox/styles.js +44 -0
  303. package/components/listbox/styles.js.map +1 -0
  304. package/components/listbox/types.d.ts +101 -0
  305. package/components/listbox/types.js +32 -0
  306. package/components/listbox/types.js.map +1 -0
  307. package/components/listbox/useListboxItem.d.ts +12 -0
  308. package/components/listbox/useListboxItem.js +90 -0
  309. package/components/listbox/useListboxItem.js.map +1 -0
  310. package/components/number/Number.d.ts +9 -0
  311. package/components/number/Number.js +105 -0
  312. package/components/number/Number.js.map +1 -0
  313. package/components/number/styles.js +10 -0
  314. package/components/number/styles.js.map +1 -0
  315. package/components/number/types.d.ts +63 -0
  316. package/components/number-field/NumberField.d.ts +10 -0
  317. package/components/number-field/NumberField.js +216 -0
  318. package/components/number-field/NumberField.js.map +1 -0
  319. package/components/number-field/styles.js +240 -0
  320. package/components/number-field/styles.js.map +1 -0
  321. package/components/number-field/types.d.ts +74 -0
  322. package/components/number-field/types.js +14 -0
  323. package/components/number-field/types.js.map +1 -0
  324. package/components/pill/Pill.d.ts +9 -0
  325. package/components/pill/Pill.js +93 -0
  326. package/components/pill/Pill.js.map +1 -0
  327. package/components/pill/styles.js +305 -0
  328. package/components/pill/styles.js.map +1 -0
  329. package/components/pill/types.d.ts +47 -0
  330. package/components/pill/types.js +15 -0
  331. package/components/pill/types.js.map +1 -0
  332. package/components/progress-bar/ProgressBar.d.ts +9 -0
  333. package/components/progress-bar/ProgressBar.js +35 -0
  334. package/components/progress-bar/ProgressBar.js.map +1 -0
  335. package/components/progress-bar/styles.js +38 -0
  336. package/components/progress-bar/styles.js.map +1 -0
  337. package/components/progress-bar/types.d.ts +20 -0
  338. package/components/radio/Radio.d.ts +11 -0
  339. package/components/radio/Radio.js +128 -0
  340. package/components/radio/Radio.js.map +1 -0
  341. package/components/radio/styles.js +113 -0
  342. package/components/radio/styles.js.map +1 -0
  343. package/components/radio/types.d.ts +58 -0
  344. package/components/radio-group/RadioGroup.d.ts +10 -0
  345. package/components/radio-group/RadioGroup.js +89 -0
  346. package/components/radio-group/RadioGroup.js.map +1 -0
  347. package/components/radio-group/context.js +6 -0
  348. package/components/radio-group/context.js.map +1 -0
  349. package/components/radio-group/styles.js +78 -0
  350. package/components/radio-group/styles.js.map +1 -0
  351. package/components/radio-group/types.d.ts +68 -0
  352. package/components/radio-group/types.js +18 -0
  353. package/components/radio-group/types.js.map +1 -0
  354. package/components/shared/styles.d.ts +17 -0
  355. package/components/shared/styles.js +250 -0
  356. package/components/shared/styles.js.map +1 -0
  357. package/components/shield/Shield.d.ts +9 -0
  358. package/components/shield/Shield.js +136 -0
  359. package/components/shield/Shield.js.map +1 -0
  360. package/components/shield/styles.js +71 -0
  361. package/components/shield/styles.js.map +1 -0
  362. package/components/shield/types.d.ts +52 -0
  363. package/components/shield/types.js +25 -0
  364. package/components/shield/types.js.map +1 -0
  365. package/components/side-navigation-menu/SideNavigationMenu.d.ts +9 -0
  366. package/components/side-navigation-menu/SideNavigationMenu.js +367 -0
  367. package/components/side-navigation-menu/SideNavigationMenu.js.map +1 -0
  368. package/components/side-navigation-menu/context.js +6 -0
  369. package/components/side-navigation-menu/context.js.map +1 -0
  370. package/components/side-navigation-menu/reducer.js +26 -0
  371. package/components/side-navigation-menu/reducer.js.map +1 -0
  372. package/components/side-navigation-menu/styles.js +196 -0
  373. package/components/side-navigation-menu/styles.js.map +1 -0
  374. package/components/side-navigation-menu/types.d.ts +72 -0
  375. package/components/side-navigation-menu/types.js +21 -0
  376. package/components/side-navigation-menu/types.js.map +1 -0
  377. package/components/side-navigation-menu-bar/SideNavigationMenuBar.d.ts +9 -0
  378. package/components/side-navigation-menu-bar/SideNavigationMenuBar.js +217 -0
  379. package/components/side-navigation-menu-bar/SideNavigationMenuBar.js.map +1 -0
  380. package/components/side-navigation-menu-bar/context.js +6 -0
  381. package/components/side-navigation-menu-bar/context.js.map +1 -0
  382. package/components/side-navigation-menu-bar/styles.js +89 -0
  383. package/components/side-navigation-menu-bar/styles.js.map +1 -0
  384. package/components/side-navigation-menu-bar/types.d.ts +65 -0
  385. package/components/side-navigation-menu-bar/types.js +22 -0
  386. package/components/side-navigation-menu-bar/types.js.map +1 -0
  387. package/components/side-navigation-menu-bar/useSideNavigationMenuBar.d.ts +9 -0
  388. package/components/side-navigation-menu-bar/useSideNavigationMenuBar.js +70 -0
  389. package/components/side-navigation-menu-bar/useSideNavigationMenuBar.js.map +1 -0
  390. package/components/side-navigation-menu-item/SideNavigationMenuItem.d.ts +9 -0
  391. package/components/side-navigation-menu-item/SideNavigationMenuItem.js +115 -0
  392. package/components/side-navigation-menu-item/SideNavigationMenuItem.js.map +1 -0
  393. package/components/side-navigation-menu-item/styles.js +174 -0
  394. package/components/side-navigation-menu-item/styles.js.map +1 -0
  395. package/components/side-navigation-menu-item/types.d.ts +51 -0
  396. package/components/skeleton/Skeleton.d.ts +15 -0
  397. package/components/skeleton/Skeleton.js +42 -0
  398. package/components/skeleton/Skeleton.js.map +1 -0
  399. package/components/skeleton/styles.js +84 -0
  400. package/components/skeleton/styles.js.map +1 -0
  401. package/components/skeleton/types.d.ts +18 -0
  402. package/components/skeleton-circle/SkeletonCircle.d.ts +9 -0
  403. package/components/skeleton-circle/SkeletonCircle.js +36 -0
  404. package/components/skeleton-circle/SkeletonCircle.js.map +1 -0
  405. package/components/skeleton-circle/styles.js +26 -0
  406. package/components/skeleton-circle/styles.js.map +1 -0
  407. package/components/skeleton-circle/types.d.ts +12 -0
  408. package/components/skeleton-text/SkeletonText.d.ts +9 -0
  409. package/components/skeleton-text/SkeletonText.js +42 -0
  410. package/components/skeleton-text/SkeletonText.js.map +1 -0
  411. package/components/skeleton-text/styles.js +39 -0
  412. package/components/skeleton-text/styles.js.map +1 -0
  413. package/components/skeleton-text/types.d.ts +36 -0
  414. package/components/skeleton-text/types.js +20 -0
  415. package/components/skeleton-text/types.js.map +1 -0
  416. package/components/spinner/Spinner.d.ts +9 -0
  417. package/components/spinner/Spinner.js +82 -0
  418. package/components/spinner/Spinner.js.map +1 -0
  419. package/components/spinner/images/spinner-grey-l1.svg.js +4 -0
  420. package/components/spinner/images/spinner-grey-l1.svg.js.map +1 -0
  421. package/components/spinner/images/spinner-grey-l2.svg.js +4 -0
  422. package/components/spinner/images/spinner-grey-l2.svg.js.map +1 -0
  423. package/components/spinner/images/spinner-grey-l3.svg.js +4 -0
  424. package/components/spinner/images/spinner-grey-l3.svg.js.map +1 -0
  425. package/components/spinner/images/spinner-primary-n.svg.js +4 -0
  426. package/components/spinner/images/spinner-primary-n.svg.js.map +1 -0
  427. package/components/spinner/intl/en-US.json.js +7 -0
  428. package/components/spinner/intl/en-US.json.js.map +1 -0
  429. package/components/spinner/intl/fr-FR.json.js +7 -0
  430. package/components/spinner/intl/fr-FR.json.js.map +1 -0
  431. package/components/spinner/intl/index.js +10 -0
  432. package/components/spinner/intl/index.js.map +1 -0
  433. package/components/spinner/styles.js +13 -0
  434. package/components/spinner/styles.js.map +1 -0
  435. package/components/spinner/types.d.ts +38 -0
  436. package/components/spinner/types.js +16 -0
  437. package/components/spinner/types.js.map +1 -0
  438. package/components/switch/Switch.d.ts +11 -0
  439. package/components/switch/Switch.js +137 -0
  440. package/components/switch/Switch.js.map +1 -0
  441. package/components/switch/styles.js +187 -0
  442. package/components/switch/styles.js.map +1 -0
  443. package/components/switch/types.d.ts +58 -0
  444. package/components/switch-group/SwitchGroup.d.ts +10 -0
  445. package/components/switch-group/SwitchGroup.js +101 -0
  446. package/components/switch-group/SwitchGroup.js.map +1 -0
  447. package/components/switch-group/context.js +6 -0
  448. package/components/switch-group/context.js.map +1 -0
  449. package/components/switch-group/styles.js +78 -0
  450. package/components/switch-group/styles.js.map +1 -0
  451. package/components/switch-group/types.d.ts +72 -0
  452. package/components/switch-group/types.js +18 -0
  453. package/components/switch-group/types.js.map +1 -0
  454. package/components/text/Text.d.ts +9 -0
  455. package/components/text/Text.js +51 -0
  456. package/components/text/Text.js.map +1 -0
  457. package/components/text/styles.js +112 -0
  458. package/components/text/styles.js.map +1 -0
  459. package/components/text/types.d.ts +73 -0
  460. package/components/text/types.js +34 -0
  461. package/components/text/types.js.map +1 -0
  462. package/components/text-area/TextArea.d.ts +10 -0
  463. package/components/text-area/TextArea.js +165 -0
  464. package/components/text-area/TextArea.js.map +1 -0
  465. package/components/text-area/styles.js +240 -0
  466. package/components/text-area/styles.js.map +1 -0
  467. package/components/text-area/types.d.ts +28 -0
  468. package/components/text-area/types.js +14 -0
  469. package/components/text-area/types.js.map +1 -0
  470. package/components/text-field/TextField.d.ts +10 -0
  471. package/components/text-field/TextField.js +197 -0
  472. package/components/text-field/TextField.js.map +1 -0
  473. package/components/text-field/intl/en-US.json.js +8 -0
  474. package/components/text-field/intl/en-US.json.js.map +1 -0
  475. package/components/text-field/intl/fr-FR.json.js +8 -0
  476. package/components/text-field/intl/fr-FR.json.js.map +1 -0
  477. package/components/text-field/intl/index.js +10 -0
  478. package/components/text-field/intl/index.js.map +1 -0
  479. package/components/text-field/styles.d.ts +22 -0
  480. package/components/text-field/styles.js +252 -0
  481. package/components/text-field/styles.js.map +1 -0
  482. package/components/text-field/types.d.ts +99 -0
  483. package/components/text-field/types.js +18 -0
  484. package/components/text-field/types.js.map +1 -0
  485. package/components/theme/context.d.ts +11 -0
  486. package/components/theme/context.js +7 -0
  487. package/components/theme/context.js.map +1 -0
  488. package/components/theme/useTheme.d.ts +5 -0
  489. package/components/theme/useTheme.js +13 -0
  490. package/components/theme/useTheme.js.map +1 -0
  491. package/hooks/useBoundingRect.d.ts +8 -0
  492. package/hooks/useBoundingRect.js +17 -0
  493. package/hooks/useBoundingRect.js.map +1 -0
  494. package/hooks/useComputeNumberOfRows.d.ts +15 -0
  495. package/hooks/useComputeNumberOfRows.js +40 -0
  496. package/hooks/useComputeNumberOfRows.js.map +1 -0
  497. package/hooks/useIsLoaded.d.ts +5 -0
  498. package/hooks/useIsLoaded.js +14 -0
  499. package/hooks/useIsLoaded.js.map +1 -0
  500. package/hooks/useWindowSize.d.ts +8 -0
  501. package/hooks/useWindowSize.js +42 -0
  502. package/hooks/useWindowSize.js.map +1 -0
  503. package/index.d.ts +157 -4667
  504. package/index.js +121 -24514
  505. package/index.js.map +1 -1
  506. package/package.json +11 -3
  507. package/packages/popovers/src/components/tooltip/Tooltip.js +62 -0
  508. package/packages/popovers/src/components/tooltip/Tooltip.js.map +1 -0
  509. package/packages/popovers/src/components/tooltip/context.js +6 -0
  510. package/packages/popovers/src/components/tooltip/context.js.map +1 -0
  511. package/packages/popovers/src/components/tooltip/types.js +28 -0
  512. package/packages/popovers/src/components/tooltip/types.js.map +1 -0
  513. package/packages/popovers/src/components/tooltip/useTooltip.js +78 -0
  514. package/packages/popovers/src/components/tooltip/useTooltip.js.map +1 -0
  515. package/packages/popovers/src/components/tooltip/useTooltipContext.js +13 -0
  516. package/packages/popovers/src/components/tooltip/useTooltipContext.js.map +1 -0
  517. package/packages/popovers/src/components/tooltip-content/TooltipContent.js +80 -0
  518. package/packages/popovers/src/components/tooltip-content/TooltipContent.js.map +1 -0
  519. package/packages/popovers/src/components/tooltip-content/styles.js +128 -0
  520. package/packages/popovers/src/components/tooltip-content/styles.js.map +1 -0
  521. package/packages/popovers/src/components/tooltip-trigger/TooltipTrigger.js +47 -0
  522. package/packages/popovers/src/components/tooltip-trigger/TooltipTrigger.js.map +1 -0
  523. package/react-aria/internationalized/date/DateFormatter.d.ts +25 -0
  524. package/react-aria/internationalized/date/DateFormatter.js +187 -0
  525. package/react-aria/internationalized/date/DateFormatter.js.map +1 -0
  526. package/react-aria/internationalized/message/MessageDictionary.d.ts +7 -0
  527. package/react-aria/internationalized/message/MessageDictionary.js +82 -0
  528. package/react-aria/internationalized/message/MessageDictionary.js.map +1 -0
  529. package/react-aria/internationalized/message/MessageFormatter.js +38 -0
  530. package/react-aria/internationalized/message/MessageFormatter.js.map +1 -0
  531. package/react-aria/internationalized/number/NumberFormatter.d.ts +6 -0
  532. package/react-aria/internationalized/number/NumberFormatter.js +222 -0
  533. package/react-aria/internationalized/number/NumberFormatter.js.map +1 -0
  534. package/react-aria/internationalized/number/NumberParser.js +288 -0
  535. package/react-aria/internationalized/number/NumberParser.js.map +1 -0
  536. package/react-aria/internationalized/string/LocalizedStringDictionary.d.ts +21 -0
  537. package/react-aria/internationalized/string/LocalizedStringDictionary.js +118 -0
  538. package/react-aria/internationalized/string/LocalizedStringDictionary.js.map +1 -0
  539. package/react-aria/internationalized/string/LocalizedStringFormatter.d.ts +21 -0
  540. package/react-aria/internationalized/string/LocalizedStringFormatter.js +70 -0
  541. package/react-aria/internationalized/string/LocalizedStringFormatter.js.map +1 -0
  542. package/react-aria/react-aria/button/useButton.js +95 -0
  543. package/react-aria/react-aria/button/useButton.js.map +1 -0
  544. package/react-aria/react-aria/focus/focusSafely.js +33 -0
  545. package/react-aria/react-aria/focus/focusSafely.js.map +1 -0
  546. package/react-aria/react-aria/focus/useFocusRing.js +57 -0
  547. package/react-aria/react-aria/focus/useFocusRing.js.map +1 -0
  548. package/react-aria/react-aria/focus/useFocusable.js +47 -0
  549. package/react-aria/react-aria/focus/useFocusable.js.map +1 -0
  550. package/react-aria/react-aria/form/useFormValidation.js +112 -0
  551. package/react-aria/react-aria/form/useFormValidation.js.map +1 -0
  552. package/react-aria/react-aria/i18n/context.d.ts +19 -0
  553. package/react-aria/react-aria/i18n/context.js +41 -0
  554. package/react-aria/react-aria/i18n/context.js.map +1 -0
  555. package/react-aria/react-aria/i18n/useCollator.d.ts +8 -0
  556. package/react-aria/react-aria/i18n/useCollator.js +25 -0
  557. package/react-aria/react-aria/i18n/useCollator.js.map +1 -0
  558. package/react-aria/react-aria/i18n/useDateFormatter.d.ts +13 -0
  559. package/react-aria/react-aria/i18n/useDateFormatter.js +39 -0
  560. package/react-aria/react-aria/i18n/useDateFormatter.js.map +1 -0
  561. package/react-aria/react-aria/i18n/useDefaultLocale.d.ts +10 -0
  562. package/react-aria/react-aria/i18n/useDefaultLocale.js +67 -0
  563. package/react-aria/react-aria/i18n/useDefaultLocale.js.map +1 -0
  564. package/react-aria/react-aria/i18n/useFilter.d.ts +15 -0
  565. package/react-aria/react-aria/i18n/useFilter.js +58 -0
  566. package/react-aria/react-aria/i18n/useFilter.js.map +1 -0
  567. package/react-aria/react-aria/i18n/useListFormatter.d.ts +8 -0
  568. package/react-aria/react-aria/i18n/useListFormatter.js +20 -0
  569. package/react-aria/react-aria/i18n/useListFormatter.js.map +1 -0
  570. package/react-aria/react-aria/i18n/useLocalizedStringFormatter.d.ts +15 -0
  571. package/react-aria/react-aria/i18n/useLocalizedStringFormatter.js +38 -0
  572. package/react-aria/react-aria/i18n/useLocalizedStringFormatter.js.map +1 -0
  573. package/react-aria/react-aria/i18n/useMessageFormatter.d.ts +13 -0
  574. package/react-aria/react-aria/i18n/useMessageFormatter.js +32 -0
  575. package/react-aria/react-aria/i18n/useMessageFormatter.js.map +1 -0
  576. package/react-aria/react-aria/i18n/useNumberFormatter.d.ts +10 -0
  577. package/react-aria/react-aria/i18n/useNumberFormatter.js +21 -0
  578. package/react-aria/react-aria/i18n/useNumberFormatter.js.map +1 -0
  579. package/react-aria/react-aria/i18n/utils.js +49 -0
  580. package/react-aria/react-aria/i18n/utils.js.map +1 -0
  581. package/react-aria/react-aria/interactions/context.js +20 -0
  582. package/react-aria/react-aria/interactions/context.js.map +1 -0
  583. package/react-aria/react-aria/interactions/createEventHandler.js +48 -0
  584. package/react-aria/react-aria/interactions/createEventHandler.js.map +1 -0
  585. package/react-aria/react-aria/interactions/textSelection.js +85 -0
  586. package/react-aria/react-aria/interactions/textSelection.js.map +1 -0
  587. package/react-aria/react-aria/interactions/useFocus.js +53 -0
  588. package/react-aria/react-aria/interactions/useFocus.js.map +1 -0
  589. package/react-aria/react-aria/interactions/useFocusVisible.js +236 -0
  590. package/react-aria/react-aria/interactions/useFocusVisible.js.map +1 -0
  591. package/react-aria/react-aria/interactions/useFocusWithin.js +65 -0
  592. package/react-aria/react-aria/interactions/useFocusWithin.js.map +1 -0
  593. package/react-aria/react-aria/interactions/useKeyboard.js +27 -0
  594. package/react-aria/react-aria/interactions/useKeyboard.js.map +1 -0
  595. package/react-aria/react-aria/interactions/usePress.js +769 -0
  596. package/react-aria/react-aria/interactions/usePress.js.map +1 -0
  597. package/react-aria/react-aria/interactions/useScrollWheel.js +31 -0
  598. package/react-aria/react-aria/interactions/useScrollWheel.js.map +1 -0
  599. package/react-aria/react-aria/interactions/utils.js +116 -0
  600. package/react-aria/react-aria/interactions/utils.js.map +1 -0
  601. package/react-aria/react-aria/label/useField.js +42 -0
  602. package/react-aria/react-aria/label/useField.js.map +1 -0
  603. package/react-aria/react-aria/label/useLabel.js +42 -0
  604. package/react-aria/react-aria/label/useLabel.js.map +1 -0
  605. package/react-aria/react-aria/live-announcer/LiveAnnouncer.js +121 -0
  606. package/react-aria/react-aria/live-announcer/LiveAnnouncer.js.map +1 -0
  607. package/react-aria/react-aria/numberfield/intl/en-US.json.js +11 -0
  608. package/react-aria/react-aria/numberfield/intl/en-US.json.js.map +1 -0
  609. package/react-aria/react-aria/numberfield/intl/fr-FR.json.js +11 -0
  610. package/react-aria/react-aria/numberfield/intl/fr-FR.json.js.map +1 -0
  611. package/react-aria/react-aria/numberfield/intl/index.js +10 -0
  612. package/react-aria/react-aria/numberfield/intl/index.js.map +1 -0
  613. package/react-aria/react-aria/numberfield/useNumberField.js +294 -0
  614. package/react-aria/react-aria/numberfield/useNumberField.js.map +1 -0
  615. package/react-aria/react-aria/spinbutton/intl/en-US.json.js +7 -0
  616. package/react-aria/react-aria/spinbutton/intl/en-US.json.js.map +1 -0
  617. package/react-aria/react-aria/spinbutton/intl/fr-FR.json.js +7 -0
  618. package/react-aria/react-aria/spinbutton/intl/fr-FR.json.js.map +1 -0
  619. package/react-aria/react-aria/spinbutton/intl/index.js +10 -0
  620. package/react-aria/react-aria/spinbutton/intl/index.js.map +1 -0
  621. package/react-aria/react-aria/spinbutton/useSpinButton.js +168 -0
  622. package/react-aria/react-aria/spinbutton/useSpinButton.js.map +1 -0
  623. package/react-aria/react-aria/ssr/SSRProvider.d.ts +22 -0
  624. package/react-aria/react-aria/ssr/SSRProvider.js +157 -0
  625. package/react-aria/react-aria/ssr/SSRProvider.js.map +1 -0
  626. package/react-aria/react-aria/textfield/useFormattedTextField.js +142 -0
  627. package/react-aria/react-aria/textfield/useFormattedTextField.js.map +1 -0
  628. package/react-aria/react-aria/textfield/useTextField.js +156 -0
  629. package/react-aria/react-aria/textfield/useTextField.js.map +1 -0
  630. package/react-aria/react-aria/utils/chain.js +33 -0
  631. package/react-aria/react-aria/utils/chain.js.map +1 -0
  632. package/react-aria/react-aria/utils/domHelpers.js +14 -0
  633. package/react-aria/react-aria/utils/domHelpers.js.map +1 -0
  634. package/react-aria/react-aria/utils/filterDOMProps.js +45 -0
  635. package/react-aria/react-aria/utils/filterDOMProps.js.map +1 -0
  636. package/react-aria/react-aria/utils/focusWithoutScrolling.js +88 -0
  637. package/react-aria/react-aria/utils/focusWithoutScrolling.js.map +1 -0
  638. package/react-aria/react-aria/utils/isVirtualEvent.js +51 -0
  639. package/react-aria/react-aria/utils/isVirtualEvent.js.map +1 -0
  640. package/react-aria/react-aria/utils/mergeProps.js +48 -0
  641. package/react-aria/react-aria/utils/mergeProps.js.map +1 -0
  642. package/react-aria/react-aria/utils/openLink.js +55 -0
  643. package/react-aria/react-aria/utils/openLink.js.map +1 -0
  644. package/react-aria/react-aria/utils/platform.js +69 -0
  645. package/react-aria/react-aria/utils/platform.js.map +1 -0
  646. package/react-aria/react-aria/utils/runAfterTransition.js +100 -0
  647. package/react-aria/react-aria/utils/runAfterTransition.js.map +1 -0
  648. package/react-aria/react-aria/utils/useDeepMemo.js +16 -0
  649. package/react-aria/react-aria/utils/useDeepMemo.js.map +1 -0
  650. package/react-aria/react-aria/utils/useEffectEvent.js +31 -0
  651. package/react-aria/react-aria/utils/useEffectEvent.js.map +1 -0
  652. package/react-aria/react-aria/utils/useEvent.js +21 -0
  653. package/react-aria/react-aria/utils/useEvent.js.map +1 -0
  654. package/react-aria/react-aria/utils/useFormReset.js +23 -0
  655. package/react-aria/react-aria/utils/useFormReset.js.map +1 -0
  656. package/react-aria/react-aria/utils/useGlobalListeners.js +44 -0
  657. package/react-aria/react-aria/utils/useGlobalListeners.js.map +1 -0
  658. package/react-aria/react-aria/utils/useId.js +86 -0
  659. package/react-aria/react-aria/utils/useId.js.map +1 -0
  660. package/react-aria/react-aria/utils/useLabels.js +39 -0
  661. package/react-aria/react-aria/utils/useLabels.js.map +1 -0
  662. package/react-aria/react-aria/utils/useLayoutEffect.js +21 -0
  663. package/react-aria/react-aria/utils/useLayoutEffect.js.map +1 -0
  664. package/react-aria/react-aria/utils/useSyncRef.js +29 -0
  665. package/react-aria/react-aria/utils/useSyncRef.js.map +1 -0
  666. package/react-aria/react-aria/utils/useValueEffect.js +52 -0
  667. package/react-aria/react-aria/utils/useValueEffect.js.map +1 -0
  668. package/react-aria/react-stately/form/useFormValidationState.js +191 -0
  669. package/react-aria/react-stately/form/useFormValidationState.js.map +1 -0
  670. package/react-aria/react-stately/numberfield/useNumberFieldState.js +196 -0
  671. package/react-aria/react-stately/numberfield/useNumberFieldState.js.map +1 -0
  672. package/react-aria/react-stately/utils/number.js +56 -0
  673. package/react-aria/react-stately/utils/number.js.map +1 -0
  674. package/react-aria/react-stately/utils/useControlledState.js +68 -0
  675. package/react-aria/react-stately/utils/useControlledState.js.map +1 -0
  676. package/react-aria/react-types/shared/locale.d.ts +3 -0
  677. package/types/colors.d.ts +102 -0
  678. package/types/colors.js +64 -0
  679. package/types/colors.js.map +1 -0
  680. package/types/fonts.d.ts +12 -0
  681. package/types/fonts.js +10 -0
  682. package/types/fonts.js.map +1 -0
  683. package/types/helpers.d.ts +23 -0
  684. package/types/products.d.ts +40 -0
  685. package/types/products.js +38 -0
  686. package/types/products.js.map +1 -0
  687. package/types/styles.d.ts +283 -0
  688. package/types/styles.js +161 -0
  689. package/types/styles.js.map +1 -0
  690. package/utils/filterComponents.d.ts +12 -0
  691. package/utils/filterComponents.js +24 -0
  692. package/utils/filterComponents.js.map +1 -0
  693. package/utils/getTextWidth.d.ts +6 -0
  694. package/utils/getTextWidth.js +32 -0
  695. package/utils/getTextWidth.js.map +1 -0
  696. package/utils/isComponent.d.ts +12 -0
  697. package/utils/isComponent.js +15 -0
  698. package/utils/isComponent.js.map +1 -0
  699. package/utils/partitionComponents.d.ts +10 -0
  700. package/utils/partitionComponents.js +26 -0
  701. package/utils/partitionComponents.js.map +1 -0
  702. package/utils/redsift-design-tokens.d.ts +1389 -0
  703. package/utils/redsift-design-tokens.js +1391 -0
  704. package/utils/redsift-design-tokens.js.map +1 -0
  705. package/utils/useId.d.ts +6 -0
  706. package/utils/useId.js +42 -0
  707. package/utils/useId.js.map +1 -0
  708. package/utils/warnIfNoAccessibleLabelFound.d.ts +11 -0
  709. package/utils/warnIfNoAccessibleLabelFound.js +20 -0
  710. package/utils/warnIfNoAccessibleLabelFound.js.map +1 -0
@@ -0,0 +1,419 @@
1
+ import { objectSpread2 as _objectSpread2 } from '../../_virtual/_rollupPluginBabelHelpers.js';
2
+ import { FocusWithinGroupActionType, Navigation, EventKey } from './types.js';
3
+
4
+ const DOCUMENT_POSITION_FOLLOWING = 4;
5
+ const FocusWithinGroupReducer = (state, action) => {
6
+ switch (action.type) {
7
+ case FocusWithinGroupActionType.REGISTER_TAB_STOP:
8
+ {
9
+ const newTabStop = action.payload;
10
+ if (!newTabStop.domElementRef.current) {
11
+ return state;
12
+ }
13
+
14
+ // Iterate backwards through state.tabStops since it is
15
+ // most likely that the tab stop will need to be inserted
16
+ // at the end of that array.
17
+ let indexToInsertAt = -1;
18
+ for (let i = state.tabStops.length - 1; i >= 0; --i) {
19
+ const loopTabStop = state.tabStops[i];
20
+ if (loopTabStop.id === newTabStop.id) {
21
+ // console.warn(false, `'${newTabStop.id}' tab stop already registered`);
22
+ return state;
23
+ }
24
+ // The compareDocumentPosition condition is true
25
+ // if newTabStop follows loopTabStop:
26
+ if (indexToInsertAt === -1 && loopTabStop.domElementRef.current && !!(loopTabStop.domElementRef.current.compareDocumentPosition(newTabStop.domElementRef.current) & DOCUMENT_POSITION_FOLLOWING)) {
27
+ indexToInsertAt = i + 1;
28
+ break;
29
+ }
30
+ }
31
+
32
+ // The indexToInsertAt is -1 when newTabStop should be inserted
33
+ // at the start of tabStops (the compareDocumentPosition condition
34
+ // always returns false in that case).
35
+ if (indexToInsertAt === -1) {
36
+ indexToInsertAt = 0;
37
+ }
38
+ const newTabStops = state.tabStops.slice();
39
+ newTabStops.splice(indexToInsertAt, 0, newTabStop);
40
+ return _objectSpread2(_objectSpread2({}, state), {}, {
41
+ selectedId: state.focusOnInit ? getUpdatedSelectedId(newTabStops, state.selectedId) : null,
42
+ tabStops: newTabStops,
43
+ rowStartMap: null
44
+ });
45
+ }
46
+ case FocusWithinGroupActionType.UNREGISTER_TAB_STOP:
47
+ {
48
+ const id = action.payload.id;
49
+ const newTabStops = state.tabStops.filter(tabStop => tabStop.id !== id);
50
+ if (newTabStops.length === state.tabStops.length) {
51
+ // console.warn(false, `'${id}' tab stop already unregistered`);
52
+ return state;
53
+ }
54
+ return _objectSpread2(_objectSpread2({}, state), {}, {
55
+ selectedId: state.focusOnInit ? getUpdatedSelectedId(newTabStops, state.selectedId) : null,
56
+ tabStops: newTabStops,
57
+ rowStartMap: null
58
+ });
59
+ }
60
+ case FocusWithinGroupActionType.TAB_STOP_UPDATED:
61
+ {
62
+ const {
63
+ id,
64
+ rowIndex,
65
+ isDisabled,
66
+ value
67
+ } = action.payload;
68
+ const index = state.tabStops.findIndex(tabStop => tabStop.id === id);
69
+ if (index === -1) {
70
+ console.warn(false, `'${id}' tab stop not registered`);
71
+ return state;
72
+ }
73
+ const tabStop = state.tabStops[index];
74
+ if (tabStop.isDisabled === isDisabled && tabStop.rowIndex === rowIndex && tabStop.value === value) {
75
+ // Nothing to do so short-circuit.
76
+ return state;
77
+ }
78
+ const newTabStop = _objectSpread2(_objectSpread2({}, tabStop), {}, {
79
+ rowIndex,
80
+ isDisabled,
81
+ value
82
+ });
83
+ const newTabStops = state.tabStops.slice();
84
+ newTabStops.splice(index, 1, newTabStop);
85
+ return _objectSpread2(_objectSpread2({}, state), {}, {
86
+ selectedId: state.focusOnInit ? getUpdatedSelectedId(newTabStops, state.selectedId) : null,
87
+ tabStops: newTabStops,
88
+ rowStartMap: null
89
+ });
90
+ }
91
+ case FocusWithinGroupActionType.KEY_DOWN_ON_ITEM:
92
+ {
93
+ const {
94
+ id,
95
+ key,
96
+ ctrlKey
97
+ } = action.payload;
98
+ const index = state.tabStops.findIndex(tabStop => tabStop.id === id);
99
+ if (index === -1) {
100
+ console.warn(false, `'${id}' tab stop not registered`);
101
+ return state;
102
+ }
103
+ return moveSelectionFromKey(state, index, key, ctrlKey);
104
+ }
105
+ case FocusWithinGroupActionType.CLICK_ON_ITEM:
106
+ {
107
+ const id = action.payload.id;
108
+ const index = state.tabStops.findIndex(tabStop => tabStop.id === id);
109
+ if (index === -1) {
110
+ console.warn(false, `'${id}' tab stop not registered`);
111
+ return state;
112
+ }
113
+ const currentTabStop = state.tabStops[index];
114
+ return currentTabStop.isDisabled ? state : selectTabStop(state, currentTabStop, undefined, state.focusOnClick);
115
+ }
116
+ case FocusWithinGroupActionType.FOCUS_ON_LIST:
117
+ {
118
+ var _action$payload$id, _state$tabStops$;
119
+ const id = (_action$payload$id = action.payload.id) !== null && _action$payload$id !== void 0 ? _action$payload$id : (_state$tabStops$ = state.tabStops[0]) === null || _state$tabStops$ === void 0 ? void 0 : _state$tabStops$.id;
120
+ const index = state.tabStops.findIndex(tabStop => tabStop.id === id);
121
+ if (index === -1) {
122
+ return state;
123
+ }
124
+ const currentTabStop = state.tabStops[index];
125
+ return currentTabStop.isDisabled ? _objectSpread2(_objectSpread2({}, state), {}, {
126
+ delayedAction: undefined
127
+ }, action.payload) : selectTabStop(_objectSpread2(_objectSpread2({}, state), {}, {
128
+ delayedAction: undefined
129
+ }, action.payload), currentTabStop, undefined, state.focusOnClick);
130
+ }
131
+ case FocusWithinGroupActionType.BLUR_ON_LIST:
132
+ {
133
+ return _objectSpread2(_objectSpread2({}, state), {}, {
134
+ activedescendant: ['', '']
135
+ });
136
+ }
137
+ case FocusWithinGroupActionType.KEY_DOWN_ON_LIST:
138
+ {
139
+ const {
140
+ key,
141
+ ctrlKey
142
+ } = action.payload;
143
+ let index = state.tabStops.findIndex(tabStop => tabStop.id === state.selectedId);
144
+ if (index === -1) {
145
+ if (state.focusOnInit) {
146
+ console.warn(false, `'${state.selectedId}' tab stop not registered`);
147
+ return _objectSpread2(_objectSpread2({}, state), {}, {
148
+ delayedAction: undefined
149
+ });
150
+ } else {
151
+ index = 0;
152
+ }
153
+ }
154
+ return moveSelectionFromKey(_objectSpread2(_objectSpread2({}, state), {}, {
155
+ delayedAction: undefined
156
+ }), index, key, ctrlKey);
157
+ }
158
+ case FocusWithinGroupActionType.OPTIONS_UPDATED:
159
+ return _objectSpread2(_objectSpread2({}, state), action.payload);
160
+ case FocusWithinGroupActionType.FILTER_LIST:
161
+ return _objectSpread2(_objectSpread2({}, state), {}, {
162
+ selectedId: null
163
+ }, action.payload);
164
+ case FocusWithinGroupActionType.DELAY_ACTION:
165
+ return _objectSpread2(_objectSpread2({}, state), {}, {
166
+ delayedAction: action.payload
167
+ });
168
+ /* istanbul ignore next */
169
+ default:
170
+ return state;
171
+ }
172
+ };
173
+ function findIndexOfVeryFirstActiveTabStop(tabStops) {
174
+ return tabStops.findIndex(tabStop => !tabStop.isDisabled);
175
+ }
176
+ function findIndexOfVeryLastActiveTabStop(tabStops) {
177
+ for (let i = tabStops.length - 1; i >= 0; --i) {
178
+ const tabStop = tabStops[i];
179
+ if (!tabStop.isDisabled) {
180
+ return i;
181
+ }
182
+ }
183
+ return -1;
184
+ }
185
+
186
+ // Determine the updated value for selectedId:
187
+ function getUpdatedSelectedId(tabStops, currentSelectedId) {
188
+ if (currentSelectedId === null) {
189
+ // There is not currently selected tab stop, so find
190
+ // the first tab stop that is not isDisabled and return
191
+ // its id, otherwise return null.
192
+ const index = tabStops.findIndex(tabStop => !tabStop.isDisabled);
193
+ return index === -1 ? null : tabStops[index].id;
194
+ }
195
+ let index = tabStops.findIndex(tabStop => tabStop.id === currentSelectedId);
196
+ if (index !== -1 && !tabStops[index].isDisabled) {
197
+ // The current selected id is still valid, so return it.
198
+ return currentSelectedId;
199
+ }
200
+
201
+ // Finds the first tab stop that is not isDisabled and return
202
+ // its id, otherwise return null.
203
+ index = tabStops.findIndex(tabStop => !tabStop.isDisabled);
204
+ return index === -1 ? null : tabStops[index].id;
205
+ }
206
+
207
+ // Translates the user key down event info into a navigation instruction.
208
+ function getNavigationValue(key, ctrlKey, isGrid, direction, loopAround, isFirst, isLast) {
209
+ switch (key) {
210
+ case EventKey.ArrowLeft:
211
+ if (isGrid || direction === 'horizontal' || direction === 'both') {
212
+ return !isGrid && loopAround && isFirst ? Navigation.VERY_LAST : Navigation.PREVIOUS;
213
+ }
214
+ return null;
215
+ case EventKey.ArrowRight:
216
+ if (isGrid || direction === 'horizontal' || direction === 'both') {
217
+ return !isGrid && loopAround && isLast ? Navigation.VERY_FIRST : Navigation.NEXT;
218
+ }
219
+ return null;
220
+ case EventKey.ArrowUp:
221
+ if (isGrid) {
222
+ return Navigation.PREVIOUS_ROW;
223
+ } else if (direction === 'vertical' || direction === 'both') {
224
+ return loopAround && isFirst ? Navigation.VERY_LAST : Navigation.PREVIOUS;
225
+ }
226
+ return null;
227
+ case EventKey.ArrowDown:
228
+ if (isGrid) {
229
+ return Navigation.NEXT_ROW;
230
+ } else if (direction === 'vertical' || direction === 'both') {
231
+ return loopAround && isLast ? Navigation.VERY_FIRST : Navigation.NEXT;
232
+ }
233
+ return null;
234
+ case EventKey.Home:
235
+ return !isGrid || ctrlKey ? Navigation.VERY_FIRST : Navigation.FIRST_IN_ROW;
236
+ case EventKey.End:
237
+ return !isGrid || ctrlKey ? Navigation.VERY_LAST : Navigation.LAST_IN_ROW;
238
+ /* istanbul ignore next */
239
+ default:
240
+ return null;
241
+ }
242
+ }
243
+
244
+ // Creates the new state for a tab stop when it becomes the selected one.
245
+ function selectTabStop(state, tabStop, rowStartMap) {
246
+ let allowFocusing = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : true;
247
+ return _objectSpread2(_objectSpread2({}, state), {}, {
248
+ allowFocusing,
249
+ selectedId: tabStop.id,
250
+ rowStartMap: rowStartMap || state.rowStartMap,
251
+ activedescendant: state.focusType === 'virtual-focus' ? [tabStop.id, tabStop.value] : undefined
252
+ });
253
+ }
254
+
255
+ // Creates the row start index lookup map
256
+ // for the currently registered tab stops.
257
+ function createRowStartMap(state) {
258
+ const map = new Map();
259
+ for (let i = 0; i < state.tabStops.length; ++i) {
260
+ const {
261
+ rowIndex
262
+ } = state.tabStops[i];
263
+ if (rowIndex !== null && !map.has(rowIndex)) {
264
+ map.set(rowIndex, i);
265
+ }
266
+ }
267
+ return map;
268
+ }
269
+ function moveSelectionFromKey(state, index, key, ctrlKey) {
270
+ const currentTabStop = state.tabStops[index];
271
+ if (currentTabStop.isDisabled) {
272
+ return state;
273
+ }
274
+ const isGrid = currentTabStop.rowIndex !== null;
275
+ const isFirst = index === findIndexOfVeryFirstActiveTabStop(state.tabStops);
276
+ const isLast = index === findIndexOfVeryLastActiveTabStop(state.tabStops);
277
+ const navigation = getNavigationValue(key, ctrlKey, isGrid, state.direction, state.loopAround, isFirst, isLast);
278
+ if (!navigation) {
279
+ return state;
280
+ }
281
+ switch (navigation) {
282
+ case Navigation.NEXT:
283
+ {
284
+ for (let i = index + 1; i < state.tabStops.length; ++i) {
285
+ const tabStop = state.tabStops[i];
286
+ if (isGrid && tabStop.rowIndex !== currentTabStop.rowIndex) {
287
+ break;
288
+ }
289
+ if (!tabStop.isDisabled) {
290
+ return selectTabStop(state, tabStop);
291
+ }
292
+ }
293
+ }
294
+ break;
295
+ case Navigation.PREVIOUS:
296
+ {
297
+ for (let i = index - 1; i >= 0; --i) {
298
+ const tabStop = state.tabStops[i];
299
+ if (isGrid && tabStop.rowIndex !== currentTabStop.rowIndex) {
300
+ break;
301
+ }
302
+ if (!tabStop.isDisabled) {
303
+ return selectTabStop(state, tabStop);
304
+ }
305
+ }
306
+ }
307
+ break;
308
+ case Navigation.VERY_FIRST:
309
+ {
310
+ const index = findIndexOfVeryFirstActiveTabStop(state.tabStops);
311
+ if (index > -1) {
312
+ return selectTabStop(state, state.tabStops[index]);
313
+ }
314
+ }
315
+ break;
316
+ case Navigation.VERY_LAST:
317
+ {
318
+ const index = findIndexOfVeryLastActiveTabStop(state.tabStops);
319
+ if (index > -1) {
320
+ return selectTabStop(state, state.tabStops[index]);
321
+ }
322
+ }
323
+ break;
324
+ case Navigation.PREVIOUS_ROW:
325
+ {
326
+ if (currentTabStop.rowIndex === null || currentTabStop.rowIndex === 0) {
327
+ return state;
328
+ }
329
+ const rowStartMap = state.rowStartMap || createRowStartMap(state);
330
+ const rowStartIndex = rowStartMap.get(currentTabStop.rowIndex);
331
+ if (rowStartIndex === undefined) {
332
+ return state;
333
+ }
334
+ const columnOffset = index - rowStartIndex;
335
+ for (let i = currentTabStop.rowIndex - 1; i >= 0; --i) {
336
+ const rowStartIndex = rowStartMap.get(i);
337
+ if (rowStartIndex === undefined) {
338
+ return state;
339
+ }
340
+ const rowTabStop = state.tabStops[rowStartIndex + columnOffset];
341
+ if (rowTabStop && !rowTabStop.isDisabled) {
342
+ return selectTabStop(state, rowTabStop, rowStartMap);
343
+ }
344
+ }
345
+ return _objectSpread2(_objectSpread2({}, state), {}, {
346
+ allowFocusing: true,
347
+ rowStartMap
348
+ });
349
+ }
350
+ case Navigation.NEXT_ROW:
351
+ {
352
+ const maxRowIndex = state.tabStops[state.tabStops.length - 1].rowIndex;
353
+ if (currentTabStop.rowIndex === null || maxRowIndex === null || currentTabStop.rowIndex === maxRowIndex) {
354
+ return state;
355
+ }
356
+ const rowStartMap = state.rowStartMap || createRowStartMap(state);
357
+ const rowStartIndex = rowStartMap.get(currentTabStop.rowIndex);
358
+ if (rowStartIndex === undefined) {
359
+ return state;
360
+ }
361
+ const columnOffset = index - rowStartIndex;
362
+ for (let i = currentTabStop.rowIndex + 1; i <= maxRowIndex; ++i) {
363
+ const rowStartIndex = rowStartMap.get(i);
364
+ if (rowStartIndex === undefined) {
365
+ return state;
366
+ }
367
+ const rowTabStop = state.tabStops[rowStartIndex + columnOffset];
368
+ if (rowTabStop && !rowTabStop.isDisabled) {
369
+ return selectTabStop(state, rowTabStop, rowStartMap);
370
+ }
371
+ }
372
+ return _objectSpread2(_objectSpread2({}, state), {}, {
373
+ allowFocusing: true,
374
+ rowStartMap
375
+ });
376
+ }
377
+ case Navigation.FIRST_IN_ROW:
378
+ {
379
+ if (currentTabStop.rowIndex === null) {
380
+ return state;
381
+ }
382
+ const rowStartMap = state.rowStartMap || createRowStartMap(state);
383
+ const rowStartIndex = rowStartMap.get(currentTabStop.rowIndex);
384
+ if (rowStartIndex === undefined) {
385
+ return state;
386
+ }
387
+ for (let i = rowStartIndex; i < state.tabStops.length; ++i) {
388
+ const tabStop = state.tabStops[i];
389
+ if (tabStop.rowIndex !== currentTabStop.rowIndex) {
390
+ break;
391
+ } else if (!tabStop.isDisabled) {
392
+ return selectTabStop(state, state.tabStops[i], rowStartMap);
393
+ }
394
+ }
395
+ }
396
+ break;
397
+ case Navigation.LAST_IN_ROW:
398
+ {
399
+ if (currentTabStop.rowIndex === null) {
400
+ return state;
401
+ }
402
+ const rowStartMap = state.rowStartMap || createRowStartMap(state);
403
+ const rowEndIndex = rowStartMap.has(currentTabStop.rowIndex + 1) ? (rowStartMap.get(currentTabStop.rowIndex + 1) || 0) - 1 : state.tabStops.length - 1;
404
+ for (let i = rowEndIndex; i >= 0; --i) {
405
+ const tabStop = state.tabStops[i];
406
+ if (tabStop.rowIndex !== currentTabStop.rowIndex) {
407
+ break;
408
+ } else if (!tabStop.isDisabled) {
409
+ return selectTabStop(state, state.tabStops[i], rowStartMap);
410
+ }
411
+ }
412
+ }
413
+ break;
414
+ }
415
+ return state;
416
+ }
417
+
418
+ export { FocusWithinGroupReducer };
419
+ //# sourceMappingURL=reducer.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"reducer.js","sources":["../../../src/components/focus-within-group/reducer.ts"],"sourcesContent":["import {\n FocusWithinGroupState,\n FocusWithinGroupAction,\n FocusWithinGroupActionType,\n TabStop,\n RowStartMap,\n EventKey,\n Navigation,\n} from './types';\n\nconst DOCUMENT_POSITION_FOLLOWING = 4;\n\nexport const FocusWithinGroupReducer = (\n state: FocusWithinGroupState,\n action: FocusWithinGroupAction\n): FocusWithinGroupState => {\n switch (action.type) {\n case FocusWithinGroupActionType.REGISTER_TAB_STOP: {\n const newTabStop = action.payload;\n if (!newTabStop.domElementRef.current) {\n return state;\n }\n\n // Iterate backwards through state.tabStops since it is\n // most likely that the tab stop will need to be inserted\n // at the end of that array.\n let indexToInsertAt = -1;\n for (let i = state.tabStops.length - 1; i >= 0; --i) {\n const loopTabStop = state.tabStops[i];\n if (loopTabStop.id === newTabStop.id) {\n // console.warn(false, `'${newTabStop.id}' tab stop already registered`);\n return state;\n }\n // The compareDocumentPosition condition is true\n // if newTabStop follows loopTabStop:\n if (\n indexToInsertAt === -1 &&\n loopTabStop.domElementRef.current &&\n !!(\n loopTabStop.domElementRef.current.compareDocumentPosition(newTabStop.domElementRef.current) &\n DOCUMENT_POSITION_FOLLOWING\n )\n ) {\n indexToInsertAt = i + 1;\n break;\n }\n }\n\n // The indexToInsertAt is -1 when newTabStop should be inserted\n // at the start of tabStops (the compareDocumentPosition condition\n // always returns false in that case).\n if (indexToInsertAt === -1) {\n indexToInsertAt = 0;\n }\n\n const newTabStops = state.tabStops.slice();\n newTabStops.splice(indexToInsertAt, 0, newTabStop);\n\n return {\n ...state,\n selectedId: state.focusOnInit ? getUpdatedSelectedId(newTabStops, state.selectedId) : null,\n tabStops: newTabStops,\n rowStartMap: null,\n };\n }\n case FocusWithinGroupActionType.UNREGISTER_TAB_STOP: {\n const id = action.payload.id;\n const newTabStops = state.tabStops.filter((tabStop) => tabStop.id !== id);\n if (newTabStops.length === state.tabStops.length) {\n // console.warn(false, `'${id}' tab stop already unregistered`);\n return state;\n }\n return {\n ...state,\n selectedId: state.focusOnInit ? getUpdatedSelectedId(newTabStops, state.selectedId) : null,\n tabStops: newTabStops,\n rowStartMap: null,\n };\n }\n case FocusWithinGroupActionType.TAB_STOP_UPDATED: {\n const { id, rowIndex, isDisabled, value } = action.payload;\n const index = state.tabStops.findIndex((tabStop) => tabStop.id === id);\n if (index === -1) {\n console.warn(false, `'${id}' tab stop not registered`);\n return state;\n }\n\n const tabStop = state.tabStops[index];\n if (tabStop.isDisabled === isDisabled && tabStop.rowIndex === rowIndex && tabStop.value === value) {\n // Nothing to do so short-circuit.\n return state;\n }\n\n const newTabStop = { ...tabStop, rowIndex, isDisabled, value };\n const newTabStops = state.tabStops.slice();\n newTabStops.splice(index, 1, newTabStop);\n\n return {\n ...state,\n selectedId: state.focusOnInit ? getUpdatedSelectedId(newTabStops, state.selectedId) : null,\n tabStops: newTabStops,\n rowStartMap: null,\n };\n }\n case FocusWithinGroupActionType.KEY_DOWN_ON_ITEM: {\n const { id, key, ctrlKey } = action.payload;\n const index = state.tabStops.findIndex((tabStop) => tabStop.id === id);\n if (index === -1) {\n console.warn(false, `'${id}' tab stop not registered`);\n return state;\n }\n return moveSelectionFromKey(state, index, key, ctrlKey);\n }\n case FocusWithinGroupActionType.CLICK_ON_ITEM: {\n const id = action.payload.id;\n const index = state.tabStops.findIndex((tabStop) => tabStop.id === id);\n if (index === -1) {\n console.warn(false, `'${id}' tab stop not registered`);\n return state;\n }\n const currentTabStop = state.tabStops[index];\n return currentTabStop.isDisabled ? state : selectTabStop(state, currentTabStop, undefined, state.focusOnClick);\n }\n case FocusWithinGroupActionType.FOCUS_ON_LIST: {\n const id = action.payload.id ?? state.tabStops[0]?.id;\n const index = state.tabStops.findIndex((tabStop) => tabStop.id === id);\n if (index === -1) {\n return state;\n }\n const currentTabStop = state.tabStops[index];\n return currentTabStop.isDisabled\n ? { ...state, delayedAction: undefined, ...action.payload }\n : selectTabStop(\n { ...state, delayedAction: undefined, ...action.payload },\n currentTabStop,\n undefined,\n state.focusOnClick\n );\n }\n case FocusWithinGroupActionType.BLUR_ON_LIST: {\n return { ...state, activedescendant: ['', ''] };\n }\n case FocusWithinGroupActionType.KEY_DOWN_ON_LIST: {\n const { key, ctrlKey } = action.payload;\n let index = state.tabStops.findIndex((tabStop) => tabStop.id === state.selectedId);\n if (index === -1) {\n if (state.focusOnInit) {\n console.warn(false, `'${state.selectedId}' tab stop not registered`);\n return { ...state, delayedAction: undefined };\n } else {\n index = 0;\n }\n }\n return moveSelectionFromKey({ ...state, delayedAction: undefined }, index, key, ctrlKey);\n }\n case FocusWithinGroupActionType.OPTIONS_UPDATED:\n return { ...state, ...action.payload };\n case FocusWithinGroupActionType.FILTER_LIST:\n return { ...state, selectedId: null, ...action.payload };\n case FocusWithinGroupActionType.DELAY_ACTION:\n return { ...state, delayedAction: action.payload };\n /* istanbul ignore next */\n default:\n return state;\n }\n};\n\nfunction findIndexOfVeryFirstActiveTabStop(tabStops: FocusWithinGroupState['tabStops']): number {\n return tabStops.findIndex((tabStop) => !tabStop.isDisabled);\n}\n\nfunction findIndexOfVeryLastActiveTabStop(tabStops: FocusWithinGroupState['tabStops']): number {\n for (let i = tabStops.length - 1; i >= 0; --i) {\n const tabStop = tabStops[i];\n if (!tabStop.isDisabled) {\n return i;\n }\n }\n return -1;\n}\n\n// Determine the updated value for selectedId:\nfunction getUpdatedSelectedId(\n tabStops: FocusWithinGroupState['tabStops'],\n currentSelectedId: FocusWithinGroupState['selectedId']\n): FocusWithinGroupState['selectedId'] {\n if (currentSelectedId === null) {\n // There is not currently selected tab stop, so find\n // the first tab stop that is not isDisabled and return\n // its id, otherwise return null.\n const index = tabStops.findIndex((tabStop) => !tabStop.isDisabled);\n return index === -1 ? null : tabStops[index].id;\n }\n\n let index = tabStops.findIndex((tabStop) => tabStop.id === currentSelectedId);\n if (index !== -1 && !tabStops[index].isDisabled) {\n // The current selected id is still valid, so return it.\n return currentSelectedId;\n }\n\n // Finds the first tab stop that is not isDisabled and return\n // its id, otherwise return null.\n index = tabStops.findIndex((tabStop) => !tabStop.isDisabled);\n return index === -1 ? null : tabStops[index].id;\n}\n\n// Translates the user key down event info into a navigation instruction.\nfunction getNavigationValue(\n key: EventKey,\n ctrlKey: boolean,\n isGrid: boolean,\n direction: string,\n loopAround: boolean,\n isFirst: boolean,\n isLast: boolean\n): Navigation | null {\n switch (key) {\n case EventKey.ArrowLeft:\n if (isGrid || direction === 'horizontal' || direction === 'both') {\n return !isGrid && loopAround && isFirst ? Navigation.VERY_LAST : Navigation.PREVIOUS;\n }\n return null;\n case EventKey.ArrowRight:\n if (isGrid || direction === 'horizontal' || direction === 'both') {\n return !isGrid && loopAround && isLast ? Navigation.VERY_FIRST : Navigation.NEXT;\n }\n return null;\n case EventKey.ArrowUp:\n if (isGrid) {\n return Navigation.PREVIOUS_ROW;\n } else if (direction === 'vertical' || direction === 'both') {\n return loopAround && isFirst ? Navigation.VERY_LAST : Navigation.PREVIOUS;\n }\n return null;\n case EventKey.ArrowDown:\n if (isGrid) {\n return Navigation.NEXT_ROW;\n } else if (direction === 'vertical' || direction === 'both') {\n return loopAround && isLast ? Navigation.VERY_FIRST : Navigation.NEXT;\n }\n return null;\n case EventKey.Home:\n return !isGrid || ctrlKey ? Navigation.VERY_FIRST : Navigation.FIRST_IN_ROW;\n case EventKey.End:\n return !isGrid || ctrlKey ? Navigation.VERY_LAST : Navigation.LAST_IN_ROW;\n /* istanbul ignore next */\n default:\n return null;\n }\n}\n\n// Creates the new state for a tab stop when it becomes the selected one.\nfunction selectTabStop(\n state: FocusWithinGroupState,\n tabStop: TabStop,\n rowStartMap?: RowStartMap,\n allowFocusing = true\n) {\n return {\n ...state,\n allowFocusing,\n selectedId: tabStop.id,\n rowStartMap: rowStartMap || state.rowStartMap,\n activedescendant:\n state.focusType === 'virtual-focus' ? ([tabStop.id, tabStop.value] as [string, string]) : undefined,\n };\n}\n\n// Creates the row start index lookup map\n// for the currently registered tab stops.\nfunction createRowStartMap(state: FocusWithinGroupState) {\n const map: RowStartMap = new Map();\n for (let i = 0; i < state.tabStops.length; ++i) {\n const { rowIndex } = state.tabStops[i];\n if (rowIndex !== null && !map.has(rowIndex)) {\n map.set(rowIndex, i);\n }\n }\n return map;\n}\n\nfunction moveSelectionFromKey(state: FocusWithinGroupState, index: number, key: EventKey, ctrlKey: boolean) {\n const currentTabStop = state.tabStops[index];\n if (currentTabStop.isDisabled) {\n return state;\n }\n const isGrid = currentTabStop.rowIndex !== null;\n const isFirst = index === findIndexOfVeryFirstActiveTabStop(state.tabStops);\n const isLast = index === findIndexOfVeryLastActiveTabStop(state.tabStops);\n const navigation = getNavigationValue(key, ctrlKey, isGrid, state.direction, state.loopAround, isFirst, isLast);\n if (!navigation) {\n return state;\n }\n\n switch (navigation) {\n case Navigation.NEXT:\n {\n for (let i = index + 1; i < state.tabStops.length; ++i) {\n const tabStop = state.tabStops[i];\n if (isGrid && tabStop.rowIndex !== currentTabStop.rowIndex) {\n break;\n }\n if (!tabStop.isDisabled) {\n return selectTabStop(state, tabStop);\n }\n }\n }\n break;\n case Navigation.PREVIOUS:\n {\n for (let i = index - 1; i >= 0; --i) {\n const tabStop = state.tabStops[i];\n if (isGrid && tabStop.rowIndex !== currentTabStop.rowIndex) {\n break;\n }\n if (!tabStop.isDisabled) {\n return selectTabStop(state, tabStop);\n }\n }\n }\n break;\n case Navigation.VERY_FIRST:\n {\n const index = findIndexOfVeryFirstActiveTabStop(state.tabStops);\n if (index > -1) {\n return selectTabStop(state, state.tabStops[index]);\n }\n }\n break;\n case Navigation.VERY_LAST:\n {\n const index = findIndexOfVeryLastActiveTabStop(state.tabStops);\n if (index > -1) {\n return selectTabStop(state, state.tabStops[index]);\n }\n }\n break;\n case Navigation.PREVIOUS_ROW: {\n if (currentTabStop.rowIndex === null || currentTabStop.rowIndex === 0) {\n return state;\n }\n const rowStartMap = state.rowStartMap || createRowStartMap(state);\n const rowStartIndex = rowStartMap.get(currentTabStop.rowIndex);\n if (rowStartIndex === undefined) {\n return state;\n }\n const columnOffset = index - rowStartIndex;\n for (let i = currentTabStop.rowIndex - 1; i >= 0; --i) {\n const rowStartIndex = rowStartMap.get(i);\n if (rowStartIndex === undefined) {\n return state;\n }\n const rowTabStop = state.tabStops[rowStartIndex + columnOffset];\n if (rowTabStop && !rowTabStop.isDisabled) {\n return selectTabStop(state, rowTabStop, rowStartMap);\n }\n }\n return { ...state, allowFocusing: true, rowStartMap };\n }\n case Navigation.NEXT_ROW: {\n const maxRowIndex = state.tabStops[state.tabStops.length - 1].rowIndex;\n if (currentTabStop.rowIndex === null || maxRowIndex === null || currentTabStop.rowIndex === maxRowIndex) {\n return state;\n }\n const rowStartMap = state.rowStartMap || createRowStartMap(state);\n const rowStartIndex = rowStartMap.get(currentTabStop.rowIndex);\n if (rowStartIndex === undefined) {\n return state;\n }\n const columnOffset = index - rowStartIndex;\n for (let i = currentTabStop.rowIndex + 1; i <= maxRowIndex; ++i) {\n const rowStartIndex = rowStartMap.get(i);\n if (rowStartIndex === undefined) {\n return state;\n }\n const rowTabStop = state.tabStops[rowStartIndex + columnOffset];\n if (rowTabStop && !rowTabStop.isDisabled) {\n return selectTabStop(state, rowTabStop, rowStartMap);\n }\n }\n return { ...state, allowFocusing: true, rowStartMap };\n }\n case Navigation.FIRST_IN_ROW:\n {\n if (currentTabStop.rowIndex === null) {\n return state;\n }\n const rowStartMap = state.rowStartMap || createRowStartMap(state);\n const rowStartIndex = rowStartMap.get(currentTabStop.rowIndex);\n if (rowStartIndex === undefined) {\n return state;\n }\n for (let i = rowStartIndex; i < state.tabStops.length; ++i) {\n const tabStop = state.tabStops[i];\n if (tabStop.rowIndex !== currentTabStop.rowIndex) {\n break;\n } else if (!tabStop.isDisabled) {\n return selectTabStop(state, state.tabStops[i], rowStartMap);\n }\n }\n }\n break;\n case Navigation.LAST_IN_ROW:\n {\n if (currentTabStop.rowIndex === null) {\n return state;\n }\n const rowStartMap = state.rowStartMap || createRowStartMap(state);\n const rowEndIndex = rowStartMap.has(currentTabStop.rowIndex + 1)\n ? (rowStartMap.get(currentTabStop.rowIndex + 1) || 0) - 1\n : state.tabStops.length - 1;\n for (let i = rowEndIndex; i >= 0; --i) {\n const tabStop = state.tabStops[i];\n if (tabStop.rowIndex !== currentTabStop.rowIndex) {\n break;\n } else if (!tabStop.isDisabled) {\n return selectTabStop(state, state.tabStops[i], rowStartMap);\n }\n }\n }\n break;\n }\n return state;\n}\n"],"names":["DOCUMENT_POSITION_FOLLOWING","FocusWithinGroupReducer","state","action","type","FocusWithinGroupActionType","REGISTER_TAB_STOP","newTabStop","payload","domElementRef","current","indexToInsertAt","i","tabStops","length","loopTabStop","id","compareDocumentPosition","newTabStops","slice","splice","_objectSpread","selectedId","focusOnInit","getUpdatedSelectedId","rowStartMap","UNREGISTER_TAB_STOP","filter","tabStop","TAB_STOP_UPDATED","rowIndex","isDisabled","value","index","findIndex","console","warn","KEY_DOWN_ON_ITEM","key","ctrlKey","moveSelectionFromKey","CLICK_ON_ITEM","currentTabStop","selectTabStop","undefined","focusOnClick","FOCUS_ON_LIST","_action$payload$id","_state$tabStops$","delayedAction","BLUR_ON_LIST","activedescendant","KEY_DOWN_ON_LIST","OPTIONS_UPDATED","FILTER_LIST","DELAY_ACTION","findIndexOfVeryFirstActiveTabStop","findIndexOfVeryLastActiveTabStop","currentSelectedId","getNavigationValue","isGrid","direction","loopAround","isFirst","isLast","EventKey","ArrowLeft","Navigation","VERY_LAST","PREVIOUS","ArrowRight","VERY_FIRST","NEXT","ArrowUp","PREVIOUS_ROW","ArrowDown","NEXT_ROW","Home","FIRST_IN_ROW","End","LAST_IN_ROW","allowFocusing","arguments","focusType","createRowStartMap","map","Map","has","set","navigation","rowStartIndex","get","columnOffset","rowTabStop","maxRowIndex","rowEndIndex"],"mappings":";;;AAUA,MAAMA,2BAA2B,GAAG,CAAC,CAAA;MAExBC,uBAAuB,GAAGA,CACrCC,KAA4B,EAC5BC,MAA8B,KACJ;EAC1B,QAAQA,MAAM,CAACC,IAAI;IACjB,KAAKC,0BAA0B,CAACC,iBAAiB;AAAE,MAAA;AACjD,QAAA,MAAMC,UAAU,GAAGJ,MAAM,CAACK,OAAO,CAAA;AACjC,QAAA,IAAI,CAACD,UAAU,CAACE,aAAa,CAACC,OAAO,EAAE;AACrC,UAAA,OAAOR,KAAK,CAAA;AACd,SAAA;;AAEA;AACA;AACA;QACA,IAAIS,eAAe,GAAG,CAAC,CAAC,CAAA;AACxB,QAAA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AC7D,WAAA;AACF,SAAA;AACF,OAAA;AACA,MAAA,MAAA;AACJ,GAAA;AACA,EAAA,OAAOvB,KAAK,CAAA;AACd;;;;"}
@@ -0,0 +1,143 @@
1
+ import { ComponentProps } from 'react';
2
+
3
+ declare enum EventKey {
4
+ ArrowLeft = "ArrowLeft",
5
+ ArrowRight = "ArrowRight",
6
+ ArrowUp = "ArrowUp",
7
+ ArrowDown = "ArrowDown",
8
+ Home = "Home",
9
+ End = "End",
10
+ Enter = "Enter"
11
+ }
12
+ type KeyDirection = 'horizontal' | 'vertical' | 'both';
13
+ declare enum Navigation {
14
+ PREVIOUS = "PREVIOUS",
15
+ NEXT = "NEXT",
16
+ VERY_FIRST = "VERY_FIRST",
17
+ VERY_LAST = "VERY_LAST",
18
+ PREVIOUS_ROW = "PREVIOUS_ROW",
19
+ NEXT_ROW = "NEXT_ROW",
20
+ FIRST_IN_ROW = "FIRST_IN_ROW",
21
+ LAST_IN_ROW = "LAST_IN_ROW"
22
+ }
23
+ type TabStop = Readonly<{
24
+ id: string;
25
+ domElementRef: React.RefObject<Element>;
26
+ isDisabled: boolean;
27
+ rowIndex: number | null;
28
+ value: string;
29
+ }>;
30
+ type RowStartMap = Map<Exclude<TabStop['rowIndex'], null>, number>;
31
+ type FocusWithinGroupState = Readonly<{
32
+ selectedId: string | null;
33
+ allowFocusing: boolean;
34
+ tabStops: readonly TabStop[];
35
+ direction: KeyDirection;
36
+ focusOnClick: boolean;
37
+ focusOnInit: boolean;
38
+ loopAround: boolean;
39
+ rowStartMap: RowStartMap | null;
40
+ focusType: 'roving-tabindex' | 'virtual-focus';
41
+ listRole: 'listbox' | 'menu';
42
+ activedescendant?: [string, string];
43
+ filter?: {
44
+ value: string;
45
+ type: 'startsWith' | 'contains' | 'endsWith';
46
+ caseSensitive?: boolean;
47
+ };
48
+ delayedAction?: BaseFocusWithinGroupAction;
49
+ maxOptionsLength?: number;
50
+ }>;
51
+ type FocusWithinGroupOptions = Partial<Pick<FocusWithinGroupState, 'direction' | 'focusOnClick' | 'focusOnInit' | 'loopAround' | 'focusType' | 'listRole' | 'activedescendant' | 'maxOptionsLength'>>;
52
+ declare enum FocusWithinGroupActionType {
53
+ REGISTER_TAB_STOP = "REGISTER_TAB_STOP",
54
+ UNREGISTER_TAB_STOP = "UNREGISTER_TAB_STOP",
55
+ KEY_DOWN_ON_ITEM = "KEY_DOWN_ON_ITEM",
56
+ CLICK_ON_ITEM = "CLICK_ON_ITEM",
57
+ KEY_DOWN_ON_LIST = "KEY_DOWN_ON_LIST",
58
+ FOCUS_ON_LIST = "FOCUS_ON_LIST",
59
+ BLUR_ON_LIST = "BLUR_ON_LIST",
60
+ TAB_STOP_UPDATED = "TAB_STOP_UPDATED",
61
+ OPTIONS_UPDATED = "OPTIONS_UPDATED",
62
+ FILTER_LIST = "FILTER_LIST",
63
+ DELAY_ACTION = "DELAY_ACTION"
64
+ }
65
+ type BaseFocusWithinGroupAction = {
66
+ type: FocusWithinGroupActionType.REGISTER_TAB_STOP;
67
+ payload: TabStop;
68
+ } | {
69
+ type: FocusWithinGroupActionType.UNREGISTER_TAB_STOP;
70
+ payload: {
71
+ id: TabStop['id'];
72
+ };
73
+ } | {
74
+ type: FocusWithinGroupActionType.TAB_STOP_UPDATED;
75
+ payload: {
76
+ id: TabStop['id'];
77
+ rowIndex: TabStop['rowIndex'];
78
+ isDisabled: TabStop['isDisabled'];
79
+ value: string;
80
+ };
81
+ } | {
82
+ type: FocusWithinGroupActionType.KEY_DOWN_ON_ITEM;
83
+ payload: {
84
+ id: TabStop['id'];
85
+ key: EventKey;
86
+ ctrlKey: boolean;
87
+ };
88
+ } | {
89
+ type: FocusWithinGroupActionType.CLICK_ON_ITEM;
90
+ payload: {
91
+ id: TabStop['id'];
92
+ };
93
+ } | {
94
+ type: FocusWithinGroupActionType.KEY_DOWN_ON_LIST;
95
+ payload: {
96
+ key: EventKey;
97
+ ctrlKey: boolean;
98
+ };
99
+ } | {
100
+ type: FocusWithinGroupActionType.FOCUS_ON_LIST;
101
+ payload: {
102
+ id: TabStop['id'];
103
+ filter?: FocusWithinGroupState['filter'];
104
+ };
105
+ } | {
106
+ type: FocusWithinGroupActionType.BLUR_ON_LIST;
107
+ payload: {};
108
+ } | {
109
+ type: FocusWithinGroupActionType.OPTIONS_UPDATED;
110
+ payload: FocusWithinGroupOptions;
111
+ } | {
112
+ type: FocusWithinGroupActionType.FILTER_LIST;
113
+ payload: {
114
+ filter: FocusWithinGroupState['filter'];
115
+ };
116
+ };
117
+ type FocusWithinGroupAction = BaseFocusWithinGroupAction | {
118
+ type: FocusWithinGroupActionType.DELAY_ACTION;
119
+ payload: BaseFocusWithinGroupAction;
120
+ };
121
+ type UseFocusWithinGroupProps = {
122
+ tabIndex?: number;
123
+ isFocused: boolean;
124
+ handleKeyDown: (event: React.KeyboardEvent) => void;
125
+ handleClick: () => void;
126
+ };
127
+ type UseFocusGroupProps = {
128
+ activedescendant: [string, string] | undefined;
129
+ handleKeyDown: (event: React.KeyboardEvent) => void;
130
+ handleFocus: () => void;
131
+ handleBlur: () => void;
132
+ };
133
+ type FocusWithinGroupContextProps = {
134
+ state: FocusWithinGroupState;
135
+ dispatch: React.Dispatch<FocusWithinGroupAction>;
136
+ };
137
+ /**
138
+ * Component props.
139
+ */
140
+ interface FocusWithinGroupProps extends ComponentProps<'div'>, FocusWithinGroupOptions {
141
+ }
142
+
143
+ export { BaseFocusWithinGroupAction, EventKey, FocusWithinGroupAction, FocusWithinGroupActionType, FocusWithinGroupContextProps, FocusWithinGroupOptions, FocusWithinGroupProps, FocusWithinGroupState, KeyDirection, Navigation, RowStartMap, TabStop, UseFocusGroupProps, UseFocusWithinGroupProps };
@@ -0,0 +1,42 @@
1
+ let EventKey = /*#__PURE__*/function (EventKey) {
2
+ EventKey["ArrowLeft"] = "ArrowLeft";
3
+ EventKey["ArrowRight"] = "ArrowRight";
4
+ EventKey["ArrowUp"] = "ArrowUp";
5
+ EventKey["ArrowDown"] = "ArrowDown";
6
+ EventKey["Home"] = "Home";
7
+ EventKey["End"] = "End";
8
+ EventKey["Enter"] = "Enter";
9
+ return EventKey;
10
+ }({});
11
+ let Navigation = /*#__PURE__*/function (Navigation) {
12
+ Navigation["PREVIOUS"] = "PREVIOUS";
13
+ Navigation["NEXT"] = "NEXT";
14
+ Navigation["VERY_FIRST"] = "VERY_FIRST";
15
+ Navigation["VERY_LAST"] = "VERY_LAST";
16
+ Navigation["PREVIOUS_ROW"] = "PREVIOUS_ROW";
17
+ Navigation["NEXT_ROW"] = "NEXT_ROW";
18
+ Navigation["FIRST_IN_ROW"] = "FIRST_IN_ROW";
19
+ Navigation["LAST_IN_ROW"] = "LAST_IN_ROW";
20
+ return Navigation;
21
+ }({});
22
+ let FocusWithinGroupActionType = /*#__PURE__*/function (FocusWithinGroupActionType) {
23
+ FocusWithinGroupActionType["REGISTER_TAB_STOP"] = "REGISTER_TAB_STOP";
24
+ FocusWithinGroupActionType["UNREGISTER_TAB_STOP"] = "UNREGISTER_TAB_STOP";
25
+ FocusWithinGroupActionType["KEY_DOWN_ON_ITEM"] = "KEY_DOWN_ON_ITEM";
26
+ FocusWithinGroupActionType["CLICK_ON_ITEM"] = "CLICK_ON_ITEM";
27
+ FocusWithinGroupActionType["KEY_DOWN_ON_LIST"] = "KEY_DOWN_ON_LIST";
28
+ FocusWithinGroupActionType["FOCUS_ON_LIST"] = "FOCUS_ON_LIST";
29
+ FocusWithinGroupActionType["BLUR_ON_LIST"] = "BLUR_ON_LIST";
30
+ FocusWithinGroupActionType["TAB_STOP_UPDATED"] = "TAB_STOP_UPDATED";
31
+ FocusWithinGroupActionType["OPTIONS_UPDATED"] = "OPTIONS_UPDATED";
32
+ FocusWithinGroupActionType["FILTER_LIST"] = "FILTER_LIST";
33
+ FocusWithinGroupActionType["DELAY_ACTION"] = "DELAY_ACTION";
34
+ return FocusWithinGroupActionType;
35
+ }({});
36
+
37
+ /**
38
+ * Component props.
39
+ */
40
+
41
+ export { EventKey, FocusWithinGroupActionType, Navigation };
42
+ //# sourceMappingURL=types.js.map