@contember/react-utils 1.3.0-rc.3 → 2.0.0-alpha.10

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 (657) hide show
  1. package/api-extractor.json +3 -0
  2. package/dist/development/index.cjs +35 -72
  3. package/dist/development/index.cjs.map +1 -1
  4. package/dist/development/index.js +35 -72
  5. package/dist/development/index.js.map +1 -1
  6. package/dist/development/{context → src/context}/createContext.cjs +3 -3
  7. package/dist/development/src/context/createContext.cjs.map +1 -0
  8. package/dist/development/src/context/createContext.js.map +1 -0
  9. package/dist/{production → development/src}/context/createRequiredContext.cjs +3 -3
  10. package/dist/development/src/context/createRequiredContext.cjs.map +1 -0
  11. package/dist/development/src/context/createRequiredContext.js.map +1 -0
  12. package/dist/development/src/debug-context/Constants.cjs.map +1 -0
  13. package/dist/development/src/debug-context/Constants.js.map +1 -0
  14. package/dist/development/{debug-context → src/debug-context}/Context.cjs +8 -8
  15. package/dist/development/src/debug-context/Context.cjs.map +1 -0
  16. package/dist/development/{debug-context → src/debug-context}/Context.js +1 -1
  17. package/dist/development/src/debug-context/Context.js.map +1 -0
  18. package/dist/development/src/hooks/unwrapRefValue.cjs.map +1 -0
  19. package/dist/development/src/hooks/unwrapRefValue.js.map +1 -0
  20. package/dist/development/{hooks → src/hooks}/useAbortController.cjs +4 -4
  21. package/dist/development/src/hooks/useAbortController.cjs.map +1 -0
  22. package/dist/development/src/hooks/useAbortController.js.map +1 -0
  23. package/dist/development/{hooks → src/hooks}/useArrayMapMemo.cjs +3 -3
  24. package/dist/development/src/hooks/useArrayMapMemo.cjs.map +1 -0
  25. package/dist/development/src/hooks/useArrayMapMemo.js.map +1 -0
  26. package/dist/development/{hooks → src/hooks}/useAutoHeightTextArea.cjs +3 -3
  27. package/dist/development/src/hooks/useAutoHeightTextArea.cjs.map +1 -0
  28. package/dist/development/src/hooks/useAutoHeightTextArea.js.map +1 -0
  29. package/dist/development/{hooks → src/hooks}/useChildrenAsLabel.cjs +4 -5
  30. package/dist/development/src/hooks/useChildrenAsLabel.cjs.map +1 -0
  31. package/dist/development/{hooks → src/hooks}/useChildrenAsLabel.js +1 -2
  32. package/dist/development/src/hooks/useChildrenAsLabel.js.map +1 -0
  33. package/dist/development/{hooks → src/hooks}/useComposeRef.cjs +3 -3
  34. package/dist/development/src/hooks/useComposeRef.cjs.map +1 -0
  35. package/dist/development/src/hooks/useComposeRef.js.map +1 -0
  36. package/dist/development/src/hooks/useConstantLengthInvariant.cjs.map +1 -0
  37. package/dist/development/src/hooks/useConstantLengthInvariant.js.map +1 -0
  38. package/dist/development/src/hooks/useConstantValueInvariant.cjs.map +1 -0
  39. package/dist/development/src/hooks/useConstantValueInvariant.js.map +1 -0
  40. package/dist/development/{hooks → src/hooks}/useDebounce.cjs +3 -3
  41. package/dist/development/src/hooks/useDebounce.cjs.map +1 -0
  42. package/dist/development/src/hooks/useDebounce.js.map +1 -0
  43. package/dist/development/{hooks → src/hooks}/useDebounceCallback.cjs +5 -5
  44. package/dist/development/src/hooks/useDebounceCallback.cjs.map +1 -0
  45. package/dist/development/src/hooks/useDebounceCallback.js.map +1 -0
  46. package/dist/development/{hooks → src/hooks}/useDocumentTitle.cjs +3 -3
  47. package/dist/development/src/hooks/useDocumentTitle.cjs.map +1 -0
  48. package/dist/development/src/hooks/useDocumentTitle.js.map +1 -0
  49. package/dist/development/{hooks → src/hooks}/useExpectSameValueReference.cjs +4 -4
  50. package/dist/development/src/hooks/useExpectSameValueReference.cjs.map +1 -0
  51. package/dist/development/{hooks → src/hooks}/useExpectSameValueReference.js +2 -2
  52. package/dist/development/src/hooks/useExpectSameValueReference.js.map +1 -0
  53. package/dist/development/{hooks → src/hooks}/useForceRender.cjs +2 -2
  54. package/dist/development/src/hooks/useForceRender.cjs.map +1 -0
  55. package/dist/development/src/hooks/useForceRender.js.map +1 -0
  56. package/dist/{production → development/src}/hooks/useId.cjs +2 -2
  57. package/dist/development/src/hooks/useId.cjs.map +1 -0
  58. package/dist/development/src/hooks/useId.js.map +1 -0
  59. package/dist/development/{hooks → src/hooks}/useIsMounted.cjs +3 -3
  60. package/dist/development/src/hooks/useIsMounted.cjs.map +1 -0
  61. package/dist/development/src/hooks/useIsMounted.js.map +1 -0
  62. package/dist/{production → development/src}/hooks/useObjectMemo.cjs +2 -2
  63. package/dist/development/src/hooks/useObjectMemo.cjs.map +1 -0
  64. package/dist/development/src/hooks/useObjectMemo.js.map +1 -0
  65. package/dist/{production → development/src}/hooks/useOnElementClickOutsideCallback.cjs +2 -2
  66. package/dist/development/src/hooks/useOnElementClickOutsideCallback.cjs.map +1 -0
  67. package/dist/development/src/hooks/useOnElementClickOutsideCallback.js.map +1 -0
  68. package/dist/development/{hooks → src/hooks}/useOnElementMouseEnterDelayedCallback.cjs +2 -2
  69. package/dist/development/src/hooks/useOnElementMouseEnterDelayedCallback.cjs.map +1 -0
  70. package/dist/development/src/hooks/useOnElementMouseEnterDelayedCallback.js.map +1 -0
  71. package/dist/{production → development/src}/hooks/useOnElementResize.cjs +5 -5
  72. package/dist/development/src/hooks/useOnElementResize.cjs.map +1 -0
  73. package/dist/development/{hooks → src/hooks}/useOnElementResize.js +1 -1
  74. package/dist/development/src/hooks/useOnElementResize.js.map +1 -0
  75. package/dist/{production → development/src}/hooks/useOnWindowResize.cjs +5 -5
  76. package/dist/development/src/hooks/useOnWindowResize.cjs.map +1 -0
  77. package/dist/development/{hooks → src/hooks}/useOnWindowResize.js +1 -1
  78. package/dist/development/src/hooks/useOnWindowResize.js.map +1 -0
  79. package/dist/development/{hooks → src/hooks}/usePreviousValue.cjs +3 -3
  80. package/dist/development/src/hooks/usePreviousValue.cjs.map +1 -0
  81. package/dist/development/src/hooks/usePreviousValue.js.map +1 -0
  82. package/dist/{production → development/src}/hooks/useStoredState.cjs +4 -4
  83. package/dist/development/src/hooks/useStoredState.cjs.map +1 -0
  84. package/dist/development/src/hooks/useStoredState.js.map +1 -0
  85. package/dist/development/{hooks → src/hooks}/useUpdatedRef.cjs +2 -2
  86. package/dist/development/src/hooks/useUpdatedRef.cjs.map +1 -0
  87. package/dist/development/src/hooks/useUpdatedRef.js.map +1 -0
  88. package/dist/development/{hooks → src/hooks}/useWindowSize.cjs +4 -4
  89. package/dist/development/src/hooks/useWindowSize.cjs.map +1 -0
  90. package/dist/development/src/hooks/useWindowSize.js.map +1 -0
  91. package/dist/development/src/referentiallyStable/emptyArray.cjs.map +1 -0
  92. package/dist/development/src/referentiallyStable/emptyArray.js.map +1 -0
  93. package/dist/development/src/referentiallyStable/emptyObject.cjs.map +1 -0
  94. package/dist/development/src/referentiallyStable/emptyObject.js.map +1 -0
  95. package/dist/development/src/referentiallyStable/identityFunction.cjs.map +1 -0
  96. package/dist/development/src/referentiallyStable/identityFunction.js.map +1 -0
  97. package/dist/development/src/referentiallyStable/noop.cjs.map +1 -0
  98. package/dist/development/src/referentiallyStable/noop.js.map +1 -0
  99. package/dist/development/src/referentiallyStable/returnFalse.cjs.map +1 -0
  100. package/dist/development/src/referentiallyStable/returnFalse.js.map +1 -0
  101. package/dist/development/src/referentiallyStable/returnTrue.cjs.map +1 -0
  102. package/dist/development/src/referentiallyStable/returnTrue.js.map +1 -0
  103. package/dist/{production → development/src}/referentiallyStable/useReferentiallyStableCallback.cjs +3 -3
  104. package/dist/development/src/referentiallyStable/useReferentiallyStableCallback.cjs.map +1 -0
  105. package/dist/development/src/referentiallyStable/useReferentiallyStableCallback.js.map +1 -0
  106. package/dist/production/index.cjs +35 -72
  107. package/dist/production/index.cjs.map +1 -1
  108. package/dist/production/index.js +35 -72
  109. package/dist/production/index.js.map +1 -1
  110. package/dist/production/{context → src/context}/createContext.cjs +3 -3
  111. package/dist/production/src/context/createContext.cjs.map +1 -0
  112. package/dist/production/src/context/createContext.js.map +1 -0
  113. package/dist/{development → production/src}/context/createRequiredContext.cjs +3 -3
  114. package/dist/production/src/context/createRequiredContext.cjs.map +1 -0
  115. package/dist/production/src/context/createRequiredContext.js.map +1 -0
  116. package/dist/production/src/debug-context/Constants.cjs.map +1 -0
  117. package/dist/production/src/debug-context/Constants.js.map +1 -0
  118. package/dist/production/{debug-context → src/debug-context}/Context.cjs +7 -7
  119. package/dist/production/src/debug-context/Context.cjs.map +1 -0
  120. package/dist/production/src/debug-context/Context.js.map +1 -0
  121. package/dist/production/src/hooks/unwrapRefValue.cjs.map +1 -0
  122. package/dist/production/src/hooks/unwrapRefValue.js.map +1 -0
  123. package/dist/production/{hooks → src/hooks}/useAbortController.cjs +4 -4
  124. package/dist/production/src/hooks/useAbortController.cjs.map +1 -0
  125. package/dist/production/src/hooks/useAbortController.js.map +1 -0
  126. package/dist/production/{hooks → src/hooks}/useArrayMapMemo.cjs +3 -3
  127. package/dist/production/src/hooks/useArrayMapMemo.cjs.map +1 -0
  128. package/dist/production/src/hooks/useArrayMapMemo.js.map +1 -0
  129. package/dist/production/{hooks → src/hooks}/useAutoHeightTextArea.cjs +3 -3
  130. package/dist/production/src/hooks/useAutoHeightTextArea.cjs.map +1 -0
  131. package/dist/production/src/hooks/useAutoHeightTextArea.js.map +1 -0
  132. package/dist/production/{hooks → src/hooks}/useChildrenAsLabel.cjs +5 -7
  133. package/dist/production/src/hooks/useChildrenAsLabel.cjs.map +1 -0
  134. package/dist/production/{hooks → src/hooks}/useChildrenAsLabel.js +2 -4
  135. package/dist/production/src/hooks/useChildrenAsLabel.js.map +1 -0
  136. package/dist/production/{hooks → src/hooks}/useComposeRef.cjs +3 -3
  137. package/dist/production/src/hooks/useComposeRef.cjs.map +1 -0
  138. package/dist/production/src/hooks/useComposeRef.js.map +1 -0
  139. package/dist/production/src/hooks/useConstantLengthInvariant.cjs.map +1 -0
  140. package/dist/production/src/hooks/useConstantLengthInvariant.js.map +1 -0
  141. package/dist/production/src/hooks/useConstantValueInvariant.cjs.map +1 -0
  142. package/dist/production/src/hooks/useConstantValueInvariant.js.map +1 -0
  143. package/dist/production/{hooks → src/hooks}/useDebounce.cjs +3 -3
  144. package/dist/production/src/hooks/useDebounce.cjs.map +1 -0
  145. package/dist/production/src/hooks/useDebounce.js.map +1 -0
  146. package/dist/production/{hooks → src/hooks}/useDebounceCallback.cjs +5 -5
  147. package/dist/production/src/hooks/useDebounceCallback.cjs.map +1 -0
  148. package/dist/production/src/hooks/useDebounceCallback.js.map +1 -0
  149. package/dist/production/{hooks → src/hooks}/useDocumentTitle.cjs +3 -3
  150. package/dist/production/src/hooks/useDocumentTitle.cjs.map +1 -0
  151. package/dist/production/src/hooks/useDocumentTitle.js.map +1 -0
  152. package/dist/production/{hooks → src/hooks}/useExpectSameValueReference.cjs +4 -4
  153. package/dist/production/src/hooks/useExpectSameValueReference.cjs.map +1 -0
  154. package/dist/production/{hooks → src/hooks}/useExpectSameValueReference.js +2 -2
  155. package/dist/production/src/hooks/useExpectSameValueReference.js.map +1 -0
  156. package/dist/production/{hooks → src/hooks}/useForceRender.cjs +2 -2
  157. package/dist/production/src/hooks/useForceRender.cjs.map +1 -0
  158. package/dist/production/src/hooks/useForceRender.js.map +1 -0
  159. package/dist/{development → production/src}/hooks/useId.cjs +2 -2
  160. package/dist/production/src/hooks/useId.cjs.map +1 -0
  161. package/dist/production/src/hooks/useId.js.map +1 -0
  162. package/dist/production/{hooks → src/hooks}/useIsMounted.cjs +3 -3
  163. package/dist/production/src/hooks/useIsMounted.cjs.map +1 -0
  164. package/dist/production/src/hooks/useIsMounted.js.map +1 -0
  165. package/dist/{development → production/src}/hooks/useObjectMemo.cjs +2 -2
  166. package/dist/production/src/hooks/useObjectMemo.cjs.map +1 -0
  167. package/dist/production/src/hooks/useObjectMemo.js.map +1 -0
  168. package/dist/{development → production/src}/hooks/useOnElementClickOutsideCallback.cjs +2 -2
  169. package/dist/production/src/hooks/useOnElementClickOutsideCallback.cjs.map +1 -0
  170. package/dist/production/src/hooks/useOnElementClickOutsideCallback.js.map +1 -0
  171. package/dist/production/{hooks → src/hooks}/useOnElementMouseEnterDelayedCallback.cjs +2 -2
  172. package/dist/production/src/hooks/useOnElementMouseEnterDelayedCallback.cjs.map +1 -0
  173. package/dist/production/src/hooks/useOnElementMouseEnterDelayedCallback.js.map +1 -0
  174. package/dist/{development → production/src}/hooks/useOnElementResize.cjs +5 -5
  175. package/dist/production/src/hooks/useOnElementResize.cjs.map +1 -0
  176. package/dist/production/{hooks → src/hooks}/useOnElementResize.js +1 -1
  177. package/dist/production/src/hooks/useOnElementResize.js.map +1 -0
  178. package/dist/{development → production/src}/hooks/useOnWindowResize.cjs +5 -5
  179. package/dist/production/src/hooks/useOnWindowResize.cjs.map +1 -0
  180. package/dist/production/{hooks → src/hooks}/useOnWindowResize.js +1 -1
  181. package/dist/production/src/hooks/useOnWindowResize.js.map +1 -0
  182. package/dist/production/{hooks → src/hooks}/usePreviousValue.cjs +3 -3
  183. package/dist/production/src/hooks/usePreviousValue.cjs.map +1 -0
  184. package/dist/production/src/hooks/usePreviousValue.js.map +1 -0
  185. package/dist/{development → production/src}/hooks/useStoredState.cjs +4 -4
  186. package/dist/production/src/hooks/useStoredState.cjs.map +1 -0
  187. package/dist/production/src/hooks/useStoredState.js.map +1 -0
  188. package/dist/production/{hooks → src/hooks}/useUpdatedRef.cjs +2 -2
  189. package/dist/production/src/hooks/useUpdatedRef.cjs.map +1 -0
  190. package/dist/production/src/hooks/useUpdatedRef.js.map +1 -0
  191. package/dist/production/{hooks → src/hooks}/useWindowSize.cjs +4 -4
  192. package/dist/production/src/hooks/useWindowSize.cjs.map +1 -0
  193. package/dist/production/src/hooks/useWindowSize.js.map +1 -0
  194. package/dist/production/src/referentiallyStable/emptyArray.cjs.map +1 -0
  195. package/dist/production/src/referentiallyStable/emptyArray.js.map +1 -0
  196. package/dist/production/src/referentiallyStable/emptyObject.cjs.map +1 -0
  197. package/dist/production/src/referentiallyStable/emptyObject.js.map +1 -0
  198. package/dist/production/src/referentiallyStable/identityFunction.cjs.map +1 -0
  199. package/dist/production/src/referentiallyStable/identityFunction.js.map +1 -0
  200. package/dist/production/src/referentiallyStable/noop.cjs.map +1 -0
  201. package/dist/production/src/referentiallyStable/noop.js.map +1 -0
  202. package/dist/production/src/referentiallyStable/returnFalse.cjs.map +1 -0
  203. package/dist/production/src/referentiallyStable/returnFalse.js.map +1 -0
  204. package/dist/production/src/referentiallyStable/returnTrue.cjs.map +1 -0
  205. package/dist/production/src/referentiallyStable/returnTrue.js.map +1 -0
  206. package/dist/{development → production/src}/referentiallyStable/useReferentiallyStableCallback.cjs +3 -3
  207. package/dist/production/src/referentiallyStable/useReferentiallyStableCallback.cjs.map +1 -0
  208. package/dist/production/src/referentiallyStable/useReferentiallyStableCallback.js.map +1 -0
  209. package/dist/types/debug-context/Types.d.ts.map +1 -1
  210. package/dist/types/hooks/index.d.ts +0 -10
  211. package/dist/types/hooks/index.d.ts.map +1 -1
  212. package/dist/types/hooks/useArrayMapMemo.d.ts.map +1 -1
  213. package/dist/types/hooks/useAutoHeightTextArea.d.ts.map +1 -1
  214. package/dist/types/hooks/useComposeRef.d.ts.map +1 -1
  215. package/dist/types/hooks/useConstantLengthInvariant.d.ts.map +1 -1
  216. package/dist/types/hooks/useConstantValueInvariant.d.ts.map +1 -1
  217. package/dist/types/hooks/useDebounce.d.ts.map +1 -1
  218. package/dist/types/hooks/useObjectMemo.d.ts.map +1 -1
  219. package/dist/types/hooks/usePreviousValue.d.ts.map +1 -1
  220. package/dist/types/hooks/useStoredState.d.ts.map +1 -1
  221. package/dist/types/index.d.ts +0 -1
  222. package/dist/types/index.d.ts.map +1 -1
  223. package/dist/types/referentiallyStable/emptyArray.d.ts.map +1 -1
  224. package/dist/types/referentiallyStable/identityFunction.d.ts.map +1 -1
  225. package/dist/types/referentiallyStable/useReferentiallyStableCallback.d.ts.map +1 -1
  226. package/dist/types/tsconfig.tsbuildinfo +1 -1
  227. package/dist/types/types/PropsWithRequiredChildren.d.ts.map +1 -1
  228. package/package.json +5 -13
  229. package/src/context/createContext.ts +3 -3
  230. package/src/context/createRequiredContext.ts +10 -10
  231. package/src/debug-context/Types.ts +8 -8
  232. package/src/hooks/index.ts +0 -10
  233. package/src/hooks/useComposeRef.ts +1 -1
  234. package/src/hooks/useExpectSameValueReference.ts +3 -3
  235. package/src/hooks/useOnElementResize.ts +1 -1
  236. package/src/hooks/useOnWindowResize.ts +1 -1
  237. package/src/hooks/useStoredState.ts +2 -2
  238. package/src/hooks/useWindowSize.ts +12 -12
  239. package/src/index.ts +0 -1
  240. package/src/tsconfig.json +5 -2
  241. package/src/types/PropsWithRequiredChildren.ts +1 -1
  242. package/tests/hooks/useChildrenAsLabel.test.tsx +96 -0
  243. package/tests/hooks/useId.test.ts +13 -0
  244. package/tests/tsconfig.json +10 -0
  245. package/tsconfig.json +8 -0
  246. package/tsdoc.json +6 -0
  247. package/dist/development/context/createContext.cjs.map +0 -1
  248. package/dist/development/context/createContext.js.map +0 -1
  249. package/dist/development/context/createRequiredContext.cjs.map +0 -1
  250. package/dist/development/context/createRequiredContext.js.map +0 -1
  251. package/dist/development/debug-context/Constants.cjs.map +0 -1
  252. package/dist/development/debug-context/Constants.js.map +0 -1
  253. package/dist/development/debug-context/Context.cjs.map +0 -1
  254. package/dist/development/debug-context/Context.js.map +0 -1
  255. package/dist/development/hooks/unwrapRefValue.cjs.map +0 -1
  256. package/dist/development/hooks/unwrapRefValue.js.map +0 -1
  257. package/dist/development/hooks/useAbortController.cjs.map +0 -1
  258. package/dist/development/hooks/useAbortController.js.map +0 -1
  259. package/dist/development/hooks/useAddClassNameDuringResize.cjs +0 -32
  260. package/dist/development/hooks/useAddClassNameDuringResize.cjs.map +0 -1
  261. package/dist/development/hooks/useAddClassNameDuringResize.js +0 -32
  262. package/dist/development/hooks/useAddClassNameDuringResize.js.map +0 -1
  263. package/dist/development/hooks/useArrayMapMemo.cjs.map +0 -1
  264. package/dist/development/hooks/useArrayMapMemo.js.map +0 -1
  265. package/dist/development/hooks/useAutoHeightTextArea.cjs.map +0 -1
  266. package/dist/development/hooks/useAutoHeightTextArea.js.map +0 -1
  267. package/dist/development/hooks/useChildrenAsLabel.cjs.map +0 -1
  268. package/dist/development/hooks/useChildrenAsLabel.js.map +0 -1
  269. package/dist/development/hooks/useCloseOnClickOutside.cjs +0 -25
  270. package/dist/development/hooks/useCloseOnClickOutside.cjs.map +0 -1
  271. package/dist/development/hooks/useCloseOnClickOutside.js +0 -25
  272. package/dist/development/hooks/useCloseOnClickOutside.js.map +0 -1
  273. package/dist/development/hooks/useCloseOnEscape.cjs +0 -20
  274. package/dist/development/hooks/useCloseOnEscape.cjs.map +0 -1
  275. package/dist/development/hooks/useCloseOnEscape.js +0 -20
  276. package/dist/development/hooks/useCloseOnEscape.js.map +0 -1
  277. package/dist/development/hooks/useComposeRef.cjs.map +0 -1
  278. package/dist/development/hooks/useComposeRef.js.map +0 -1
  279. package/dist/development/hooks/useConstantLengthInvariant.cjs.map +0 -1
  280. package/dist/development/hooks/useConstantLengthInvariant.js.map +0 -1
  281. package/dist/development/hooks/useConstantValueInvariant.cjs.map +0 -1
  282. package/dist/development/hooks/useConstantValueInvariant.js.map +0 -1
  283. package/dist/development/hooks/useContainerWidth.cjs +0 -14
  284. package/dist/development/hooks/useContainerWidth.cjs.map +0 -1
  285. package/dist/development/hooks/useContainerWidth.js +0 -14
  286. package/dist/development/hooks/useContainerWidth.js.map +0 -1
  287. package/dist/development/hooks/useDebounce.cjs.map +0 -1
  288. package/dist/development/hooks/useDebounce.js.map +0 -1
  289. package/dist/development/hooks/useDebounceCallback.cjs.map +0 -1
  290. package/dist/development/hooks/useDebounceCallback.js.map +0 -1
  291. package/dist/development/hooks/useDocumentTitle.cjs.map +0 -1
  292. package/dist/development/hooks/useDocumentTitle.js.map +0 -1
  293. package/dist/development/hooks/useElementSize.cjs +0 -37
  294. package/dist/development/hooks/useElementSize.cjs.map +0 -1
  295. package/dist/development/hooks/useElementSize.js +0 -37
  296. package/dist/development/hooks/useElementSize.js.map +0 -1
  297. package/dist/development/hooks/useElementTopOffset.cjs +0 -29
  298. package/dist/development/hooks/useElementTopOffset.cjs.map +0 -1
  299. package/dist/development/hooks/useElementTopOffset.js +0 -29
  300. package/dist/development/hooks/useElementTopOffset.js.map +0 -1
  301. package/dist/development/hooks/useEventHandler.cjs +0 -19
  302. package/dist/development/hooks/useEventHandler.cjs.map +0 -1
  303. package/dist/development/hooks/useEventHandler.js +0 -19
  304. package/dist/development/hooks/useEventHandler.js.map +0 -1
  305. package/dist/development/hooks/useExpectSameValueReference.cjs.map +0 -1
  306. package/dist/development/hooks/useExpectSameValueReference.js.map +0 -1
  307. package/dist/development/hooks/useForceRender.cjs.map +0 -1
  308. package/dist/development/hooks/useForceRender.js.map +0 -1
  309. package/dist/development/hooks/useId.cjs.map +0 -1
  310. package/dist/development/hooks/useId.js.map +0 -1
  311. package/dist/development/hooks/useIsMounted.cjs.map +0 -1
  312. package/dist/development/hooks/useIsMounted.js.map +0 -1
  313. package/dist/development/hooks/useObjectMemo.cjs.map +0 -1
  314. package/dist/development/hooks/useObjectMemo.js.map +0 -1
  315. package/dist/development/hooks/useOnElementClickOutsideCallback.cjs.map +0 -1
  316. package/dist/development/hooks/useOnElementClickOutsideCallback.js.map +0 -1
  317. package/dist/development/hooks/useOnElementMouseEnterDelayedCallback.cjs.map +0 -1
  318. package/dist/development/hooks/useOnElementMouseEnterDelayedCallback.js.map +0 -1
  319. package/dist/development/hooks/useOnElementMutation.cjs +0 -35
  320. package/dist/development/hooks/useOnElementMutation.cjs.map +0 -1
  321. package/dist/development/hooks/useOnElementMutation.js +0 -35
  322. package/dist/development/hooks/useOnElementMutation.js.map +0 -1
  323. package/dist/development/hooks/useOnElementResize.cjs.map +0 -1
  324. package/dist/development/hooks/useOnElementResize.js.map +0 -1
  325. package/dist/development/hooks/useOnScrollWithin.cjs +0 -52
  326. package/dist/development/hooks/useOnScrollWithin.cjs.map +0 -1
  327. package/dist/development/hooks/useOnScrollWithin.js +0 -52
  328. package/dist/development/hooks/useOnScrollWithin.js.map +0 -1
  329. package/dist/development/hooks/useOnWindowResize.cjs.map +0 -1
  330. package/dist/development/hooks/useOnWindowResize.js.map +0 -1
  331. package/dist/development/hooks/usePreviousValue.cjs.map +0 -1
  332. package/dist/development/hooks/usePreviousValue.js.map +0 -1
  333. package/dist/development/hooks/useScrollOffsets.cjs +0 -67
  334. package/dist/development/hooks/useScrollOffsets.cjs.map +0 -1
  335. package/dist/development/hooks/useScrollOffsets.js +0 -67
  336. package/dist/development/hooks/useScrollOffsets.js.map +0 -1
  337. package/dist/development/hooks/useStoredState.cjs.map +0 -1
  338. package/dist/development/hooks/useStoredState.js.map +0 -1
  339. package/dist/development/hooks/useUpdatedRef.cjs.map +0 -1
  340. package/dist/development/hooks/useUpdatedRef.js.map +0 -1
  341. package/dist/development/hooks/useWindowSize.cjs.map +0 -1
  342. package/dist/development/hooks/useWindowSize.js.map +0 -1
  343. package/dist/development/referentiallyStable/emptyArray.cjs.map +0 -1
  344. package/dist/development/referentiallyStable/emptyArray.js.map +0 -1
  345. package/dist/development/referentiallyStable/emptyObject.cjs.map +0 -1
  346. package/dist/development/referentiallyStable/emptyObject.js.map +0 -1
  347. package/dist/development/referentiallyStable/identityFunction.cjs.map +0 -1
  348. package/dist/development/referentiallyStable/identityFunction.js.map +0 -1
  349. package/dist/development/referentiallyStable/noop.cjs.map +0 -1
  350. package/dist/development/referentiallyStable/noop.js.map +0 -1
  351. package/dist/development/referentiallyStable/returnFalse.cjs.map +0 -1
  352. package/dist/development/referentiallyStable/returnFalse.js.map +0 -1
  353. package/dist/development/referentiallyStable/returnTrue.cjs.map +0 -1
  354. package/dist/development/referentiallyStable/returnTrue.js.map +0 -1
  355. package/dist/development/referentiallyStable/useReferentiallyStableCallback.cjs.map +0 -1
  356. package/dist/development/referentiallyStable/useReferentiallyStableCallback.js.map +0 -1
  357. package/dist/development/theming/ColorSchemeProvider.cjs +0 -16
  358. package/dist/development/theming/ColorSchemeProvider.cjs.map +0 -1
  359. package/dist/development/theming/ColorSchemeProvider.js +0 -16
  360. package/dist/development/theming/ColorSchemeProvider.js.map +0 -1
  361. package/dist/development/theming/GlobalClassNamePrefixContext.cjs +0 -6
  362. package/dist/development/theming/GlobalClassNamePrefixContext.cjs.map +0 -1
  363. package/dist/development/theming/GlobalClassNamePrefixContext.js +0 -6
  364. package/dist/development/theming/GlobalClassNamePrefixContext.js.map +0 -1
  365. package/dist/development/theming/contexts.cjs +0 -12
  366. package/dist/development/theming/contexts.cjs.map +0 -1
  367. package/dist/development/theming/contexts.js +0 -12
  368. package/dist/development/theming/contexts.js.map +0 -1
  369. package/dist/development/theming/useClassName.cjs +0 -17
  370. package/dist/development/theming/useClassName.cjs.map +0 -1
  371. package/dist/development/theming/useClassName.js +0 -17
  372. package/dist/development/theming/useClassName.js.map +0 -1
  373. package/dist/development/theming/useClassNameFactory.cjs +0 -22
  374. package/dist/development/theming/useClassNameFactory.cjs.map +0 -1
  375. package/dist/development/theming/useClassNameFactory.js +0 -22
  376. package/dist/development/theming/useClassNameFactory.js.map +0 -1
  377. package/dist/development/theming/useThemedClassName.cjs +0 -17
  378. package/dist/development/theming/useThemedClassName.cjs.map +0 -1
  379. package/dist/development/theming/useThemedClassName.js +0 -17
  380. package/dist/development/theming/useThemedClassName.js.map +0 -1
  381. package/dist/development/theming/useThemedClassNameFactory.cjs +0 -29
  382. package/dist/development/theming/useThemedClassNameFactory.cjs.map +0 -1
  383. package/dist/development/theming/useThemedClassNameFactory.js +0 -29
  384. package/dist/development/theming/useThemedClassNameFactory.js.map +0 -1
  385. package/dist/production/context/createContext.cjs.map +0 -1
  386. package/dist/production/context/createContext.js.map +0 -1
  387. package/dist/production/context/createRequiredContext.cjs.map +0 -1
  388. package/dist/production/context/createRequiredContext.js.map +0 -1
  389. package/dist/production/debug-context/Constants.cjs.map +0 -1
  390. package/dist/production/debug-context/Constants.js.map +0 -1
  391. package/dist/production/debug-context/Context.cjs.map +0 -1
  392. package/dist/production/debug-context/Context.js.map +0 -1
  393. package/dist/production/hooks/unwrapRefValue.cjs.map +0 -1
  394. package/dist/production/hooks/unwrapRefValue.js.map +0 -1
  395. package/dist/production/hooks/useAbortController.cjs.map +0 -1
  396. package/dist/production/hooks/useAbortController.js.map +0 -1
  397. package/dist/production/hooks/useAddClassNameDuringResize.cjs +0 -32
  398. package/dist/production/hooks/useAddClassNameDuringResize.cjs.map +0 -1
  399. package/dist/production/hooks/useAddClassNameDuringResize.js +0 -32
  400. package/dist/production/hooks/useAddClassNameDuringResize.js.map +0 -1
  401. package/dist/production/hooks/useArrayMapMemo.cjs.map +0 -1
  402. package/dist/production/hooks/useArrayMapMemo.js.map +0 -1
  403. package/dist/production/hooks/useAutoHeightTextArea.cjs.map +0 -1
  404. package/dist/production/hooks/useAutoHeightTextArea.js.map +0 -1
  405. package/dist/production/hooks/useChildrenAsLabel.cjs.map +0 -1
  406. package/dist/production/hooks/useChildrenAsLabel.js.map +0 -1
  407. package/dist/production/hooks/useCloseOnClickOutside.cjs +0 -25
  408. package/dist/production/hooks/useCloseOnClickOutside.cjs.map +0 -1
  409. package/dist/production/hooks/useCloseOnClickOutside.js +0 -25
  410. package/dist/production/hooks/useCloseOnClickOutside.js.map +0 -1
  411. package/dist/production/hooks/useCloseOnEscape.cjs +0 -20
  412. package/dist/production/hooks/useCloseOnEscape.cjs.map +0 -1
  413. package/dist/production/hooks/useCloseOnEscape.js +0 -20
  414. package/dist/production/hooks/useCloseOnEscape.js.map +0 -1
  415. package/dist/production/hooks/useComposeRef.cjs.map +0 -1
  416. package/dist/production/hooks/useComposeRef.js.map +0 -1
  417. package/dist/production/hooks/useConstantLengthInvariant.cjs.map +0 -1
  418. package/dist/production/hooks/useConstantLengthInvariant.js.map +0 -1
  419. package/dist/production/hooks/useConstantValueInvariant.cjs.map +0 -1
  420. package/dist/production/hooks/useConstantValueInvariant.js.map +0 -1
  421. package/dist/production/hooks/useContainerWidth.cjs +0 -14
  422. package/dist/production/hooks/useContainerWidth.cjs.map +0 -1
  423. package/dist/production/hooks/useContainerWidth.js +0 -14
  424. package/dist/production/hooks/useContainerWidth.js.map +0 -1
  425. package/dist/production/hooks/useDebounce.cjs.map +0 -1
  426. package/dist/production/hooks/useDebounce.js.map +0 -1
  427. package/dist/production/hooks/useDebounceCallback.cjs.map +0 -1
  428. package/dist/production/hooks/useDebounceCallback.js.map +0 -1
  429. package/dist/production/hooks/useDocumentTitle.cjs.map +0 -1
  430. package/dist/production/hooks/useDocumentTitle.js.map +0 -1
  431. package/dist/production/hooks/useElementSize.cjs +0 -37
  432. package/dist/production/hooks/useElementSize.cjs.map +0 -1
  433. package/dist/production/hooks/useElementSize.js +0 -37
  434. package/dist/production/hooks/useElementSize.js.map +0 -1
  435. package/dist/production/hooks/useElementTopOffset.cjs +0 -29
  436. package/dist/production/hooks/useElementTopOffset.cjs.map +0 -1
  437. package/dist/production/hooks/useElementTopOffset.js +0 -29
  438. package/dist/production/hooks/useElementTopOffset.js.map +0 -1
  439. package/dist/production/hooks/useEventHandler.cjs +0 -19
  440. package/dist/production/hooks/useEventHandler.cjs.map +0 -1
  441. package/dist/production/hooks/useEventHandler.js +0 -19
  442. package/dist/production/hooks/useEventHandler.js.map +0 -1
  443. package/dist/production/hooks/useExpectSameValueReference.cjs.map +0 -1
  444. package/dist/production/hooks/useExpectSameValueReference.js.map +0 -1
  445. package/dist/production/hooks/useForceRender.cjs.map +0 -1
  446. package/dist/production/hooks/useForceRender.js.map +0 -1
  447. package/dist/production/hooks/useId.cjs.map +0 -1
  448. package/dist/production/hooks/useId.js.map +0 -1
  449. package/dist/production/hooks/useIsMounted.cjs.map +0 -1
  450. package/dist/production/hooks/useIsMounted.js.map +0 -1
  451. package/dist/production/hooks/useObjectMemo.cjs.map +0 -1
  452. package/dist/production/hooks/useObjectMemo.js.map +0 -1
  453. package/dist/production/hooks/useOnElementClickOutsideCallback.cjs.map +0 -1
  454. package/dist/production/hooks/useOnElementClickOutsideCallback.js.map +0 -1
  455. package/dist/production/hooks/useOnElementMouseEnterDelayedCallback.cjs.map +0 -1
  456. package/dist/production/hooks/useOnElementMouseEnterDelayedCallback.js.map +0 -1
  457. package/dist/production/hooks/useOnElementMutation.cjs +0 -35
  458. package/dist/production/hooks/useOnElementMutation.cjs.map +0 -1
  459. package/dist/production/hooks/useOnElementMutation.js +0 -35
  460. package/dist/production/hooks/useOnElementMutation.js.map +0 -1
  461. package/dist/production/hooks/useOnElementResize.cjs.map +0 -1
  462. package/dist/production/hooks/useOnElementResize.js.map +0 -1
  463. package/dist/production/hooks/useOnScrollWithin.cjs +0 -52
  464. package/dist/production/hooks/useOnScrollWithin.cjs.map +0 -1
  465. package/dist/production/hooks/useOnScrollWithin.js +0 -52
  466. package/dist/production/hooks/useOnScrollWithin.js.map +0 -1
  467. package/dist/production/hooks/useOnWindowResize.cjs.map +0 -1
  468. package/dist/production/hooks/useOnWindowResize.js.map +0 -1
  469. package/dist/production/hooks/usePreviousValue.cjs.map +0 -1
  470. package/dist/production/hooks/usePreviousValue.js.map +0 -1
  471. package/dist/production/hooks/useScrollOffsets.cjs +0 -67
  472. package/dist/production/hooks/useScrollOffsets.cjs.map +0 -1
  473. package/dist/production/hooks/useScrollOffsets.js +0 -67
  474. package/dist/production/hooks/useScrollOffsets.js.map +0 -1
  475. package/dist/production/hooks/useStoredState.cjs.map +0 -1
  476. package/dist/production/hooks/useStoredState.js.map +0 -1
  477. package/dist/production/hooks/useUpdatedRef.cjs.map +0 -1
  478. package/dist/production/hooks/useUpdatedRef.js.map +0 -1
  479. package/dist/production/hooks/useWindowSize.cjs.map +0 -1
  480. package/dist/production/hooks/useWindowSize.js.map +0 -1
  481. package/dist/production/referentiallyStable/emptyArray.cjs.map +0 -1
  482. package/dist/production/referentiallyStable/emptyArray.js.map +0 -1
  483. package/dist/production/referentiallyStable/emptyObject.cjs.map +0 -1
  484. package/dist/production/referentiallyStable/emptyObject.js.map +0 -1
  485. package/dist/production/referentiallyStable/identityFunction.cjs.map +0 -1
  486. package/dist/production/referentiallyStable/identityFunction.js.map +0 -1
  487. package/dist/production/referentiallyStable/noop.cjs.map +0 -1
  488. package/dist/production/referentiallyStable/noop.js.map +0 -1
  489. package/dist/production/referentiallyStable/returnFalse.cjs.map +0 -1
  490. package/dist/production/referentiallyStable/returnFalse.js.map +0 -1
  491. package/dist/production/referentiallyStable/returnTrue.cjs.map +0 -1
  492. package/dist/production/referentiallyStable/returnTrue.js.map +0 -1
  493. package/dist/production/referentiallyStable/useReferentiallyStableCallback.cjs.map +0 -1
  494. package/dist/production/referentiallyStable/useReferentiallyStableCallback.js.map +0 -1
  495. package/dist/production/theming/ColorSchemeProvider.cjs +0 -12
  496. package/dist/production/theming/ColorSchemeProvider.cjs.map +0 -1
  497. package/dist/production/theming/ColorSchemeProvider.js +0 -12
  498. package/dist/production/theming/ColorSchemeProvider.js.map +0 -1
  499. package/dist/production/theming/GlobalClassNamePrefixContext.cjs +0 -6
  500. package/dist/production/theming/GlobalClassNamePrefixContext.cjs.map +0 -1
  501. package/dist/production/theming/GlobalClassNamePrefixContext.js +0 -6
  502. package/dist/production/theming/GlobalClassNamePrefixContext.js.map +0 -1
  503. package/dist/production/theming/contexts.cjs +0 -12
  504. package/dist/production/theming/contexts.cjs.map +0 -1
  505. package/dist/production/theming/contexts.js +0 -12
  506. package/dist/production/theming/contexts.js.map +0 -1
  507. package/dist/production/theming/useClassName.cjs +0 -17
  508. package/dist/production/theming/useClassName.cjs.map +0 -1
  509. package/dist/production/theming/useClassName.js +0 -17
  510. package/dist/production/theming/useClassName.js.map +0 -1
  511. package/dist/production/theming/useClassNameFactory.cjs +0 -22
  512. package/dist/production/theming/useClassNameFactory.cjs.map +0 -1
  513. package/dist/production/theming/useClassNameFactory.js +0 -22
  514. package/dist/production/theming/useClassNameFactory.js.map +0 -1
  515. package/dist/production/theming/useThemedClassName.cjs +0 -17
  516. package/dist/production/theming/useThemedClassName.cjs.map +0 -1
  517. package/dist/production/theming/useThemedClassName.js +0 -17
  518. package/dist/production/theming/useThemedClassName.js.map +0 -1
  519. package/dist/production/theming/useThemedClassNameFactory.cjs +0 -29
  520. package/dist/production/theming/useThemedClassNameFactory.cjs.map +0 -1
  521. package/dist/production/theming/useThemedClassNameFactory.js +0 -29
  522. package/dist/production/theming/useThemedClassNameFactory.js.map +0 -1
  523. package/dist/types/hooks/useAddClassNameDuringResize.d.ts +0 -13
  524. package/dist/types/hooks/useAddClassNameDuringResize.d.ts.map +0 -1
  525. package/dist/types/hooks/useCloseOnClickOutside.d.ts +0 -7
  526. package/dist/types/hooks/useCloseOnClickOutside.d.ts.map +0 -1
  527. package/dist/types/hooks/useCloseOnEscape.d.ts +0 -5
  528. package/dist/types/hooks/useCloseOnEscape.d.ts.map +0 -1
  529. package/dist/types/hooks/useContainerWidth.d.ts +0 -4
  530. package/dist/types/hooks/useContainerWidth.d.ts.map +0 -1
  531. package/dist/types/hooks/useElementSize.d.ts +0 -16
  532. package/dist/types/hooks/useElementSize.d.ts.map +0 -1
  533. package/dist/types/hooks/useElementTopOffset.d.ts +0 -3
  534. package/dist/types/hooks/useElementTopOffset.d.ts.map +0 -1
  535. package/dist/types/hooks/useEventHandler.d.ts +0 -10
  536. package/dist/types/hooks/useEventHandler.d.ts.map +0 -1
  537. package/dist/types/hooks/useOnElementMutation.d.ts +0 -3
  538. package/dist/types/hooks/useOnElementMutation.d.ts.map +0 -1
  539. package/dist/types/hooks/useOnScrollWithin.d.ts +0 -10
  540. package/dist/types/hooks/useOnScrollWithin.d.ts.map +0 -1
  541. package/dist/types/hooks/useScrollOffsets.d.ts +0 -14
  542. package/dist/types/hooks/useScrollOffsets.d.ts.map +0 -1
  543. package/dist/types/theming/ColorSchemeProvider.d.ts +0 -6
  544. package/dist/types/theming/ColorSchemeProvider.d.ts.map +0 -1
  545. package/dist/types/theming/GlobalClassNamePrefixContext.d.ts +0 -2
  546. package/dist/types/theming/GlobalClassNamePrefixContext.d.ts.map +0 -1
  547. package/dist/types/theming/contexts.d.ts +0 -12
  548. package/dist/types/theming/contexts.d.ts.map +0 -1
  549. package/dist/types/theming/index.d.ts +0 -8
  550. package/dist/types/theming/index.d.ts.map +0 -1
  551. package/dist/types/theming/useClassName.d.ts +0 -11
  552. package/dist/types/theming/useClassName.d.ts.map +0 -1
  553. package/dist/types/theming/useClassNameFactory.d.ts +0 -17
  554. package/dist/types/theming/useClassNameFactory.d.ts.map +0 -1
  555. package/dist/types/theming/useThemedClassName.d.ts +0 -39
  556. package/dist/types/theming/useThemedClassName.d.ts.map +0 -1
  557. package/dist/types/theming/useThemedClassNameFactory.d.ts +0 -3
  558. package/dist/types/theming/useThemedClassNameFactory.d.ts.map +0 -1
  559. package/src/hooks/useAddClassNameDuringResize.ts +0 -56
  560. package/src/hooks/useCloseOnClickOutside.ts +0 -27
  561. package/src/hooks/useCloseOnEscape.ts +0 -18
  562. package/src/hooks/useContainerWidth.ts +0 -13
  563. package/src/hooks/useElementSize.ts +0 -56
  564. package/src/hooks/useElementTopOffset.ts +0 -35
  565. package/src/hooks/useEventHandler.ts +0 -24
  566. package/src/hooks/useOnElementMutation.ts +0 -42
  567. package/src/hooks/useOnScrollWithin.ts +0 -68
  568. package/src/hooks/useScrollOffsets.ts +0 -87
  569. package/src/theming/ColorSchemeProvider.tsx +0 -16
  570. package/src/theming/GlobalClassNamePrefixContext.ts +0 -3
  571. package/src/theming/contexts.ts +0 -18
  572. package/src/theming/index.ts +0 -7
  573. package/src/theming/useClassName.ts +0 -28
  574. package/src/theming/useClassNameFactory.ts +0 -50
  575. package/src/theming/useThemedClassName.ts +0 -54
  576. package/src/theming/useThemedClassNameFactory.ts +0 -44
  577. /package/dist/development/{context → src/context}/createContext.js +0 -0
  578. /package/dist/development/{context → src/context}/createRequiredContext.js +0 -0
  579. /package/dist/development/{debug-context → src/debug-context}/Constants.cjs +0 -0
  580. /package/dist/development/{debug-context → src/debug-context}/Constants.js +0 -0
  581. /package/dist/development/{hooks → src/hooks}/unwrapRefValue.cjs +0 -0
  582. /package/dist/development/{hooks → src/hooks}/unwrapRefValue.js +0 -0
  583. /package/dist/development/{hooks → src/hooks}/useAbortController.js +0 -0
  584. /package/dist/development/{hooks → src/hooks}/useArrayMapMemo.js +0 -0
  585. /package/dist/development/{hooks → src/hooks}/useAutoHeightTextArea.js +0 -0
  586. /package/dist/development/{hooks → src/hooks}/useComposeRef.js +0 -0
  587. /package/dist/development/{hooks → src/hooks}/useConstantLengthInvariant.cjs +0 -0
  588. /package/dist/development/{hooks → src/hooks}/useConstantLengthInvariant.js +0 -0
  589. /package/dist/development/{hooks → src/hooks}/useConstantValueInvariant.cjs +0 -0
  590. /package/dist/development/{hooks → src/hooks}/useConstantValueInvariant.js +0 -0
  591. /package/dist/development/{hooks → src/hooks}/useDebounce.js +0 -0
  592. /package/dist/development/{hooks → src/hooks}/useDebounceCallback.js +0 -0
  593. /package/dist/development/{hooks → src/hooks}/useDocumentTitle.js +0 -0
  594. /package/dist/development/{hooks → src/hooks}/useForceRender.js +0 -0
  595. /package/dist/development/{hooks → src/hooks}/useId.js +0 -0
  596. /package/dist/development/{hooks → src/hooks}/useIsMounted.js +0 -0
  597. /package/dist/development/{hooks → src/hooks}/useObjectMemo.js +0 -0
  598. /package/dist/development/{hooks → src/hooks}/useOnElementClickOutsideCallback.js +0 -0
  599. /package/dist/development/{hooks → src/hooks}/useOnElementMouseEnterDelayedCallback.js +0 -0
  600. /package/dist/development/{hooks → src/hooks}/usePreviousValue.js +0 -0
  601. /package/dist/development/{hooks → src/hooks}/useStoredState.js +0 -0
  602. /package/dist/development/{hooks → src/hooks}/useUpdatedRef.js +0 -0
  603. /package/dist/development/{hooks → src/hooks}/useWindowSize.js +0 -0
  604. /package/dist/development/{referentiallyStable → src/referentiallyStable}/emptyArray.cjs +0 -0
  605. /package/dist/development/{referentiallyStable → src/referentiallyStable}/emptyArray.js +0 -0
  606. /package/dist/development/{referentiallyStable → src/referentiallyStable}/emptyObject.cjs +0 -0
  607. /package/dist/development/{referentiallyStable → src/referentiallyStable}/emptyObject.js +0 -0
  608. /package/dist/development/{referentiallyStable → src/referentiallyStable}/identityFunction.cjs +0 -0
  609. /package/dist/development/{referentiallyStable → src/referentiallyStable}/identityFunction.js +0 -0
  610. /package/dist/development/{referentiallyStable → src/referentiallyStable}/noop.cjs +0 -0
  611. /package/dist/development/{referentiallyStable → src/referentiallyStable}/noop.js +0 -0
  612. /package/dist/development/{referentiallyStable → src/referentiallyStable}/returnFalse.cjs +0 -0
  613. /package/dist/development/{referentiallyStable → src/referentiallyStable}/returnFalse.js +0 -0
  614. /package/dist/development/{referentiallyStable → src/referentiallyStable}/returnTrue.cjs +0 -0
  615. /package/dist/development/{referentiallyStable → src/referentiallyStable}/returnTrue.js +0 -0
  616. /package/dist/development/{referentiallyStable → src/referentiallyStable}/useReferentiallyStableCallback.js +0 -0
  617. /package/dist/production/{context → src/context}/createContext.js +0 -0
  618. /package/dist/production/{context → src/context}/createRequiredContext.js +0 -0
  619. /package/dist/production/{debug-context → src/debug-context}/Constants.cjs +0 -0
  620. /package/dist/production/{debug-context → src/debug-context}/Constants.js +0 -0
  621. /package/dist/production/{debug-context → src/debug-context}/Context.js +0 -0
  622. /package/dist/production/{hooks → src/hooks}/unwrapRefValue.cjs +0 -0
  623. /package/dist/production/{hooks → src/hooks}/unwrapRefValue.js +0 -0
  624. /package/dist/production/{hooks → src/hooks}/useAbortController.js +0 -0
  625. /package/dist/production/{hooks → src/hooks}/useArrayMapMemo.js +0 -0
  626. /package/dist/production/{hooks → src/hooks}/useAutoHeightTextArea.js +0 -0
  627. /package/dist/production/{hooks → src/hooks}/useComposeRef.js +0 -0
  628. /package/dist/production/{hooks → src/hooks}/useConstantLengthInvariant.cjs +0 -0
  629. /package/dist/production/{hooks → src/hooks}/useConstantLengthInvariant.js +0 -0
  630. /package/dist/production/{hooks → src/hooks}/useConstantValueInvariant.cjs +0 -0
  631. /package/dist/production/{hooks → src/hooks}/useConstantValueInvariant.js +0 -0
  632. /package/dist/production/{hooks → src/hooks}/useDebounce.js +0 -0
  633. /package/dist/production/{hooks → src/hooks}/useDebounceCallback.js +0 -0
  634. /package/dist/production/{hooks → src/hooks}/useDocumentTitle.js +0 -0
  635. /package/dist/production/{hooks → src/hooks}/useForceRender.js +0 -0
  636. /package/dist/production/{hooks → src/hooks}/useId.js +0 -0
  637. /package/dist/production/{hooks → src/hooks}/useIsMounted.js +0 -0
  638. /package/dist/production/{hooks → src/hooks}/useObjectMemo.js +0 -0
  639. /package/dist/production/{hooks → src/hooks}/useOnElementClickOutsideCallback.js +0 -0
  640. /package/dist/production/{hooks → src/hooks}/useOnElementMouseEnterDelayedCallback.js +0 -0
  641. /package/dist/production/{hooks → src/hooks}/usePreviousValue.js +0 -0
  642. /package/dist/production/{hooks → src/hooks}/useStoredState.js +0 -0
  643. /package/dist/production/{hooks → src/hooks}/useUpdatedRef.js +0 -0
  644. /package/dist/production/{hooks → src/hooks}/useWindowSize.js +0 -0
  645. /package/dist/production/{referentiallyStable → src/referentiallyStable}/emptyArray.cjs +0 -0
  646. /package/dist/production/{referentiallyStable → src/referentiallyStable}/emptyArray.js +0 -0
  647. /package/dist/production/{referentiallyStable → src/referentiallyStable}/emptyObject.cjs +0 -0
  648. /package/dist/production/{referentiallyStable → src/referentiallyStable}/emptyObject.js +0 -0
  649. /package/dist/production/{referentiallyStable → src/referentiallyStable}/identityFunction.cjs +0 -0
  650. /package/dist/production/{referentiallyStable → src/referentiallyStable}/identityFunction.js +0 -0
  651. /package/dist/production/{referentiallyStable → src/referentiallyStable}/noop.cjs +0 -0
  652. /package/dist/production/{referentiallyStable → src/referentiallyStable}/noop.js +0 -0
  653. /package/dist/production/{referentiallyStable → src/referentiallyStable}/returnFalse.cjs +0 -0
  654. /package/dist/production/{referentiallyStable → src/referentiallyStable}/returnFalse.js +0 -0
  655. /package/dist/production/{referentiallyStable → src/referentiallyStable}/returnTrue.cjs +0 -0
  656. /package/dist/production/{referentiallyStable → src/referentiallyStable}/returnTrue.js +0 -0
  657. /package/dist/production/{referentiallyStable → src/referentiallyStable}/useReferentiallyStableCallback.js +0 -0
@@ -1,17 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
- const utilities = require("@contember/utilities");
4
- const react = require("react");
5
- const GlobalClassNamePrefixContext = require("./GlobalClassNamePrefixContext.cjs");
6
- function useClassName(componentClassName, additionalClassName = null, prefixOverride) {
7
- const contextPrefix = react.useContext(GlobalClassNamePrefixContext.GlobalClassNamePrefixContext);
8
- const classNamePrefix = prefixOverride === null || prefixOverride === "" ? "" : prefixOverride || contextPrefix;
9
- const componentClassNameList = utilities.flatClassNameList(componentClassName).map(
10
- (componentClassName2) => `${classNamePrefix}${componentClassName2}`
11
- );
12
- return utilities.deduplicateClassName(componentClassNameList.concat(
13
- utilities.flatClassNameList(additionalClassName)
14
- )).join(" ");
15
- }
16
- exports.useClassName = useClassName;
17
- //# sourceMappingURL=useClassName.cjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"useClassName.cjs","sources":["../../../src/theming/useClassName.ts"],"sourcesContent":["import { NestedClassName, deduplicateClassName, flatClassNameList } from '@contember/utilities'\nimport { useContext } from 'react'\nimport { GlobalClassNamePrefixContext } from './GlobalClassNamePrefixContext'\n\n/**\n * Hook for component class name accepting outer class name\n *\n * @param componentClassName - Component class name\n * @param additionalClassName - Additional class name\n * @param prefixOverride - Context component prefix override\n * @returns Prefixed component class name.\n */\nexport function useClassName (\n\tcomponentClassName: NestedClassName,\n\tadditionalClassName: NestedClassName = null,\n\tprefixOverride?: string | null | undefined,\n) {\n\tconst contextPrefix = useContext(GlobalClassNamePrefixContext)\n\tconst classNamePrefix: string = prefixOverride === null || prefixOverride === '' ? '' : prefixOverride || contextPrefix\n\n\tconst componentClassNameList: string[] = flatClassNameList(componentClassName).map(\n\t\tcomponentClassName => `${classNamePrefix}${componentClassName}`,\n\t)\n\n\treturn deduplicateClassName(componentClassNameList.concat(\n\t\tflatClassNameList(additionalClassName),\n\t)).join(' ')\n}\n"],"names":["useContext","GlobalClassNamePrefixContext","flatClassNameList","componentClassName","deduplicateClassName"],"mappings":";;;;;AAYO,SAAS,aACf,oBACA,sBAAuC,MACvC,gBACC;AACK,QAAA,gBAAgBA,iBAAWC,6BAAAA,4BAA4B;AAC7D,QAAM,kBAA0B,mBAAmB,QAAQ,mBAAmB,KAAK,KAAK,kBAAkB;AAEpG,QAAA,yBAAmCC,UAAAA,kBAAkB,kBAAkB,EAAE;AAAA,IAC9E,CAAAC,wBAAsB,GAAG,eAAe,GAAGA,mBAAkB;AAAA,EAAA;AAG9D,SAAOC,UAAAA,qBAAqB,uBAAuB;AAAA,IAClDF,UAAAA,kBAAkB,mBAAmB;AAAA,EAAA,CACrC,EAAE,KAAK,GAAG;AACZ;;"}
@@ -1,17 +0,0 @@
1
- import { flatClassNameList, deduplicateClassName } from "@contember/utilities";
2
- import { useContext } from "react";
3
- import { GlobalClassNamePrefixContext } from "./GlobalClassNamePrefixContext.js";
4
- function useClassName(componentClassName, additionalClassName = null, prefixOverride) {
5
- const contextPrefix = useContext(GlobalClassNamePrefixContext);
6
- const classNamePrefix = prefixOverride === null || prefixOverride === "" ? "" : prefixOverride || contextPrefix;
7
- const componentClassNameList = flatClassNameList(componentClassName).map(
8
- (componentClassName2) => `${classNamePrefix}${componentClassName2}`
9
- );
10
- return deduplicateClassName(componentClassNameList.concat(
11
- flatClassNameList(additionalClassName)
12
- )).join(" ");
13
- }
14
- export {
15
- useClassName
16
- };
17
- //# sourceMappingURL=useClassName.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"useClassName.js","sources":["../../../src/theming/useClassName.ts"],"sourcesContent":["import { NestedClassName, deduplicateClassName, flatClassNameList } from '@contember/utilities'\nimport { useContext } from 'react'\nimport { GlobalClassNamePrefixContext } from './GlobalClassNamePrefixContext'\n\n/**\n * Hook for component class name accepting outer class name\n *\n * @param componentClassName - Component class name\n * @param additionalClassName - Additional class name\n * @param prefixOverride - Context component prefix override\n * @returns Prefixed component class name.\n */\nexport function useClassName (\n\tcomponentClassName: NestedClassName,\n\tadditionalClassName: NestedClassName = null,\n\tprefixOverride?: string | null | undefined,\n) {\n\tconst contextPrefix = useContext(GlobalClassNamePrefixContext)\n\tconst classNamePrefix: string = prefixOverride === null || prefixOverride === '' ? '' : prefixOverride || contextPrefix\n\n\tconst componentClassNameList: string[] = flatClassNameList(componentClassName).map(\n\t\tcomponentClassName => `${classNamePrefix}${componentClassName}`,\n\t)\n\n\treturn deduplicateClassName(componentClassNameList.concat(\n\t\tflatClassNameList(additionalClassName),\n\t)).join(' ')\n}\n"],"names":["componentClassName"],"mappings":";;;AAYO,SAAS,aACf,oBACA,sBAAuC,MACvC,gBACC;AACK,QAAA,gBAAgB,WAAW,4BAA4B;AAC7D,QAAM,kBAA0B,mBAAmB,QAAQ,mBAAmB,KAAK,KAAK,kBAAkB;AAEpG,QAAA,yBAAmC,kBAAkB,kBAAkB,EAAE;AAAA,IAC9E,CAAAA,wBAAsB,GAAG,eAAe,GAAGA,mBAAkB;AAAA,EAAA;AAG9D,SAAO,qBAAqB,uBAAuB;AAAA,IAClD,kBAAkB,mBAAmB;AAAA,EAAA,CACrC,EAAE,KAAK,GAAG;AACZ;"}
@@ -1,22 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
- const utilities = require("@contember/utilities");
4
- const react = require("react");
5
- const GlobalClassNamePrefixContext = require("./GlobalClassNamePrefixContext.cjs");
6
- const useReferentiallyStableCallback = require("../referentiallyStable/useReferentiallyStableCallback.cjs");
7
- function useClassNameFactory(componentClassName, glue = "-", prefixOverride) {
8
- const contextPrefix = react.useContext(GlobalClassNamePrefixContext.GlobalClassNamePrefixContext);
9
- const classNamePrefix = prefixOverride === null || prefixOverride === "" ? "" : prefixOverride || contextPrefix;
10
- const componentClassNameList = utilities.flatClassNameList(componentClassName).map(
11
- (componentClassName2) => `${classNamePrefix}${componentClassName2}`
12
- );
13
- function componentClassNameFor(suffix = null, additionalClassName = null) {
14
- const classNameSuffix = suffix ?? "";
15
- return utilities.deduplicateClassName((classNameSuffix ? classNameSuffix.match(/^[a-zA-Z0-9]/) ? componentClassNameList.map((componentClassName2) => `${componentClassName2}${glue}${classNameSuffix}`) : componentClassNameList.map((componentClassName2) => `${componentClassName2}${classNameSuffix}`) : componentClassNameList).concat(
16
- utilities.flatClassNameList(additionalClassName)
17
- )).join(" ");
18
- }
19
- return useReferentiallyStableCallback.useReferentiallyStableCallback(componentClassNameFor);
20
- }
21
- exports.useClassNameFactory = useClassNameFactory;
22
- //# sourceMappingURL=useClassNameFactory.cjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"useClassNameFactory.cjs","sources":["../../../src/theming/useClassNameFactory.ts"],"sourcesContent":["import { NestedClassName, deduplicateClassName, flatClassNameList } from '@contember/utilities'\nimport { useContext } from 'react'\nimport { useReferentiallyStableCallback } from '../referentiallyStable'\nimport { GlobalClassNamePrefixContext } from './GlobalClassNamePrefixContext'\n\n/**\n * Hook for component class name accepting outer class name\n *\n * Returns a reusable function almost that is handy for components\n * with many sub-component parts that should inherit the root component\n * name.\n *\n * Also, product of the factory is a function that can be used outside of rules of hooks.\n *\n * @param componentClassName - Component class name\n * @param glue - String to use to glue component and sub-component suffix\n * @param prefixOverride - Context component prefix override\n * @returns\n */\nexport function useClassNameFactory(\n\tcomponentClassName: NestedClassName,\n\tglue: string | null = '-',\n\tprefixOverride?: string | null | undefined,\n) {\n\tconst contextPrefix = useContext(GlobalClassNamePrefixContext)\n\tconst classNamePrefix: string = prefixOverride === null || prefixOverride === '' ? '' : prefixOverride || contextPrefix\n\n\tconst componentClassNameList: string[] = flatClassNameList(componentClassName).map(\n\t\tcomponentClassName => `${classNamePrefix}${componentClassName}`,\n\t)\n\n\tfunction componentClassNameFor(\n\t\tsuffix: string | null | undefined = null,\n\t\tadditionalClassName: NestedClassName = null,\n\t): string {\n\t\tconst classNameSuffix: string = suffix ?? ''\n\n\t\treturn deduplicateClassName((classNameSuffix\n\t\t\t? (classNameSuffix.match(/^[a-zA-Z0-9]/)\n\t\t\t\t? componentClassNameList.map(componentClassName => `${componentClassName}${glue}${classNameSuffix}`)\n\t\t\t\t: componentClassNameList.map(componentClassName => `${componentClassName}${classNameSuffix}`)\n\t\t\t)\n\t\t\t: componentClassNameList\n\t\t).concat(\n\t\t\tflatClassNameList(additionalClassName),\n\t\t)).join(' ')\n\t}\n\n\treturn useReferentiallyStableCallback(componentClassNameFor)\n}\n"],"names":["useContext","GlobalClassNamePrefixContext","flatClassNameList","componentClassName","deduplicateClassName","useReferentiallyStableCallback"],"mappings":";;;;;;AAmBO,SAAS,oBACf,oBACA,OAAsB,KACtB,gBACC;AACK,QAAA,gBAAgBA,iBAAWC,6BAAAA,4BAA4B;AAC7D,QAAM,kBAA0B,mBAAmB,QAAQ,mBAAmB,KAAK,KAAK,kBAAkB;AAEpG,QAAA,yBAAmCC,UAAAA,kBAAkB,kBAAkB,EAAE;AAAA,IAC9E,CAAAC,wBAAsB,GAAG,eAAe,GAAGA,mBAAkB;AAAA,EAAA;AAG9D,WAAS,sBACR,SAAoC,MACpC,sBAAuC,MAC9B;AACT,UAAM,kBAA0B,UAAU;AAE1C,WAAOC,UAAsB,sBAAA,kBACzB,gBAAgB,MAAM,cAAc,IACpC,uBAAuB,IAAI,CAAAD,wBAAsB,GAAGA,mBAAkB,GAAG,IAAI,GAAG,eAAe,EAAE,IACjG,uBAAuB,IAAI,CAAAA,wBAAsB,GAAGA,mBAAkB,GAAG,eAAe,EAAE,IAE3F,wBACD;AAAA,MACDD,UAAAA,kBAAkB,mBAAmB;AAAA,IAAA,CACrC,EAAE,KAAK,GAAG;AAAA,EACZ;AAEA,SAAOG,+BAAAA,+BAA+B,qBAAqB;AAC5D;;"}
@@ -1,22 +0,0 @@
1
- import { flatClassNameList, deduplicateClassName } from "@contember/utilities";
2
- import { useContext } from "react";
3
- import { GlobalClassNamePrefixContext } from "./GlobalClassNamePrefixContext.js";
4
- import { useReferentiallyStableCallback } from "../referentiallyStable/useReferentiallyStableCallback.js";
5
- function useClassNameFactory(componentClassName, glue = "-", prefixOverride) {
6
- const contextPrefix = useContext(GlobalClassNamePrefixContext);
7
- const classNamePrefix = prefixOverride === null || prefixOverride === "" ? "" : prefixOverride || contextPrefix;
8
- const componentClassNameList = flatClassNameList(componentClassName).map(
9
- (componentClassName2) => `${classNamePrefix}${componentClassName2}`
10
- );
11
- function componentClassNameFor(suffix = null, additionalClassName = null) {
12
- const classNameSuffix = suffix ?? "";
13
- return deduplicateClassName((classNameSuffix ? classNameSuffix.match(/^[a-zA-Z0-9]/) ? componentClassNameList.map((componentClassName2) => `${componentClassName2}${glue}${classNameSuffix}`) : componentClassNameList.map((componentClassName2) => `${componentClassName2}${classNameSuffix}`) : componentClassNameList).concat(
14
- flatClassNameList(additionalClassName)
15
- )).join(" ");
16
- }
17
- return useReferentiallyStableCallback(componentClassNameFor);
18
- }
19
- export {
20
- useClassNameFactory
21
- };
22
- //# sourceMappingURL=useClassNameFactory.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"useClassNameFactory.js","sources":["../../../src/theming/useClassNameFactory.ts"],"sourcesContent":["import { NestedClassName, deduplicateClassName, flatClassNameList } from '@contember/utilities'\nimport { useContext } from 'react'\nimport { useReferentiallyStableCallback } from '../referentiallyStable'\nimport { GlobalClassNamePrefixContext } from './GlobalClassNamePrefixContext'\n\n/**\n * Hook for component class name accepting outer class name\n *\n * Returns a reusable function almost that is handy for components\n * with many sub-component parts that should inherit the root component\n * name.\n *\n * Also, product of the factory is a function that can be used outside of rules of hooks.\n *\n * @param componentClassName - Component class name\n * @param glue - String to use to glue component and sub-component suffix\n * @param prefixOverride - Context component prefix override\n * @returns\n */\nexport function useClassNameFactory(\n\tcomponentClassName: NestedClassName,\n\tglue: string | null = '-',\n\tprefixOverride?: string | null | undefined,\n) {\n\tconst contextPrefix = useContext(GlobalClassNamePrefixContext)\n\tconst classNamePrefix: string = prefixOverride === null || prefixOverride === '' ? '' : prefixOverride || contextPrefix\n\n\tconst componentClassNameList: string[] = flatClassNameList(componentClassName).map(\n\t\tcomponentClassName => `${classNamePrefix}${componentClassName}`,\n\t)\n\n\tfunction componentClassNameFor(\n\t\tsuffix: string | null | undefined = null,\n\t\tadditionalClassName: NestedClassName = null,\n\t): string {\n\t\tconst classNameSuffix: string = suffix ?? ''\n\n\t\treturn deduplicateClassName((classNameSuffix\n\t\t\t? (classNameSuffix.match(/^[a-zA-Z0-9]/)\n\t\t\t\t? componentClassNameList.map(componentClassName => `${componentClassName}${glue}${classNameSuffix}`)\n\t\t\t\t: componentClassNameList.map(componentClassName => `${componentClassName}${classNameSuffix}`)\n\t\t\t)\n\t\t\t: componentClassNameList\n\t\t).concat(\n\t\t\tflatClassNameList(additionalClassName),\n\t\t)).join(' ')\n\t}\n\n\treturn useReferentiallyStableCallback(componentClassNameFor)\n}\n"],"names":["componentClassName"],"mappings":";;;;AAmBO,SAAS,oBACf,oBACA,OAAsB,KACtB,gBACC;AACK,QAAA,gBAAgB,WAAW,4BAA4B;AAC7D,QAAM,kBAA0B,mBAAmB,QAAQ,mBAAmB,KAAK,KAAK,kBAAkB;AAEpG,QAAA,yBAAmC,kBAAkB,kBAAkB,EAAE;AAAA,IAC9E,CAAAA,wBAAsB,GAAG,eAAe,GAAGA,mBAAkB;AAAA,EAAA;AAG9D,WAAS,sBACR,SAAoC,MACpC,sBAAuC,MAC9B;AACT,UAAM,kBAA0B,UAAU;AAE1C,WAAO,sBAAsB,kBACzB,gBAAgB,MAAM,cAAc,IACpC,uBAAuB,IAAI,CAAAA,wBAAsB,GAAGA,mBAAkB,GAAG,IAAI,GAAG,eAAe,EAAE,IACjG,uBAAuB,IAAI,CAAAA,wBAAsB,GAAGA,mBAAkB,GAAG,eAAe,EAAE,IAE3F,wBACD;AAAA,MACD,kBAAkB,mBAAmB;AAAA,IAAA,CACrC,EAAE,KAAK,GAAG;AAAA,EACZ;AAEA,SAAO,+BAA+B,qBAAqB;AAC5D;"}
@@ -1,17 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
- const utilities = require("@contember/utilities");
4
- const contexts = require("./contexts.cjs");
5
- const useClassName = require("./useClassName.cjs");
6
- function useThemedClassName(componentClassName, additionalClassName, prefixOverride) {
7
- return useClassName.useClassName(
8
- componentClassName,
9
- utilities.filterThemedClassName(
10
- additionalClassName,
11
- utilities.colorSchemeClassName(contexts.useColorScheme())
12
- ),
13
- prefixOverride
14
- );
15
- }
16
- exports.useThemedClassName = useThemedClassName;
17
- //# sourceMappingURL=useThemedClassName.cjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"useThemedClassName.cjs","sources":["../../../src/theming/useThemedClassName.ts"],"sourcesContent":["import { NestedClassName, colorSchemeClassName, filterThemedClassName } from '@contember/utilities'\nimport { useColorScheme } from './contexts'\nimport { useClassName } from './useClassName'\n\n/**\n * Hook for component class name accepting outer class name with theme-* and scheme-* class manes\n *\n * It looks for theme CSS classes in the given class name, deduplicates them and returns final theme class name with scheme CSS class set\n * @internal\n *\n * @param componentClassName - Component class name\n * @param additionalClassName - Additional class name\n * @param prefixOverride - Context component prefix override\n * @returns string\n * @see useColorScheme\n *\n * @example\n * ```tsx\n * function Button({ className }: { className?: string | string[] }) {\n * \t const [contentThemeClassName, controlsThemeClassName] = useThemedClassName(className)\n *\n * \t return (\n * \t\t <div className={contentThemeClassName}>\n * \t\t\t <button className={controlsThemeClassName}>Click me</button>\n * \t\t </div>\n * \t )\n * }\n *\n * function App() {\n * \t return (\n * \t\t <Button className=\"theme-default theme-danger:hover\" />\n * \t )\n * }\n *\n * // renders:\n * // <div class=\"scheme-system theme-default-content theme-danger-content:hover\">\n * // \t<button class=\"scheme-system theme-default-controls theme-danger-controls:hover\">Click me</button>\n * // </div>\n * ```\n */\nexport function useThemedClassName(\n\tcomponentClassName: NestedClassName,\n\tadditionalClassName: NestedClassName,\n\tprefixOverride?: string | null | undefined,\n): string {\n\treturn useClassName(\n\t\tcomponentClassName,\n\t\tfilterThemedClassName(\n\t\t\tadditionalClassName,\n\t\t\tcolorSchemeClassName(useColorScheme()),\n\t\t),\n\t\tprefixOverride,\n\t)\n}\n"],"names":["useClassName","filterThemedClassName","colorSchemeClassName","useColorScheme"],"mappings":";;;;;AAwCgB,SAAA,mBACf,oBACA,qBACA,gBACS;AACF,SAAAA,aAAA;AAAA,IACN;AAAA,IACAC,UAAA;AAAA,MACC;AAAA,MACAC,UAAA,qBAAqBC,yBAAgB;AAAA,IACtC;AAAA,IACA;AAAA,EAAA;AAEF;;"}
@@ -1,17 +0,0 @@
1
- import { filterThemedClassName, colorSchemeClassName } from "@contember/utilities";
2
- import { useColorScheme } from "./contexts.js";
3
- import { useClassName } from "./useClassName.js";
4
- function useThemedClassName(componentClassName, additionalClassName, prefixOverride) {
5
- return useClassName(
6
- componentClassName,
7
- filterThemedClassName(
8
- additionalClassName,
9
- colorSchemeClassName(useColorScheme())
10
- ),
11
- prefixOverride
12
- );
13
- }
14
- export {
15
- useThemedClassName
16
- };
17
- //# sourceMappingURL=useThemedClassName.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"useThemedClassName.js","sources":["../../../src/theming/useThemedClassName.ts"],"sourcesContent":["import { NestedClassName, colorSchemeClassName, filterThemedClassName } from '@contember/utilities'\nimport { useColorScheme } from './contexts'\nimport { useClassName } from './useClassName'\n\n/**\n * Hook for component class name accepting outer class name with theme-* and scheme-* class manes\n *\n * It looks for theme CSS classes in the given class name, deduplicates them and returns final theme class name with scheme CSS class set\n * @internal\n *\n * @param componentClassName - Component class name\n * @param additionalClassName - Additional class name\n * @param prefixOverride - Context component prefix override\n * @returns string\n * @see useColorScheme\n *\n * @example\n * ```tsx\n * function Button({ className }: { className?: string | string[] }) {\n * \t const [contentThemeClassName, controlsThemeClassName] = useThemedClassName(className)\n *\n * \t return (\n * \t\t <div className={contentThemeClassName}>\n * \t\t\t <button className={controlsThemeClassName}>Click me</button>\n * \t\t </div>\n * \t )\n * }\n *\n * function App() {\n * \t return (\n * \t\t <Button className=\"theme-default theme-danger:hover\" />\n * \t )\n * }\n *\n * // renders:\n * // <div class=\"scheme-system theme-default-content theme-danger-content:hover\">\n * // \t<button class=\"scheme-system theme-default-controls theme-danger-controls:hover\">Click me</button>\n * // </div>\n * ```\n */\nexport function useThemedClassName(\n\tcomponentClassName: NestedClassName,\n\tadditionalClassName: NestedClassName,\n\tprefixOverride?: string | null | undefined,\n): string {\n\treturn useClassName(\n\t\tcomponentClassName,\n\t\tfilterThemedClassName(\n\t\t\tadditionalClassName,\n\t\t\tcolorSchemeClassName(useColorScheme()),\n\t\t),\n\t\tprefixOverride,\n\t)\n}\n"],"names":[],"mappings":";;;AAwCgB,SAAA,mBACf,oBACA,qBACA,gBACS;AACF,SAAA;AAAA,IACN;AAAA,IACA;AAAA,MACC;AAAA,MACA,qBAAqB,gBAAgB;AAAA,IACtC;AAAA,IACA;AAAA,EAAA;AAEF;"}
@@ -1,29 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
- const utilities = require("@contember/utilities");
4
- const react = require("react");
5
- const GlobalClassNamePrefixContext = require("./GlobalClassNamePrefixContext.cjs");
6
- const contexts = require("./contexts.cjs");
7
- const useReferentiallyStableCallback = require("../referentiallyStable/useReferentiallyStableCallback.cjs");
8
- function useThemedClassNameFactory(componentClassName, glue = "-", prefixOverride) {
9
- const contextPrefix = react.useContext(GlobalClassNamePrefixContext.GlobalClassNamePrefixContext);
10
- const classNamePrefix = prefixOverride === null || prefixOverride === "" ? "" : prefixOverride || contextPrefix;
11
- const componentClassNameList = utilities.flatClassNameList(componentClassName).map(
12
- (componentClassName2) => `${classNamePrefix}${componentClassName2}`
13
- );
14
- const colorScheme = utilities.colorSchemeClassName(contexts.useColorScheme());
15
- function componentClassNameFor(suffix = null, additionalClassName = null) {
16
- const classNameSuffix = suffix ?? "";
17
- return utilities.deduplicateClassName((classNameSuffix ? classNameSuffix.match(/^[a-zA-Z0-9]/) ? componentClassNameList.map((componentClassName2) => `${componentClassName2}${glue}${classNameSuffix}`) : componentClassNameList.map((componentClassName2) => `${componentClassName2}${classNameSuffix}`) : componentClassNameList).concat(
18
- utilities.flatClassNameList(
19
- utilities.filterThemedClassName(
20
- additionalClassName,
21
- colorScheme
22
- )
23
- )
24
- )).join(" ");
25
- }
26
- return useReferentiallyStableCallback.useReferentiallyStableCallback(componentClassNameFor);
27
- }
28
- exports.useThemedClassNameFactory = useThemedClassNameFactory;
29
- //# sourceMappingURL=useThemedClassNameFactory.cjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"useThemedClassNameFactory.cjs","sources":["../../../src/theming/useThemedClassNameFactory.ts"],"sourcesContent":["import { NestedClassName, colorSchemeClassName, deduplicateClassName, filterThemedClassName, flatClassNameList } from '@contember/utilities'\nimport { useContext } from 'react'\nimport { useReferentiallyStableCallback } from '../referentiallyStable'\nimport { GlobalClassNamePrefixContext } from './GlobalClassNamePrefixContext'\nimport { useColorScheme } from './contexts'\n\nexport function useThemedClassNameFactory(\n\tcomponentClassName: NestedClassName,\n\tglue: string | null = '-',\n\tprefixOverride?: string | null | undefined,\n) {\n\tconst contextPrefix = useContext(GlobalClassNamePrefixContext)\n\tconst classNamePrefix: string = prefixOverride === null || prefixOverride === '' ? '' : prefixOverride || contextPrefix\n\n\tconst componentClassNameList: string[] = flatClassNameList(componentClassName).map(\n\t\tcomponentClassName => `${classNamePrefix}${componentClassName}`,\n\t)\n\n\tconst colorScheme = colorSchemeClassName(useColorScheme())\n\n\tfunction componentClassNameFor(\n\t\tsuffix: string | null | undefined = null,\n\t\tadditionalClassName: NestedClassName = null,\n\t): string {\n\t\tconst classNameSuffix: string = suffix ?? ''\n\n\t\treturn deduplicateClassName((classNameSuffix\n\t\t\t? (classNameSuffix.match(/^[a-zA-Z0-9]/)\n\t\t\t\t? componentClassNameList.map(componentClassName => `${componentClassName}${glue}${classNameSuffix}`)\n\t\t\t\t: componentClassNameList.map(componentClassName => `${componentClassName}${classNameSuffix}`)\n\t\t\t)\n\t\t\t: componentClassNameList\n\t\t).concat(\n\t\t\tflatClassNameList(\n\t\t\t\tfilterThemedClassName(\n\t\t\t\t\tadditionalClassName,\n\t\t\t\t\tcolorScheme,\n\t\t\t\t),\n\t\t\t),\n\t\t)).join(' ')\n\t}\n\n\treturn useReferentiallyStableCallback(componentClassNameFor)\n}\n"],"names":["useContext","GlobalClassNamePrefixContext","flatClassNameList","componentClassName","colorSchemeClassName","useColorScheme","deduplicateClassName","filterThemedClassName","useReferentiallyStableCallback"],"mappings":";;;;;;;AAMO,SAAS,0BACf,oBACA,OAAsB,KACtB,gBACC;AACK,QAAA,gBAAgBA,iBAAWC,6BAAAA,4BAA4B;AAC7D,QAAM,kBAA0B,mBAAmB,QAAQ,mBAAmB,KAAK,KAAK,kBAAkB;AAEpG,QAAA,yBAAmCC,UAAAA,kBAAkB,kBAAkB,EAAE;AAAA,IAC9E,CAAAC,wBAAsB,GAAG,eAAe,GAAGA,mBAAkB;AAAA,EAAA;AAGxD,QAAA,cAAcC,UAAAA,qBAAqBC,SAAA,eAAA,CAAgB;AAEzD,WAAS,sBACR,SAAoC,MACpC,sBAAuC,MAC9B;AACT,UAAM,kBAA0B,UAAU;AAE1C,WAAOC,UAAsB,sBAAA,kBACzB,gBAAgB,MAAM,cAAc,IACpC,uBAAuB,IAAI,CAAAH,wBAAsB,GAAGA,mBAAkB,GAAG,IAAI,GAAG,eAAe,EAAE,IACjG,uBAAuB,IAAI,CAAAA,wBAAsB,GAAGA,mBAAkB,GAAG,eAAe,EAAE,IAE3F,wBACD;AAAA,MACDD,UAAA;AAAA,QACCK,UAAA;AAAA,UACC;AAAA,UACA;AAAA,QACD;AAAA,MACD;AAAA,IAAA,CACA,EAAE,KAAK,GAAG;AAAA,EACZ;AAEA,SAAOC,+BAAAA,+BAA+B,qBAAqB;AAC5D;;"}
@@ -1,29 +0,0 @@
1
- import { flatClassNameList, colorSchemeClassName, deduplicateClassName, filterThemedClassName } from "@contember/utilities";
2
- import { useContext } from "react";
3
- import { GlobalClassNamePrefixContext } from "./GlobalClassNamePrefixContext.js";
4
- import { useColorScheme } from "./contexts.js";
5
- import { useReferentiallyStableCallback } from "../referentiallyStable/useReferentiallyStableCallback.js";
6
- function useThemedClassNameFactory(componentClassName, glue = "-", prefixOverride) {
7
- const contextPrefix = useContext(GlobalClassNamePrefixContext);
8
- const classNamePrefix = prefixOverride === null || prefixOverride === "" ? "" : prefixOverride || contextPrefix;
9
- const componentClassNameList = flatClassNameList(componentClassName).map(
10
- (componentClassName2) => `${classNamePrefix}${componentClassName2}`
11
- );
12
- const colorScheme = colorSchemeClassName(useColorScheme());
13
- function componentClassNameFor(suffix = null, additionalClassName = null) {
14
- const classNameSuffix = suffix ?? "";
15
- return deduplicateClassName((classNameSuffix ? classNameSuffix.match(/^[a-zA-Z0-9]/) ? componentClassNameList.map((componentClassName2) => `${componentClassName2}${glue}${classNameSuffix}`) : componentClassNameList.map((componentClassName2) => `${componentClassName2}${classNameSuffix}`) : componentClassNameList).concat(
16
- flatClassNameList(
17
- filterThemedClassName(
18
- additionalClassName,
19
- colorScheme
20
- )
21
- )
22
- )).join(" ");
23
- }
24
- return useReferentiallyStableCallback(componentClassNameFor);
25
- }
26
- export {
27
- useThemedClassNameFactory
28
- };
29
- //# sourceMappingURL=useThemedClassNameFactory.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"useThemedClassNameFactory.js","sources":["../../../src/theming/useThemedClassNameFactory.ts"],"sourcesContent":["import { NestedClassName, colorSchemeClassName, deduplicateClassName, filterThemedClassName, flatClassNameList } from '@contember/utilities'\nimport { useContext } from 'react'\nimport { useReferentiallyStableCallback } from '../referentiallyStable'\nimport { GlobalClassNamePrefixContext } from './GlobalClassNamePrefixContext'\nimport { useColorScheme } from './contexts'\n\nexport function useThemedClassNameFactory(\n\tcomponentClassName: NestedClassName,\n\tglue: string | null = '-',\n\tprefixOverride?: string | null | undefined,\n) {\n\tconst contextPrefix = useContext(GlobalClassNamePrefixContext)\n\tconst classNamePrefix: string = prefixOverride === null || prefixOverride === '' ? '' : prefixOverride || contextPrefix\n\n\tconst componentClassNameList: string[] = flatClassNameList(componentClassName).map(\n\t\tcomponentClassName => `${classNamePrefix}${componentClassName}`,\n\t)\n\n\tconst colorScheme = colorSchemeClassName(useColorScheme())\n\n\tfunction componentClassNameFor(\n\t\tsuffix: string | null | undefined = null,\n\t\tadditionalClassName: NestedClassName = null,\n\t): string {\n\t\tconst classNameSuffix: string = suffix ?? ''\n\n\t\treturn deduplicateClassName((classNameSuffix\n\t\t\t? (classNameSuffix.match(/^[a-zA-Z0-9]/)\n\t\t\t\t? componentClassNameList.map(componentClassName => `${componentClassName}${glue}${classNameSuffix}`)\n\t\t\t\t: componentClassNameList.map(componentClassName => `${componentClassName}${classNameSuffix}`)\n\t\t\t)\n\t\t\t: componentClassNameList\n\t\t).concat(\n\t\t\tflatClassNameList(\n\t\t\t\tfilterThemedClassName(\n\t\t\t\t\tadditionalClassName,\n\t\t\t\t\tcolorScheme,\n\t\t\t\t),\n\t\t\t),\n\t\t)).join(' ')\n\t}\n\n\treturn useReferentiallyStableCallback(componentClassNameFor)\n}\n"],"names":["componentClassName"],"mappings":";;;;;AAMO,SAAS,0BACf,oBACA,OAAsB,KACtB,gBACC;AACK,QAAA,gBAAgB,WAAW,4BAA4B;AAC7D,QAAM,kBAA0B,mBAAmB,QAAQ,mBAAmB,KAAK,KAAK,kBAAkB;AAEpG,QAAA,yBAAmC,kBAAkB,kBAAkB,EAAE;AAAA,IAC9E,CAAAA,wBAAsB,GAAG,eAAe,GAAGA,mBAAkB;AAAA,EAAA;AAGxD,QAAA,cAAc,qBAAqB,eAAA,CAAgB;AAEzD,WAAS,sBACR,SAAoC,MACpC,sBAAuC,MAC9B;AACT,UAAM,kBAA0B,UAAU;AAE1C,WAAO,sBAAsB,kBACzB,gBAAgB,MAAM,cAAc,IACpC,uBAAuB,IAAI,CAAAA,wBAAsB,GAAGA,mBAAkB,GAAG,IAAI,GAAG,eAAe,EAAE,IACjG,uBAAuB,IAAI,CAAAA,wBAAsB,GAAGA,mBAAkB,GAAG,eAAe,EAAE,IAE3F,wBACD;AAAA,MACD;AAAA,QACC;AAAA,UACC;AAAA,UACA;AAAA,QACD;AAAA,MACD;AAAA,IAAA,CACA,EAAE,KAAK,GAAG;AAAA,EACZ;AAEA,SAAO,+BAA+B,qBAAqB;AAC5D;"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"createContext.cjs","sources":["../../../src/context/createContext.ts"],"sourcesContent":["import type { Context } from 'react'\nimport { createContext as baseCreateContext, useContext } from 'react'\n\nexport function createContext<T>(name: string, initialValue: T): [Context<T>, () => T] {\n const OptionalContext = baseCreateContext<T>(initialValue)\n OptionalContext.displayName = name\n\n return [OptionalContext, () => useContext(OptionalContext)]\n}\n"],"names":["baseCreateContext","useContext"],"mappings":";;;AAGgB,SAAA,cAAiB,MAAc,cAAwC;AAC/E,QAAA,kBAAkBA,oBAAqB,YAAY;AACzD,kBAAgB,cAAc;AAE9B,SAAO,CAAC,iBAAiB,MAAMC,iBAAW,eAAe,CAAC;AAC5D;;"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"createContext.js","sources":["../../../src/context/createContext.ts"],"sourcesContent":["import type { Context } from 'react'\nimport { createContext as baseCreateContext, useContext } from 'react'\n\nexport function createContext<T>(name: string, initialValue: T): [Context<T>, () => T] {\n const OptionalContext = baseCreateContext<T>(initialValue)\n OptionalContext.displayName = name\n\n return [OptionalContext, () => useContext(OptionalContext)]\n}\n"],"names":["baseCreateContext"],"mappings":";AAGgB,SAAA,cAAiB,MAAc,cAAwC;AAC/E,QAAA,kBAAkBA,gBAAqB,YAAY;AACzD,kBAAgB,cAAc;AAE9B,SAAO,CAAC,iBAAiB,MAAM,WAAW,eAAe,CAAC;AAC5D;"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"createRequiredContext.cjs","sources":["../../../src/context/createRequiredContext.ts"],"sourcesContent":["import type { Context } from 'react'\nimport { createContext, useContext } from 'react'\n\nconst EmptyContextSymbol = Symbol('EmptyContextSymbol')\n\nexport function createRequiredContext<T>(displayName: string): [Context<T>, () => T] {\n const RequiredContext = createContext<T>(EmptyContextSymbol as T)\n RequiredContext.displayName = displayName\n\n const useRequiredContext = (): T => {\n const context = useContext(RequiredContext)\n\n if (context === EmptyContextSymbol) {\n throw new Error(`use${displayName} must be used within a ${displayName} provider`)\n }\n\n return context\n }\n\n return [RequiredContext, useRequiredContext]\n}\n"],"names":["createContext","useContext"],"mappings":";;;AAGA,MAAM,qBAAqB,OAAO,oBAAoB;AAE/C,SAAS,sBAAyB,aAA4C;AAC7E,QAAA,kBAAkBA,oBAAiB,kBAAuB;AAChE,kBAAgB,cAAc;AAE9B,QAAM,qBAAqB,MAAS;AAC5B,UAAA,UAAUC,iBAAW,eAAe;AAE1C,QAAI,YAAY,oBAAoB;AAClC,YAAM,IAAI,MAAM,MAAM,WAAW,0BAA0B,WAAW,WAAW;AAAA,IACnF;AAEO,WAAA;AAAA,EAAA;AAGF,SAAA,CAAC,iBAAiB,kBAAkB;AAC7C;;"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"createRequiredContext.js","sources":["../../../src/context/createRequiredContext.ts"],"sourcesContent":["import type { Context } from 'react'\nimport { createContext, useContext } from 'react'\n\nconst EmptyContextSymbol = Symbol('EmptyContextSymbol')\n\nexport function createRequiredContext<T>(displayName: string): [Context<T>, () => T] {\n const RequiredContext = createContext<T>(EmptyContextSymbol as T)\n RequiredContext.displayName = displayName\n\n const useRequiredContext = (): T => {\n const context = useContext(RequiredContext)\n\n if (context === EmptyContextSymbol) {\n throw new Error(`use${displayName} must be used within a ${displayName} provider`)\n }\n\n return context\n }\n\n return [RequiredContext, useRequiredContext]\n}\n"],"names":[],"mappings":";AAGA,MAAM,qBAAqB,OAAO,oBAAoB;AAE/C,SAAS,sBAAyB,aAA4C;AAC7E,QAAA,kBAAkB,cAAiB,kBAAuB;AAChE,kBAAgB,cAAc;AAE9B,QAAM,qBAAqB,MAAS;AAC5B,UAAA,UAAU,WAAW,eAAe;AAE1C,QAAI,YAAY,oBAAoB;AAClC,YAAM,IAAI,MAAM,MAAM,WAAW,0BAA0B,WAAW,WAAW;AAAA,IACnF;AAEO,WAAA;AAAA,EAAA;AAGF,SAAA,CAAC,iBAAiB,kBAAkB;AAC7C;"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"Constants.cjs","sources":["../../../src/debug-context/Constants.ts"],"sourcesContent":["import type { ScopedConsoleContextType } from './Types'\n\nexport function noopLog(...parameters: any[]) { }\n\nexport function noopLogged<T>(message: string, value: T): T {\n\treturn value\n}\n\nexport const noopScopedConsole: ScopedConsoleContextType = Object.freeze({\n\tlog: noopLog,\n\tlogged: noopLogged,\n\twarn: noopLog,\n\twarned: noopLogged,\n\terror: noopLog,\n\terrored: noopLogged,\n\ttrace: noopLog,\n\ttraced: noopLogged,\n})\n\nexport function isNoopScopedConsole(value: unknown): boolean {\n\treturn value === noopScopedConsole\n}\n"],"names":[],"mappings":";;AAEO,SAAS,WAAW,YAAmB;AAAE;AAEhC,SAAA,WAAc,SAAiB,OAAa;AACpD,SAAA;AACR;AAEa,MAAA,oBAA8C,OAAO,OAAO;AAAA,EACxE,KAAK;AAAA,EACL,QAAQ;AAAA,EACR,MAAM;AAAA,EACN,QAAQ;AAAA,EACR,OAAO;AAAA,EACP,SAAS;AAAA,EACT,OAAO;AAAA,EACP,QAAQ;AACT,CAAC;AAEM,SAAS,oBAAoB,OAAyB;AAC5D,SAAO,UAAU;AAClB;;;;;"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"Constants.js","sources":["../../../src/debug-context/Constants.ts"],"sourcesContent":["import type { ScopedConsoleContextType } from './Types'\n\nexport function noopLog(...parameters: any[]) { }\n\nexport function noopLogged<T>(message: string, value: T): T {\n\treturn value\n}\n\nexport const noopScopedConsole: ScopedConsoleContextType = Object.freeze({\n\tlog: noopLog,\n\tlogged: noopLogged,\n\twarn: noopLog,\n\twarned: noopLogged,\n\terror: noopLog,\n\terrored: noopLogged,\n\ttrace: noopLog,\n\ttraced: noopLogged,\n})\n\nexport function isNoopScopedConsole(value: unknown): boolean {\n\treturn value === noopScopedConsole\n}\n"],"names":[],"mappings":"AAEO,SAAS,WAAW,YAAmB;AAAE;AAEhC,SAAA,WAAc,SAAiB,OAAa;AACpD,SAAA;AACR;AAEa,MAAA,oBAA8C,OAAO,OAAO;AAAA,EACxE,KAAK;AAAA,EACL,QAAQ;AAAA,EACR,MAAM;AAAA,EACN,QAAQ;AAAA,EACR,OAAO;AAAA,EACP,SAAS;AAAA,EACT,OAAO;AAAA,EACP,QAAQ;AACT,CAAC;AAEM,SAAS,oBAAoB,OAAyB;AAC5D,SAAO,UAAU;AAClB;"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"Context.cjs","sources":["../../../src/debug-context/Context.tsx"],"sourcesContent":["import { ReactNode, createContext, memo, useContext, useMemo, useRef } from 'react'\nimport { isNoopScopedConsole, noopScopedConsole } from './Constants'\nimport { ScopedConsoleContextType } from './Types'\n\nfunction createPrefixedConsole(message: string, prefixedConsole?: ScopedConsoleContextType): ScopedConsoleContextType {\n\treturn {\n\t\terror: function error(...parameters: any[]) {\n\t\t\t(prefixedConsole ?? console).error(message, ...parameters)\n\t\t},\n\t\terrored: function errored<T>(message: string, value: T): T {\n\t\t\t(prefixedConsole ?? console).error(message, value)\n\t\t\treturn value\n\t\t},\n\t\tlog: function log(...parameters: any[]) {\n\t\t\t(prefixedConsole ?? console).log(message, ...parameters)\n\t\t},\n\t\tlogged: function logged<T>(message: string, value: T): T {\n\t\t\t(prefixedConsole ?? console).log(message, value)\n\t\t\treturn value\n\t\t},\n\t\ttrace: function trace(...parameters: any[]) {\n\t\t\t(prefixedConsole ?? console).trace(message, ...parameters)\n\t\t},\n\t\ttraced: function traced<T>(message: string, value: T): T {\n\t\t\t(prefixedConsole ?? console).trace(message, value)\n\t\t\treturn value\n\t\t},\n\t\twarn: function warn(...parameters: any[]) {\n\t\t\t(prefixedConsole ?? console).warn(message, ...parameters)\n\t\t},\n\t\twarned: function warned<T>(message: string, value: T): T {\n\t\t\t(prefixedConsole ?? console).warn(message, value)\n\t\t\treturn value\n\t\t},\n\t}\n}\n\nexport const ScopedConsoleContext = createContext<ScopedConsoleContextType>(null!)\nScopedConsoleContext.displayName = 'ScopedConsoleContext'\n\nfunction parentScopedConsoleOrNone(parentConsole: ScopedConsoleContextType): ScopedConsoleContextType | undefined {\n\treturn isNoopScopedConsole(parentConsole) ? undefined : parentConsole\n}\n\nexport const useScopedConsoleRef = (prefix: string, override?: boolean) => {\n\tif (prefix.length === 0) {\n\t\tthrow new Error('Prefix must be non-empty string')\n\t}\n\tconst parentConsole = parentScopedConsoleOrNone(useContext(ScopedConsoleContext))\n\n\tconst scopedConsole = useMemo(() => {\n\t\tif (override !== false && (parentConsole || override)) {\n\t\t\treturn createPrefixedConsole(prefix, parentConsole)\n\t\t} else {\n\t\t\treturn noopScopedConsole\n\t\t}\n\t}, [override, parentConsole, prefix])\n\n\tconst ref = useRef(scopedConsole)\n\tref.current = scopedConsole\n\n\treturn ref\n}\n\nexport type DebugChildrenProps =\n\t| { active?: true; children: ReactNode; id: string }\n\t| { active?: false; children: ReactNode; id?: string }\n\nexport const DebugChildren = memo<DebugChildrenProps>(({ active = true, children, id }) => {\n\tconst parentScopedConsole = parentScopedConsoleOrNone(useContext(ScopedConsoleContext))\n\n\tconst console = active && id\n\t\t? createPrefixedConsole(id, parentScopedConsole)\n\t\t: noopScopedConsole\n\n\treturn (\n\t\t<ScopedConsoleContext.Provider value={active ? console : noopScopedConsole}>\n\t\t\t{children}\n\t\t</ScopedConsoleContext.Provider>\n\t)\n})\nDebugChildren.displayName = 'DebugChildren'\n"],"names":["message","createContext","isNoopScopedConsole","useContext","useMemo","noopScopedConsole","useRef","memo","console","jsx"],"mappings":";;;;;AAIA,SAAS,sBAAsB,SAAiB,iBAAsE;AAC9G,SAAA;AAAA,IACN,OAAO,SAAS,SAAS,YAAmB;AAC3C,OAAC,mBAAmB,SAAS,MAAM,SAAS,GAAG,UAAU;AAAA,IAC1D;AAAA,IACA,SAAS,SAAS,QAAWA,UAAiB,OAAa;AAC1D,OAAC,mBAAmB,SAAS,MAAMA,UAAS,KAAK;AAC1C,aAAA;AAAA,IACR;AAAA,IACA,KAAK,SAAS,OAAO,YAAmB;AACvC,OAAC,mBAAmB,SAAS,IAAI,SAAS,GAAG,UAAU;AAAA,IACxD;AAAA,IACA,QAAQ,SAAS,OAAUA,UAAiB,OAAa;AACxD,OAAC,mBAAmB,SAAS,IAAIA,UAAS,KAAK;AACxC,aAAA;AAAA,IACR;AAAA,IACA,OAAO,SAAS,SAAS,YAAmB;AAC3C,OAAC,mBAAmB,SAAS,MAAM,SAAS,GAAG,UAAU;AAAA,IAC1D;AAAA,IACA,QAAQ,SAAS,OAAUA,UAAiB,OAAa;AACxD,OAAC,mBAAmB,SAAS,MAAMA,UAAS,KAAK;AAC1C,aAAA;AAAA,IACR;AAAA,IACA,MAAM,SAAS,QAAQ,YAAmB;AACzC,OAAC,mBAAmB,SAAS,KAAK,SAAS,GAAG,UAAU;AAAA,IACzD;AAAA,IACA,QAAQ,SAAS,OAAUA,UAAiB,OAAa;AACxD,OAAC,mBAAmB,SAAS,KAAKA,UAAS,KAAK;AACzC,aAAA;AAAA,IACR;AAAA,EAAA;AAEF;AAEa,MAAA,uBAAuBC,oBAAwC,IAAK;AACjF,qBAAqB,cAAc;AAEnC,SAAS,0BAA0B,eAA+E;AAC1G,SAAAC,UAAA,oBAAoB,aAAa,IAAI,SAAY;AACzD;AAEa,MAAA,sBAAsB,CAAC,QAAgB,aAAuB;AACtE,MAAA,OAAO,WAAW,GAAG;AAClB,UAAA,IAAI,MAAM,iCAAiC;AAAA,EAClD;AACA,QAAM,gBAAgB,0BAA0BC,iBAAW,oBAAoB,CAAC;AAE1E,QAAA,gBAAgBC,MAAAA,QAAQ,MAAM;AAC/B,QAAA,aAAa,UAAU,iBAAiB,WAAW;AAC/C,aAAA,sBAAsB,QAAQ,aAAa;AAAA,IAAA,OAC5C;AACC,aAAAC;IACR;AAAA,EACE,GAAA,CAAC,UAAU,eAAe,MAAM,CAAC;AAE9B,QAAA,MAAMC,aAAO,aAAa;AAChC,MAAI,UAAU;AAEP,SAAA;AACR;AAMa,MAAA,gBAAgBC,WAAyB,CAAC,EAAE,SAAS,MAAM,UAAU,SAAS;AAC1F,QAAM,sBAAsB,0BAA0BJ,iBAAW,oBAAoB,CAAC;AAEtF,QAAMK,WAAU,UAAU,KACvB,sBAAsB,IAAI,mBAAmB,IAC7CH;AAGF,SAAAI,2BAAA,IAAC,qBAAqB,UAArB,EAA8B,OAAO,SAASD,WAAUH,UAAAA,mBACvD,SACF,CAAA;AAEF,CAAC;AACD,cAAc,cAAc;;;;"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"Context.js","sources":["../../../src/debug-context/Context.tsx"],"sourcesContent":["import { ReactNode, createContext, memo, useContext, useMemo, useRef } from 'react'\nimport { isNoopScopedConsole, noopScopedConsole } from './Constants'\nimport { ScopedConsoleContextType } from './Types'\n\nfunction createPrefixedConsole(message: string, prefixedConsole?: ScopedConsoleContextType): ScopedConsoleContextType {\n\treturn {\n\t\terror: function error(...parameters: any[]) {\n\t\t\t(prefixedConsole ?? console).error(message, ...parameters)\n\t\t},\n\t\terrored: function errored<T>(message: string, value: T): T {\n\t\t\t(prefixedConsole ?? console).error(message, value)\n\t\t\treturn value\n\t\t},\n\t\tlog: function log(...parameters: any[]) {\n\t\t\t(prefixedConsole ?? console).log(message, ...parameters)\n\t\t},\n\t\tlogged: function logged<T>(message: string, value: T): T {\n\t\t\t(prefixedConsole ?? console).log(message, value)\n\t\t\treturn value\n\t\t},\n\t\ttrace: function trace(...parameters: any[]) {\n\t\t\t(prefixedConsole ?? console).trace(message, ...parameters)\n\t\t},\n\t\ttraced: function traced<T>(message: string, value: T): T {\n\t\t\t(prefixedConsole ?? console).trace(message, value)\n\t\t\treturn value\n\t\t},\n\t\twarn: function warn(...parameters: any[]) {\n\t\t\t(prefixedConsole ?? console).warn(message, ...parameters)\n\t\t},\n\t\twarned: function warned<T>(message: string, value: T): T {\n\t\t\t(prefixedConsole ?? console).warn(message, value)\n\t\t\treturn value\n\t\t},\n\t}\n}\n\nexport const ScopedConsoleContext = createContext<ScopedConsoleContextType>(null!)\nScopedConsoleContext.displayName = 'ScopedConsoleContext'\n\nfunction parentScopedConsoleOrNone(parentConsole: ScopedConsoleContextType): ScopedConsoleContextType | undefined {\n\treturn isNoopScopedConsole(parentConsole) ? undefined : parentConsole\n}\n\nexport const useScopedConsoleRef = (prefix: string, override?: boolean) => {\n\tif (prefix.length === 0) {\n\t\tthrow new Error('Prefix must be non-empty string')\n\t}\n\tconst parentConsole = parentScopedConsoleOrNone(useContext(ScopedConsoleContext))\n\n\tconst scopedConsole = useMemo(() => {\n\t\tif (override !== false && (parentConsole || override)) {\n\t\t\treturn createPrefixedConsole(prefix, parentConsole)\n\t\t} else {\n\t\t\treturn noopScopedConsole\n\t\t}\n\t}, [override, parentConsole, prefix])\n\n\tconst ref = useRef(scopedConsole)\n\tref.current = scopedConsole\n\n\treturn ref\n}\n\nexport type DebugChildrenProps =\n\t| { active?: true; children: ReactNode; id: string }\n\t| { active?: false; children: ReactNode; id?: string }\n\nexport const DebugChildren = memo<DebugChildrenProps>(({ active = true, children, id }) => {\n\tconst parentScopedConsole = parentScopedConsoleOrNone(useContext(ScopedConsoleContext))\n\n\tconst console = active && id\n\t\t? createPrefixedConsole(id, parentScopedConsole)\n\t\t: noopScopedConsole\n\n\treturn (\n\t\t<ScopedConsoleContext.Provider value={active ? console : noopScopedConsole}>\n\t\t\t{children}\n\t\t</ScopedConsoleContext.Provider>\n\t)\n})\nDebugChildren.displayName = 'DebugChildren'\n"],"names":["message","console"],"mappings":";;;AAIA,SAAS,sBAAsB,SAAiB,iBAAsE;AAC9G,SAAA;AAAA,IACN,OAAO,SAAS,SAAS,YAAmB;AAC3C,OAAC,mBAAmB,SAAS,MAAM,SAAS,GAAG,UAAU;AAAA,IAC1D;AAAA,IACA,SAAS,SAAS,QAAWA,UAAiB,OAAa;AAC1D,OAAC,mBAAmB,SAAS,MAAMA,UAAS,KAAK;AAC1C,aAAA;AAAA,IACR;AAAA,IACA,KAAK,SAAS,OAAO,YAAmB;AACvC,OAAC,mBAAmB,SAAS,IAAI,SAAS,GAAG,UAAU;AAAA,IACxD;AAAA,IACA,QAAQ,SAAS,OAAUA,UAAiB,OAAa;AACxD,OAAC,mBAAmB,SAAS,IAAIA,UAAS,KAAK;AACxC,aAAA;AAAA,IACR;AAAA,IACA,OAAO,SAAS,SAAS,YAAmB;AAC3C,OAAC,mBAAmB,SAAS,MAAM,SAAS,GAAG,UAAU;AAAA,IAC1D;AAAA,IACA,QAAQ,SAAS,OAAUA,UAAiB,OAAa;AACxD,OAAC,mBAAmB,SAAS,MAAMA,UAAS,KAAK;AAC1C,aAAA;AAAA,IACR;AAAA,IACA,MAAM,SAAS,QAAQ,YAAmB;AACzC,OAAC,mBAAmB,SAAS,KAAK,SAAS,GAAG,UAAU;AAAA,IACzD;AAAA,IACA,QAAQ,SAAS,OAAUA,UAAiB,OAAa;AACxD,OAAC,mBAAmB,SAAS,KAAKA,UAAS,KAAK;AACzC,aAAA;AAAA,IACR;AAAA,EAAA;AAEF;AAEa,MAAA,uBAAuB,cAAwC,IAAK;AACjF,qBAAqB,cAAc;AAEnC,SAAS,0BAA0B,eAA+E;AAC1G,SAAA,oBAAoB,aAAa,IAAI,SAAY;AACzD;AAEa,MAAA,sBAAsB,CAAC,QAAgB,aAAuB;AACtE,MAAA,OAAO,WAAW,GAAG;AAClB,UAAA,IAAI,MAAM,iCAAiC;AAAA,EAClD;AACA,QAAM,gBAAgB,0BAA0B,WAAW,oBAAoB,CAAC;AAE1E,QAAA,gBAAgB,QAAQ,MAAM;AAC/B,QAAA,aAAa,UAAU,iBAAiB,WAAW;AAC/C,aAAA,sBAAsB,QAAQ,aAAa;AAAA,IAAA,OAC5C;AACC,aAAA;AAAA,IACR;AAAA,EACE,GAAA,CAAC,UAAU,eAAe,MAAM,CAAC;AAE9B,QAAA,MAAM,OAAO,aAAa;AAChC,MAAI,UAAU;AAEP,SAAA;AACR;AAMa,MAAA,gBAAgB,KAAyB,CAAC,EAAE,SAAS,MAAM,UAAU,SAAS;AAC1F,QAAM,sBAAsB,0BAA0B,WAAW,oBAAoB,CAAC;AAEtF,QAAMC,WAAU,UAAU,KACvB,sBAAsB,IAAI,mBAAmB,IAC7C;AAGF,SAAA,oBAAC,qBAAqB,UAArB,EAA8B,OAAO,SAASA,WAAU,mBACvD,SACF,CAAA;AAEF,CAAC;AACD,cAAc,cAAc;"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"unwrapRefValue.cjs","sources":["../../../src/hooks/unwrapRefValue.ts"],"sourcesContent":["import { RefObject } from 'react'\n\nexport type RefObjectOrElement<T> = T | RefObject<T>\n\n/**\n * Unwraps a ref object or returns the value if it is not a ref object.\n * @param value - Value to unwrap\n * @returns Unwrapped value\n */\nexport function unwrapRefValue<T>(value: RefObjectOrElement<T>): T | null {\n\tif (value && typeof value === 'object' && 'current' in value) {\n\t\treturn value.current\n\t} else {\n\t\treturn value\n\t}\n}\n"],"names":[],"mappings":";;AASO,SAAS,eAAkB,OAAwC;AACzE,MAAI,SAAS,OAAO,UAAU,YAAY,aAAa,OAAO;AAC7D,WAAO,MAAM;AAAA,EAAA,OACP;AACC,WAAA;AAAA,EACR;AACD;;"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"unwrapRefValue.js","sources":["../../../src/hooks/unwrapRefValue.ts"],"sourcesContent":["import { RefObject } from 'react'\n\nexport type RefObjectOrElement<T> = T | RefObject<T>\n\n/**\n * Unwraps a ref object or returns the value if it is not a ref object.\n * @param value - Value to unwrap\n * @returns Unwrapped value\n */\nexport function unwrapRefValue<T>(value: RefObjectOrElement<T>): T | null {\n\tif (value && typeof value === 'object' && 'current' in value) {\n\t\treturn value.current\n\t} else {\n\t\treturn value\n\t}\n}\n"],"names":[],"mappings":"AASO,SAAS,eAAkB,OAAwC;AACzE,MAAI,SAAS,OAAO,UAAU,YAAY,aAAa,OAAO;AAC7D,WAAO,MAAM;AAAA,EAAA,OACP;AACC,WAAA;AAAA,EACR;AACD;"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"useAbortController.cjs","sources":["../../../src/hooks/useAbortController.ts"],"sourcesContent":["import { useCallback, useEffect, useRef } from 'react'\n\nexport const useAbortController = () => {\n\tconst lastAbortControllerRef = useRef<AbortController | undefined>(undefined)\n\tuseEffect(() => () => {\n\t\tlastAbortControllerRef.current?.abort()\n\t}, [])\n\treturn useCallback((): AbortSignal => {\n\t\tlastAbortControllerRef.current?.abort()\n\n\t\tconst newController = new AbortController()\n\t\tlastAbortControllerRef.current = newController\n\t\treturn newController.signal\n\t}, [])\n}\n"],"names":["useRef","useEffect","useCallback"],"mappings":";;;AAEO,MAAM,qBAAqB,MAAM;AACjC,QAAA,yBAAyBA,MAAAA,OAAoC,MAAS;AAC5EC,QAAAA,UAAU,MAAM,MAAM;AACrB,2BAAuB,SAAS;EACjC,GAAG,CAAE,CAAA;AACL,SAAOC,kBAAY,MAAmB;AACrC,2BAAuB,SAAS;AAE1B,UAAA,gBAAgB,IAAI;AAC1B,2BAAuB,UAAU;AACjC,WAAO,cAAc;AAAA,EACtB,GAAG,CAAE,CAAA;AACN;;"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"useAbortController.js","sources":["../../../src/hooks/useAbortController.ts"],"sourcesContent":["import { useCallback, useEffect, useRef } from 'react'\n\nexport const useAbortController = () => {\n\tconst lastAbortControllerRef = useRef<AbortController | undefined>(undefined)\n\tuseEffect(() => () => {\n\t\tlastAbortControllerRef.current?.abort()\n\t}, [])\n\treturn useCallback((): AbortSignal => {\n\t\tlastAbortControllerRef.current?.abort()\n\n\t\tconst newController = new AbortController()\n\t\tlastAbortControllerRef.current = newController\n\t\treturn newController.signal\n\t}, [])\n}\n"],"names":[],"mappings":";AAEO,MAAM,qBAAqB,MAAM;AACjC,QAAA,yBAAyB,OAAoC,MAAS;AAC5E,YAAU,MAAM,MAAM;AACrB,2BAAuB,SAAS;EACjC,GAAG,CAAE,CAAA;AACL,SAAO,YAAY,MAAmB;AACrC,2BAAuB,SAAS;AAE1B,UAAA,gBAAgB,IAAI;AAC1B,2BAAuB,UAAU;AACjC,WAAO,cAAc;AAAA,EACtB,GAAG,CAAE,CAAA;AACN;"}
@@ -1,32 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
- const react = require("react");
4
- const useOnWindowResize = require("./useOnWindowResize.cjs");
5
- const useReferentiallyStableCallback = require("../referentiallyStable/useReferentiallyStableCallback.cjs");
6
- function addClassName(className, element) {
7
- if (element.classList.contains(className)) {
8
- element.classList.remove(className);
9
- }
10
- }
11
- function removeClassName(className, element) {
12
- if (!element.classList.contains(className)) {
13
- element.classList.add(className);
14
- }
15
- }
16
- function useAddClassNameDuringResize(className, timeoutToRestore = 300, element) {
17
- const timeoutID = react.useRef();
18
- const addTemporaryClassName = useReferentiallyStableCallback.useReferentiallyStableCallback(() => {
19
- clearTimeout(timeoutID.current);
20
- removeClassName(className, element ?? document.body);
21
- timeoutID.current = setTimeout(() => {
22
- addClassName(className, element ?? document.body);
23
- }, timeoutToRestore);
24
- return () => {
25
- clearTimeout(timeoutID.current);
26
- };
27
- });
28
- react.useLayoutEffect(addTemporaryClassName, [addTemporaryClassName]);
29
- useOnWindowResize.useOnWindowResize(addTemporaryClassName);
30
- }
31
- exports.useAddClassNameDuringResize = useAddClassNameDuringResize;
32
- //# sourceMappingURL=useAddClassNameDuringResize.cjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"useAddClassNameDuringResize.cjs","sources":["../../../src/hooks/useAddClassNameDuringResize.ts"],"sourcesContent":["import { useLayoutEffect, useRef } from 'react'\nimport { useReferentiallyStableCallback } from '../referentiallyStable'\nimport { useOnWindowResize } from './useOnWindowResize'\n\nfunction addClassName(\n\tclassName: string,\n\telement: HTMLElement,\n) {\n\tif (element.classList.contains(className)) {\n\t\telement.classList.remove(className)\n\t}\n}\n\nfunction removeClassName(\n\tclassName: string,\n\telement: HTMLElement,\n) {\n\tif (!element.classList.contains(className)) {\n\t\telement.classList.add(className)\n\t}\n}\n\n/**\n * Adds CSS class during resize event to element\n *\n * - Falls back to document.body when no element is specified\n * - Adds CSS class to element also on the initial load\n * - Uses element.classList directly\n *\n * @param className - CSS class to apply during the resize event\n * @param timeoutToRestore - Timeout in milliseconds to wait before finally removing the CSS class\n * @param element - Optional HTML element to apply CSS class to\n */\nexport function useAddClassNameDuringResize(\n\tclassName: string,\n\ttimeoutToRestore: number = 300,\n\telement?: HTMLElement,\n) {\n\tconst timeoutID = useRef<number>()\n\n\tconst addTemporaryClassName = useReferentiallyStableCallback(() => {\n\t\tclearTimeout(timeoutID.current)\n\t\tremoveClassName(className, element ?? document.body)\n\n\t\ttimeoutID.current = setTimeout(() => {\n\t\t\taddClassName(className, element ?? document.body)\n\t\t}, timeoutToRestore)\n\n\t\treturn () => {\n\t\t\tclearTimeout(timeoutID.current)\n\t\t}\n\t})\n\n\tuseLayoutEffect(addTemporaryClassName, [addTemporaryClassName])\n\tuseOnWindowResize(addTemporaryClassName)\n}\n"],"names":["useRef","useReferentiallyStableCallback","useLayoutEffect","useOnWindowResize"],"mappings":";;;;;AAIA,SAAS,aACR,WACA,SACC;AACD,MAAI,QAAQ,UAAU,SAAS,SAAS,GAAG;AAClC,YAAA,UAAU,OAAO,SAAS;AAAA,EACnC;AACD;AAEA,SAAS,gBACR,WACA,SACC;AACD,MAAI,CAAC,QAAQ,UAAU,SAAS,SAAS,GAAG;AACnC,YAAA,UAAU,IAAI,SAAS;AAAA,EAChC;AACD;AAaO,SAAS,4BACf,WACA,mBAA2B,KAC3B,SACC;AACD,QAAM,YAAYA,MAAAA;AAEZ,QAAA,wBAAwBC,+BAAAA,+BAA+B,MAAM;AAClE,iBAAa,UAAU,OAAO;AACd,oBAAA,WAAW,WAAW,SAAS,IAAI;AAEzC,cAAA,UAAU,WAAW,MAAM;AACvB,mBAAA,WAAW,WAAW,SAAS,IAAI;AAAA,OAC9C,gBAAgB;AAEnB,WAAO,MAAM;AACZ,mBAAa,UAAU,OAAO;AAAA,IAAA;AAAA,EAC/B,CACA;AAEeC,QAAAA,gBAAA,uBAAuB,CAAC,qBAAqB,CAAC;AAC9DC,oBAAA,kBAAkB,qBAAqB;AACxC;;"}
@@ -1,32 +0,0 @@
1
- import { useRef, useLayoutEffect } from "react";
2
- import { useOnWindowResize } from "./useOnWindowResize.js";
3
- import { useReferentiallyStableCallback } from "../referentiallyStable/useReferentiallyStableCallback.js";
4
- function addClassName(className, element) {
5
- if (element.classList.contains(className)) {
6
- element.classList.remove(className);
7
- }
8
- }
9
- function removeClassName(className, element) {
10
- if (!element.classList.contains(className)) {
11
- element.classList.add(className);
12
- }
13
- }
14
- function useAddClassNameDuringResize(className, timeoutToRestore = 300, element) {
15
- const timeoutID = useRef();
16
- const addTemporaryClassName = useReferentiallyStableCallback(() => {
17
- clearTimeout(timeoutID.current);
18
- removeClassName(className, element ?? document.body);
19
- timeoutID.current = setTimeout(() => {
20
- addClassName(className, element ?? document.body);
21
- }, timeoutToRestore);
22
- return () => {
23
- clearTimeout(timeoutID.current);
24
- };
25
- });
26
- useLayoutEffect(addTemporaryClassName, [addTemporaryClassName]);
27
- useOnWindowResize(addTemporaryClassName);
28
- }
29
- export {
30
- useAddClassNameDuringResize
31
- };
32
- //# sourceMappingURL=useAddClassNameDuringResize.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"useAddClassNameDuringResize.js","sources":["../../../src/hooks/useAddClassNameDuringResize.ts"],"sourcesContent":["import { useLayoutEffect, useRef } from 'react'\nimport { useReferentiallyStableCallback } from '../referentiallyStable'\nimport { useOnWindowResize } from './useOnWindowResize'\n\nfunction addClassName(\n\tclassName: string,\n\telement: HTMLElement,\n) {\n\tif (element.classList.contains(className)) {\n\t\telement.classList.remove(className)\n\t}\n}\n\nfunction removeClassName(\n\tclassName: string,\n\telement: HTMLElement,\n) {\n\tif (!element.classList.contains(className)) {\n\t\telement.classList.add(className)\n\t}\n}\n\n/**\n * Adds CSS class during resize event to element\n *\n * - Falls back to document.body when no element is specified\n * - Adds CSS class to element also on the initial load\n * - Uses element.classList directly\n *\n * @param className - CSS class to apply during the resize event\n * @param timeoutToRestore - Timeout in milliseconds to wait before finally removing the CSS class\n * @param element - Optional HTML element to apply CSS class to\n */\nexport function useAddClassNameDuringResize(\n\tclassName: string,\n\ttimeoutToRestore: number = 300,\n\telement?: HTMLElement,\n) {\n\tconst timeoutID = useRef<number>()\n\n\tconst addTemporaryClassName = useReferentiallyStableCallback(() => {\n\t\tclearTimeout(timeoutID.current)\n\t\tremoveClassName(className, element ?? document.body)\n\n\t\ttimeoutID.current = setTimeout(() => {\n\t\t\taddClassName(className, element ?? document.body)\n\t\t}, timeoutToRestore)\n\n\t\treturn () => {\n\t\t\tclearTimeout(timeoutID.current)\n\t\t}\n\t})\n\n\tuseLayoutEffect(addTemporaryClassName, [addTemporaryClassName])\n\tuseOnWindowResize(addTemporaryClassName)\n}\n"],"names":[],"mappings":";;;AAIA,SAAS,aACR,WACA,SACC;AACD,MAAI,QAAQ,UAAU,SAAS,SAAS,GAAG;AAClC,YAAA,UAAU,OAAO,SAAS;AAAA,EACnC;AACD;AAEA,SAAS,gBACR,WACA,SACC;AACD,MAAI,CAAC,QAAQ,UAAU,SAAS,SAAS,GAAG;AACnC,YAAA,UAAU,IAAI,SAAS;AAAA,EAChC;AACD;AAaO,SAAS,4BACf,WACA,mBAA2B,KAC3B,SACC;AACD,QAAM,YAAY;AAEZ,QAAA,wBAAwB,+BAA+B,MAAM;AAClE,iBAAa,UAAU,OAAO;AACd,oBAAA,WAAW,WAAW,SAAS,IAAI;AAEzC,cAAA,UAAU,WAAW,MAAM;AACvB,mBAAA,WAAW,WAAW,SAAS,IAAI;AAAA,OAC9C,gBAAgB;AAEnB,WAAO,MAAM;AACZ,mBAAa,UAAU,OAAO;AAAA,IAAA;AAAA,EAC/B,CACA;AAEe,kBAAA,uBAAuB,CAAC,qBAAqB,CAAC;AAC9D,oBAAkB,qBAAqB;AACxC;"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"useArrayMapMemo.cjs","sources":["../../../src/hooks/useArrayMapMemo.ts"],"sourcesContent":["import { useMemo } from 'react'\nimport { useConstantLengthInvariant } from './useConstantLengthInvariant'\n\n/**\n * ⚠️ ONLY USE THIS IF YOU *REALLY* KNOW WHAT YOU'RE DOING! ⚠️\n * ⚠ HERE BE DRAGONS THAT KNOW WHERE YOU LIVE! ⚠\n *\n * This is a bit of React naughtiness that allows us to memoize outputs of Array.prototype.map() based on the contents\n * of the original array, and not its referential equality. That way, if we create a new array with identical items,\n * we get an array that is referentially equal to the previous one.\n */\nexport const useArrayMapMemo = <Item, OutputItem>(\n\titems: Item[],\n\tmap: (value: Item, index: number, array: Item[]) => OutputItem,\n): OutputItem[] => {\n\tuseConstantLengthInvariant(items)\n\n\t// This is tricky. We don't want to exclude the map function from the dependency list because if it changes but the\n\t// items array remains the same, we still want to re-compute the new array. However, if that yields the same array,\n\t// in the sense that the items are identical, albeit computed via a different map function, we still want to\n\t// preserve the referential equality of the original. Hence the second memo.\n\n\t// eslint-disable-next-line react-hooks/exhaustive-deps\n\tconst mapped = useMemo(() => items.map(map), [map, ...items])\n\n\t// eslint-disable-next-line react-hooks/exhaustive-deps\n\treturn useMemo(() => mapped, mapped) // This is deliberately not `[mapped]`\n}\n"],"names":["useMemo"],"mappings":";;;AAWa,MAAA,kBAAkB,CAC9B,OACA,QACkB;AASZ,QAAA,SAASA,MAAAA,QAAQ,MAAM,MAAM,IAAI,GAAG,GAAG,CAAC,KAAK,GAAG,KAAK,CAAC;AAGrD,SAAAA,cAAQ,MAAM,QAAQ,MAAM;AACpC;;"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"useArrayMapMemo.js","sources":["../../../src/hooks/useArrayMapMemo.ts"],"sourcesContent":["import { useMemo } from 'react'\nimport { useConstantLengthInvariant } from './useConstantLengthInvariant'\n\n/**\n * ⚠️ ONLY USE THIS IF YOU *REALLY* KNOW WHAT YOU'RE DOING! ⚠️\n * ⚠ HERE BE DRAGONS THAT KNOW WHERE YOU LIVE! ⚠\n *\n * This is a bit of React naughtiness that allows us to memoize outputs of Array.prototype.map() based on the contents\n * of the original array, and not its referential equality. That way, if we create a new array with identical items,\n * we get an array that is referentially equal to the previous one.\n */\nexport const useArrayMapMemo = <Item, OutputItem>(\n\titems: Item[],\n\tmap: (value: Item, index: number, array: Item[]) => OutputItem,\n): OutputItem[] => {\n\tuseConstantLengthInvariant(items)\n\n\t// This is tricky. We don't want to exclude the map function from the dependency list because if it changes but the\n\t// items array remains the same, we still want to re-compute the new array. However, if that yields the same array,\n\t// in the sense that the items are identical, albeit computed via a different map function, we still want to\n\t// preserve the referential equality of the original. Hence the second memo.\n\n\t// eslint-disable-next-line react-hooks/exhaustive-deps\n\tconst mapped = useMemo(() => items.map(map), [map, ...items])\n\n\t// eslint-disable-next-line react-hooks/exhaustive-deps\n\treturn useMemo(() => mapped, mapped) // This is deliberately not `[mapped]`\n}\n"],"names":[],"mappings":";AAWa,MAAA,kBAAkB,CAC9B,OACA,QACkB;AASZ,QAAA,SAAS,QAAQ,MAAM,MAAM,IAAI,GAAG,GAAG,CAAC,KAAK,GAAG,KAAK,CAAC;AAGrD,SAAA,QAAQ,MAAM,QAAQ,MAAM;AACpC;"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"useAutoHeightTextArea.cjs","sources":["../../../src/hooks/useAutoHeightTextArea.ts"],"sourcesContent":["import { px } from '@contember/utilities'\nimport { useCallback, useLayoutEffect } from 'react'\nimport { RefObjectOrElement, unwrapRefValue } from './unwrapRefValue'\nimport { useOnElementResize } from './useOnElementResize'\n\nexport const useAutoHeightTextArea = (\n\ttextAreaRef: RefObjectOrElement<HTMLTextAreaElement>,\n\tvalue: string,\n\tminRows: number,\n\tmaxRows: number,\n) => {\n\tconst measure = useCallback(async (ref: HTMLTextAreaElement | null, minRows: number, maxRows: number) => {\n\t\tif (ref) {\n\t\t\tconst rowsAttribute = ref.rows\n\n\t\t\tref.style.height = ''\n\t\t\tref.style.minHeight = ''\n\t\t\tref.style.maxHeight = ''\n\n\t\t\tif (minRows !== maxRows) {\n\t\t\t\tconst height = ref.scrollHeight - ref.clientHeight + ref.offsetHeight\n\t\t\t\tlet minHeight: number\n\t\t\t\tlet maxHeight: number\n\n\t\t\t\tref.rows = minRows\n\t\t\t\tminHeight = await ref.getBoundingClientRect().height\n\n\t\t\t\tif (maxRows === Infinity) {\n\t\t\t\t\tmaxHeight = Infinity\n\t\t\t\t} else {\n\t\t\t\t\tref.rows = maxRows\n\t\t\t\t\tmaxHeight = await ref.getBoundingClientRect().height\n\t\t\t\t}\n\n\t\t\t\tref.style.height = px(height)\n\t\t\t\tref.style.minHeight = px(minHeight)\n\t\t\t\tref.style.maxHeight = px(maxHeight)\n\t\t\t}\n\n\t\t\tref.rows = rowsAttribute\n\t\t}\n\t}, [])\n\n\tuseOnElementResize(textAreaRef, () => {\n\t\tmeasure(unwrapRefValue(textAreaRef), minRows, maxRows)\n\t})\n\n\tuseLayoutEffect(() => {\n\t\tmeasure(unwrapRefValue(textAreaRef), minRows, maxRows)\n\t}, [maxRows, measure, minRows, textAreaRef, value])\n}\n"],"names":["useCallback","minRows","maxRows","px","useOnElementResize","unwrapRefValue","useLayoutEffect"],"mappings":";;;;;;AAKO,MAAM,wBAAwB,CACpC,aACA,OACA,SACA,YACI;AACJ,QAAM,UAAUA,MAAA,YAAY,OAAO,KAAiCC,UAAiBC,aAAoB;AACxG,QAAI,KAAK;AACR,YAAM,gBAAgB,IAAI;AAE1B,UAAI,MAAM,SAAS;AACnB,UAAI,MAAM,YAAY;AACtB,UAAI,MAAM,YAAY;AAEtB,UAAID,aAAYC,UAAS;AACxB,cAAM,SAAS,IAAI,eAAe,IAAI,eAAe,IAAI;AACrD,YAAA;AACA,YAAA;AAEJ,YAAI,OAAOD;AACC,oBAAA,MAAM,IAAI,sBAAA,EAAwB;AAE9C,YAAIC,aAAY,UAAU;AACb,sBAAA;AAAA,QAAA,OACN;AACN,cAAI,OAAOA;AACC,sBAAA,MAAM,IAAI,sBAAA,EAAwB;AAAA,QAC/C;AAEI,YAAA,MAAM,SAASC,UAAA,GAAG,MAAM;AACxB,YAAA,MAAM,YAAYA,UAAA,GAAG,SAAS;AAC9B,YAAA,MAAM,YAAYA,UAAA,GAAG,SAAS;AAAA,MACnC;AAEA,UAAI,OAAO;AAAA,IACZ;AAAA,EACD,GAAG,CAAE,CAAA;AAELC,qBAAA,mBAAmB,aAAa,MAAM;AACrC,YAAQC,eAAAA,eAAe,WAAW,GAAG,SAAS,OAAO;AAAA,EAAA,CACrD;AAEDC,QAAAA,gBAAgB,MAAM;AACrB,YAAQD,eAAAA,eAAe,WAAW,GAAG,SAAS,OAAO;AAAA,EAAA,GACnD,CAAC,SAAS,SAAS,SAAS,aAAa,KAAK,CAAC;AACnD;;"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"useAutoHeightTextArea.js","sources":["../../../src/hooks/useAutoHeightTextArea.ts"],"sourcesContent":["import { px } from '@contember/utilities'\nimport { useCallback, useLayoutEffect } from 'react'\nimport { RefObjectOrElement, unwrapRefValue } from './unwrapRefValue'\nimport { useOnElementResize } from './useOnElementResize'\n\nexport const useAutoHeightTextArea = (\n\ttextAreaRef: RefObjectOrElement<HTMLTextAreaElement>,\n\tvalue: string,\n\tminRows: number,\n\tmaxRows: number,\n) => {\n\tconst measure = useCallback(async (ref: HTMLTextAreaElement | null, minRows: number, maxRows: number) => {\n\t\tif (ref) {\n\t\t\tconst rowsAttribute = ref.rows\n\n\t\t\tref.style.height = ''\n\t\t\tref.style.minHeight = ''\n\t\t\tref.style.maxHeight = ''\n\n\t\t\tif (minRows !== maxRows) {\n\t\t\t\tconst height = ref.scrollHeight - ref.clientHeight + ref.offsetHeight\n\t\t\t\tlet minHeight: number\n\t\t\t\tlet maxHeight: number\n\n\t\t\t\tref.rows = minRows\n\t\t\t\tminHeight = await ref.getBoundingClientRect().height\n\n\t\t\t\tif (maxRows === Infinity) {\n\t\t\t\t\tmaxHeight = Infinity\n\t\t\t\t} else {\n\t\t\t\t\tref.rows = maxRows\n\t\t\t\t\tmaxHeight = await ref.getBoundingClientRect().height\n\t\t\t\t}\n\n\t\t\t\tref.style.height = px(height)\n\t\t\t\tref.style.minHeight = px(minHeight)\n\t\t\t\tref.style.maxHeight = px(maxHeight)\n\t\t\t}\n\n\t\t\tref.rows = rowsAttribute\n\t\t}\n\t}, [])\n\n\tuseOnElementResize(textAreaRef, () => {\n\t\tmeasure(unwrapRefValue(textAreaRef), minRows, maxRows)\n\t})\n\n\tuseLayoutEffect(() => {\n\t\tmeasure(unwrapRefValue(textAreaRef), minRows, maxRows)\n\t}, [maxRows, measure, minRows, textAreaRef, value])\n}\n"],"names":["minRows","maxRows"],"mappings":";;;;AAKO,MAAM,wBAAwB,CACpC,aACA,OACA,SACA,YACI;AACJ,QAAM,UAAU,YAAY,OAAO,KAAiCA,UAAiBC,aAAoB;AACxG,QAAI,KAAK;AACR,YAAM,gBAAgB,IAAI;AAE1B,UAAI,MAAM,SAAS;AACnB,UAAI,MAAM,YAAY;AACtB,UAAI,MAAM,YAAY;AAEtB,UAAID,aAAYC,UAAS;AACxB,cAAM,SAAS,IAAI,eAAe,IAAI,eAAe,IAAI;AACrD,YAAA;AACA,YAAA;AAEJ,YAAI,OAAOD;AACC,oBAAA,MAAM,IAAI,sBAAA,EAAwB;AAE9C,YAAIC,aAAY,UAAU;AACb,sBAAA;AAAA,QAAA,OACN;AACN,cAAI,OAAOA;AACC,sBAAA,MAAM,IAAI,sBAAA,EAAwB;AAAA,QAC/C;AAEI,YAAA,MAAM,SAAS,GAAG,MAAM;AACxB,YAAA,MAAM,YAAY,GAAG,SAAS;AAC9B,YAAA,MAAM,YAAY,GAAG,SAAS;AAAA,MACnC;AAEA,UAAI,OAAO;AAAA,IACZ;AAAA,EACD,GAAG,CAAE,CAAA;AAEL,qBAAmB,aAAa,MAAM;AACrC,YAAQ,eAAe,WAAW,GAAG,SAAS,OAAO;AAAA,EAAA,CACrD;AAED,kBAAgB,MAAM;AACrB,YAAQ,eAAe,WAAW,GAAG,SAAS,OAAO;AAAA,EAAA,GACnD,CAAC,SAAS,SAAS,SAAS,aAAa,KAAK,CAAC;AACnD;"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"useChildrenAsLabel.cjs","sources":["../../../src/hooks/useChildrenAsLabel.ts"],"sourcesContent":["import { Children, ReactNode, useMemo } from 'react'\n\nconst MULTIPLE_SPACES_REG_EXP = / +/g\n\nfunction normalize(text: string): string {\n\treturn text.replace(MULTIPLE_SPACES_REG_EXP, ' ').trim()\n}\n\n/**\n * Walks through the children and returns a string representation of the text content.\n *\n * @param node - The children to walk through.\n * @returns String representation of the text content or undefined if there is no text content.\n *\n */\nexport function getChildrenAsLabel(node: ReactNode): string | undefined {\n\tif (typeof node === 'string' || typeof node === 'number') {\n\t\treturn String(node)\n\t} else if (node === null || node === undefined || typeof node === 'boolean') {\n\t\treturn undefined\n\t} else if (Array.isArray(node)) {\n\t\treturn normalize(node.map(getChildrenAsLabel).join(''))\n\t} else {\n\t\tlet label: (string | number)[] = []\n\n\t\tChildren.map(node, child => {\n\t\t\tif (child === null || child === undefined || typeof child === 'boolean') {\n\t\t\t} else if (typeof child === 'string') {\n\t\t\t\tlabel.push(child)\n\t\t\t} else if (typeof child === 'number') {\n\t\t\t\tlabel.push(child)\n\t\t\t} else if (Array.isArray(child)) {\n\t\t\t\tconst childLabel = getChildrenAsLabel(child)\n\n\t\t\t\tif (childLabel) {\n\t\t\t\t\tlabel.push(childLabel)\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t// ReactElement | JSXElementConstructor | ReactPortal\n\t\t\t\tif ('props' in child && 'children' in child.props) {\n\t\t\t\t\tconst childLabel = getChildrenAsLabel(child.props.children)\n\n\t\t\t\t\tif (childLabel) {\n\t\t\t\t\t\tlabel.push(childLabel)\n\t\t\t\t\t}\n\t\t\t\t} else if ('children' in child) {\n\t\t\t\t\t// ReactPortal\n\t\t\t\t\tconst childLabel = getChildrenAsLabel(child.children)\n\n\t\t\t\t\tif (childLabel) {\n\t\t\t\t\t\tlabel.push(childLabel)\n\t\t\t\t\t}\n\t\t\t\t} else if (import.meta.env.DEV) {\n\t\t\t\t\tconsole.warn('Unsupported child:', child)\n\t\t\t\t}\n\t\t\t}\n\t\t})\n\n\t\treturn label.length > 0 ? label.join('') : undefined\n\t}\n}\n\n/**\n * Walks through the children and returns a string representation of the text content.\n *\n * @param node - The children to walk through.\n * @returns String representation of the text content or undefined if there is no text content.\n *\n */\nexport function useChildrenAsLabel(node: ReactNode): string | undefined {\n\treturn useMemo(() => getChildrenAsLabel(node), [node])\n}\n"],"names":["Children","useMemo"],"mappings":";;;AAEA,MAAM,0BAA0B;AAEhC,SAAS,UAAU,MAAsB;AACxC,SAAO,KAAK,QAAQ,yBAAyB,GAAG,EAAE,KAAK;AACxD;AASO,SAAS,mBAAmB,MAAqC;AACvE,MAAI,OAAO,SAAS,YAAY,OAAO,SAAS,UAAU;AACzD,WAAO,OAAO,IAAI;AAAA,EAAA,WACR,SAAS,QAAQ,SAAS,UAAa,OAAO,SAAS,WAAW;AACrE,WAAA;AAAA,EACG,WAAA,MAAM,QAAQ,IAAI,GAAG;AAC/B,WAAO,UAAU,KAAK,IAAI,kBAAkB,EAAE,KAAK,EAAE,CAAC;AAAA,EAAA,OAChD;AACN,QAAI,QAA6B,CAAA;AAExBA,UAAAA,SAAA,IAAI,MAAM,CAAS,UAAA;AAC3B,UAAI,UAAU,QAAQ,UAAU,UAAa,OAAO,UAAU;AAAW;AAAA,eAC9D,OAAO,UAAU,UAAU;AACrC,cAAM,KAAK,KAAK;AAAA,MAAA,WACN,OAAO,UAAU,UAAU;AACrC,cAAM,KAAK,KAAK;AAAA,MACN,WAAA,MAAM,QAAQ,KAAK,GAAG;AAC1B,cAAA,aAAa,mBAAmB,KAAK;AAE3C,YAAI,YAAY;AACf,gBAAM,KAAK,UAAU;AAAA,QACtB;AAAA,MAAA,OACM;AAEN,YAAI,WAAW,SAAS,cAAc,MAAM,OAAO;AAClD,gBAAM,aAAa,mBAAmB,MAAM,MAAM,QAAQ;AAE1D,cAAI,YAAY;AACf,kBAAM,KAAK,UAAU;AAAA,UACtB;AAAA,QAAA,WACU,cAAc,OAAO;AAEzB,gBAAA,aAAa,mBAAmB,MAAM,QAAQ;AAEpD,cAAI,YAAY;AACf,kBAAM,KAAK,UAAU;AAAA,UACtB;AAAA,QAAA;;MAIF;AAAA,IAAA,CACA;AAED,WAAO,MAAM,SAAS,IAAI,MAAM,KAAK,EAAE,IAAI;AAAA,EAC5C;AACD;AASO,SAAS,mBAAmB,MAAqC;AACvE,SAAOC,MAAAA,QAAQ,MAAM,mBAAmB,IAAI,GAAG,CAAC,IAAI,CAAC;AACtD;;;"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"useChildrenAsLabel.js","sources":["../../../src/hooks/useChildrenAsLabel.ts"],"sourcesContent":["import { Children, ReactNode, useMemo } from 'react'\n\nconst MULTIPLE_SPACES_REG_EXP = / +/g\n\nfunction normalize(text: string): string {\n\treturn text.replace(MULTIPLE_SPACES_REG_EXP, ' ').trim()\n}\n\n/**\n * Walks through the children and returns a string representation of the text content.\n *\n * @param node - The children to walk through.\n * @returns String representation of the text content or undefined if there is no text content.\n *\n */\nexport function getChildrenAsLabel(node: ReactNode): string | undefined {\n\tif (typeof node === 'string' || typeof node === 'number') {\n\t\treturn String(node)\n\t} else if (node === null || node === undefined || typeof node === 'boolean') {\n\t\treturn undefined\n\t} else if (Array.isArray(node)) {\n\t\treturn normalize(node.map(getChildrenAsLabel).join(''))\n\t} else {\n\t\tlet label: (string | number)[] = []\n\n\t\tChildren.map(node, child => {\n\t\t\tif (child === null || child === undefined || typeof child === 'boolean') {\n\t\t\t} else if (typeof child === 'string') {\n\t\t\t\tlabel.push(child)\n\t\t\t} else if (typeof child === 'number') {\n\t\t\t\tlabel.push(child)\n\t\t\t} else if (Array.isArray(child)) {\n\t\t\t\tconst childLabel = getChildrenAsLabel(child)\n\n\t\t\t\tif (childLabel) {\n\t\t\t\t\tlabel.push(childLabel)\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t// ReactElement | JSXElementConstructor | ReactPortal\n\t\t\t\tif ('props' in child && 'children' in child.props) {\n\t\t\t\t\tconst childLabel = getChildrenAsLabel(child.props.children)\n\n\t\t\t\t\tif (childLabel) {\n\t\t\t\t\t\tlabel.push(childLabel)\n\t\t\t\t\t}\n\t\t\t\t} else if ('children' in child) {\n\t\t\t\t\t// ReactPortal\n\t\t\t\t\tconst childLabel = getChildrenAsLabel(child.children)\n\n\t\t\t\t\tif (childLabel) {\n\t\t\t\t\t\tlabel.push(childLabel)\n\t\t\t\t\t}\n\t\t\t\t} else if (import.meta.env.DEV) {\n\t\t\t\t\tconsole.warn('Unsupported child:', child)\n\t\t\t\t}\n\t\t\t}\n\t\t})\n\n\t\treturn label.length > 0 ? label.join('') : undefined\n\t}\n}\n\n/**\n * Walks through the children and returns a string representation of the text content.\n *\n * @param node - The children to walk through.\n * @returns String representation of the text content or undefined if there is no text content.\n *\n */\nexport function useChildrenAsLabel(node: ReactNode): string | undefined {\n\treturn useMemo(() => getChildrenAsLabel(node), [node])\n}\n"],"names":[],"mappings":";AAEA,MAAM,0BAA0B;AAEhC,SAAS,UAAU,MAAsB;AACxC,SAAO,KAAK,QAAQ,yBAAyB,GAAG,EAAE,KAAK;AACxD;AASO,SAAS,mBAAmB,MAAqC;AACvE,MAAI,OAAO,SAAS,YAAY,OAAO,SAAS,UAAU;AACzD,WAAO,OAAO,IAAI;AAAA,EAAA,WACR,SAAS,QAAQ,SAAS,UAAa,OAAO,SAAS,WAAW;AACrE,WAAA;AAAA,EACG,WAAA,MAAM,QAAQ,IAAI,GAAG;AAC/B,WAAO,UAAU,KAAK,IAAI,kBAAkB,EAAE,KAAK,EAAE,CAAC;AAAA,EAAA,OAChD;AACN,QAAI,QAA6B,CAAA;AAExB,aAAA,IAAI,MAAM,CAAS,UAAA;AAC3B,UAAI,UAAU,QAAQ,UAAU,UAAa,OAAO,UAAU;AAAW;AAAA,eAC9D,OAAO,UAAU,UAAU;AACrC,cAAM,KAAK,KAAK;AAAA,MAAA,WACN,OAAO,UAAU,UAAU;AACrC,cAAM,KAAK,KAAK;AAAA,MACN,WAAA,MAAM,QAAQ,KAAK,GAAG;AAC1B,cAAA,aAAa,mBAAmB,KAAK;AAE3C,YAAI,YAAY;AACf,gBAAM,KAAK,UAAU;AAAA,QACtB;AAAA,MAAA,OACM;AAEN,YAAI,WAAW,SAAS,cAAc,MAAM,OAAO;AAClD,gBAAM,aAAa,mBAAmB,MAAM,MAAM,QAAQ;AAE1D,cAAI,YAAY;AACf,kBAAM,KAAK,UAAU;AAAA,UACtB;AAAA,QAAA,WACU,cAAc,OAAO;AAEzB,gBAAA,aAAa,mBAAmB,MAAM,QAAQ;AAEpD,cAAI,YAAY;AACf,kBAAM,KAAK,UAAU;AAAA,UACtB;AAAA,QAAA;;MAIF;AAAA,IAAA,CACA;AAED,WAAO,MAAM,SAAS,IAAI,MAAM,KAAK,EAAE,IAAI;AAAA,EAC5C;AACD;AASO,SAAS,mBAAmB,MAAqC;AACvE,SAAO,QAAQ,MAAM,mBAAmB,IAAI,GAAG,CAAC,IAAI,CAAC;AACtD;"}
@@ -1,25 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
- const react = require("react");
4
- const useCloseOnClickOutside = ({ isOpen, close, contents, outside }) => {
5
- react.useEffect(() => {
6
- if (isOpen) {
7
- const closeOnClickOutside = (event) => {
8
- const target = event.target;
9
- if (target instanceof Node && (!document.body.contains(target) || target === document.body || contents.some((it) => it && it.contains(target)))) {
10
- return;
11
- }
12
- if (contents.every((it) => it === null)) {
13
- return;
14
- }
15
- close();
16
- };
17
- (outside ?? window).addEventListener("click", closeOnClickOutside);
18
- return () => {
19
- (outside ?? window).removeEventListener("click", closeOnClickOutside);
20
- };
21
- }
22
- }, [close, isOpen, contents, outside]);
23
- };
24
- exports.useCloseOnClickOutside = useCloseOnClickOutside;
25
- //# sourceMappingURL=useCloseOnClickOutside.cjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"useCloseOnClickOutside.cjs","sources":["../../../src/hooks/useCloseOnClickOutside.ts"],"sourcesContent":["import { useEffect } from 'react'\n\nexport const useCloseOnClickOutside = ({ isOpen, close, contents, outside }: { isOpen: boolean, close: () => void, contents: (Node | null)[], outside?: HTMLElement | null }) => {\n\tuseEffect(() => {\n\t\tif (isOpen) {\n\t\t\tconst closeOnClickOutside = (event: Event) => {\n\t\t\t\tconst target = event.target\n\t\t\t\tif (\n\t\t\t\t\ttarget instanceof Node &&\n\t\t\t\t\t(!document.body.contains(target) ||\n\t\t\t\t\t\ttarget === document.body ||\n\t\t\t\t\t\tcontents.some(it => it && it.contains(target)))\n\t\t\t\t) {\n\t\t\t\t\treturn\n\t\t\t\t}\n\t\t\t\tif (contents.every(it => it === null)) {\n\t\t\t\t\treturn\n\t\t\t\t}\n\t\t\t\tclose()\n\t\t\t}\n\t\t\t(outside ?? window).addEventListener('click', closeOnClickOutside)\n\t\t\treturn () => {\n\t\t\t\t(outside ?? window).removeEventListener('click', closeOnClickOutside)\n\t\t\t}\n\t\t}\n\t}, [close, isOpen, contents, outside])\n}\n"],"names":["useEffect"],"mappings":";;;AAEO,MAAM,yBAAyB,CAAC,EAAE,QAAQ,OAAO,UAAU,cAA+G;AAChLA,QAAAA,UAAU,MAAM;AACf,QAAI,QAAQ;AACL,YAAA,sBAAsB,CAAC,UAAiB;AAC7C,cAAM,SAAS,MAAM;AACrB,YACC,kBAAkB,SACjB,CAAC,SAAS,KAAK,SAAS,MAAM,KAC9B,WAAW,SAAS,QACpB,SAAS,KAAK,CAAM,OAAA,MAAM,GAAG,SAAS,MAAM,CAAC,IAC7C;AACD;AAAA,QACD;AACA,YAAI,SAAS,MAAM,CAAM,OAAA,OAAO,IAAI,GAAG;AACtC;AAAA,QACD;AACM;MAAA;AAEP,OAAC,WAAW,QAAQ,iBAAiB,SAAS,mBAAmB;AACjE,aAAO,MAAM;AACZ,SAAC,WAAW,QAAQ,oBAAoB,SAAS,mBAAmB;AAAA,MAAA;AAAA,IAEtE;AAAA,KACE,CAAC,OAAO,QAAQ,UAAU,OAAO,CAAC;AACtC;;"}
@@ -1,25 +0,0 @@
1
- import { useEffect } from "react";
2
- const useCloseOnClickOutside = ({ isOpen, close, contents, outside }) => {
3
- useEffect(() => {
4
- if (isOpen) {
5
- const closeOnClickOutside = (event) => {
6
- const target = event.target;
7
- if (target instanceof Node && (!document.body.contains(target) || target === document.body || contents.some((it) => it && it.contains(target)))) {
8
- return;
9
- }
10
- if (contents.every((it) => it === null)) {
11
- return;
12
- }
13
- close();
14
- };
15
- (outside ?? window).addEventListener("click", closeOnClickOutside);
16
- return () => {
17
- (outside ?? window).removeEventListener("click", closeOnClickOutside);
18
- };
19
- }
20
- }, [close, isOpen, contents, outside]);
21
- };
22
- export {
23
- useCloseOnClickOutside
24
- };
25
- //# sourceMappingURL=useCloseOnClickOutside.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"useCloseOnClickOutside.js","sources":["../../../src/hooks/useCloseOnClickOutside.ts"],"sourcesContent":["import { useEffect } from 'react'\n\nexport const useCloseOnClickOutside = ({ isOpen, close, contents, outside }: { isOpen: boolean, close: () => void, contents: (Node | null)[], outside?: HTMLElement | null }) => {\n\tuseEffect(() => {\n\t\tif (isOpen) {\n\t\t\tconst closeOnClickOutside = (event: Event) => {\n\t\t\t\tconst target = event.target\n\t\t\t\tif (\n\t\t\t\t\ttarget instanceof Node &&\n\t\t\t\t\t(!document.body.contains(target) ||\n\t\t\t\t\t\ttarget === document.body ||\n\t\t\t\t\t\tcontents.some(it => it && it.contains(target)))\n\t\t\t\t) {\n\t\t\t\t\treturn\n\t\t\t\t}\n\t\t\t\tif (contents.every(it => it === null)) {\n\t\t\t\t\treturn\n\t\t\t\t}\n\t\t\t\tclose()\n\t\t\t}\n\t\t\t(outside ?? window).addEventListener('click', closeOnClickOutside)\n\t\t\treturn () => {\n\t\t\t\t(outside ?? window).removeEventListener('click', closeOnClickOutside)\n\t\t\t}\n\t\t}\n\t}, [close, isOpen, contents, outside])\n}\n"],"names":[],"mappings":";AAEO,MAAM,yBAAyB,CAAC,EAAE,QAAQ,OAAO,UAAU,cAA+G;AAChL,YAAU,MAAM;AACf,QAAI,QAAQ;AACL,YAAA,sBAAsB,CAAC,UAAiB;AAC7C,cAAM,SAAS,MAAM;AACrB,YACC,kBAAkB,SACjB,CAAC,SAAS,KAAK,SAAS,MAAM,KAC9B,WAAW,SAAS,QACpB,SAAS,KAAK,CAAM,OAAA,MAAM,GAAG,SAAS,MAAM,CAAC,IAC7C;AACD;AAAA,QACD;AACA,YAAI,SAAS,MAAM,CAAM,OAAA,OAAO,IAAI,GAAG;AACtC;AAAA,QACD;AACM;MAAA;AAEP,OAAC,WAAW,QAAQ,iBAAiB,SAAS,mBAAmB;AACjE,aAAO,MAAM;AACZ,SAAC,WAAW,QAAQ,oBAAoB,SAAS,mBAAmB;AAAA,MAAA;AAAA,IAEtE;AAAA,KACE,CAAC,OAAO,QAAQ,UAAU,OAAO,CAAC;AACtC;"}
@@ -1,20 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
- const react = require("react");
4
- const useCloseOnEscape = ({ isOpen, close }) => {
5
- react.useEffect(() => {
6
- if (isOpen) {
7
- const closeOnEscapeKey = (event) => {
8
- if (event.key === "Escape") {
9
- close();
10
- }
11
- };
12
- window.addEventListener("keydown", closeOnEscapeKey);
13
- return () => {
14
- window.removeEventListener("keydown", closeOnEscapeKey);
15
- };
16
- }
17
- }, [close, isOpen]);
18
- };
19
- exports.useCloseOnEscape = useCloseOnEscape;
20
- //# sourceMappingURL=useCloseOnEscape.cjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"useCloseOnEscape.cjs","sources":["../../../src/hooks/useCloseOnEscape.ts"],"sourcesContent":["import { useEffect } from 'react'\n\nexport const useCloseOnEscape = ({ isOpen, close }: { isOpen: boolean, close: () => void }) => {\n\tuseEffect(() => {\n\t\tif (isOpen) {\n\t\t\tconst closeOnEscapeKey = (event: KeyboardEvent) => {\n\t\t\t\tif (event.key === 'Escape') {\n\t\t\t\t\tclose()\n\t\t\t\t}\n\t\t\t}\n\t\t\twindow.addEventListener('keydown', closeOnEscapeKey)\n\n\t\t\treturn () => {\n\t\t\t\twindow.removeEventListener('keydown', closeOnEscapeKey)\n\t\t\t}\n\t\t}\n\t}, [close, isOpen])\n}\n"],"names":["useEffect"],"mappings":";;;AAEO,MAAM,mBAAmB,CAAC,EAAE,QAAQ,YAAoD;AAC9FA,QAAAA,UAAU,MAAM;AACf,QAAI,QAAQ;AACL,YAAA,mBAAmB,CAAC,UAAyB;AAC9C,YAAA,MAAM,QAAQ,UAAU;AACrB;QACP;AAAA,MAAA;AAEM,aAAA,iBAAiB,WAAW,gBAAgB;AAEnD,aAAO,MAAM;AACL,eAAA,oBAAoB,WAAW,gBAAgB;AAAA,MAAA;AAAA,IAExD;AAAA,EAAA,GACE,CAAC,OAAO,MAAM,CAAC;AACnB;;"}
@@ -1,20 +0,0 @@
1
- import { useEffect } from "react";
2
- const useCloseOnEscape = ({ isOpen, close }) => {
3
- useEffect(() => {
4
- if (isOpen) {
5
- const closeOnEscapeKey = (event) => {
6
- if (event.key === "Escape") {
7
- close();
8
- }
9
- };
10
- window.addEventListener("keydown", closeOnEscapeKey);
11
- return () => {
12
- window.removeEventListener("keydown", closeOnEscapeKey);
13
- };
14
- }
15
- }, [close, isOpen]);
16
- };
17
- export {
18
- useCloseOnEscape
19
- };
20
- //# sourceMappingURL=useCloseOnEscape.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"useCloseOnEscape.js","sources":["../../../src/hooks/useCloseOnEscape.ts"],"sourcesContent":["import { useEffect } from 'react'\n\nexport const useCloseOnEscape = ({ isOpen, close }: { isOpen: boolean, close: () => void }) => {\n\tuseEffect(() => {\n\t\tif (isOpen) {\n\t\t\tconst closeOnEscapeKey = (event: KeyboardEvent) => {\n\t\t\t\tif (event.key === 'Escape') {\n\t\t\t\t\tclose()\n\t\t\t\t}\n\t\t\t}\n\t\t\twindow.addEventListener('keydown', closeOnEscapeKey)\n\n\t\t\treturn () => {\n\t\t\t\twindow.removeEventListener('keydown', closeOnEscapeKey)\n\t\t\t}\n\t\t}\n\t}, [close, isOpen])\n}\n"],"names":[],"mappings":";AAEO,MAAM,mBAAmB,CAAC,EAAE,QAAQ,YAAoD;AAC9F,YAAU,MAAM;AACf,QAAI,QAAQ;AACL,YAAA,mBAAmB,CAAC,UAAyB;AAC9C,YAAA,MAAM,QAAQ,UAAU;AACrB;QACP;AAAA,MAAA;AAEM,aAAA,iBAAiB,WAAW,gBAAgB;AAEnD,aAAO,MAAM;AACL,eAAA,oBAAoB,WAAW,gBAAgB;AAAA,MAAA;AAAA,IAExD;AAAA,EAAA,GACE,CAAC,OAAO,MAAM,CAAC;AACnB;"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"useComposeRef.cjs","sources":["../../../src/hooks/useComposeRef.ts"],"sourcesContent":["import { MutableRefObject, RefCallback, useMemo, useRef } from 'react'\n\nexport type MaybeRef<T> = ((instance: T | null) => void) | MutableRefObject<T | null> | null | undefined\nexport type ComposedRefCallback<T> = RefCallback<T> & { current: T | null };\n\nfunction setRef<T>(ref: MaybeRef<T>, instance: T | null): void {\n\tif (ref) {\n\t\tif (typeof ref === 'function') {\n\t\t\tref(instance)\n\t\t} else if (instance) {\n\t\t\tref.current = instance\n\t\t}\n\t}\n}\n\n/**\n * Fills any number of refs with an instance\n *\n * Useful when you need to use outer ref and inner in the same time, e.g. passing element\n * back to forwardedRef an also using the same value within the component locally.\n *\n * @param refs - Rest parameter of refs to fill with instance\n * @returns Returns a function similar to a RefCallback\n */\nexport function useComposeRef<T>(...refs: MaybeRef<T>[]): ComposedRefCallback<T> {\n\tconst initialRefs = useRef(refs)\n\n\tconst composeRef: ComposedRefCallback<T> = useMemo(() => {\n\t\tfunction composedRefCallback(instance: T | null) {\n\t\t\tinitialRefs.current.forEach(ref => setRef(ref, instance))\n\t\t\tsetCurrent(instance)\n\t\t}\n\n\t\tfunction setCurrent(instance: T | null) {\n\t\t\tif (instance) {\n\t\t\t\tcomposedRefCallback.current = instance\n\t\t\t}\n\t\t}\n\n\t\tcomposedRefCallback.current = null as T | null\n\n\t\treturn composedRefCallback\n\t}, [])\n\n\treturn composeRef\n}\n"],"names":["useRef","useMemo"],"mappings":";;;AAKA,SAAS,OAAU,KAAkB,UAA0B;AAC9D,MAAI,KAAK;AACJ,QAAA,OAAO,QAAQ,YAAY;AAC9B,UAAI,QAAQ;AAAA,eACF,UAAU;AACpB,UAAI,UAAU;AAAA,IACf;AAAA,EACD;AACD;AAWO,SAAS,iBAAoB,MAA6C;AAC1E,QAAA,cAAcA,aAAO,IAAI;AAEzB,QAAA,aAAqCC,MAAAA,QAAQ,MAAM;AACxD,aAAS,oBAAoB,UAAoB;AAChD,kBAAY,QAAQ,QAAQ,CAAA,QAAO,OAAO,KAAK,QAAQ,CAAC;AACxD,iBAAW,QAAQ;AAAA,IACpB;AAEA,aAAS,WAAW,UAAoB;AACvC,UAAI,UAAU;AACb,4BAAoB,UAAU;AAAA,MAC/B;AAAA,IACD;AAEA,wBAAoB,UAAU;AAEvB,WAAA;AAAA,EACR,GAAG,CAAE,CAAA;AAEE,SAAA;AACR;;"}