@mui/utils 5.16.1 → 5.16.2

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 (352) hide show
  1. package/CHANGELOG.md +18 -0
  2. package/ClassNameGenerator/ClassNameGenerator.js +7 -1
  3. package/ClassNameGenerator/index.js +13 -1
  4. package/ClassNameGenerator/package.json +2 -2
  5. package/HTMLElementType/HTMLElementType.js +7 -1
  6. package/HTMLElementType/index.js +13 -1
  7. package/HTMLElementType/package.json +2 -2
  8. package/appendOwnerState/appendOwnerState.d.ts +20 -0
  9. package/appendOwnerState/appendOwnerState.js +31 -0
  10. package/appendOwnerState/index.d.ts +2 -0
  11. package/{node/capitalize → appendOwnerState}/index.js +2 -2
  12. package/appendOwnerState/package.json +6 -0
  13. package/capitalize/capitalize.js +10 -3
  14. package/capitalize/index.js +13 -1
  15. package/capitalize/package.json +2 -2
  16. package/chainPropTypes/chainPropTypes.js +7 -1
  17. package/chainPropTypes/index.js +13 -1
  18. package/chainPropTypes/package.json +2 -2
  19. package/clamp/clamp.js +7 -1
  20. package/clamp/index.js +13 -1
  21. package/clamp/package.json +2 -2
  22. package/composeClasses/composeClasses.js +7 -1
  23. package/composeClasses/index.js +13 -1
  24. package/composeClasses/package.json +2 -2
  25. package/createChainedFunction/createChainedFunction.js +7 -1
  26. package/createChainedFunction/index.js +13 -1
  27. package/createChainedFunction/package.json +2 -2
  28. package/debounce/debounce.js +7 -1
  29. package/debounce/index.js +26 -2
  30. package/debounce/package.json +2 -2
  31. package/deepmerge/deepmerge.js +12 -4
  32. package/deepmerge/index.js +26 -2
  33. package/deepmerge/package.json +2 -2
  34. package/deprecatedPropType/deprecatedPropType.js +7 -1
  35. package/deprecatedPropType/index.js +13 -1
  36. package/deprecatedPropType/package.json +2 -2
  37. package/elementAcceptingRef/elementAcceptingRef.js +12 -5
  38. package/elementAcceptingRef/index.js +13 -1
  39. package/elementAcceptingRef/package.json +2 -2
  40. package/elementTypeAcceptingRef/elementTypeAcceptingRef.js +10 -3
  41. package/elementTypeAcceptingRef/index.js +13 -1
  42. package/elementTypeAcceptingRef/package.json +2 -2
  43. package/{node → esm}/ClassNameGenerator/ClassNameGenerator.js +1 -7
  44. package/esm/ClassNameGenerator/index.js +1 -0
  45. package/{node → esm}/HTMLElementType/HTMLElementType.js +1 -7
  46. package/esm/HTMLElementType/index.js +1 -0
  47. package/esm/appendOwnerState/appendOwnerState.js +25 -0
  48. package/esm/appendOwnerState/index.js +1 -0
  49. package/esm/capitalize/capitalize.js +11 -0
  50. package/esm/capitalize/index.js +1 -0
  51. package/{node → esm}/chainPropTypes/chainPropTypes.js +1 -7
  52. package/esm/chainPropTypes/index.js +1 -0
  53. package/esm/clamp/clamp.js +4 -0
  54. package/esm/clamp/index.js +1 -0
  55. package/{node → esm}/composeClasses/composeClasses.js +1 -7
  56. package/esm/composeClasses/index.js +1 -0
  57. package/{node → esm}/createChainedFunction/createChainedFunction.js +1 -7
  58. package/esm/createChainedFunction/index.js +1 -0
  59. package/{node → esm}/debounce/debounce.js +1 -7
  60. package/esm/debounce/index.js +2 -0
  61. package/{node → esm}/deepmerge/deepmerge.js +4 -12
  62. package/esm/deepmerge/index.js +2 -0
  63. package/{node → esm}/deprecatedPropType/deprecatedPropType.js +1 -7
  64. package/esm/deprecatedPropType/index.js +1 -0
  65. package/{node → esm}/elementAcceptingRef/elementAcceptingRef.js +5 -12
  66. package/esm/elementAcceptingRef/index.js +1 -0
  67. package/{node → esm}/elementTypeAcceptingRef/elementTypeAcceptingRef.js +3 -10
  68. package/esm/elementTypeAcceptingRef/index.js +1 -0
  69. package/{node → esm}/exactProp/exactProp.js +3 -10
  70. package/esm/exactProp/index.js +1 -0
  71. package/esm/extractEventHandlers/extractEventHandlers.js +18 -0
  72. package/esm/extractEventHandlers/index.js +1 -0
  73. package/{node → esm}/formatMuiErrorMessage/formatMuiErrorMessage.js +1 -7
  74. package/esm/formatMuiErrorMessage/index.js +1 -0
  75. package/esm/generateUtilityClass/generateUtilityClass.js +22 -0
  76. package/esm/generateUtilityClass/index.js +2 -0
  77. package/esm/generateUtilityClasses/generateUtilityClasses.js +8 -0
  78. package/esm/generateUtilityClasses/index.js +1 -0
  79. package/{node → esm}/getDisplayName/getDisplayName.js +5 -11
  80. package/esm/getDisplayName/index.js +2 -0
  81. package/{node → esm}/getScrollbarSize/getScrollbarSize.js +1 -7
  82. package/esm/getScrollbarSize/index.js +1 -0
  83. package/esm/getValidReactChildren/getValidReactChildren.js +11 -0
  84. package/esm/getValidReactChildren/index.js +1 -0
  85. package/esm/index.js +48 -0
  86. package/esm/integerPropType/index.js +2 -0
  87. package/{node → esm}/integerPropType/integerPropType.js +2 -9
  88. package/esm/isHostComponent/index.js +1 -0
  89. package/esm/isHostComponent/isHostComponent.js +7 -0
  90. package/esm/isMuiElement/index.js +1 -0
  91. package/esm/isMuiElement/isMuiElement.js +8 -0
  92. package/esm/mergeSlotProps/index.js +1 -0
  93. package/esm/mergeSlotProps/mergeSlotProps.js +70 -0
  94. package/esm/omitEventHandlers/index.js +1 -0
  95. package/esm/omitEventHandlers/omitEventHandlers.js +18 -0
  96. package/esm/ownerDocument/index.js +1 -0
  97. package/esm/ownerDocument/ownerDocument.js +3 -0
  98. package/esm/ownerWindow/index.js +1 -0
  99. package/esm/ownerWindow/ownerWindow.js +5 -0
  100. package/esm/ponyfillGlobal/index.js +1 -0
  101. package/esm/ponyfillGlobal/ponyfillGlobal.js +3 -0
  102. package/esm/refType/index.js +1 -0
  103. package/esm/refType/refType.js +3 -0
  104. package/esm/requirePropFactory/index.js +1 -0
  105. package/{node → esm}/requirePropFactory/requirePropFactory.js +3 -10
  106. package/esm/resolveComponentProps/index.js +1 -0
  107. package/esm/resolveComponentProps/resolveComponentProps.js +11 -0
  108. package/esm/resolveProps/index.js +1 -0
  109. package/{node → esm}/resolveProps/resolveProps.js +5 -12
  110. package/esm/scrollLeft/index.js +1 -0
  111. package/{node → esm}/scrollLeft/scrollLeft.js +2 -9
  112. package/esm/setRef/index.js +1 -0
  113. package/{node → esm}/setRef/setRef.js +1 -7
  114. package/esm/types.js +1 -0
  115. package/esm/unsupportedProp/index.js +1 -0
  116. package/{node → esm}/unsupportedProp/unsupportedProp.js +1 -7
  117. package/esm/useControlled/index.js +1 -0
  118. package/{node → esm}/useControlled/useControlled.js +2 -9
  119. package/esm/useEnhancedEffect/index.js +1 -0
  120. package/esm/useEnhancedEffect/useEnhancedEffect.js +13 -0
  121. package/esm/useEventCallback/index.js +1 -0
  122. package/esm/useEventCallback/useEventCallback.js +20 -0
  123. package/esm/useForkRef/index.js +1 -0
  124. package/esm/useForkRef/useForkRef.js +22 -0
  125. package/esm/useId/index.js +1 -0
  126. package/{node → esm}/useId/useId.js +2 -9
  127. package/esm/useIsFocusVisible/index.js +2 -0
  128. package/{node → esm}/useIsFocusVisible/useIsFocusVisible.js +5 -13
  129. package/esm/useLazyRef/index.js +1 -0
  130. package/esm/useLazyRef/useLazyRef.js +19 -0
  131. package/esm/useLocalStorageState/index.js +1 -0
  132. package/{node → esm}/useLocalStorageState/useLocalStorageState.js +3 -9
  133. package/esm/useOnMount/index.js +1 -0
  134. package/esm/useOnMount/useOnMount.js +13 -0
  135. package/esm/usePreviousProps/index.js +1 -0
  136. package/esm/usePreviousProps/usePreviousProps.js +11 -0
  137. package/esm/useSlotProps/index.js +1 -0
  138. package/esm/useSlotProps/useSlotProps.js +40 -0
  139. package/esm/useTimeout/index.js +2 -0
  140. package/{node → esm}/useTimeout/useTimeout.js +6 -14
  141. package/esm/visuallyHidden/index.js +1 -0
  142. package/{node → esm}/visuallyHidden/visuallyHidden.js +1 -7
  143. package/exactProp/exactProp.js +10 -3
  144. package/exactProp/index.js +13 -1
  145. package/exactProp/package.json +2 -2
  146. package/extractEventHandlers/extractEventHandlers.d.ts +10 -0
  147. package/extractEventHandlers/extractEventHandlers.js +24 -0
  148. package/extractEventHandlers/index.d.ts +1 -0
  149. package/{node/ClassNameGenerator → extractEventHandlers}/index.js +2 -2
  150. package/extractEventHandlers/package.json +6 -0
  151. package/formatMuiErrorMessage/formatMuiErrorMessage.js +7 -1
  152. package/formatMuiErrorMessage/index.js +13 -1
  153. package/formatMuiErrorMessage/package.json +2 -2
  154. package/generateUtilityClass/generateUtilityClass.js +14 -5
  155. package/generateUtilityClass/index.js +26 -2
  156. package/generateUtilityClass/package.json +2 -2
  157. package/generateUtilityClasses/generateUtilityClasses.js +10 -3
  158. package/generateUtilityClasses/index.js +13 -1
  159. package/generateUtilityClasses/package.json +2 -2
  160. package/getDisplayName/getDisplayName.js +11 -5
  161. package/getDisplayName/index.js +26 -2
  162. package/getDisplayName/package.json +2 -2
  163. package/getScrollbarSize/getScrollbarSize.js +7 -1
  164. package/getScrollbarSize/index.js +13 -1
  165. package/getScrollbarSize/package.json +2 -2
  166. package/getValidReactChildren/getValidReactChildren.js +9 -2
  167. package/getValidReactChildren/index.js +13 -1
  168. package/getValidReactChildren/package.json +2 -2
  169. package/index.d.ts +5 -0
  170. package/index.js +414 -45
  171. package/integerPropType/index.js +26 -2
  172. package/integerPropType/integerPropType.js +9 -2
  173. package/integerPropType/package.json +2 -2
  174. package/isHostComponent/index.d.ts +1 -0
  175. package/{node/clamp → isHostComponent}/index.js +2 -2
  176. package/isHostComponent/isHostComponent.d.ts +6 -0
  177. package/isHostComponent/isHostComponent.js +13 -0
  178. package/isHostComponent/package.json +6 -0
  179. package/isMuiElement/index.js +13 -1
  180. package/isMuiElement/isMuiElement.js +10 -2
  181. package/isMuiElement/package.json +2 -2
  182. package/legacy/appendOwnerState/appendOwnerState.js +25 -0
  183. package/legacy/appendOwnerState/index.js +1 -0
  184. package/legacy/extractEventHandlers/extractEventHandlers.js +21 -0
  185. package/legacy/extractEventHandlers/index.js +1 -0
  186. package/legacy/index.js +6 -2
  187. package/legacy/isHostComponent/index.js +1 -0
  188. package/legacy/isHostComponent/isHostComponent.js +7 -0
  189. package/legacy/mergeSlotProps/index.js +1 -0
  190. package/legacy/mergeSlotProps/mergeSlotProps.js +68 -0
  191. package/legacy/omitEventHandlers/index.js +1 -0
  192. package/legacy/omitEventHandlers/omitEventHandlers.js +20 -0
  193. package/legacy/resolveComponentProps/index.js +1 -0
  194. package/legacy/resolveComponentProps/resolveComponentProps.js +11 -0
  195. package/legacy/types.js +1 -0
  196. package/legacy/useSlotProps/index.js +1 -0
  197. package/legacy/useSlotProps/useSlotProps.js +37 -0
  198. package/mergeSlotProps/index.d.ts +2 -0
  199. package/{node/chainPropTypes → mergeSlotProps}/index.js +2 -2
  200. package/mergeSlotProps/mergeSlotProps.d.ts +56 -0
  201. package/mergeSlotProps/mergeSlotProps.js +77 -0
  202. package/mergeSlotProps/package.json +6 -0
  203. package/modern/appendOwnerState/appendOwnerState.js +25 -0
  204. package/modern/appendOwnerState/index.js +1 -0
  205. package/modern/extractEventHandlers/extractEventHandlers.js +18 -0
  206. package/modern/extractEventHandlers/index.js +1 -0
  207. package/modern/index.js +6 -2
  208. package/modern/isHostComponent/index.js +1 -0
  209. package/modern/isHostComponent/isHostComponent.js +7 -0
  210. package/modern/mergeSlotProps/index.js +1 -0
  211. package/modern/mergeSlotProps/mergeSlotProps.js +70 -0
  212. package/modern/omitEventHandlers/index.js +1 -0
  213. package/modern/omitEventHandlers/omitEventHandlers.js +18 -0
  214. package/modern/resolveComponentProps/index.js +1 -0
  215. package/modern/resolveComponentProps/resolveComponentProps.js +11 -0
  216. package/modern/types.js +1 -0
  217. package/modern/useSlotProps/index.js +1 -0
  218. package/modern/useSlotProps/useSlotProps.js +39 -0
  219. package/omitEventHandlers/index.d.ts +1 -0
  220. package/{node/HTMLElementType → omitEventHandlers}/index.js +2 -2
  221. package/omitEventHandlers/omitEventHandlers.d.ts +9 -0
  222. package/omitEventHandlers/omitEventHandlers.js +24 -0
  223. package/omitEventHandlers/package.json +6 -0
  224. package/ownerDocument/index.js +13 -1
  225. package/ownerDocument/ownerDocument.js +7 -1
  226. package/ownerDocument/package.json +2 -2
  227. package/ownerWindow/index.js +13 -1
  228. package/ownerWindow/ownerWindow.js +10 -3
  229. package/ownerWindow/package.json +2 -2
  230. package/package.json +4 -3
  231. package/ponyfillGlobal/index.js +13 -1
  232. package/ponyfillGlobal/package.json +2 -2
  233. package/ponyfillGlobal/ponyfillGlobal.js +7 -1
  234. package/refType/index.js +13 -1
  235. package/refType/package.json +2 -2
  236. package/refType/refType.js +10 -3
  237. package/requirePropFactory/index.js +13 -1
  238. package/requirePropFactory/package.json +2 -2
  239. package/requirePropFactory/requirePropFactory.js +10 -3
  240. package/resolveComponentProps/index.d.ts +1 -0
  241. package/resolveComponentProps/index.js +13 -0
  242. package/resolveComponentProps/package.json +6 -0
  243. package/resolveComponentProps/resolveComponentProps.d.ts +6 -0
  244. package/resolveComponentProps/resolveComponentProps.js +17 -0
  245. package/resolveProps/index.js +13 -1
  246. package/resolveProps/package.json +2 -2
  247. package/resolveProps/resolveProps.js +12 -5
  248. package/scrollLeft/index.js +16 -1
  249. package/scrollLeft/package.json +2 -2
  250. package/scrollLeft/scrollLeft.js +9 -2
  251. package/setRef/index.js +13 -1
  252. package/setRef/package.json +2 -2
  253. package/setRef/setRef.js +7 -1
  254. package/types.d.ts +7 -0
  255. package/types.js +5 -0
  256. package/unsupportedProp/index.js +13 -1
  257. package/unsupportedProp/package.json +2 -2
  258. package/unsupportedProp/unsupportedProp.js +7 -1
  259. package/useControlled/index.js +13 -1
  260. package/useControlled/package.json +2 -2
  261. package/useControlled/useControlled.js +9 -2
  262. package/useEnhancedEffect/index.js +13 -1
  263. package/useEnhancedEffect/package.json +2 -2
  264. package/useEnhancedEffect/useEnhancedEffect.js +9 -3
  265. package/useEventCallback/index.js +13 -1
  266. package/useEventCallback/package.json +2 -2
  267. package/useEventCallback/useEventCallback.js +12 -5
  268. package/useForkRef/index.js +13 -1
  269. package/useForkRef/package.json +2 -2
  270. package/useForkRef/useForkRef.js +12 -4
  271. package/useId/index.js +13 -1
  272. package/useId/package.json +2 -2
  273. package/useId/useId.js +9 -2
  274. package/useIsFocusVisible/index.js +26 -2
  275. package/useIsFocusVisible/package.json +2 -2
  276. package/useIsFocusVisible/useIsFocusVisible.js +13 -5
  277. package/useLazyRef/index.js +13 -1
  278. package/useLazyRef/package.json +2 -2
  279. package/useLazyRef/useLazyRef.js +9 -2
  280. package/useLocalStorageState/index.js +13 -1
  281. package/useLocalStorageState/package.json +2 -2
  282. package/useLocalStorageState/useLocalStorageState.js +9 -3
  283. package/useOnMount/index.js +13 -1
  284. package/useOnMount/package.json +2 -2
  285. package/useOnMount/useOnMount.js +9 -2
  286. package/usePreviousProps/index.js +13 -1
  287. package/usePreviousProps/package.json +2 -2
  288. package/usePreviousProps/usePreviousProps.js +9 -2
  289. package/useSlotProps/index.d.ts +2 -0
  290. package/{node/exactProp → useSlotProps}/index.js +2 -2
  291. package/useSlotProps/package.json +6 -0
  292. package/useSlotProps/useSlotProps.d.ts +41 -0
  293. package/useSlotProps/useSlotProps.js +46 -0
  294. package/useTimeout/index.js +20 -2
  295. package/useTimeout/package.json +2 -2
  296. package/useTimeout/useTimeout.js +14 -6
  297. package/visuallyHidden/index.js +13 -1
  298. package/visuallyHidden/package.json +2 -2
  299. package/visuallyHidden/visuallyHidden.js +7 -1
  300. package/node/capitalize/capitalize.js +0 -18
  301. package/node/clamp/clamp.js +0 -10
  302. package/node/composeClasses/index.js +0 -13
  303. package/node/createChainedFunction/index.js +0 -13
  304. package/node/debounce/index.js +0 -26
  305. package/node/deepmerge/index.js +0 -26
  306. package/node/deprecatedPropType/index.js +0 -13
  307. package/node/elementAcceptingRef/index.js +0 -13
  308. package/node/elementTypeAcceptingRef/index.js +0 -13
  309. package/node/formatMuiErrorMessage/index.js +0 -13
  310. package/node/generateUtilityClass/generateUtilityClass.js +0 -31
  311. package/node/generateUtilityClass/index.js +0 -26
  312. package/node/generateUtilityClasses/generateUtilityClasses.js +0 -15
  313. package/node/generateUtilityClasses/index.js +0 -13
  314. package/node/getDisplayName/index.js +0 -26
  315. package/node/getScrollbarSize/index.js +0 -13
  316. package/node/getValidReactChildren/getValidReactChildren.js +0 -18
  317. package/node/getValidReactChildren/index.js +0 -13
  318. package/node/index.js +0 -384
  319. package/node/integerPropType/index.js +0 -26
  320. package/node/isMuiElement/index.js +0 -13
  321. package/node/isMuiElement/isMuiElement.js +0 -16
  322. package/node/ownerDocument/index.js +0 -13
  323. package/node/ownerDocument/ownerDocument.js +0 -9
  324. package/node/ownerWindow/index.js +0 -13
  325. package/node/ownerWindow/ownerWindow.js +0 -12
  326. package/node/ponyfillGlobal/index.js +0 -13
  327. package/node/ponyfillGlobal/ponyfillGlobal.js +0 -9
  328. package/node/refType/index.js +0 -13
  329. package/node/refType/refType.js +0 -10
  330. package/node/requirePropFactory/index.js +0 -13
  331. package/node/resolveProps/index.js +0 -13
  332. package/node/scrollLeft/index.js +0 -16
  333. package/node/setRef/index.js +0 -13
  334. package/node/unsupportedProp/index.js +0 -13
  335. package/node/useControlled/index.js +0 -13
  336. package/node/useEnhancedEffect/index.js +0 -13
  337. package/node/useEnhancedEffect/useEnhancedEffect.js +0 -19
  338. package/node/useEventCallback/index.js +0 -13
  339. package/node/useEventCallback/useEventCallback.js +0 -27
  340. package/node/useForkRef/index.js +0 -13
  341. package/node/useForkRef/useForkRef.js +0 -30
  342. package/node/useId/index.js +0 -13
  343. package/node/useIsFocusVisible/index.js +0 -26
  344. package/node/useLazyRef/index.js +0 -13
  345. package/node/useLazyRef/useLazyRef.js +0 -26
  346. package/node/useLocalStorageState/index.js +0 -13
  347. package/node/useOnMount/index.js +0 -13
  348. package/node/useOnMount/useOnMount.js +0 -20
  349. package/node/usePreviousProps/index.js +0 -13
  350. package/node/usePreviousProps/usePreviousProps.js +0 -18
  351. package/node/useTimeout/index.js +0 -20
  352. package/node/visuallyHidden/index.js +0 -13
@@ -0,0 +1,70 @@
1
+ import _extends from "@babel/runtime/helpers/esm/extends";
2
+ import clsx from 'clsx';
3
+ import extractEventHandlers from '../extractEventHandlers';
4
+ import omitEventHandlers from '../omitEventHandlers';
5
+ /**
6
+ * Merges the slot component internal props (usually coming from a hook)
7
+ * with the externally provided ones.
8
+ *
9
+ * The merge order is (the latter overrides the former):
10
+ * 1. The internal props (specified as a getter function to work with get*Props hook result)
11
+ * 2. Additional props (specified internally on a Base UI component)
12
+ * 3. External props specified on the owner component. These should only be used on a root slot.
13
+ * 4. External props specified in the `slotProps.*` prop.
14
+ * 5. The `className` prop - combined from all the above.
15
+ * @param parameters
16
+ * @returns
17
+ */
18
+ function mergeSlotProps(parameters) {
19
+ const {
20
+ getSlotProps,
21
+ additionalProps,
22
+ externalSlotProps,
23
+ externalForwardedProps,
24
+ className
25
+ } = parameters;
26
+ if (!getSlotProps) {
27
+ // The simpler case - getSlotProps is not defined, so no internal event handlers are defined,
28
+ // so we can simply merge all the props without having to worry about extracting event handlers.
29
+ const joinedClasses = clsx(additionalProps == null ? void 0 : additionalProps.className, className, externalForwardedProps == null ? void 0 : externalForwardedProps.className, externalSlotProps == null ? void 0 : externalSlotProps.className);
30
+ const mergedStyle = _extends({}, additionalProps == null ? void 0 : additionalProps.style, externalForwardedProps == null ? void 0 : externalForwardedProps.style, externalSlotProps == null ? void 0 : externalSlotProps.style);
31
+ const props = _extends({}, additionalProps, externalForwardedProps, externalSlotProps);
32
+ if (joinedClasses.length > 0) {
33
+ props.className = joinedClasses;
34
+ }
35
+ if (Object.keys(mergedStyle).length > 0) {
36
+ props.style = mergedStyle;
37
+ }
38
+ return {
39
+ props,
40
+ internalRef: undefined
41
+ };
42
+ }
43
+
44
+ // In this case, getSlotProps is responsible for calling the external event handlers.
45
+ // We don't need to include them in the merged props because of this.
46
+
47
+ const eventHandlers = extractEventHandlers(_extends({}, externalForwardedProps, externalSlotProps));
48
+ const componentsPropsWithoutEventHandlers = omitEventHandlers(externalSlotProps);
49
+ const otherPropsWithoutEventHandlers = omitEventHandlers(externalForwardedProps);
50
+ const internalSlotProps = getSlotProps(eventHandlers);
51
+
52
+ // The order of classes is important here.
53
+ // Emotion (that we use in libraries consuming Base UI) depends on this order
54
+ // to properly override style. It requires the most important classes to be last
55
+ // (see https://github.com/mui/material-ui/pull/33205) for the related discussion.
56
+ const joinedClasses = clsx(internalSlotProps == null ? void 0 : internalSlotProps.className, additionalProps == null ? void 0 : additionalProps.className, className, externalForwardedProps == null ? void 0 : externalForwardedProps.className, externalSlotProps == null ? void 0 : externalSlotProps.className);
57
+ const mergedStyle = _extends({}, internalSlotProps == null ? void 0 : internalSlotProps.style, additionalProps == null ? void 0 : additionalProps.style, externalForwardedProps == null ? void 0 : externalForwardedProps.style, externalSlotProps == null ? void 0 : externalSlotProps.style);
58
+ const props = _extends({}, internalSlotProps, additionalProps, otherPropsWithoutEventHandlers, componentsPropsWithoutEventHandlers);
59
+ if (joinedClasses.length > 0) {
60
+ props.className = joinedClasses;
61
+ }
62
+ if (Object.keys(mergedStyle).length > 0) {
63
+ props.style = mergedStyle;
64
+ }
65
+ return {
66
+ props,
67
+ internalRef: internalSlotProps.ref
68
+ };
69
+ }
70
+ export default mergeSlotProps;
@@ -0,0 +1 @@
1
+ export { default } from './omitEventHandlers';
@@ -0,0 +1,18 @@
1
+ /**
2
+ * Removes event handlers from the given object.
3
+ * A field is considered an event handler if it is a function with a name beginning with `on`.
4
+ *
5
+ * @param object Object to remove event handlers from.
6
+ * @returns Object with event handlers removed.
7
+ */
8
+ function omitEventHandlers(object) {
9
+ if (object === undefined) {
10
+ return {};
11
+ }
12
+ const result = {};
13
+ Object.keys(object).filter(prop => !(prop.match(/^on[A-Z]/) && typeof object[prop] === 'function')).forEach(prop => {
14
+ result[prop] = object[prop];
15
+ });
16
+ return result;
17
+ }
18
+ export default omitEventHandlers;
@@ -0,0 +1 @@
1
+ export { default } from './ownerDocument';
@@ -0,0 +1,3 @@
1
+ export default function ownerDocument(node) {
2
+ return node && node.ownerDocument || document;
3
+ }
@@ -0,0 +1 @@
1
+ export { default } from './ownerWindow';
@@ -0,0 +1,5 @@
1
+ import ownerDocument from '../ownerDocument';
2
+ export default function ownerWindow(node) {
3
+ const doc = ownerDocument(node);
4
+ return doc.defaultView || window;
5
+ }
@@ -0,0 +1 @@
1
+ export { default } from './ponyfillGlobal';
@@ -0,0 +1,3 @@
1
+ /* eslint-disable */
2
+ // https://github.com/zloirock/core-js/issues/86#issuecomment-115759028
3
+ export default typeof window != 'undefined' && window.Math == Math ? window : typeof self != 'undefined' && self.Math == Math ? self : Function('return this')();
@@ -0,0 +1 @@
1
+ export { default } from './refType';
@@ -0,0 +1,3 @@
1
+ import PropTypes from 'prop-types';
2
+ const refType = PropTypes.oneOfType([PropTypes.func, PropTypes.object]);
3
+ export default refType;
@@ -0,0 +1 @@
1
+ export { default } from './requirePropFactory';
@@ -1,18 +1,11 @@
1
- "use strict";
2
-
3
- var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
- Object.defineProperty(exports, "__esModule", {
5
- value: true
6
- });
7
- exports.default = requirePropFactory;
8
- var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
9
- function requirePropFactory(componentNameInError, Component) {
1
+ import _extends from "@babel/runtime/helpers/esm/extends";
2
+ export default function requirePropFactory(componentNameInError, Component) {
10
3
  if (process.env.NODE_ENV === 'production') {
11
4
  return () => null;
12
5
  }
13
6
 
14
7
  // eslint-disable-next-line react/forbid-foreign-prop-types
15
- const prevPropTypes = Component ? (0, _extends2.default)({}, Component.propTypes) : null;
8
+ const prevPropTypes = Component ? _extends({}, Component.propTypes) : null;
16
9
  const requireProp = requiredProp => (props, propName, componentName, location, propFullName, ...args) => {
17
10
  const propFullNameSafe = propFullName || propName;
18
11
  const defaultTypeChecker = prevPropTypes == null ? void 0 : prevPropTypes[propFullNameSafe];
@@ -0,0 +1 @@
1
+ export { default } from './resolveComponentProps';
@@ -0,0 +1,11 @@
1
+ /**
2
+ * If `componentProps` is a function, calls it with the provided `ownerState`.
3
+ * Otherwise, just returns `componentProps`.
4
+ */
5
+ function resolveComponentProps(componentProps, ownerState, slotState) {
6
+ if (typeof componentProps === 'function') {
7
+ return componentProps(ownerState, slotState);
8
+ }
9
+ return componentProps;
10
+ }
11
+ export default resolveComponentProps;
@@ -0,0 +1 @@
1
+ export { default } from './resolveProps';
@@ -1,22 +1,15 @@
1
- "use strict";
2
-
3
- var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
- Object.defineProperty(exports, "__esModule", {
5
- value: true
6
- });
7
- exports.default = resolveProps;
8
- var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
1
+ import _extends from "@babel/runtime/helpers/esm/extends";
9
2
  /**
10
3
  * Add keys, values of `defaultProps` that does not exist in `props`
11
4
  * @param {object} defaultProps
12
5
  * @param {object} props
13
6
  * @returns {object} resolved props
14
7
  */
15
- function resolveProps(defaultProps, props) {
16
- const output = (0, _extends2.default)({}, props);
8
+ export default function resolveProps(defaultProps, props) {
9
+ const output = _extends({}, props);
17
10
  Object.keys(defaultProps).forEach(propName => {
18
11
  if (propName.toString().match(/^(components|slots)$/)) {
19
- output[propName] = (0, _extends2.default)({}, defaultProps[propName], output[propName]);
12
+ output[propName] = _extends({}, defaultProps[propName], output[propName]);
20
13
  } else if (propName.toString().match(/^(componentsProps|slotProps)$/)) {
21
14
  const defaultSlotProps = defaultProps[propName] || {};
22
15
  const slotProps = props[propName];
@@ -28,7 +21,7 @@ function resolveProps(defaultProps, props) {
28
21
  // Reduce the iteration if the default slot props is empty
29
22
  output[propName] = slotProps;
30
23
  } else {
31
- output[propName] = (0, _extends2.default)({}, slotProps);
24
+ output[propName] = _extends({}, slotProps);
32
25
  Object.keys(defaultSlotProps).forEach(slotPropName => {
33
26
  output[propName][slotPropName] = resolveProps(defaultSlotProps[slotPropName], slotProps[slotPropName]);
34
27
  });
@@ -0,0 +1 @@
1
+ export * from './scrollLeft';
@@ -1,10 +1,3 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.detectScrollType = detectScrollType;
7
- exports.getNormalizedScrollLeft = getNormalizedScrollLeft;
8
1
  // Source from https://github.com/alitaheri/normalize-scroll-left
9
2
  let cachedType;
10
3
 
@@ -27,7 +20,7 @@ let cachedType;
27
20
  *
28
21
  * spec* https://drafts.csswg.org/cssom-view/#dom-window-scroll
29
22
  */
30
- function detectScrollType() {
23
+ export function detectScrollType() {
31
24
  if (cachedType) {
32
25
  return cachedType;
33
26
  }
@@ -58,7 +51,7 @@ function detectScrollType() {
58
51
  }
59
52
 
60
53
  // Based on https://stackoverflow.com/a/24394376
61
- function getNormalizedScrollLeft(element, direction) {
54
+ export function getNormalizedScrollLeft(element, direction) {
62
55
  const scrollLeft = element.scrollLeft;
63
56
 
64
57
  // Perform the calculations only when direction is rtl to avoid messing up the ltr behavior
@@ -0,0 +1 @@
1
+ export { default } from './setRef';
@@ -1,9 +1,3 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.default = setRef;
7
1
  /**
8
2
  * TODO v5: consider making it private
9
3
  *
@@ -17,7 +11,7 @@ exports.default = setRef;
17
11
  * while still using it inside the component.
18
12
  * @param ref A ref callback or ref object. If anything falsy, this is a no-op.
19
13
  */
20
- function setRef(ref, value) {
14
+ export default function setRef(ref, value) {
21
15
  if (typeof ref === 'function') {
22
16
  ref(value);
23
17
  } else if (ref) {
package/esm/types.js ADDED
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1 @@
1
+ export { default } from './unsupportedProp';
@@ -1,10 +1,4 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.default = unsupportedProp;
7
- function unsupportedProp(props, propName, componentName, location, propFullName) {
1
+ export default function unsupportedProp(props, propName, componentName, location, propFullName) {
8
2
  if (process.env.NODE_ENV === 'production') {
9
3
  return null;
10
4
  }
@@ -0,0 +1 @@
1
+ export { default } from './useControlled';
@@ -1,15 +1,8 @@
1
- "use strict";
2
1
  'use client';
3
2
 
4
3
  /* eslint-disable react-hooks/rules-of-hooks, react-hooks/exhaustive-deps */
5
- Object.defineProperty(exports, "__esModule", {
6
- value: true
7
- });
8
- exports.default = useControlled;
9
- var React = _interopRequireWildcard(require("react"));
10
- function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
11
- function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
12
- function useControlled({
4
+ import * as React from 'react';
5
+ export default function useControlled({
13
6
  controlled,
14
7
  default: defaultProp,
15
8
  name,
@@ -0,0 +1 @@
1
+ export { default } from './useEnhancedEffect';
@@ -0,0 +1,13 @@
1
+ 'use client';
2
+
3
+ import * as React from 'react';
4
+
5
+ /**
6
+ * A version of `React.useLayoutEffect` that does not show a warning when server-side rendering.
7
+ * This is useful for effects that are only needed for client-side rendering but not for SSR.
8
+ *
9
+ * Before you use this hook, make sure to read https://gist.github.com/gaearon/e7d97cdf38a2907924ea12e4ebdf3c85
10
+ * and confirm it doesn't apply to your use-case.
11
+ */
12
+ const useEnhancedEffect = typeof window !== 'undefined' ? React.useLayoutEffect : React.useEffect;
13
+ export default useEnhancedEffect;
@@ -0,0 +1 @@
1
+ export { default } from './useEventCallback';
@@ -0,0 +1,20 @@
1
+ 'use client';
2
+
3
+ import * as React from 'react';
4
+ import useEnhancedEffect from '../useEnhancedEffect';
5
+
6
+ /**
7
+ * Inspired by https://github.com/facebook/react/issues/14099#issuecomment-440013892
8
+ * See RFC in https://github.com/reactjs/rfcs/pull/220
9
+ */
10
+
11
+ function useEventCallback(fn) {
12
+ const ref = React.useRef(fn);
13
+ useEnhancedEffect(() => {
14
+ ref.current = fn;
15
+ });
16
+ return React.useRef((...args) =>
17
+ // @ts-expect-error hide `this`
18
+ (0, ref.current)(...args)).current;
19
+ }
20
+ export default useEventCallback;
@@ -0,0 +1 @@
1
+ export { default } from './useForkRef';
@@ -0,0 +1,22 @@
1
+ 'use client';
2
+
3
+ import * as React from 'react';
4
+ import setRef from '../setRef';
5
+ export default function useForkRef(...refs) {
6
+ /**
7
+ * This will create a new function if the refs passed to this hook change and are all defined.
8
+ * This means react will call the old forkRef with `null` and the new forkRef
9
+ * with the ref. Cleanup naturally emerges from this behavior.
10
+ */
11
+ return React.useMemo(() => {
12
+ if (refs.every(ref => ref == null)) {
13
+ return null;
14
+ }
15
+ return instance => {
16
+ refs.forEach(ref => {
17
+ setRef(ref, instance);
18
+ });
19
+ };
20
+ // eslint-disable-next-line react-hooks/exhaustive-deps
21
+ }, refs);
22
+ }
@@ -0,0 +1 @@
1
+ export { default } from './useId';
@@ -1,13 +1,6 @@
1
- "use strict";
2
1
  'use client';
3
2
 
4
- Object.defineProperty(exports, "__esModule", {
5
- value: true
6
- });
7
- exports.default = useId;
8
- var React = _interopRequireWildcard(require("react"));
9
- function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
10
- function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
3
+ import * as React from 'react';
11
4
  let globalId = 0;
12
5
  function useGlobalId(idOverride) {
13
6
  const [defaultId, setDefaultId] = React.useState(idOverride);
@@ -33,7 +26,7 @@ const maybeReactUseId = React['useId'.toString()];
33
26
  * @param idOverride
34
27
  * @returns {string}
35
28
  */
36
- function useId(idOverride) {
29
+ export default function useId(idOverride) {
37
30
  if (maybeReactUseId !== undefined) {
38
31
  const reactId = maybeReactUseId();
39
32
  return idOverride != null ? idOverride : reactId;
@@ -0,0 +1,2 @@
1
+ export { default } from './useIsFocusVisible';
2
+ export * from './useIsFocusVisible';
@@ -1,19 +1,11 @@
1
- "use strict";
2
1
  'use client';
3
2
 
4
3
  // based on https://github.com/WICG/focus-visible/blob/v4.1.5/src/focus-visible.js
5
- Object.defineProperty(exports, "__esModule", {
6
- value: true
7
- });
8
- exports.default = useIsFocusVisible;
9
- exports.teardown = teardown;
10
- var React = _interopRequireWildcard(require("react"));
11
- var _useTimeout = require("../useTimeout/useTimeout");
12
- function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
13
- function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
4
+ import * as React from 'react';
5
+ import { Timeout } from '../useTimeout/useTimeout';
14
6
  let hadKeyboardEvent = true;
15
7
  let hadFocusVisibleRecently = false;
16
- const hadFocusVisibleRecentlyTimeout = new _useTimeout.Timeout();
8
+ const hadFocusVisibleRecentlyTimeout = new Timeout();
17
9
  const inputTypesWhitelist = {
18
10
  text: true,
19
11
  search: true,
@@ -96,7 +88,7 @@ function prepare(doc) {
96
88
  doc.addEventListener('touchstart', handlePointerDown, true);
97
89
  doc.addEventListener('visibilitychange', handleVisibilityChange, true);
98
90
  }
99
- function teardown(doc) {
91
+ export function teardown(doc) {
100
92
  doc.removeEventListener('keydown', handleKeyDown, true);
101
93
  doc.removeEventListener('mousedown', handlePointerDown, true);
102
94
  doc.removeEventListener('pointerdown', handlePointerDown, true);
@@ -120,7 +112,7 @@ function isFocusVisible(event) {
120
112
  // focusable events only.
121
113
  return hadKeyboardEvent || focusTriggersKeyboardModality(target);
122
114
  }
123
- function useIsFocusVisible() {
115
+ export default function useIsFocusVisible() {
124
116
  const ref = React.useCallback(node => {
125
117
  if (node != null) {
126
118
  prepare(node.ownerDocument);
@@ -0,0 +1 @@
1
+ export { default } from './useLazyRef';
@@ -0,0 +1,19 @@
1
+ 'use client';
2
+
3
+ import * as React from 'react';
4
+ const UNINITIALIZED = {};
5
+
6
+ /**
7
+ * A React.useRef() that is initialized lazily with a function. Note that it accepts an optional
8
+ * initialization argument, so the initialization function doesn't need to be an inline closure.
9
+ *
10
+ * @usage
11
+ * const ref = useLazyRef(sortColumns, columns)
12
+ */
13
+ export default function useLazyRef(init, initArg) {
14
+ const ref = React.useRef(UNINITIALIZED);
15
+ if (ref.current === UNINITIALIZED) {
16
+ ref.current = init(initArg);
17
+ }
18
+ return ref;
19
+ }
@@ -0,0 +1 @@
1
+ export { default } from './useLocalStorageState';
@@ -1,13 +1,7 @@
1
- "use strict";
2
1
  'use client';
3
2
 
4
- Object.defineProperty(exports, "__esModule", {
5
- value: true
6
- });
7
- exports.default = void 0;
8
- var React = _interopRequireWildcard(require("react"));
9
- function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
10
- function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
3
+ import * as React from 'react';
4
+
11
5
  // storage events only work across tabs, we'll use an event emitter to announce within the current tab
12
6
  const currentTabChangeListeners = new Map();
13
7
  function onCurrentTabStorageChange(key, handler) {
@@ -114,4 +108,4 @@ function useLocalStorageStateBrowser(key, initializer = null) {
114
108
  }
115
109
  return [storedValue, setStoredValue];
116
110
  }
117
- var _default = exports.default = typeof window === 'undefined' ? useLocalStorageStateServer : useLocalStorageStateBrowser;
111
+ export default typeof window === 'undefined' ? useLocalStorageStateServer : useLocalStorageStateBrowser;
@@ -0,0 +1 @@
1
+ export { default } from './useOnMount';
@@ -0,0 +1,13 @@
1
+ 'use client';
2
+
3
+ import * as React from 'react';
4
+ const EMPTY = [];
5
+
6
+ /**
7
+ * A React.useEffect equivalent that runs once, when the component is mounted.
8
+ */
9
+ export default function useOnMount(fn) {
10
+ /* eslint-disable react-hooks/exhaustive-deps */
11
+ React.useEffect(fn, EMPTY);
12
+ /* eslint-enable react-hooks/exhaustive-deps */
13
+ }
@@ -0,0 +1 @@
1
+ export { default } from './usePreviousProps';
@@ -0,0 +1,11 @@
1
+ 'use client';
2
+
3
+ import * as React from 'react';
4
+ const usePreviousProps = value => {
5
+ const ref = React.useRef({});
6
+ React.useEffect(() => {
7
+ ref.current = value;
8
+ });
9
+ return ref.current;
10
+ };
11
+ export default usePreviousProps;
@@ -0,0 +1 @@
1
+ export { default } from './useSlotProps';
@@ -0,0 +1,40 @@
1
+ 'use client';
2
+
3
+ import _extends from "@babel/runtime/helpers/esm/extends";
4
+ import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
5
+ const _excluded = ["elementType", "externalSlotProps", "ownerState", "skipResolvingSlotProps"];
6
+ import useForkRef from '../useForkRef';
7
+ import appendOwnerState from '../appendOwnerState';
8
+ import mergeSlotProps from '../mergeSlotProps';
9
+ import resolveComponentProps from '../resolveComponentProps';
10
+ /**
11
+ * @ignore - do not document.
12
+ * Builds the props to be passed into the slot of an unstyled component.
13
+ * It merges the internal props of the component with the ones supplied by the user, allowing to customize the behavior.
14
+ * If the slot component is not a host component, it also merges in the `ownerState`.
15
+ *
16
+ * @param parameters.getSlotProps - A function that returns the props to be passed to the slot component.
17
+ */
18
+ function useSlotProps(parameters) {
19
+ var _parameters$additiona;
20
+ const {
21
+ elementType,
22
+ externalSlotProps,
23
+ ownerState,
24
+ skipResolvingSlotProps = false
25
+ } = parameters,
26
+ rest = _objectWithoutPropertiesLoose(parameters, _excluded);
27
+ const resolvedComponentsProps = skipResolvingSlotProps ? {} : resolveComponentProps(externalSlotProps, ownerState);
28
+ const {
29
+ props: mergedProps,
30
+ internalRef
31
+ } = mergeSlotProps(_extends({}, rest, {
32
+ externalSlotProps: resolvedComponentsProps
33
+ }));
34
+ const ref = useForkRef(internalRef, resolvedComponentsProps == null ? void 0 : resolvedComponentsProps.ref, (_parameters$additiona = parameters.additionalProps) == null ? void 0 : _parameters$additiona.ref);
35
+ const props = appendOwnerState(elementType, _extends({}, mergedProps, {
36
+ ref
37
+ }), ownerState);
38
+ return props;
39
+ }
40
+ export default useSlotProps;
@@ -0,0 +1,2 @@
1
+ export { default } from './useTimeout';
2
+ export { Timeout } from './useTimeout';
@@ -1,15 +1,8 @@
1
- "use strict";
2
1
  'use client';
3
2
 
4
- var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
5
- Object.defineProperty(exports, "__esModule", {
6
- value: true
7
- });
8
- exports.Timeout = void 0;
9
- exports.default = useTimeout;
10
- var _useLazyRef = _interopRequireDefault(require("../useLazyRef/useLazyRef"));
11
- var _useOnMount = _interopRequireDefault(require("../useOnMount/useOnMount"));
12
- class Timeout {
3
+ import useLazyRef from '../useLazyRef/useLazyRef';
4
+ import useOnMount from '../useOnMount/useOnMount';
5
+ export class Timeout {
13
6
  constructor() {
14
7
  this.currentId = null;
15
8
  this.clear = () => {
@@ -36,9 +29,8 @@ class Timeout {
36
29
  }, delay);
37
30
  }
38
31
  }
39
- exports.Timeout = Timeout;
40
- function useTimeout() {
41
- const timeout = (0, _useLazyRef.default)(Timeout.create).current;
42
- (0, _useOnMount.default)(timeout.disposeEffect);
32
+ export default function useTimeout() {
33
+ const timeout = useLazyRef(Timeout.create).current;
34
+ useOnMount(timeout.disposeEffect);
43
35
  return timeout;
44
36
  }
@@ -0,0 +1 @@
1
+ export { default } from './visuallyHidden';
@@ -1,9 +1,3 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.default = void 0;
7
1
  const visuallyHidden = {
8
2
  border: 0,
9
3
  clip: 'rect(0 0 0 0)',
@@ -15,4 +9,4 @@ const visuallyHidden = {
15
9
  whiteSpace: 'nowrap',
16
10
  width: '1px'
17
11
  };
18
- var _default = exports.default = visuallyHidden;
12
+ export default visuallyHidden;