@basic-ui/core 0.0.53 → 0.0.56

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 (302) hide show
  1. package/build/cjs/index.js +278 -505
  2. package/build/cjs/index.js.map +1 -1
  3. package/build/esm/Accordion/Accordion.js +20 -29
  4. package/build/esm/Accordion/Accordion.js.map +1 -1
  5. package/build/esm/Accordion/AccordionBody.js +18 -32
  6. package/build/esm/Accordion/AccordionBody.js.map +1 -1
  7. package/build/esm/Accordion/AccordionHeader.js +37 -74
  8. package/build/esm/Accordion/AccordionHeader.js.map +1 -1
  9. package/build/esm/Accordion/AccordionItem.js +19 -22
  10. package/build/esm/Accordion/AccordionItem.js.map +1 -1
  11. package/build/esm/Accordion/context.js +16 -13
  12. package/build/esm/Accordion/context.js.map +1 -1
  13. package/build/esm/Accordion/index.js.map +1 -1
  14. package/build/esm/Accordion/scopeQuery.js.map +1 -1
  15. package/build/esm/CheckBox/CheckBox.js +15 -25
  16. package/build/esm/CheckBox/CheckBox.js.map +1 -1
  17. package/build/esm/CheckBox/index.js.map +1 -1
  18. package/build/esm/ComboBox/Combobox.d.ts +7 -7
  19. package/build/esm/ComboBox/Combobox.js +52 -59
  20. package/build/esm/ComboBox/Combobox.js.map +1 -1
  21. package/build/esm/ComboBox/ComboboxButton.js +23 -28
  22. package/build/esm/ComboBox/ComboboxButton.js.map +1 -1
  23. package/build/esm/ComboBox/ComboboxInput.js +67 -70
  24. package/build/esm/ComboBox/ComboboxInput.js.map +1 -1
  25. package/build/esm/ComboBox/ComboboxLabel.js +15 -17
  26. package/build/esm/ComboBox/ComboboxLabel.js.map +1 -1
  27. package/build/esm/ComboBox/ComboboxList.js +19 -20
  28. package/build/esm/ComboBox/ComboboxList.js.map +1 -1
  29. package/build/esm/ComboBox/ComboboxOption.js +41 -45
  30. package/build/esm/ComboBox/ComboboxOption.js.map +1 -1
  31. package/build/esm/ComboBox/ComboboxPopover.js +22 -21
  32. package/build/esm/ComboBox/ComboboxPopover.js.map +1 -1
  33. package/build/esm/ComboBox/cities.js.map +1 -1
  34. package/build/esm/ComboBox/context.js +5 -6
  35. package/build/esm/ComboBox/context.js.map +1 -1
  36. package/build/esm/ComboBox/hooks.d.ts +2 -2
  37. package/build/esm/ComboBox/hooks.js +175 -148
  38. package/build/esm/ComboBox/hooks.js.map +1 -1
  39. package/build/esm/ComboBox/index.js.map +1 -1
  40. package/build/esm/ComboBox/makeHash.js +3 -6
  41. package/build/esm/ComboBox/makeHash.js.map +1 -1
  42. package/build/esm/ComboBox/scopeQuery.js.map +1 -1
  43. package/build/esm/FocusLock/FocusLock.js +26 -32
  44. package/build/esm/FocusLock/FocusLock.js.map +1 -1
  45. package/build/esm/FocusLock/index.js.map +1 -1
  46. package/build/esm/FocusLock/tabUtils.js +5 -7
  47. package/build/esm/FocusLock/tabUtils.js.map +1 -1
  48. package/build/esm/FocusLock/useFocusLock.js +14 -19
  49. package/build/esm/FocusLock/useFocusLock.js.map +1 -1
  50. package/build/esm/List/List.js +9 -11
  51. package/build/esm/List/List.js.map +1 -1
  52. package/build/esm/List/ListItem.js +9 -11
  53. package/build/esm/List/ListItem.js.map +1 -1
  54. package/build/esm/List/context.js +6 -6
  55. package/build/esm/List/context.js.map +1 -1
  56. package/build/esm/List/index.js.map +1 -1
  57. package/build/esm/Menu/ContextMenuTrigger.d.ts +4 -4
  58. package/build/esm/Menu/ContextMenuTrigger.js +32 -37
  59. package/build/esm/Menu/ContextMenuTrigger.js.map +1 -1
  60. package/build/esm/Menu/Menu.js +33 -49
  61. package/build/esm/Menu/Menu.js.map +1 -1
  62. package/build/esm/Menu/MenuButton.d.ts +4 -4
  63. package/build/esm/Menu/MenuButton.js +28 -44
  64. package/build/esm/Menu/MenuButton.js.map +1 -1
  65. package/build/esm/Menu/MenuItem.js +29 -38
  66. package/build/esm/Menu/MenuItem.js.map +1 -1
  67. package/build/esm/Menu/MenuList.js +61 -116
  68. package/build/esm/Menu/MenuList.js.map +1 -1
  69. package/build/esm/Menu/MenuPopover.js +16 -19
  70. package/build/esm/Menu/MenuPopover.js.map +1 -1
  71. package/build/esm/Menu/context.d.ts +1 -1
  72. package/build/esm/Menu/context.js +14 -12
  73. package/build/esm/Menu/context.js.map +1 -1
  74. package/build/esm/Menu/fixtures/countryList.js +1 -1
  75. package/build/esm/Menu/fixtures/countryList.js.map +1 -1
  76. package/build/esm/Menu/index.js.map +1 -1
  77. package/build/esm/Menu/scope.js.map +1 -1
  78. package/build/esm/Modal/Modal.js +13 -18
  79. package/build/esm/Modal/Modal.js.map +1 -1
  80. package/build/esm/Modal/ModalBackdrop.js +24 -33
  81. package/build/esm/Modal/ModalBackdrop.js.map +1 -1
  82. package/build/esm/Modal/index.js.map +1 -1
  83. package/build/esm/Popper/Popper.d.ts +3 -3
  84. package/build/esm/Popper/Popper.js +44 -61
  85. package/build/esm/Popper/Popper.js.map +1 -1
  86. package/build/esm/Popper/PopperArrow.js +11 -16
  87. package/build/esm/Popper/PopperArrow.js.map +1 -1
  88. package/build/esm/Popper/context.js +3 -5
  89. package/build/esm/Popper/context.js.map +1 -1
  90. package/build/esm/Popper/index.js.map +1 -1
  91. package/build/esm/Portal/Portal.js +9 -11
  92. package/build/esm/Portal/Portal.js.map +1 -1
  93. package/build/esm/Portal/PortalSelectorProvider.d.ts +3 -3
  94. package/build/esm/Portal/PortalSelectorProvider.js +6 -4
  95. package/build/esm/Portal/PortalSelectorProvider.js.map +1 -1
  96. package/build/esm/Portal/index.js.map +1 -1
  97. package/build/esm/RadioButton/RadioButton.js +17 -23
  98. package/build/esm/RadioButton/RadioButton.js.map +1 -1
  99. package/build/esm/RadioButton/RadioGroup.js +19 -28
  100. package/build/esm/RadioButton/RadioGroup.js.map +1 -1
  101. package/build/esm/RadioButton/context.d.ts +1 -1
  102. package/build/esm/RadioButton/context.js +8 -6
  103. package/build/esm/RadioButton/context.js.map +1 -1
  104. package/build/esm/RadioButton/index.js.map +1 -1
  105. package/build/esm/SkipNav/SkipNav.js +9 -11
  106. package/build/esm/SkipNav/SkipNav.js.map +1 -1
  107. package/build/esm/SkipNav/index.js.map +1 -1
  108. package/build/esm/Slider/Slider.d.ts +7 -7
  109. package/build/esm/Slider/Slider.js +340 -407
  110. package/build/esm/Slider/Slider.js.map +1 -1
  111. package/build/esm/Slider/index.js.map +1 -1
  112. package/build/esm/Spinner/Spinner.js +31 -59
  113. package/build/esm/Spinner/Spinner.js.map +1 -1
  114. package/build/esm/Spinner/SpinnerButton.js +14 -19
  115. package/build/esm/Spinner/SpinnerButton.js.map +1 -1
  116. package/build/esm/Spinner/context.js +8 -7
  117. package/build/esm/Spinner/context.js.map +1 -1
  118. package/build/esm/Spinner/index.js.map +1 -1
  119. package/build/esm/Tabs/Tab.js +32 -50
  120. package/build/esm/Tabs/Tab.js.map +1 -1
  121. package/build/esm/Tabs/TabList.js +24 -34
  122. package/build/esm/Tabs/TabList.js.map +1 -1
  123. package/build/esm/Tabs/TabPanel.js +16 -23
  124. package/build/esm/Tabs/TabPanel.js.map +1 -1
  125. package/build/esm/Tabs/TabPanels.js +15 -20
  126. package/build/esm/Tabs/TabPanels.js.map +1 -1
  127. package/build/esm/Tabs/Tabs.js +17 -33
  128. package/build/esm/Tabs/Tabs.js.map +1 -1
  129. package/build/esm/Tabs/context.js +16 -13
  130. package/build/esm/Tabs/context.js.map +1 -1
  131. package/build/esm/Tabs/index.js.map +1 -1
  132. package/build/esm/Tabs/scopeQuery.js.map +1 -1
  133. package/build/esm/Tooltip/Tooltip.d.ts +2 -2
  134. package/build/esm/Tooltip/Tooltip.js +20 -30
  135. package/build/esm/Tooltip/Tooltip.js.map +1 -1
  136. package/build/esm/Tooltip/index.js.map +1 -1
  137. package/build/esm/Tooltip/stateMachine.d.ts +2 -2
  138. package/build/esm/Tooltip/stateMachine.js +95 -81
  139. package/build/esm/Tooltip/stateMachine.js.map +1 -1
  140. package/build/esm/Tooltip/useTooltip.d.ts +2 -2
  141. package/build/esm/Tooltip/useTooltip.js +38 -50
  142. package/build/esm/Tooltip/useTooltip.js.map +1 -1
  143. package/build/esm/hooks/index.js.map +1 -1
  144. package/build/esm/hooks/useAutoFocus.js +3 -3
  145. package/build/esm/hooks/useAutoFocus.js.map +1 -1
  146. package/build/esm/hooks/useChildrenCounter.js +6 -8
  147. package/build/esm/hooks/useChildrenCounter.js.map +1 -1
  148. package/build/esm/hooks/useControlledState.js +6 -16
  149. package/build/esm/hooks/useControlledState.js.map +1 -1
  150. package/build/esm/hooks/useFocusReturn.js +8 -12
  151. package/build/esm/hooks/useFocusReturn.js.map +1 -1
  152. package/build/esm/hooks/useFocusState.d.ts +2 -2
  153. package/build/esm/hooks/useFocusState.js +9 -15
  154. package/build/esm/hooks/useFocusState.js.map +1 -1
  155. package/build/esm/hooks/useGestureHandlers.d.ts +1 -1
  156. package/build/esm/hooks/useGestureHandlers.js +80 -100
  157. package/build/esm/hooks/useGestureHandlers.js.map +1 -1
  158. package/build/esm/hooks/useMeasure.js +7 -15
  159. package/build/esm/hooks/useMeasure.js.map +1 -1
  160. package/build/esm/hooks/useOnClickOutside.js +4 -6
  161. package/build/esm/hooks/useOnClickOutside.js.map +1 -1
  162. package/build/esm/hooks/useOnKeyDown.js +3 -4
  163. package/build/esm/hooks/useOnKeyDown.js.map +1 -1
  164. package/build/esm/hooks/useReducerMachine.d.ts +1 -1
  165. package/build/esm/hooks/useReducerMachine.js +15 -26
  166. package/build/esm/hooks/useReducerMachine.js.map +1 -1
  167. package/build/esm/hooks/useRemoveBodyScroll.js +9 -14
  168. package/build/esm/hooks/useRemoveBodyScroll.js.map +1 -1
  169. package/build/esm/hooks/useScope.d.ts +2 -2
  170. package/build/esm/hooks/useScope.js +12 -14
  171. package/build/esm/hooks/useScope.js.map +1 -1
  172. package/build/esm/hooks/useThrottle.js +5 -10
  173. package/build/esm/hooks/useThrottle.js.map +1 -1
  174. package/build/esm/index.js +4 -2
  175. package/build/esm/index.js.map +1 -1
  176. package/build/esm/styles.d.js +2 -0
  177. package/build/esm/styles.d.js.map +1 -0
  178. package/build/esm/utils/assign-ref.js +3 -5
  179. package/build/esm/utils/assign-ref.js.map +1 -1
  180. package/build/esm/utils/can-use-dom.js.map +1 -1
  181. package/build/esm/utils/clamp.js.map +1 -1
  182. package/build/esm/utils/context.d.ts +1 -1
  183. package/build/esm/utils/context.js +13 -20
  184. package/build/esm/utils/context.js.map +1 -1
  185. package/build/esm/utils/create-subscription.js +5 -10
  186. package/build/esm/utils/create-subscription.js.map +1 -1
  187. package/build/esm/utils/get-circular-index.js +0 -1
  188. package/build/esm/utils/get-circular-index.js.map +1 -1
  189. package/build/esm/utils/index.js.map +1 -1
  190. package/build/esm/utils/is-right-click.js.map +1 -1
  191. package/build/esm/utils/owner-document.js +1 -1
  192. package/build/esm/utils/owner-document.js.map +1 -1
  193. package/build/esm/utils/polymorphic.d.ts +10 -10
  194. package/build/esm/utils/polymorphic.js.map +1 -1
  195. package/build/esm/utils/rubber-band-clamp.js +2 -5
  196. package/build/esm/utils/rubber-band-clamp.js.map +1 -1
  197. package/build/esm/utils/use-stable-callback.js +8 -10
  198. package/build/esm/utils/use-stable-callback.js.map +1 -1
  199. package/build/esm/utils/wrap-event.d.ts +1 -1
  200. package/build/esm/utils/wrap-event.js +2 -5
  201. package/build/esm/utils/wrap-event.js.map +1 -1
  202. package/build/tsconfig-build.tsbuildinfo +1 -1
  203. package/package.json +6 -6
  204. package/src/Accordion/Accordion.tsx +1 -1
  205. package/src/Accordion/AccordionBody.tsx +1 -1
  206. package/src/Accordion/AccordionHeader.tsx +1 -2
  207. package/src/ComboBox/Combobox.tsx +2 -2
  208. package/src/ComboBox/ComboboxList.tsx +1 -1
  209. package/src/ComboBox/ComboboxOption.tsx +0 -1
  210. package/src/ComboBox/hooks.tsx +0 -3
  211. package/src/FocusLock/useFocusLock.ts +0 -1
  212. package/src/Menu/Menu.tsx +2 -3
  213. package/src/Menu/MenuItem.tsx +1 -2
  214. package/src/Menu/MenuList.tsx +4 -4
  215. package/src/Modal/Modal.story.tsx +11 -7
  216. package/src/Modal/ModalBackdrop.tsx +1 -1
  217. package/src/Modal/NavDrawer.story.tsx +9 -6
  218. package/src/Popper/Popper.story.tsx +23 -7
  219. package/src/Popper/Popper.tsx +2 -2
  220. package/src/RadioButton/RadioButton.story.tsx +2 -1
  221. package/src/Slider/Slider.tsx +6 -11
  222. package/src/Spinner/Spinner.tsx +1 -1
  223. package/src/Tabs/TabList.tsx +1 -1
  224. package/src/Tooltip/Tooltip.tsx +8 -5
  225. package/src/Tooltip/useTooltip.ts +1 -1
  226. package/src/hooks/useControlledState.ts +1 -6
  227. package/src/hooks/useGestureHandlers.ts +0 -4
  228. package/src/hooks/useRemoveBodyScroll.ts +0 -1
  229. package/src/hooks/useScope.ts +1 -1
  230. package/src/styles.d.ts +1 -0
  231. package/src/utils/polymorphic.ts +14 -10
  232. package/src/utils/use-stable-callback.ts +0 -1
  233. package/build/esm/Carousel/Carousel.d.ts +0 -9
  234. package/build/esm/Carousel/Carousel.js +0 -38
  235. package/build/esm/Carousel/Carousel.js.map +0 -1
  236. package/build/esm/Carousel/Fader.d.ts +0 -14
  237. package/build/esm/Carousel/Fader.js +0 -76
  238. package/build/esm/Carousel/Fader.js.map +0 -1
  239. package/build/esm/Carousel/FaderItem.d.ts +0 -5
  240. package/build/esm/Carousel/FaderItem.js +0 -16
  241. package/build/esm/Carousel/FaderItem.js.map +0 -1
  242. package/build/esm/Carousel/Preloader.d.ts +0 -7
  243. package/build/esm/Carousel/Preloader.js +0 -70
  244. package/build/esm/Carousel/Preloader.js.map +0 -1
  245. package/build/esm/Carousel/Slider.d.ts +0 -14
  246. package/build/esm/Carousel/Slider.js +0 -212
  247. package/build/esm/Carousel/Slider.js.map +0 -1
  248. package/build/esm/Carousel/SliderItem.d.ts +0 -12
  249. package/build/esm/Carousel/SliderItem.js +0 -41
  250. package/build/esm/Carousel/SliderItem.js.map +0 -1
  251. package/build/esm/Carousel/context.d.ts +0 -10
  252. package/build/esm/Carousel/context.js +0 -8
  253. package/build/esm/Carousel/context.js.map +0 -1
  254. package/build/esm/Carousel/getSliderParams.d.ts +0 -9
  255. package/build/esm/Carousel/getSliderParams.js +0 -85
  256. package/build/esm/Carousel/getSliderParams.js.map +0 -1
  257. package/build/esm/Carousel/index.d.ts +0 -7
  258. package/build/esm/Carousel/index.js +0 -8
  259. package/build/esm/Carousel/index.js.map +0 -1
  260. package/build/esm/Carousel/useCarouselGestures.d.ts +0 -30
  261. package/build/esm/Carousel/useCarouselGestures.js +0 -33
  262. package/build/esm/Carousel/useCarouselGestures.js.map +0 -1
  263. package/build/esm/DatePicker/DatePicker.d.ts +0 -24
  264. package/build/esm/DatePicker/DatePicker.js +0 -101
  265. package/build/esm/DatePicker/DatePicker.js.map +0 -1
  266. package/build/esm/DatePicker/DatePickerSelect.d.ts +0 -8
  267. package/build/esm/DatePicker/DatePickerSelect.js +0 -201
  268. package/build/esm/DatePicker/DatePickerSelect.js.map +0 -1
  269. package/build/esm/DatePicker/RangeDatePicker.d.ts +0 -28
  270. package/build/esm/DatePicker/RangeDatePicker.js +0 -94
  271. package/build/esm/DatePicker/RangeDatePicker.js.map +0 -1
  272. package/build/esm/DatePicker/adjustDates.d.ts +0 -4
  273. package/build/esm/DatePicker/adjustDates.js +0 -18
  274. package/build/esm/DatePicker/adjustDates.js.map +0 -1
  275. package/build/esm/DatePicker/contexts.d.ts +0 -31
  276. package/build/esm/DatePicker/contexts.js +0 -15
  277. package/build/esm/DatePicker/contexts.js.map +0 -1
  278. package/build/esm/DatePicker/dateTypes.d.ts +0 -2
  279. package/build/esm/DatePicker/dateTypes.js +0 -2
  280. package/build/esm/DatePicker/dateTypes.js.map +0 -1
  281. package/build/esm/DatePicker/hooks.d.ts +0 -36
  282. package/build/esm/DatePicker/hooks.js +0 -98
  283. package/build/esm/DatePicker/hooks.js.map +0 -1
  284. package/build/esm/DatePicker/index.d.ts +0 -5
  285. package/build/esm/DatePicker/index.js +0 -6
  286. package/build/esm/DatePicker/index.js.map +0 -1
  287. package/build/esm/hooks/useId.d.ts +0 -1
  288. package/build/esm/hooks/useId.js +0 -25
  289. package/build/esm/hooks/useId.js.map +0 -1
  290. package/build/esm/utils/assignRef.d.ts +0 -3
  291. package/build/esm/utils/assignRef.js +0 -25
  292. package/build/esm/utils/assignRef.js.map +0 -1
  293. package/build/esm/utils/getCircularIndex.d.ts +0 -1
  294. package/build/esm/utils/getCircularIndex.js +0 -8
  295. package/build/esm/utils/getCircularIndex.js.map +0 -1
  296. package/build/esm/utils/rubberBandClamp.d.ts +0 -2
  297. package/build/esm/utils/rubberBandClamp.js +0 -20
  298. package/build/esm/utils/rubberBandClamp.js.map +0 -1
  299. package/build/esm/utils/wrapEvent.d.ts +0 -3
  300. package/build/esm/utils/wrapEvent.js +0 -16
  301. package/build/esm/utils/wrapEvent.js.map +0 -1
  302. package/build/tsconfig.tsbuildinfo +0 -7270
@@ -1,8 +1,7 @@
1
1
  import { createContext, useContext } from 'react';
2
- var comboboxContext = /*#__PURE__*/createContext(null);
3
- var ComboBoxProvider = comboboxContext.Provider;
4
- export { ComboBoxProvider };
5
- export var useComboBoxContext = function useComboBoxContext() {
6
- return useContext(comboboxContext);
7
- };
2
+ const comboboxContext = /*#__PURE__*/createContext(null);
3
+ export const {
4
+ Provider: ComboBoxProvider
5
+ } = comboboxContext;
6
+ export const useComboBoxContext = () => useContext(comboboxContext);
8
7
  //# sourceMappingURL=context.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"context.js","names":["createContext","useContext","comboboxContext","ComboBoxProvider","Provider","useComboBoxContext"],"sources":["../../../src/ComboBox/context.ts"],"sourcesContent":["import type { MutableRefObject } from 'react';\nimport { createContext, useContext } from 'react';\n\nimport type { ActionTypes, StateTypes, ReducerState } from './hooks';\nimport type { SelectEventHandler } from './Combobox';\nimport type { Scope } from '../hooks';\n\nexport interface ComboBoxContextProps {\n data: Omit<ReducerState, 'state'>;\n inputRef: MutableRefObject<HTMLInputElement | null>;\n popoverRef: MutableRefObject<HTMLDivElement | null>;\n buttonRef: MutableRefObject<HTMLButtonElement | null>;\n onSelect?: SelectEventHandler;\n optionsRef: MutableRefObject<{\n [itemId: string]: {\n value: string | unknown;\n text: string;\n };\n }>;\n listScope: Scope<HTMLElement>;\n state: StateTypes;\n transition: (action: ActionTypes, payload?: any) => void;\n listboxIdRef: MutableRefObject<string | undefined>;\n labelIdRef: MutableRefObject<string | undefined>;\n autocompletePropRef: MutableRefObject<boolean>;\n persistSelectionRef: MutableRefObject<boolean>;\n clearOnEscapeRef: MutableRefObject<boolean>;\n isVisible: boolean;\n openOnFocus: boolean;\n selectOnBlur: boolean;\n}\n\nconst comboboxContext = createContext<ComboBoxContextProps>(null as any);\nexport const { Provider: ComboBoxProvider } = comboboxContext;\nexport const useComboBoxContext = () => useContext(comboboxContext);\n"],"mappings":"AACA,SAASA,aAAT,EAAwBC,UAAxB,QAA0C,OAA1C;AA+BA,IAAMC,eAAe,gBAAGF,aAAa,CAAuB,IAAvB,CAArC;AACO,IAAkBG,gBAAlB,GAAuCD,eAAvC,CAAQE,QAAR;;AACP,OAAO,IAAMC,kBAAkB,GAAG,SAArBA,kBAAqB;EAAA,OAAMJ,UAAU,CAACC,eAAD,CAAhB;AAAA,CAA3B"}
1
+ {"version":3,"file":"context.js","names":["createContext","useContext","comboboxContext","Provider","ComboBoxProvider","useComboBoxContext"],"sources":["../../../src/ComboBox/context.ts"],"sourcesContent":["import type { MutableRefObject } from 'react';\nimport { createContext, useContext } from 'react';\n\nimport type { ActionTypes, StateTypes, ReducerState } from './hooks';\nimport type { SelectEventHandler } from './Combobox';\nimport type { Scope } from '../hooks';\n\nexport interface ComboBoxContextProps {\n data: Omit<ReducerState, 'state'>;\n inputRef: MutableRefObject<HTMLInputElement | null>;\n popoverRef: MutableRefObject<HTMLDivElement | null>;\n buttonRef: MutableRefObject<HTMLButtonElement | null>;\n onSelect?: SelectEventHandler;\n optionsRef: MutableRefObject<{\n [itemId: string]: {\n value: string | unknown;\n text: string;\n };\n }>;\n listScope: Scope<HTMLElement>;\n state: StateTypes;\n transition: (action: ActionTypes, payload?: any) => void;\n listboxIdRef: MutableRefObject<string | undefined>;\n labelIdRef: MutableRefObject<string | undefined>;\n autocompletePropRef: MutableRefObject<boolean>;\n persistSelectionRef: MutableRefObject<boolean>;\n clearOnEscapeRef: MutableRefObject<boolean>;\n isVisible: boolean;\n openOnFocus: boolean;\n selectOnBlur: boolean;\n}\n\nconst comboboxContext = createContext<ComboBoxContextProps>(null as any);\nexport const { Provider: ComboBoxProvider } = comboboxContext;\nexport const useComboBoxContext = () => useContext(comboboxContext);\n"],"mappings":"AACA,SAASA,aAAa,EAAEC,UAAU,QAAQ,OAAO;AA+BjD,MAAMC,eAAe,gBAAGF,aAAa,CAAuB,IAAW,CAAC;AACxE,OAAO,MAAM;EAAEG,QAAQ,EAAEC;AAAiB,CAAC,GAAGF,eAAe;AAC7D,OAAO,MAAMG,kBAAkB,GAAGA,CAAA,KAAMJ,UAAU,CAACC,eAAe,CAAC","ignoreList":[]}
@@ -3,7 +3,7 @@ import type { StateChart as GenericStateChart, StateMachineState } from '../hook
3
3
  export declare const IDLE = "IDLE";
4
4
  declare const SUGGESTING = "SUGGESTING";
5
5
  export declare const NAVIGATING = "NAVIGATING";
6
- export declare type StateTypes = typeof IDLE | typeof SUGGESTING | typeof NAVIGATING;
6
+ export type StateTypes = typeof IDLE | typeof SUGGESTING | typeof NAVIGATING;
7
7
  export declare const INIT = "INIT";
8
8
  export declare const CLEAR = "CLEAR";
9
9
  export declare const CLEAR_SELECTION = "CLEAR_SELECTION";
@@ -16,7 +16,7 @@ declare const BLUR = "BLUR";
16
16
  export declare const FOCUS = "FOCUS";
17
17
  export declare const OPEN_WITH_BUTTON = "OPEN_WITH_BUTTON";
18
18
  export declare const CLOSE_WITH_BUTTON = "CLOSE_WITH_BUTTON";
19
- export declare type ActionTypes = typeof CLEAR | typeof CLEAR_SELECTION | typeof CHANGE | typeof INIT | typeof NAVIGATE | typeof SELECT_WITH_KEYBOARD | typeof SELECT_WITH_CLICK | typeof ESCAPE | typeof BLUR | typeof FOCUS | typeof OPEN_WITH_BUTTON | typeof CLOSE_WITH_BUTTON;
19
+ export type ActionTypes = typeof CLEAR | typeof CLEAR_SELECTION | typeof CHANGE | typeof INIT | typeof NAVIGATE | typeof SELECT_WITH_KEYBOARD | typeof SELECT_WITH_CLICK | typeof ESCAPE | typeof BLUR | typeof FOCUS | typeof OPEN_WITH_BUTTON | typeof CLOSE_WITH_BUTTON;
20
20
  export declare const stateChart: GenericStateChart<StateTypes, ActionTypes>;
21
21
  export interface ReducerState extends StateMachineState<StateTypes, ActionTypes> {
22
22
  item: string;
@@ -1,174 +1,206 @@
1
- import _extends from "@babel/runtime/helpers/extends";
2
- import _defineProperty from "@babel/runtime/helpers/defineProperty";
3
-
4
- var _on, _on2, _on3, _states;
5
-
6
- /* eslint-disable @typescript-eslint/no-use-before-define */
7
-
8
- /* eslint-disable default-case */
9
1
  import { useEffect } from 'react';
10
2
  import { getCircularIndex } from '../utils/get-circular-index';
11
3
  import { useComboBoxContext } from './context';
12
- import { scopeQuery } from './scopeQuery'; ////////////////////////////////////////////////////////////////////////////////
4
+ import { scopeQuery } from './scopeQuery';
5
+
6
+ ////////////////////////////////////////////////////////////////////////////////
13
7
  // States
14
- // Nothing going on, waiting for the user to type or use the arrow keys
15
8
 
16
- export var IDLE = 'IDLE'; // The component is suggesting options as the user types
9
+ // Nothing going on, waiting for the user to type or use the arrow keys
10
+ export const IDLE = 'IDLE';
17
11
 
18
- var SUGGESTING = 'SUGGESTING'; // The user is using the keyboard to navigate the list, not typing
12
+ // The component is suggesting options as the user types
13
+ const SUGGESTING = 'SUGGESTING';
19
14
 
20
- export var NAVIGATING = 'NAVIGATING';
15
+ // The user is using the keyboard to navigate the list, not typing
16
+ export const NAVIGATING = 'NAVIGATING';
21
17
  ////////////////////////////////////////////////////////////////////////////////
22
18
  // Actions:
23
- // Used to sync the state with controlled state, right after mounting
24
- export var INIT = 'INIT'; // User cleared the value w/ backspace, but input still has focus
25
19
 
26
- export var CLEAR = 'CLEAR'; // User cleared the value w/ backspace, but input still has focus
20
+ // Used to sync the state with controlled state, right after mounting
21
+ export const INIT = 'INIT';
27
22
 
28
- export var CLEAR_SELECTION = 'CLEAR_SELECTION'; // User is typing
23
+ // User cleared the value w/ backspace, but input still has focus
24
+ export const CLEAR = 'CLEAR';
29
25
 
30
- export var CHANGE = 'CHANGE'; // User is navigating w/ the keyboard
26
+ // User cleared the value w/ backspace, but input still has focus
27
+ export const CLEAR_SELECTION = 'CLEAR_SELECTION';
31
28
 
32
- export var NAVIGATE = 'NAVIGATE'; // User can be navigating with keyboard and then click instead, we want the
33
- // value from the click, not the current nav item
29
+ // User is typing
30
+ export const CHANGE = 'CHANGE';
34
31
 
35
- var SELECT_WITH_KEYBOARD = 'SELECT_WITH_KEYBOARD';
36
- export var SELECT_WITH_CLICK = 'SELECT_WITH_CLICK'; // Pretty self-explanatory, user can hit escape or blur to close the popover
32
+ // User is navigating w/ the keyboard
33
+ export const NAVIGATE = 'NAVIGATE';
37
34
 
38
- var ESCAPE = 'ESCAPE';
39
- var BLUR = 'BLUR';
40
- export var FOCUS = 'FOCUS';
41
- export var OPEN_WITH_BUTTON = 'OPEN_WITH_BUTTON';
42
- export var CLOSE_WITH_BUTTON = 'CLOSE_WITH_BUTTON';
35
+ // User can be navigating with keyboard and then click instead, we want the
36
+ // value from the click, not the current nav item
37
+ const SELECT_WITH_KEYBOARD = 'SELECT_WITH_KEYBOARD';
38
+ export const SELECT_WITH_CLICK = 'SELECT_WITH_CLICK';
39
+
40
+ // Pretty self-explanatory, user can hit escape or blur to close the popover
41
+ const ESCAPE = 'ESCAPE';
42
+ const BLUR = 'BLUR';
43
+ export const FOCUS = 'FOCUS';
44
+ export const OPEN_WITH_BUTTON = 'OPEN_WITH_BUTTON';
45
+ export const CLOSE_WITH_BUTTON = 'CLOSE_WITH_BUTTON';
43
46
  ////////////////////////////////////////////////////////////////////////////////
44
- export var stateChart = {
47
+ export const stateChart = {
45
48
  initial: IDLE,
46
- states: (_states = {}, _defineProperty(_states, IDLE, {
47
- on: (_on = {}, _defineProperty(_on, BLUR, IDLE), _defineProperty(_on, CLEAR, IDLE), _defineProperty(_on, INIT, IDLE), _defineProperty(_on, CLEAR_SELECTION, IDLE), _defineProperty(_on, CHANGE, SUGGESTING), _defineProperty(_on, FOCUS, SUGGESTING), _defineProperty(_on, NAVIGATE, NAVIGATING), _defineProperty(_on, OPEN_WITH_BUTTON, SUGGESTING), _on)
48
- }), _defineProperty(_states, SUGGESTING, {
49
- on: (_on2 = {}, _defineProperty(_on2, CHANGE, SUGGESTING), _defineProperty(_on2, FOCUS, SUGGESTING), _defineProperty(_on2, INIT, SUGGESTING), _defineProperty(_on2, NAVIGATE, NAVIGATING), _defineProperty(_on2, CLEAR, IDLE), _defineProperty(_on2, CLEAR_SELECTION, SUGGESTING), _defineProperty(_on2, ESCAPE, IDLE), _defineProperty(_on2, BLUR, IDLE), _defineProperty(_on2, SELECT_WITH_CLICK, IDLE), _defineProperty(_on2, CLOSE_WITH_BUTTON, IDLE), _on2)
50
- }), _defineProperty(_states, NAVIGATING, {
51
- on: (_on3 = {}, _defineProperty(_on3, CHANGE, SUGGESTING), _defineProperty(_on3, FOCUS, SUGGESTING), _defineProperty(_on3, INIT, NAVIGATING), _defineProperty(_on3, CLEAR, IDLE), _defineProperty(_on3, CLEAR_SELECTION, NAVIGATING), _defineProperty(_on3, BLUR, IDLE), _defineProperty(_on3, ESCAPE, IDLE), _defineProperty(_on3, NAVIGATE, NAVIGATING), _defineProperty(_on3, SELECT_WITH_KEYBOARD, IDLE), _defineProperty(_on3, SELECT_WITH_CLICK, IDLE), _defineProperty(_on3, CLOSE_WITH_BUTTON, IDLE), _on3)
52
- }), _states)
49
+ states: {
50
+ [IDLE]: {
51
+ on: {
52
+ [BLUR]: IDLE,
53
+ [CLEAR]: IDLE,
54
+ [INIT]: IDLE,
55
+ [CLEAR_SELECTION]: IDLE,
56
+ [CHANGE]: SUGGESTING,
57
+ [FOCUS]: SUGGESTING,
58
+ [NAVIGATE]: NAVIGATING,
59
+ [OPEN_WITH_BUTTON]: SUGGESTING
60
+ }
61
+ },
62
+ [SUGGESTING]: {
63
+ on: {
64
+ [CHANGE]: SUGGESTING,
65
+ [FOCUS]: SUGGESTING,
66
+ [INIT]: SUGGESTING,
67
+ [NAVIGATE]: NAVIGATING,
68
+ [CLEAR]: IDLE,
69
+ [CLEAR_SELECTION]: SUGGESTING,
70
+ [ESCAPE]: IDLE,
71
+ [BLUR]: IDLE,
72
+ [SELECT_WITH_CLICK]: IDLE,
73
+ [CLOSE_WITH_BUTTON]: IDLE
74
+ }
75
+ },
76
+ [NAVIGATING]: {
77
+ on: {
78
+ [CHANGE]: SUGGESTING,
79
+ [FOCUS]: SUGGESTING,
80
+ [INIT]: NAVIGATING,
81
+ [CLEAR]: IDLE,
82
+ [CLEAR_SELECTION]: NAVIGATING,
83
+ [BLUR]: IDLE,
84
+ [ESCAPE]: IDLE,
85
+ [NAVIGATE]: NAVIGATING,
86
+ [SELECT_WITH_KEYBOARD]: IDLE,
87
+ [SELECT_WITH_CLICK]: IDLE,
88
+ [CLOSE_WITH_BUTTON]: IDLE
89
+ }
90
+ }
91
+ }
53
92
  };
54
93
  export function comboboxReducer(data, action) {
55
- var nextState = _extends(_extends({}, data), {}, {
94
+ const nextState = {
95
+ ...data,
56
96
  state: action.nextState,
57
97
  lastActionType: action.type
58
- });
59
-
98
+ };
60
99
  switch (action.type) {
61
100
  case INIT:
62
101
  case CHANGE:
63
- return _extends(_extends({}, nextState), {}, {
102
+ return {
103
+ ...nextState,
64
104
  text: action.text,
65
105
  navigationItem: '',
66
106
  item: ''
67
- });
68
-
107
+ };
69
108
  case NAVIGATE:
70
109
  case OPEN_WITH_BUTTON:
71
110
  if (action.persistSelection) {
72
- return _extends(_extends({}, nextState), {}, {
111
+ return {
112
+ ...nextState,
73
113
  navigationItem: data.item
74
- });
114
+ };
75
115
  }
76
-
77
- return _extends(_extends({}, nextState), {}, {
116
+ return {
117
+ ...nextState,
78
118
  navigationItem: action.item
79
- });
80
-
119
+ };
81
120
  case CLEAR_SELECTION:
82
- return _extends(_extends({}, nextState), {}, {
121
+ return {
122
+ ...nextState,
83
123
  navigationItem: ''
84
- });
85
-
124
+ };
86
125
  case CLEAR:
87
- return _extends(_extends({}, nextState), {}, {
126
+ return {
127
+ ...nextState,
88
128
  text: '',
89
129
  navigationItem: '',
90
130
  item: ''
91
- });
92
-
131
+ };
93
132
  case BLUR:
94
- return _extends(_extends({}, nextState), {}, {
133
+ return {
134
+ ...nextState,
95
135
  text: action.text,
96
136
  navigationItem: '',
97
137
  item: action.item
98
- });
99
-
138
+ };
100
139
  case CLOSE_WITH_BUTTON:
101
140
  case ESCAPE:
102
- return _extends(_extends({}, nextState), {}, {
141
+ return {
142
+ ...nextState,
103
143
  navigationItem: '',
104
144
  item: ''
105
- });
106
-
145
+ };
107
146
  case SELECT_WITH_CLICK:
108
147
  case SELECT_WITH_KEYBOARD:
109
- return _extends(_extends({}, nextState), {}, {
148
+ return {
149
+ ...nextState,
110
150
  text: action.text,
111
151
  item: action.item,
112
152
  navigationItem: ''
113
- });
114
-
153
+ };
115
154
  case FOCUS:
116
- return _extends(_extends({}, nextState), {}, {
155
+ return {
156
+ ...nextState,
117
157
  navigationItem: action.item
118
- });
119
-
158
+ };
120
159
  default:
121
- throw new Error("Unknown action ".concat(action.type));
160
+ throw new Error(`Unknown action ${action.type}`);
122
161
  }
123
162
  }
124
- var visibleStates = [SUGGESTING, NAVIGATING];
125
- export var isVisible = function isVisible(state) {
126
- return visibleStates.indexOf(state) >= 0;
127
- }; ////////////////////////////////////////////////////////////////////////////////
163
+ const visibleStates = [SUGGESTING, NAVIGATING];
164
+ export const isVisible = state => visibleStates.indexOf(state) >= 0;
165
+
166
+ ////////////////////////////////////////////////////////////////////////////////
128
167
  // The rest is all implementation details
168
+
129
169
  // Move focus back to the input if we start navigating w/ the
130
170
  // keyboard after focus has moved to any focusable content in
131
171
  // the popup.
132
-
133
172
  export function useFocusManagement(lastActionType, inputRef) {
134
173
  // useEffect so that the cursor goes to the end of the input instead
135
174
  // of awkwardly at the beginning, unclear to me why ...
136
- useEffect(function () {
175
+ useEffect(() => {
137
176
  if (lastActionType === NAVIGATE || lastActionType === ESCAPE || lastActionType === SELECT_WITH_CLICK || lastActionType === OPEN_WITH_BUTTON) {
138
177
  inputRef.current && inputRef.current.focus();
139
178
  }
140
179
  });
141
180
  }
142
-
143
181
  function getNextItem(currentItem, key, optionsItems, autocomplete) {
144
- var jumpToStartOrEnd = key === 'Home' || key === 'End';
145
- var incr = 1;
146
-
182
+ const jumpToStartOrEnd = key === 'Home' || key === 'End';
183
+ let incr = 1;
147
184
  switch (key) {
148
185
  case 'PageUp':
149
186
  incr = -10;
150
187
  break;
151
-
152
188
  case 'PageDown':
153
189
  incr = 10;
154
190
  break;
155
-
156
191
  case 'End':
157
192
  case 'ArrowUp':
158
193
  incr = -1;
159
194
  break;
160
-
161
195
  case 'Home':
162
196
  case 'ArrowDown':
163
197
  incr = 1;
164
198
  break;
165
199
  }
200
+ const index = currentItem === '' ? -1 : optionsItems.findIndex(n => String(n.id) === currentItem);
201
+ const optionsLen = optionsItems.length;
166
202
 
167
- var index = currentItem === '' ? -1 : optionsItems.findIndex(function (n) {
168
- return String(n.id) === currentItem;
169
- });
170
- var optionsLen = optionsItems.length; // Nothing selected, either go to start, or end
171
-
203
+ // Nothing selected, either go to start, or end
172
204
  if (index < 0 || jumpToStartOrEnd) {
173
205
  if (incr > 0) {
174
206
  // Go to start
@@ -178,39 +210,37 @@ function getNextItem(currentItem, key, optionsItems, autocomplete) {
178
210
  return optionsItems[optionsLen - 1];
179
211
  }
180
212
  } else if (autocomplete) {
181
- var nextIndex = index + incr;
182
-
213
+ const nextIndex = index + incr;
183
214
  if (nextIndex < 0 || nextIndex >= optionsLen) {
184
215
  // Next is outside the bounds of list, return nothing selected
185
216
  return null;
186
217
  }
187
- } // I'm sure it won't be null, we already check optionsLen above
188
- // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
189
-
218
+ }
190
219
 
220
+ // I'm sure it won't be null, we already check optionsLen above
191
221
  return optionsItems[getCircularIndex(index + incr, optionsLen)];
192
- } // We want the same events when the input or the popup have focus (HOW COOL ARE
193
- // HOOKS BTW?) This is probably the hairiest piece but it's not bad.
194
-
222
+ }
195
223
 
224
+ // We want the same events when the input or the popup have focus (HOW COOL ARE
225
+ // HOOKS BTW?) This is probably the hairiest piece but it's not bad.
196
226
  export function useKeyDown() {
197
- var _useComboBoxContext = useComboBoxContext(),
198
- _useComboBoxContext$d = _useComboBoxContext.data,
199
- text = _useComboBoxContext$d.text,
200
- navigationItem = _useComboBoxContext$d.navigationItem,
201
- onSelect = _useComboBoxContext.onSelect,
202
- optionsRef = _useComboBoxContext.optionsRef,
203
- inputRef = _useComboBoxContext.inputRef,
204
- state = _useComboBoxContext.state,
205
- transition = _useComboBoxContext.transition,
206
- autocompletePropRef = _useComboBoxContext.autocompletePropRef,
207
- clearOnEscapeRef = _useComboBoxContext.clearOnEscapeRef,
208
- persistSelectionRef = _useComboBoxContext.persistSelectionRef,
209
- listScope = _useComboBoxContext.listScope;
210
-
227
+ const {
228
+ data: {
229
+ text,
230
+ navigationItem
231
+ },
232
+ onSelect,
233
+ optionsRef,
234
+ inputRef,
235
+ state,
236
+ transition,
237
+ autocompletePropRef,
238
+ clearOnEscapeRef,
239
+ persistSelectionRef,
240
+ listScope
241
+ } = useComboBoxContext();
211
242
  return function handleKeyDown(event) {
212
- var optionNodes = listScope.current.queryAllNodes(scopeQuery);
213
-
243
+ const optionNodes = listScope.current.queryAllNodes(scopeQuery);
214
244
  switch (event.key) {
215
245
  case 'Home':
216
246
  case 'End':
@@ -221,14 +251,14 @@ export function useKeyDown() {
221
251
  {
222
252
  // Don't scroll the page
223
253
  event.preventDefault();
224
- var optionsLen = optionNodes.length; // If the developer didn't render any options, there's no point in
254
+ const optionsLen = optionNodes.length;
255
+
256
+ // If the developer didn't render any options, there's no point in
225
257
  // trying to navigate--but seriously what the heck? Give us some
226
258
  // options fam.
227
-
228
259
  if (optionsLen === 0) {
229
260
  return;
230
261
  }
231
-
232
262
  if (state === IDLE) {
233
263
  // Opening a closed list
234
264
  transition(NAVIGATE, {
@@ -236,10 +266,10 @@ export function useKeyDown() {
236
266
  });
237
267
  } else {
238
268
  // When autocompletting, we'll not cycle through the list directly
239
- var autocomplete = autocompletePropRef.current; // Get next selected item
240
-
241
- var nextItem = getNextItem(navigationItem, event.key, optionNodes, autocomplete);
269
+ const autocomplete = autocompletePropRef.current;
242
270
 
271
+ // Get next selected item
272
+ const nextItem = getNextItem(navigationItem, event.key, optionNodes, autocomplete);
243
273
  if (nextItem !== null) {
244
274
  nextItem.scrollIntoView({
245
275
  behavior: 'auto',
@@ -256,10 +286,8 @@ export function useKeyDown() {
256
286
  });
257
287
  }
258
288
  }
259
-
260
289
  break;
261
290
  }
262
-
263
291
  case 'Escape':
264
292
  {
265
293
  if (state !== IDLE) {
@@ -267,34 +295,31 @@ export function useKeyDown() {
267
295
  } else if (state === IDLE && text !== '') {
268
296
  if (!inputRef.current || !clearOnEscapeRef.current) {
269
297
  break;
270
- } // emulate a inputRef change event, might not work in future versions of React
271
-
298
+ }
272
299
 
273
- var lastValue = inputRef.current.value;
300
+ // emulate a inputRef change event, might not work in future versions of React
301
+ const lastValue = inputRef.current.value;
274
302
  inputRef.current.value = '';
275
- var tracker = inputRef.current._valueTracker;
276
-
303
+ const tracker = inputRef.current._valueTracker;
277
304
  if (tracker) {
278
305
  tracker.setValue(lastValue);
279
306
  }
280
-
281
- var _event = new Event('change', {
307
+ const event = new Event('change', {
282
308
  bubbles: true
283
309
  });
284
-
285
- inputRef.current.dispatchEvent(_event);
310
+ inputRef.current.dispatchEvent(event);
286
311
  }
287
-
288
312
  break;
289
313
  }
290
-
291
314
  case 'Enter':
292
315
  {
293
316
  if (state === NAVIGATING && navigationItem !== '') {
294
- var _optionsRef$current$n = optionsRef.current[navigationItem],
295
- navigationValue = _optionsRef$current$n.value,
296
- navigationText = _optionsRef$current$n.text; // don't want to submit forms
317
+ const {
318
+ value: navigationValue,
319
+ text: navigationText
320
+ } = optionsRef.current[navigationItem];
297
321
 
322
+ // don't want to submit forms
298
323
  event.preventDefault();
299
324
  onSelect && onSelect(navigationText, navigationItem, navigationValue);
300
325
  transition(SELECT_WITH_KEYBOARD, {
@@ -302,30 +327,31 @@ export function useKeyDown() {
302
327
  item: navigationItem
303
328
  });
304
329
  }
305
-
306
330
  break;
307
331
  }
308
332
  }
309
333
  };
310
334
  }
311
335
  export function useBlur() {
312
- var _useComboBoxContext2 = useComboBoxContext(),
313
- _useComboBoxContext2$ = _useComboBoxContext2.data,
314
- navigationItem = _useComboBoxContext2$.navigationItem,
315
- stateText = _useComboBoxContext2$.text,
316
- transition = _useComboBoxContext2.transition,
317
- optionsRef = _useComboBoxContext2.optionsRef,
318
- popoverRef = _useComboBoxContext2.popoverRef,
319
- inputRef = _useComboBoxContext2.inputRef,
320
- buttonRef = _useComboBoxContext2.buttonRef,
321
- onSelect = _useComboBoxContext2.onSelect,
322
- selectOnBlur = _useComboBoxContext2.selectOnBlur;
323
-
336
+ const {
337
+ data: {
338
+ navigationItem,
339
+ text: stateText
340
+ },
341
+ transition,
342
+ optionsRef,
343
+ popoverRef,
344
+ inputRef,
345
+ buttonRef,
346
+ onSelect,
347
+ selectOnBlur // not implemented yet
348
+ } = useComboBoxContext();
324
349
  return function handleBlur() {
325
- requestAnimationFrame(function () {
350
+ requestAnimationFrame(() => {
326
351
  // we on want to close only if focus rests outside the combobox
327
352
  if (document.activeElement !== inputRef.current && document.activeElement !== buttonRef.current && popoverRef.current) {
328
- if (popoverRef.current.contains(document.activeElement)) {// focus landed inside the combobox, keep it open
353
+ if (popoverRef.current.contains(document.activeElement)) {
354
+ // focus landed inside the combobox, keep it open
329
355
  // in the future, we can make it not close, select, or anything
330
356
  // this way we can have like... checkboxes available in the
331
357
  // menu item, etc.
@@ -339,9 +365,10 @@ export function useBlur() {
339
365
  });
340
366
  } else {
341
367
  // select the currently selected item
342
- var _optionsRef$current$n2 = optionsRef.current[navigationItem],
343
- navigationValue = _optionsRef$current$n2.value,
344
- navigationText = _optionsRef$current$n2.text;
368
+ const {
369
+ value: navigationValue,
370
+ text: navigationText
371
+ } = optionsRef.current[navigationItem];
345
372
  onSelect && onSelect(navigationText, navigationItem, navigationValue);
346
373
  transition(BLUR, {
347
374
  text: navigationText,