@basic-ui/core 0.0.53 → 0.0.54

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 (400) hide show
  1. package/README.md +3 -3
  2. package/build/cjs/index.js +88 -88
  3. package/build/cjs/index.js.map +1 -1
  4. package/build/esm/Accordion/Accordion.d.ts +9 -9
  5. package/build/esm/Accordion/Accordion.js.map +1 -1
  6. package/build/esm/Accordion/AccordionBody.d.ts +6 -6
  7. package/build/esm/Accordion/AccordionBody.js.map +1 -1
  8. package/build/esm/Accordion/AccordionHeader.d.ts +7 -7
  9. package/build/esm/Accordion/AccordionHeader.js.map +1 -1
  10. package/build/esm/Accordion/AccordionItem.d.ts +9 -9
  11. package/build/esm/Accordion/AccordionItem.js.map +1 -1
  12. package/build/esm/Accordion/context.d.ts +19 -19
  13. package/build/esm/Accordion/context.js.map +1 -1
  14. package/build/esm/Accordion/index.d.ts +4 -4
  15. package/build/esm/Accordion/index.js.map +1 -1
  16. package/build/esm/Accordion/scopeQuery.d.ts +2 -2
  17. package/build/esm/Accordion/scopeQuery.js.map +1 -1
  18. package/build/esm/CheckBox/CheckBox.d.ts +7 -7
  19. package/build/esm/CheckBox/CheckBox.js.map +1 -1
  20. package/build/esm/CheckBox/index.d.ts +1 -1
  21. package/build/esm/CheckBox/index.js.map +1 -1
  22. package/build/esm/ComboBox/Combobox.d.ts +18 -18
  23. package/build/esm/ComboBox/Combobox.js.map +1 -1
  24. package/build/esm/ComboBox/ComboboxButton.d.ts +9 -9
  25. package/build/esm/ComboBox/ComboboxButton.js.map +1 -1
  26. package/build/esm/ComboBox/ComboboxInput.d.ts +17 -17
  27. package/build/esm/ComboBox/ComboboxInput.js.map +1 -1
  28. package/build/esm/ComboBox/ComboboxLabel.d.ts +7 -7
  29. package/build/esm/ComboBox/ComboboxLabel.js.map +1 -1
  30. package/build/esm/ComboBox/ComboboxList.d.ts +8 -8
  31. package/build/esm/ComboBox/ComboboxList.js.map +1 -1
  32. package/build/esm/ComboBox/ComboboxOption.d.ts +11 -11
  33. package/build/esm/ComboBox/ComboboxOption.js.map +1 -1
  34. package/build/esm/ComboBox/ComboboxPopover.d.ts +9 -9
  35. package/build/esm/ComboBox/ComboboxPopover.js.map +1 -1
  36. package/build/esm/ComboBox/cities.d.ts +5 -5
  37. package/build/esm/ComboBox/cities.js.map +1 -1
  38. package/build/esm/ComboBox/context.d.ts +30 -30
  39. package/build/esm/ComboBox/context.js.map +1 -1
  40. package/build/esm/ComboBox/hooks.d.ts +37 -37
  41. package/build/esm/ComboBox/hooks.js.map +1 -1
  42. package/build/esm/ComboBox/index.d.ts +8 -8
  43. package/build/esm/ComboBox/index.js.map +1 -1
  44. package/build/esm/ComboBox/makeHash.d.ts +1 -1
  45. package/build/esm/ComboBox/makeHash.js.map +1 -1
  46. package/build/esm/ComboBox/scopeQuery.d.ts +1 -1
  47. package/build/esm/ComboBox/scopeQuery.js.map +1 -1
  48. package/build/esm/FocusLock/FocusLock.d.ts +9 -9
  49. package/build/esm/FocusLock/FocusLock.js.map +1 -1
  50. package/build/esm/FocusLock/index.d.ts +1 -1
  51. package/build/esm/FocusLock/index.js.map +1 -1
  52. package/build/esm/FocusLock/tabUtils.d.ts +3 -3
  53. package/build/esm/FocusLock/tabUtils.js.map +1 -1
  54. package/build/esm/FocusLock/useFocusLock.d.ts +7 -7
  55. package/build/esm/FocusLock/useFocusLock.js.map +1 -1
  56. package/build/esm/List/List.d.ts +7 -7
  57. package/build/esm/List/List.js.map +1 -1
  58. package/build/esm/List/ListItem.d.ts +7 -7
  59. package/build/esm/List/ListItem.js.map +1 -1
  60. package/build/esm/List/context.d.ts +4 -4
  61. package/build/esm/List/context.js.map +1 -1
  62. package/build/esm/List/index.d.ts +2 -2
  63. package/build/esm/List/index.js.map +1 -1
  64. package/build/esm/Menu/ContextMenuTrigger.d.ts +11 -11
  65. package/build/esm/Menu/ContextMenuTrigger.js.map +1 -1
  66. package/build/esm/Menu/Menu.d.ts +10 -10
  67. package/build/esm/Menu/Menu.js.map +1 -1
  68. package/build/esm/Menu/MenuButton.d.ts +11 -11
  69. package/build/esm/Menu/MenuButton.js.map +1 -1
  70. package/build/esm/Menu/MenuItem.d.ts +8 -8
  71. package/build/esm/Menu/MenuItem.js.map +1 -1
  72. package/build/esm/Menu/MenuList.d.ts +7 -7
  73. package/build/esm/Menu/MenuList.js.map +1 -1
  74. package/build/esm/Menu/MenuPopover.d.ts +8 -8
  75. package/build/esm/Menu/MenuPopover.js.map +1 -1
  76. package/build/esm/Menu/context.d.ts +25 -25
  77. package/build/esm/Menu/context.js.map +1 -1
  78. package/build/esm/Menu/fixtures/countryList.d.ts +1 -1
  79. package/build/esm/Menu/fixtures/countryList.js.map +1 -1
  80. package/build/esm/Menu/index.d.ts +6 -6
  81. package/build/esm/Menu/index.js.map +1 -1
  82. package/build/esm/Menu/scope.d.ts +1 -1
  83. package/build/esm/Menu/scope.js.map +1 -1
  84. package/build/esm/Modal/Modal.d.ts +9 -9
  85. package/build/esm/Modal/Modal.js.map +1 -1
  86. package/build/esm/Modal/ModalBackdrop.d.ts +10 -10
  87. package/build/esm/Modal/ModalBackdrop.js.map +1 -1
  88. package/build/esm/Modal/index.d.ts +2 -2
  89. package/build/esm/Modal/index.js.map +1 -1
  90. package/build/esm/Popper/Popper.d.ts +35 -35
  91. package/build/esm/Popper/Popper.js +1 -2
  92. package/build/esm/Popper/Popper.js.map +1 -1
  93. package/build/esm/Popper/PopperArrow.d.ts +6 -6
  94. package/build/esm/Popper/PopperArrow.js.map +1 -1
  95. package/build/esm/Popper/context.d.ts +6 -6
  96. package/build/esm/Popper/context.js.map +1 -1
  97. package/build/esm/Popper/index.d.ts +3 -3
  98. package/build/esm/Popper/index.js.map +1 -1
  99. package/build/esm/Portal/Portal.d.ts +7 -7
  100. package/build/esm/Portal/PortalSelectorProvider.d.ts +8 -8
  101. package/build/esm/Portal/index.d.ts +2 -2
  102. package/build/esm/RadioButton/RadioButton.d.ts +10 -10
  103. package/build/esm/RadioButton/RadioButton.js.map +1 -1
  104. package/build/esm/RadioButton/RadioGroup.d.ts +12 -12
  105. package/build/esm/RadioButton/RadioGroup.js.map +1 -1
  106. package/build/esm/RadioButton/context.d.ts +9 -9
  107. package/build/esm/RadioButton/context.js.map +1 -1
  108. package/build/esm/RadioButton/index.d.ts +2 -2
  109. package/build/esm/RadioButton/index.js.map +1 -1
  110. package/build/esm/SkipNav/SkipNav.d.ts +7 -7
  111. package/build/esm/SkipNav/SkipNav.js.map +1 -1
  112. package/build/esm/SkipNav/index.d.ts +1 -1
  113. package/build/esm/SkipNav/index.js.map +1 -1
  114. package/build/esm/Slider/Slider.d.ts +197 -197
  115. package/build/esm/Slider/Slider.js +82 -82
  116. package/build/esm/Slider/Slider.js.map +1 -1
  117. package/build/esm/Slider/index.d.ts +1 -1
  118. package/build/esm/Slider/index.js.map +1 -1
  119. package/build/esm/Spinner/Spinner.d.ts +12 -12
  120. package/build/esm/Spinner/Spinner.js.map +1 -1
  121. package/build/esm/Spinner/SpinnerButton.d.ts +8 -8
  122. package/build/esm/Spinner/SpinnerButton.js.map +1 -1
  123. package/build/esm/Spinner/context.d.ts +12 -12
  124. package/build/esm/Spinner/context.js.map +1 -1
  125. package/build/esm/Spinner/index.d.ts +2 -2
  126. package/build/esm/Spinner/index.js.map +1 -1
  127. package/build/esm/Tabs/Tab.d.ts +7 -7
  128. package/build/esm/Tabs/Tab.js.map +1 -1
  129. package/build/esm/Tabs/TabList.d.ts +9 -9
  130. package/build/esm/Tabs/TabList.js.map +1 -1
  131. package/build/esm/Tabs/TabPanel.d.ts +8 -8
  132. package/build/esm/Tabs/TabPanel.js.map +1 -1
  133. package/build/esm/Tabs/TabPanels.d.ts +8 -8
  134. package/build/esm/Tabs/TabPanels.js.map +1 -1
  135. package/build/esm/Tabs/Tabs.d.ts +10 -10
  136. package/build/esm/Tabs/Tabs.js.map +1 -1
  137. package/build/esm/Tabs/context.d.ts +17 -17
  138. package/build/esm/Tabs/context.js.map +1 -1
  139. package/build/esm/Tabs/index.d.ts +5 -5
  140. package/build/esm/Tabs/index.js.map +1 -1
  141. package/build/esm/Tabs/scopeQuery.d.ts +1 -1
  142. package/build/esm/Tabs/scopeQuery.js.map +1 -1
  143. package/build/esm/Tooltip/Tooltip.d.ts +10 -10
  144. package/build/esm/Tooltip/Tooltip.js.map +1 -1
  145. package/build/esm/Tooltip/index.d.ts +1 -1
  146. package/build/esm/Tooltip/index.js.map +1 -1
  147. package/build/esm/Tooltip/stateMachine.d.ts +28 -28
  148. package/build/esm/Tooltip/stateMachine.js.map +1 -1
  149. package/build/esm/Tooltip/useTooltip.d.ts +10 -10
  150. package/build/esm/Tooltip/useTooltip.js.map +1 -1
  151. package/build/esm/hooks/index.d.ts +13 -13
  152. package/build/esm/hooks/index.js.map +1 -1
  153. package/build/esm/hooks/useAutoFocus.d.ts +2 -2
  154. package/build/esm/hooks/useAutoFocus.js.map +1 -1
  155. package/build/esm/hooks/useChildrenCounter.d.ts +7 -7
  156. package/build/esm/hooks/useChildrenCounter.js.map +1 -1
  157. package/build/esm/hooks/useControlledState.d.ts +3 -3
  158. package/build/esm/hooks/useFocusReturn.d.ts +2 -2
  159. package/build/esm/hooks/useFocusReturn.js.map +1 -1
  160. package/build/esm/hooks/useFocusState.d.ts +11 -11
  161. package/build/esm/hooks/useFocusState.js.map +1 -1
  162. package/build/esm/hooks/useGestureHandlers.d.ts +52 -52
  163. package/build/esm/hooks/useGestureHandlers.js.map +1 -1
  164. package/build/esm/hooks/useMeasure.d.ts +7 -7
  165. package/build/esm/hooks/useMeasure.js.map +1 -1
  166. package/build/esm/hooks/useOnClickOutside.d.ts +2 -2
  167. package/build/esm/hooks/useOnClickOutside.js.map +1 -1
  168. package/build/esm/hooks/useOnKeyDown.d.ts +1 -1
  169. package/build/esm/hooks/useOnKeyDown.js.map +1 -1
  170. package/build/esm/hooks/useReducerMachine.d.ts +24 -24
  171. package/build/esm/hooks/useReducerMachine.js.map +1 -1
  172. package/build/esm/hooks/useRemoveBodyScroll.d.ts +2 -2
  173. package/build/esm/hooks/useRemoveBodyScroll.js.map +1 -1
  174. package/build/esm/hooks/useScope.d.ts +11 -11
  175. package/build/esm/hooks/useScope.js.map +1 -1
  176. package/build/esm/hooks/useThrottle.d.ts +1 -1
  177. package/build/esm/hooks/useThrottle.js.map +1 -1
  178. package/build/esm/index.d.ts +15 -15
  179. package/build/esm/index.js.map +1 -1
  180. package/build/esm/utils/assign-ref.d.ts +3 -3
  181. package/build/esm/utils/assign-ref.js.map +1 -1
  182. package/build/esm/utils/can-use-dom.d.ts +1 -1
  183. package/build/esm/utils/can-use-dom.js.map +1 -1
  184. package/build/esm/utils/clamp.d.ts +1 -1
  185. package/build/esm/utils/clamp.js.map +1 -1
  186. package/build/esm/utils/context.d.ts +7 -7
  187. package/build/esm/utils/context.js.map +1 -1
  188. package/build/esm/utils/create-subscription.d.ts +4 -4
  189. package/build/esm/utils/create-subscription.js.map +1 -1
  190. package/build/esm/utils/get-circular-index.d.ts +1 -1
  191. package/build/esm/utils/get-circular-index.js.map +1 -1
  192. package/build/esm/utils/index.d.ts +10 -10
  193. package/build/esm/utils/index.js.map +1 -1
  194. package/build/esm/utils/is-right-click.d.ts +6 -6
  195. package/build/esm/utils/is-right-click.js +4 -4
  196. package/build/esm/utils/is-right-click.js.map +1 -1
  197. package/build/esm/utils/owner-document.d.ts +7 -7
  198. package/build/esm/utils/owner-document.js +5 -5
  199. package/build/esm/utils/owner-document.js.map +1 -1
  200. package/build/esm/utils/polymorphic.d.ts +39 -39
  201. package/build/esm/utils/polymorphic.js.map +1 -1
  202. package/build/esm/utils/rubber-band-clamp.d.ts +2 -2
  203. package/build/esm/utils/rubber-band-clamp.js.map +1 -1
  204. package/build/esm/utils/use-stable-callback.d.ts +16 -16
  205. package/build/esm/utils/use-stable-callback.js +16 -16
  206. package/build/esm/utils/use-stable-callback.js.map +1 -1
  207. package/build/esm/utils/wrap-event.d.ts +3 -3
  208. package/build/esm/utils/wrap-event.js.map +1 -1
  209. package/build/tsconfig-build.tsbuildinfo +1 -1
  210. package/package.json +2 -2
  211. package/src/Accordion/Accordion.story.tsx +74 -74
  212. package/src/Accordion/Accordion.tsx +59 -59
  213. package/src/Accordion/AccordionBody.tsx +52 -52
  214. package/src/Accordion/AccordionHeader.tsx +167 -167
  215. package/src/Accordion/AccordionItem.tsx +50 -50
  216. package/src/Accordion/context.ts +37 -37
  217. package/src/Accordion/index.ts +4 -4
  218. package/src/Accordion/scopeQuery.ts +7 -7
  219. package/src/Accordion/styles.css +21 -21
  220. package/src/CheckBox/CheckBox.tsx +41 -41
  221. package/src/CheckBox/index.ts +1 -1
  222. package/src/ComboBox/ComboBox.story.tsx +120 -120
  223. package/src/ComboBox/Combobox.tsx +148 -148
  224. package/src/ComboBox/ComboboxButton.tsx +61 -61
  225. package/src/ComboBox/ComboboxInput.tsx +187 -187
  226. package/src/ComboBox/ComboboxLabel.tsx +33 -33
  227. package/src/ComboBox/ComboboxList.tsx +47 -47
  228. package/src/ComboBox/ComboboxOption.tsx +111 -111
  229. package/src/ComboBox/ComboboxPopover.tsx +64 -64
  230. package/src/ComboBox/cities.ts +23194 -23194
  231. package/src/ComboBox/context.ts +35 -35
  232. package/src/ComboBox/hooks.tsx +451 -451
  233. package/src/ComboBox/index.ts +8 -8
  234. package/src/ComboBox/makeHash.ts +19 -19
  235. package/src/ComboBox/scopeQuery.ts +6 -6
  236. package/src/ComboBox/styles.css +32 -32
  237. package/src/FocusLock/FocusLock.tsx +66 -66
  238. package/src/FocusLock/index.ts +1 -1
  239. package/src/FocusLock/tabUtils.ts +40 -40
  240. package/src/FocusLock/useFocusLock.ts +56 -56
  241. package/src/List/List.story.tsx +18 -18
  242. package/src/List/List.tsx +17 -17
  243. package/src/List/ListItem.tsx +23 -23
  244. package/src/List/context.ts +19 -19
  245. package/src/List/index.ts +2 -2
  246. package/src/Menu/ContextMenu.story.tsx +73 -73
  247. package/src/Menu/ContextMenuTrigger.tsx +76 -76
  248. package/src/Menu/Menu.story.tsx +160 -160
  249. package/src/Menu/Menu.tsx +83 -83
  250. package/src/Menu/MenuButton.tsx +83 -83
  251. package/src/Menu/MenuComplex.story.tsx +58 -58
  252. package/src/Menu/MenuItem.tsx +88 -88
  253. package/src/Menu/MenuList.tsx +254 -254
  254. package/src/Menu/MenuPopover.tsx +35 -35
  255. package/src/Menu/context.ts +44 -44
  256. package/src/Menu/fixtures/countryList.ts +198 -198
  257. package/src/Menu/index.ts +6 -6
  258. package/src/Menu/scope.ts +7 -7
  259. package/src/Menu/styles.css +42 -42
  260. package/src/Modal/Modal.story.tsx +258 -258
  261. package/src/Modal/Modal.tsx +48 -48
  262. package/src/Modal/ModalBackdrop.tsx +78 -78
  263. package/src/Modal/NavDrawer.story.tsx +158 -158
  264. package/src/Modal/index.ts +2 -2
  265. package/src/Modal/styles.css +46 -46
  266. package/src/Popper/Popper.story.tsx +263 -263
  267. package/src/Popper/Popper.tsx +1 -1
  268. package/src/Popper/PopperArrow.tsx +35 -35
  269. package/src/Popper/context.ts +10 -10
  270. package/src/Popper/index.ts +3 -3
  271. package/src/Popper/styles.css +60 -60
  272. package/src/RadioButton/RadioButton.story.tsx +77 -77
  273. package/src/RadioButton/RadioButton.tsx +55 -55
  274. package/src/RadioButton/RadioGroup.tsx +60 -60
  275. package/src/RadioButton/context.ts +17 -17
  276. package/src/RadioButton/index.ts +2 -2
  277. package/src/SkipNav/SkipNav.tsx +16 -16
  278. package/src/SkipNav/index.tsx +1 -1
  279. package/src/Slider/Slider.story.tsx +45 -45
  280. package/src/Slider/Slider.tsx +1120 -1120
  281. package/src/Slider/index.ts +1 -1
  282. package/src/Slider/styles.css +131 -131
  283. package/src/Spinner/Spinner.story.tsx +31 -31
  284. package/src/Spinner/Spinner.tsx +117 -117
  285. package/src/Spinner/SpinnerButton.tsx +54 -54
  286. package/src/Spinner/context.ts +20 -20
  287. package/src/Spinner/index.ts +2 -2
  288. package/src/Spinner/styles.css +23 -23
  289. package/src/Tabs/Tab.story.tsx +80 -80
  290. package/src/Tabs/Tab.tsx +136 -136
  291. package/src/Tabs/TabList.tsx +71 -71
  292. package/src/Tabs/TabPanel.tsx +53 -53
  293. package/src/Tabs/TabPanels.tsx +30 -30
  294. package/src/Tabs/Tabs.tsx +46 -46
  295. package/src/Tabs/context.ts +30 -30
  296. package/src/Tabs/index.tsx +5 -5
  297. package/src/Tabs/scopeQuery.ts +6 -6
  298. package/src/Tooltip/Tooltip.story.tsx +61 -61
  299. package/src/Tooltip/Tooltip.tsx +50 -50
  300. package/src/Tooltip/index.ts +1 -1
  301. package/src/Tooltip/stateMachine.ts +192 -192
  302. package/src/Tooltip/styles.css +17 -17
  303. package/src/Tooltip/useTooltip.ts +136 -136
  304. package/src/hooks/index.ts +13 -13
  305. package/src/hooks/useAutoFocus.ts +22 -22
  306. package/src/hooks/useChildrenCounter.ts +51 -51
  307. package/src/hooks/useFocusReturn.ts +43 -43
  308. package/src/hooks/useFocusState.ts +30 -30
  309. package/src/hooks/useGestureHandlers.ts +286 -286
  310. package/src/hooks/useMeasure.ts +33 -33
  311. package/src/hooks/useOnClickOutside.ts +32 -32
  312. package/src/hooks/useOnKeyDown.ts +19 -19
  313. package/src/hooks/useReducerMachine.ts +60 -60
  314. package/src/hooks/useRemoveBodyScroll.ts +39 -39
  315. package/src/hooks/useScope.ts +52 -52
  316. package/src/hooks/useThrottle.ts +19 -19
  317. package/src/index.ts +20 -20
  318. package/src/utils/assign-ref.ts +27 -27
  319. package/src/utils/can-use-dom.ts +7 -7
  320. package/src/utils/clamp.ts +3 -3
  321. package/src/utils/context.tsx +48 -48
  322. package/src/utils/create-subscription.ts +16 -16
  323. package/src/utils/get-circular-index.ts +7 -7
  324. package/src/utils/index.ts +10 -10
  325. package/src/utils/is-right-click.ts +14 -14
  326. package/src/utils/owner-document.ts +13 -13
  327. package/src/utils/polymorphic.ts +78 -78
  328. package/src/utils/rubber-band-clamp.ts +25 -25
  329. package/src/utils/use-stable-callback.ts +58 -58
  330. package/src/utils/wrap-event.ts +22 -22
  331. package/build/esm/Carousel/Carousel.d.ts +0 -9
  332. package/build/esm/Carousel/Carousel.js +0 -38
  333. package/build/esm/Carousel/Carousel.js.map +0 -1
  334. package/build/esm/Carousel/Fader.d.ts +0 -14
  335. package/build/esm/Carousel/Fader.js +0 -76
  336. package/build/esm/Carousel/Fader.js.map +0 -1
  337. package/build/esm/Carousel/FaderItem.d.ts +0 -5
  338. package/build/esm/Carousel/FaderItem.js +0 -16
  339. package/build/esm/Carousel/FaderItem.js.map +0 -1
  340. package/build/esm/Carousel/Preloader.d.ts +0 -7
  341. package/build/esm/Carousel/Preloader.js +0 -70
  342. package/build/esm/Carousel/Preloader.js.map +0 -1
  343. package/build/esm/Carousel/Slider.d.ts +0 -14
  344. package/build/esm/Carousel/Slider.js +0 -212
  345. package/build/esm/Carousel/Slider.js.map +0 -1
  346. package/build/esm/Carousel/SliderItem.d.ts +0 -12
  347. package/build/esm/Carousel/SliderItem.js +0 -41
  348. package/build/esm/Carousel/SliderItem.js.map +0 -1
  349. package/build/esm/Carousel/context.d.ts +0 -10
  350. package/build/esm/Carousel/context.js +0 -8
  351. package/build/esm/Carousel/context.js.map +0 -1
  352. package/build/esm/Carousel/getSliderParams.d.ts +0 -9
  353. package/build/esm/Carousel/getSliderParams.js +0 -85
  354. package/build/esm/Carousel/getSliderParams.js.map +0 -1
  355. package/build/esm/Carousel/index.d.ts +0 -7
  356. package/build/esm/Carousel/index.js +0 -8
  357. package/build/esm/Carousel/index.js.map +0 -1
  358. package/build/esm/Carousel/useCarouselGestures.d.ts +0 -30
  359. package/build/esm/Carousel/useCarouselGestures.js +0 -33
  360. package/build/esm/Carousel/useCarouselGestures.js.map +0 -1
  361. package/build/esm/DatePicker/DatePicker.d.ts +0 -24
  362. package/build/esm/DatePicker/DatePicker.js +0 -101
  363. package/build/esm/DatePicker/DatePicker.js.map +0 -1
  364. package/build/esm/DatePicker/DatePickerSelect.d.ts +0 -8
  365. package/build/esm/DatePicker/DatePickerSelect.js +0 -201
  366. package/build/esm/DatePicker/DatePickerSelect.js.map +0 -1
  367. package/build/esm/DatePicker/RangeDatePicker.d.ts +0 -28
  368. package/build/esm/DatePicker/RangeDatePicker.js +0 -94
  369. package/build/esm/DatePicker/RangeDatePicker.js.map +0 -1
  370. package/build/esm/DatePicker/adjustDates.d.ts +0 -4
  371. package/build/esm/DatePicker/adjustDates.js +0 -18
  372. package/build/esm/DatePicker/adjustDates.js.map +0 -1
  373. package/build/esm/DatePicker/contexts.d.ts +0 -31
  374. package/build/esm/DatePicker/contexts.js +0 -15
  375. package/build/esm/DatePicker/contexts.js.map +0 -1
  376. package/build/esm/DatePicker/dateTypes.d.ts +0 -2
  377. package/build/esm/DatePicker/dateTypes.js +0 -2
  378. package/build/esm/DatePicker/dateTypes.js.map +0 -1
  379. package/build/esm/DatePicker/hooks.d.ts +0 -36
  380. package/build/esm/DatePicker/hooks.js +0 -98
  381. package/build/esm/DatePicker/hooks.js.map +0 -1
  382. package/build/esm/DatePicker/index.d.ts +0 -5
  383. package/build/esm/DatePicker/index.js +0 -6
  384. package/build/esm/DatePicker/index.js.map +0 -1
  385. package/build/esm/hooks/useId.d.ts +0 -1
  386. package/build/esm/hooks/useId.js +0 -25
  387. package/build/esm/hooks/useId.js.map +0 -1
  388. package/build/esm/utils/assignRef.d.ts +0 -3
  389. package/build/esm/utils/assignRef.js +0 -25
  390. package/build/esm/utils/assignRef.js.map +0 -1
  391. package/build/esm/utils/getCircularIndex.d.ts +0 -1
  392. package/build/esm/utils/getCircularIndex.js +0 -8
  393. package/build/esm/utils/getCircularIndex.js.map +0 -1
  394. package/build/esm/utils/rubberBandClamp.d.ts +0 -2
  395. package/build/esm/utils/rubberBandClamp.js +0 -20
  396. package/build/esm/utils/rubberBandClamp.js.map +0 -1
  397. package/build/esm/utils/wrapEvent.d.ts +0 -3
  398. package/build/esm/utils/wrapEvent.js +0 -16
  399. package/build/esm/utils/wrapEvent.js.map +0 -1
  400. package/build/tsconfig.tsbuildinfo +0 -7270
@@ -1,16 +1,16 @@
1
- export function createSubscription() {
2
- const subscriptions: (() => void)[] = [];
3
-
4
- function subscribe(fn: () => void) {
5
- subscriptions.push(fn);
6
- return () => {
7
- subscriptions.splice(subscriptions.indexOf(fn), 1);
8
- };
9
- }
10
-
11
- function notify() {
12
- subscriptions.forEach((fn) => fn());
13
- }
14
-
15
- return { subscribe, notify };
16
- }
1
+ export function createSubscription() {
2
+ const subscriptions: (() => void)[] = [];
3
+
4
+ function subscribe(fn: () => void) {
5
+ subscriptions.push(fn);
6
+ return () => {
7
+ subscriptions.splice(subscriptions.indexOf(fn), 1);
8
+ };
9
+ }
10
+
11
+ function notify() {
12
+ subscriptions.forEach((fn) => fn());
13
+ }
14
+
15
+ return { subscribe, notify };
16
+ }
@@ -1,7 +1,7 @@
1
- export function getCircularIndex(index: number, maxLength: number) {
2
- if (maxLength < 0) {
3
- return null;
4
- }
5
-
6
- return ((index % maxLength) + maxLength) % maxLength;
7
- }
1
+ export function getCircularIndex(index: number, maxLength: number) {
2
+ if (maxLength < 0) {
3
+ return null;
4
+ }
5
+
6
+ return ((index % maxLength) + maxLength) % maxLength;
7
+ }
@@ -1,10 +1,10 @@
1
- export * from './assign-ref';
2
- export * from './can-use-dom';
3
- export * from './context';
4
- export * from './get-circular-index';
5
- export * from './is-right-click';
6
- export * from './owner-document';
7
- export * from './polymorphic';
8
- export * from './rubber-band-clamp';
9
- export * from './use-stable-callback';
10
- export * from './wrap-event';
1
+ export * from './assign-ref';
2
+ export * from './can-use-dom';
3
+ export * from './context';
4
+ export * from './get-circular-index';
5
+ export * from './is-right-click';
6
+ export * from './owner-document';
7
+ export * from './polymorphic';
8
+ export * from './rubber-band-clamp';
9
+ export * from './use-stable-callback';
10
+ export * from './wrap-event';
@@ -1,14 +1,14 @@
1
- /**
2
- * Detects right clicks
3
- *
4
- * @param nativeEvent
5
- */
6
- export function isRightClick(
7
- nativeEvent: MouseEvent | PointerEvent | TouchEvent
8
- ) {
9
- return 'which' in nativeEvent
10
- ? nativeEvent.which === 3
11
- : 'button' in nativeEvent
12
- ? (nativeEvent as any).button === 2
13
- : false;
14
- }
1
+ /**
2
+ * Detects right clicks
3
+ *
4
+ * @param nativeEvent
5
+ */
6
+ export function isRightClick(
7
+ nativeEvent: MouseEvent | PointerEvent | TouchEvent
8
+ ) {
9
+ return 'which' in nativeEvent
10
+ ? nativeEvent.which === 3
11
+ : 'button' in nativeEvent
12
+ ? (nativeEvent as any).button === 2
13
+ : false;
14
+ }
@@ -1,13 +1,13 @@
1
- import { canUseDOM } from './can-use-dom';
2
-
3
- /**
4
- * Get an element's owner document. Useful when components are used in iframes
5
- * or other environments like dev tools.
6
- *
7
- * @param element
8
- */
9
- export function getOwnerDocument<T extends Element>(
10
- element: T | null | undefined
11
- ) {
12
- return canUseDOM() ? (element ? element.ownerDocument : document) : null;
13
- }
1
+ import { canUseDOM } from './can-use-dom';
2
+
3
+ /**
4
+ * Get an element's owner document. Useful when components are used in iframes
5
+ * or other environments like dev tools.
6
+ *
7
+ * @param element
8
+ */
9
+ export function getOwnerDocument<T extends Element>(
10
+ element: T | null | undefined
11
+ ) {
12
+ return canUseDOM() ? (element ? element.ownerDocument : document) : null;
13
+ }
@@ -1,78 +1,78 @@
1
- /* eslint-disable @typescript-eslint/ban-types */
2
- // adapted from https://github.com/radix-ui/primitives/blob/2f139a832ba0cdfd445c937ebf63c2e79e0ef7ed/packages/react/polymorphic/src/polymorphic.ts
3
- // Would have liked to use it directly instead of copying but they are
4
- // (rightfully) treating it as an internal utility, so copy/paste it is to
5
- // prevent any needless churn if they make breaking changes. Big thanks to Jenna
6
- // for the heavy lifting! https://github.com/jjenzz
7
-
8
- import type * as React from 'react';
9
-
10
- // eslint-disable-next-line @typescript-eslint/ban-types
11
- export type Merge<P1 = {}, P2 = {}> = Omit<P1, keyof P2> & P2;
12
-
13
- /**
14
- * Infers the OwnProps if E is a ForwardRefExoticComponentWithAs
15
- */
16
- export type OwnProps<E> = E extends ForwardRefComponent<any, infer P> ? P : {};
17
-
18
- /**
19
- * Infers the JSX.IntrinsicElement if E is a ForwardRefExoticComponentWithAs
20
- */
21
- export type IntrinsicElement<E> = E extends ForwardRefComponent<infer I, any>
22
- ? I
23
- : never;
24
-
25
- type ForwardRefExoticComponent<E, OwnProps> = React.ForwardRefExoticComponent<
26
- Merge<
27
- E extends React.ElementType ? React.ComponentPropsWithRef<E> : never,
28
- OwnProps & { as?: E; innerAs?: E }
29
- >
30
- >;
31
-
32
- export interface ForwardRefComponent<
33
- IntrinsicElementString,
34
- OwnProps = {}
35
- /*
36
- * Extends original type to ensure built in React types play nice with
37
- * polymorphic components still e.g. `React.ElementRef` etc.
38
- */
39
- > extends ForwardRefExoticComponent<IntrinsicElementString, OwnProps> {
40
- /*
41
- * When `as` prop is passed, use this overload. Merges original own props
42
- * (without DOM props) and the inferred props from `as` element with the own
43
- * props taking precendence.
44
- *
45
- * We explicitly avoid `React.ElementType` and manually narrow the prop types
46
- * so that events are typed when using JSX.IntrinsicElements.
47
- */
48
- <As = IntrinsicElementString>(
49
- props: As extends ''
50
- ? {
51
- as: keyof JSX.IntrinsicElements;
52
- innerAs?: keyof JSX.IntrinsicElements;
53
- }
54
- : As extends React.ComponentType<infer P>
55
- ? Merge<P, OwnProps & { as: As; innerAs?: As }>
56
- : As extends keyof JSX.IntrinsicElements
57
- ? Merge<JSX.IntrinsicElements[As], OwnProps & { as: As; innerAs?: As }>
58
- : never
59
- ): React.ReactElement | null;
60
- }
61
-
62
- export interface MemoComponent<IntrinsicElementString, OwnProps = {}>
63
- extends React.MemoExoticComponent<
64
- ForwardRefComponent<IntrinsicElementString, OwnProps>
65
- > {
66
- <As = IntrinsicElementString>(
67
- props: As extends ''
68
- ? {
69
- as: keyof JSX.IntrinsicElements;
70
- innerAs?: keyof JSX.IntrinsicElements;
71
- }
72
- : As extends React.ComponentType<infer P>
73
- ? Merge<P, OwnProps & { as: As; innerAs?: As }>
74
- : As extends keyof JSX.IntrinsicElements
75
- ? Merge<JSX.IntrinsicElements[As], OwnProps & { as: As; innerAs?: As }>
76
- : never
77
- ): React.ReactElement | null;
78
- }
1
+ /* eslint-disable @typescript-eslint/ban-types */
2
+ // adapted from https://github.com/radix-ui/primitives/blob/2f139a832ba0cdfd445c937ebf63c2e79e0ef7ed/packages/react/polymorphic/src/polymorphic.ts
3
+ // Would have liked to use it directly instead of copying but they are
4
+ // (rightfully) treating it as an internal utility, so copy/paste it is to
5
+ // prevent any needless churn if they make breaking changes. Big thanks to Jenna
6
+ // for the heavy lifting! https://github.com/jjenzz
7
+
8
+ import type * as React from 'react';
9
+
10
+ // eslint-disable-next-line @typescript-eslint/ban-types
11
+ export type Merge<P1 = {}, P2 = {}> = Omit<P1, keyof P2> & P2;
12
+
13
+ /**
14
+ * Infers the OwnProps if E is a ForwardRefExoticComponentWithAs
15
+ */
16
+ export type OwnProps<E> = E extends ForwardRefComponent<any, infer P> ? P : {};
17
+
18
+ /**
19
+ * Infers the JSX.IntrinsicElement if E is a ForwardRefExoticComponentWithAs
20
+ */
21
+ export type IntrinsicElement<E> = E extends ForwardRefComponent<infer I, any>
22
+ ? I
23
+ : never;
24
+
25
+ type ForwardRefExoticComponent<E, OwnProps> = React.ForwardRefExoticComponent<
26
+ Merge<
27
+ E extends React.ElementType ? React.ComponentPropsWithRef<E> : never,
28
+ OwnProps & { as?: E; innerAs?: E }
29
+ >
30
+ >;
31
+
32
+ export interface ForwardRefComponent<
33
+ IntrinsicElementString,
34
+ OwnProps = {}
35
+ /*
36
+ * Extends original type to ensure built in React types play nice with
37
+ * polymorphic components still e.g. `React.ElementRef` etc.
38
+ */
39
+ > extends ForwardRefExoticComponent<IntrinsicElementString, OwnProps> {
40
+ /*
41
+ * When `as` prop is passed, use this overload. Merges original own props
42
+ * (without DOM props) and the inferred props from `as` element with the own
43
+ * props taking precendence.
44
+ *
45
+ * We explicitly avoid `React.ElementType` and manually narrow the prop types
46
+ * so that events are typed when using JSX.IntrinsicElements.
47
+ */
48
+ <As = IntrinsicElementString>(
49
+ props: As extends ''
50
+ ? {
51
+ as: keyof JSX.IntrinsicElements;
52
+ innerAs?: keyof JSX.IntrinsicElements;
53
+ }
54
+ : As extends React.ComponentType<infer P>
55
+ ? Merge<P, OwnProps & { as: As; innerAs?: As }>
56
+ : As extends keyof JSX.IntrinsicElements
57
+ ? Merge<JSX.IntrinsicElements[As], OwnProps & { as: As; innerAs?: As }>
58
+ : never
59
+ ): React.ReactElement | null;
60
+ }
61
+
62
+ export interface MemoComponent<IntrinsicElementString, OwnProps = {}>
63
+ extends React.MemoExoticComponent<
64
+ ForwardRefComponent<IntrinsicElementString, OwnProps>
65
+ > {
66
+ <As = IntrinsicElementString>(
67
+ props: As extends ''
68
+ ? {
69
+ as: keyof JSX.IntrinsicElements;
70
+ innerAs?: keyof JSX.IntrinsicElements;
71
+ }
72
+ : As extends React.ComponentType<infer P>
73
+ ? Merge<P, OwnProps & { as: As; innerAs?: As }>
74
+ : As extends keyof JSX.IntrinsicElements
75
+ ? Merge<JSX.IntrinsicElements[As], OwnProps & { as: As; innerAs?: As }>
76
+ : never
77
+ ): React.ReactElement | null;
78
+ }
@@ -1,25 +1,25 @@
1
- // https://twitter.com/chpwn/status/285540192096497664
2
- // iOS constant = 0.55
3
- export function rubberBand(
4
- distance: number,
5
- dimension: number,
6
- constant = 0.15
7
- ) {
8
- return (distance * dimension * constant) / (dimension + constant * distance);
9
- }
10
-
11
- export function rubberBandClamp(
12
- min: number,
13
- max: number,
14
- delta: number,
15
- constant = 0.15
16
- ) {
17
- if (delta < min) {
18
- return -rubberBand(min - delta, max - min, constant) + min;
19
- }
20
- if (delta > max) {
21
- return rubberBand(delta - max, max - min, constant) + max;
22
- }
23
-
24
- return delta;
25
- }
1
+ // https://twitter.com/chpwn/status/285540192096497664
2
+ // iOS constant = 0.55
3
+ export function rubberBand(
4
+ distance: number,
5
+ dimension: number,
6
+ constant = 0.15
7
+ ) {
8
+ return (distance * dimension * constant) / (dimension + constant * distance);
9
+ }
10
+
11
+ export function rubberBandClamp(
12
+ min: number,
13
+ max: number,
14
+ delta: number,
15
+ constant = 0.15
16
+ ) {
17
+ if (delta < min) {
18
+ return -rubberBand(min - delta, max - min, constant) + min;
19
+ }
20
+ if (delta > max) {
21
+ return rubberBand(delta - max, max - min, constant) + max;
22
+ }
23
+
24
+ return delta;
25
+ }
@@ -1,58 +1,58 @@
1
- /* eslint-disable react-hooks/rules-of-hooks */
2
- import { useRef, useEffect, useCallback, useLayoutEffect } from 'react';
3
- import type * as React from 'react';
4
-
5
- const useEnhancedEffect =
6
- typeof window !== 'undefined' ? useLayoutEffect : useEffect;
7
-
8
- /**
9
- * Converts a callback to a ref to avoid triggering re-renders when passed as a
10
- * prop and exposed as a stable function to avoid executing effects when
11
- * passed as a dependency.
12
- */
13
- function createStableCallbackHook<T extends (...args: any[]) => any>(
14
- useEffectHook: (
15
- effect: React.EffectCallback,
16
- deps?: React.DependencyList | undefined
17
- ) => void,
18
- callback: T | null | undefined
19
- ): T {
20
- const callbackRef = useRef(callback);
21
- useEffectHook(() => {
22
- callbackRef.current = callback;
23
- });
24
-
25
- // eslint-disable-next-line react-hooks/exhaustive-deps
26
- return useCallback(
27
- ((...args) => {
28
- callbackRef.current && callbackRef.current(...args);
29
- }) as T,
30
- []
31
- );
32
- }
33
-
34
- /**
35
- * Converts a callback to a ref to avoid triggering re-renders when passed as a
36
- * prop and exposed as a stable function to avoid executing effects when passed
37
- * as a dependency.
38
- */
39
- export function useStableCallback<T extends (...args: any[]) => any>(
40
- callback: T | null | undefined
41
- ): T {
42
- return createStableCallbackHook(useEffect, callback);
43
- }
44
-
45
- /**
46
- * Converts a callback to a ref to avoid triggering re-renders when passed as a
47
- * prop and exposed as a stable function to avoid executing effects when passed
48
- * as a dependency.
49
- *
50
- * Use this over `useStableCallback` when you want the callback to be cached in
51
- * `useLayoutEffect` instead of `useEffect` to deal with timing issues only when
52
- * needed.
53
- */
54
- export function useStableLayoutCallback<T extends (...args: any[]) => any>(
55
- callback: T | null | undefined
56
- ): T {
57
- return createStableCallbackHook(useEnhancedEffect, callback);
58
- }
1
+ /* eslint-disable react-hooks/rules-of-hooks */
2
+ import { useRef, useEffect, useCallback, useLayoutEffect } from 'react';
3
+ import type * as React from 'react';
4
+
5
+ const useEnhancedEffect =
6
+ typeof window !== 'undefined' ? useLayoutEffect : useEffect;
7
+
8
+ /**
9
+ * Converts a callback to a ref to avoid triggering re-renders when passed as a
10
+ * prop and exposed as a stable function to avoid executing effects when
11
+ * passed as a dependency.
12
+ */
13
+ function createStableCallbackHook<T extends (...args: any[]) => any>(
14
+ useEffectHook: (
15
+ effect: React.EffectCallback,
16
+ deps?: React.DependencyList | undefined
17
+ ) => void,
18
+ callback: T | null | undefined
19
+ ): T {
20
+ const callbackRef = useRef(callback);
21
+ useEffectHook(() => {
22
+ callbackRef.current = callback;
23
+ });
24
+
25
+ // eslint-disable-next-line react-hooks/exhaustive-deps
26
+ return useCallback(
27
+ ((...args) => {
28
+ callbackRef.current && callbackRef.current(...args);
29
+ }) as T,
30
+ []
31
+ );
32
+ }
33
+
34
+ /**
35
+ * Converts a callback to a ref to avoid triggering re-renders when passed as a
36
+ * prop and exposed as a stable function to avoid executing effects when passed
37
+ * as a dependency.
38
+ */
39
+ export function useStableCallback<T extends (...args: any[]) => any>(
40
+ callback: T | null | undefined
41
+ ): T {
42
+ return createStableCallbackHook(useEffect, callback);
43
+ }
44
+
45
+ /**
46
+ * Converts a callback to a ref to avoid triggering re-renders when passed as a
47
+ * prop and exposed as a stable function to avoid executing effects when passed
48
+ * as a dependency.
49
+ *
50
+ * Use this over `useStableCallback` when you want the callback to be cached in
51
+ * `useLayoutEffect` instead of `useEffect` to deal with timing issues only when
52
+ * needed.
53
+ */
54
+ export function useStableLayoutCallback<T extends (...args: any[]) => any>(
55
+ callback: T | null | undefined
56
+ ): T {
57
+ return createStableCallbackHook(useEnhancedEffect, callback);
58
+ }
@@ -1,22 +1,22 @@
1
- import type { SyntheticEvent } from 'react';
2
-
3
- export type CustomEventHandler<
4
- E extends SyntheticEvent<any> | Event,
5
- H extends unknown[]
6
- > = (e: E, ...args: H) => void;
7
-
8
- export function wrapEvent<
9
- EventType extends SyntheticEvent<any> | Event,
10
- H extends unknown[]
11
- >(
12
- theirHandler: CustomEventHandler<EventType, H> | undefined,
13
- ourHandler: CustomEventHandler<EventType, H>
14
- ): CustomEventHandler<EventType, H> {
15
- return (event: EventType, ...otherArgs: H) => {
16
- const ret = theirHandler && theirHandler(event, ...otherArgs);
17
- if (!event || !event.defaultPrevented) {
18
- return ourHandler(event, ...otherArgs);
19
- }
20
- return ret;
21
- };
22
- }
1
+ import type { SyntheticEvent } from 'react';
2
+
3
+ export type CustomEventHandler<
4
+ E extends SyntheticEvent<any> | Event,
5
+ H extends unknown[]
6
+ > = (e: E, ...args: H) => void;
7
+
8
+ export function wrapEvent<
9
+ EventType extends SyntheticEvent<any> | Event,
10
+ H extends unknown[]
11
+ >(
12
+ theirHandler: CustomEventHandler<EventType, H> | undefined,
13
+ ourHandler: CustomEventHandler<EventType, H>
14
+ ): CustomEventHandler<EventType, H> {
15
+ return (event: EventType, ...otherArgs: H) => {
16
+ const ret = theirHandler && theirHandler(event, ...otherArgs);
17
+ if (!event || !event.defaultPrevented) {
18
+ return ourHandler(event, ...otherArgs);
19
+ }
20
+ return ret;
21
+ };
22
+ }
@@ -1,9 +0,0 @@
1
- import React from 'react';
2
- export interface CarouselProps extends React.HTMLAttributes<HTMLElement> {
3
- as?: React.ElementType<any>;
4
- isRTL?: boolean;
5
- currentSlide?: number;
6
- slidesToShow?: number;
7
- children?: React.ReactNode;
8
- }
9
- export declare const Carousel: React.ForwardRefExoticComponent<CarouselProps & React.RefAttributes<HTMLElement>>;
@@ -1,38 +0,0 @@
1
- import _extends from "@babel/runtime/helpers/esm/extends";
2
- import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
3
- import React, { forwardRef, useMemo, useRef } from 'react';
4
- import { assignMultipleRefs } from '../utils/assignRef';
5
- import { CarouselProvider } from './context';
6
- export var Carousel = forwardRef(function Carousel(_ref, forwardedRef) {
7
- var _ref$as = _ref.as,
8
- Comp = _ref$as === void 0 ? 'section' : _ref$as,
9
- _ref$currentSlide = _ref.currentSlide,
10
- currentSlide = _ref$currentSlide === void 0 ? 0 : _ref$currentSlide,
11
- _ref$slidesToShow = _ref.slidesToShow,
12
- slidesToShow = _ref$slidesToShow === void 0 ? 1 : _ref$slidesToShow,
13
- _ref$isRTL = _ref.isRTL,
14
- isRTL = _ref$isRTL === void 0 ? false : _ref$isRTL,
15
- children = _ref.children,
16
- otherProps = _objectWithoutProperties(_ref, ["as", "currentSlide", "slidesToShow", "isRTL", "children"]);
17
-
18
- var containerRef = useRef(null);
19
- var contextValue = useMemo(function () {
20
- return {
21
- slidesToShow: slidesToShow,
22
- isRTL: isRTL,
23
- currentSlide: currentSlide,
24
- itemWidth: 100 / slidesToShow,
25
- containerRef: containerRef
26
- };
27
- }, [currentSlide, isRTL, slidesToShow]);
28
- return /*#__PURE__*/React.createElement(CarouselProvider, {
29
- value: contextValue
30
- }, /*#__PURE__*/React.createElement(Comp, _extends({
31
- ref: assignMultipleRefs(forwardedRef, containerRef)
32
- }, otherProps, {
33
- role: "region",
34
- "data-carousel-root": "",
35
- "aria-roledescription": "carousel"
36
- }), children));
37
- });
38
- //# sourceMappingURL=Carousel.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../../src/Carousel/Carousel.tsx"],"names":["React","forwardRef","useMemo","useRef","assignMultipleRefs","CarouselProvider","Carousel","forwardedRef","as","Comp","currentSlide","slidesToShow","isRTL","children","otherProps","containerRef","contextValue","itemWidth"],"mappings":";;AAAA,OAAOA,KAAP,IAAgBC,UAAhB,EAA4BC,OAA5B,EAAqCC,MAArC,QAAmD,OAAnD;AACA,SAASC,kBAAT,QAAmC,oBAAnC;AACA,SAASC,gBAAT,QAAiC,WAAjC;AAUA,OAAO,IAAMC,QAAQ,GAAGL,UAAU,CAChC,SAASK,QAAT,OASEC,YATF,EAUE;AAAA,qBAREC,EAQF;AAAA,MARMC,IAQN,wBARa,SAQb;AAAA,+BAPEC,YAOF;AAAA,MAPEA,YAOF,kCAPiB,CAOjB;AAAA,+BANEC,YAMF;AAAA,MANEA,YAMF,kCANiB,CAMjB;AAAA,wBALEC,KAKF;AAAA,MALEA,KAKF,2BALU,KAKV;AAAA,MAJEC,QAIF,QAJEA,QAIF;AAAA,MAHKC,UAGL;;AACA,MAAMC,YAAY,GAAGZ,MAAM,CAAqB,IAArB,CAA3B;AACA,MAAMa,YAAY,GAAGd,OAAO,CAC1B;AAAA,WAAO;AACLS,MAAAA,YAAY,EAAZA,YADK;AAELC,MAAAA,KAAK,EAALA,KAFK;AAGLF,MAAAA,YAAY,EAAZA,YAHK;AAILO,MAAAA,SAAS,EAAE,MAAMN,YAJZ;AAKLI,MAAAA,YAAY,EAAZA;AALK,KAAP;AAAA,GAD0B,EAQ1B,CAACL,YAAD,EAAeE,KAAf,EAAsBD,YAAtB,CAR0B,CAA5B;AAWA,sBACE,oBAAC,gBAAD;AAAkB,IAAA,KAAK,EAAEK;AAAzB,kBACE,oBAAC,IAAD;AACE,IAAA,GAAG,EAAEZ,kBAAkB,CAACG,YAAD,EAAeQ,YAAf;AADzB,KAEMD,UAFN;AAGE,IAAA,IAAI,EAAC,QAHP;AAIE,0BAAmB,EAJrB;AAKE,4BAAqB;AALvB,MAOGD,QAPH,CADF,CADF;AAaD,CArC+B,CAA3B","sourcesContent":["import React, { forwardRef, useMemo, useRef } from 'react';\nimport { assignMultipleRefs } from '../utils/assignRef';\nimport { CarouselProvider } from './context';\n\nexport interface CarouselProps extends React.HTMLAttributes<HTMLElement> {\n as?: React.ElementType<any>;\n isRTL?: boolean;\n currentSlide?: number;\n slidesToShow?: number;\n children?: React.ReactNode;\n}\n\nexport const Carousel = forwardRef<HTMLElement, CarouselProps>(\n function Carousel(\n {\n as: Comp = 'section',\n currentSlide = 0,\n slidesToShow = 1,\n isRTL = false,\n children,\n ...otherProps\n },\n forwardedRef\n ) {\n const containerRef = useRef<HTMLElement | null>(null);\n const contextValue = useMemo(\n () => ({\n slidesToShow,\n isRTL,\n currentSlide,\n itemWidth: 100 / slidesToShow,\n containerRef,\n }),\n [currentSlide, isRTL, slidesToShow]\n );\n\n return (\n <CarouselProvider value={contextValue}>\n <Comp\n ref={assignMultipleRefs(forwardedRef, containerRef)}\n {...otherProps}\n role=\"region\"\n data-carousel-root=\"\"\n aria-roledescription=\"carousel\"\n >\n {children}\n </Comp>\n </CarouselProvider>\n );\n }\n);\n"],"file":"Carousel.js"}
@@ -1,14 +0,0 @@
1
- import React from 'react';
2
- import { SpringConfig } from 'react-spring';
3
- import { GestureHandlersState } from '../hooks';
4
- export declare const faderConfig: SpringConfig;
5
- export interface FaderProps extends React.HTMLAttributes<HTMLDivElement> {
6
- as?: React.ElementType<any>;
7
- mouseSwipe?: boolean;
8
- touchSwipe?: boolean;
9
- onSwipeRight?: (s: Partial<GestureHandlersState>) => void;
10
- onSwipeLeft?: (s: Partial<GestureHandlersState>) => void;
11
- springConfig?: SpringConfig;
12
- children?: React.ReactNode[] | React.ReactNode;
13
- }
14
- export declare const Fader: React.ForwardRefExoticComponent<FaderProps & React.RefAttributes<HTMLDivElement>>;
@@ -1,76 +0,0 @@
1
- import _extends from "@babel/runtime/helpers/esm/extends";
2
- import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
3
- import React, { forwardRef, Children, useMemo } from 'react';
4
- import { useTransition, animated } from 'react-spring';
5
- import { getCircularIndex } from '../utils/getCircularIndex';
6
- import { useCarouselGestures } from './useCarouselGestures';
7
- import { useCarouselContext } from './context';
8
- export var faderConfig = {
9
- tension: 280,
10
- friction: 75,
11
- clamp: true
12
- };
13
- export var Fader = forwardRef(function Fader(_ref, ref) {
14
- var _ref$as = _ref.as,
15
- Comp = _ref$as === void 0 ? 'div' : _ref$as,
16
- maybeSingleChildren = _ref.children,
17
- _ref$springConfig = _ref.springConfig,
18
- springConfig = _ref$springConfig === void 0 ? faderConfig : _ref$springConfig,
19
- _ref$mouseSwipe = _ref.mouseSwipe,
20
- mouseSwipe = _ref$mouseSwipe === void 0 ? false : _ref$mouseSwipe,
21
- _ref$touchSwipe = _ref.touchSwipe,
22
- touchSwipe = _ref$touchSwipe === void 0 ? false : _ref$touchSwipe,
23
- onSwipeLeft = _ref.onSwipeLeft,
24
- onSwipeRight = _ref.onSwipeRight,
25
- otherProps = _objectWithoutProperties(_ref, ["as", "children", "springConfig", "mouseSwipe", "touchSwipe", "onSwipeLeft", "onSwipeRight"]);
26
-
27
- var _useCarouselContext = useCarouselContext(),
28
- _useCarouselContext$i = _useCarouselContext.isRTL,
29
- isRTL = _useCarouselContext$i === void 0 ? false : _useCarouselContext$i,
30
- _useCarouselContext$c = _useCarouselContext.currentSlide,
31
- nextSlideIndex = _useCarouselContext$c === void 0 ? 0 : _useCarouselContext$c,
32
- containerRef = _useCarouselContext.containerRef;
33
-
34
- var children = useMemo(function () {
35
- return Children.toArray(maybeSingleChildren);
36
- }, [maybeSingleChildren]);
37
- var transitions = useTransition(nextSlideIndex, {
38
- config: springConfig,
39
- from: {
40
- opacity: 0
41
- },
42
- enter: {
43
- opacity: 1
44
- },
45
- leave: {
46
- opacity: 0
47
- }
48
- });
49
-
50
- var _useCarouselGestures = useCarouselGestures({
51
- onSwipeLeft: onSwipeLeft,
52
- onSwipeRight: onSwipeRight,
53
- isRTL: isRTL,
54
- containerRef: containerRef
55
- }),
56
- handlers = _useCarouselGestures.handlers;
57
-
58
- return /*#__PURE__*/React.createElement(Comp, _extends({
59
- onTouchStart: touchSwipe ? handlers.onTouchStart : undefined,
60
- onMouseDown: mouseSwipe ? handlers.onMouseDown : undefined,
61
- "aria-live": "polite",
62
- "data-carousel-slider": "",
63
- ref: ref
64
- }, otherProps), transitions(function (style, item) {
65
- var idx = getCircularIndex(item, children.length);
66
-
67
- if (idx !== null) {
68
- return /*#__PURE__*/React.createElement(animated.span, {
69
- style: style
70
- }, children[idx]);
71
- }
72
-
73
- return null;
74
- }));
75
- });
76
- //# sourceMappingURL=Fader.js.map