@oracle/oraclejet-preact 14.0.3 → 14.0.5

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 (1146) hide show
  1. package/amd/Badge-d9f13bcf.js +2 -0
  2. package/amd/{Badge-fadeb6b4.js.map → Badge-d9f13bcf.js.map} +1 -1
  3. package/amd/BaseButton-31fe1787.js +2 -0
  4. package/amd/{BaseButton-fc90b7e6.js.map → BaseButton-31fe1787.js.map} +1 -1
  5. package/amd/Button-11c23c7a.js +2 -0
  6. package/amd/{Button-bab4ad2f.js.map → Button-11c23c7a.js.map} +1 -1
  7. package/amd/Chip-e3d549ba.js +2 -0
  8. package/amd/{Chip-7bb92fcc.js.map → Chip-e3d549ba.js.map} +1 -1
  9. package/amd/ClearIcon-58c33ef6.js +2 -0
  10. package/amd/{ClearIcon-0f086ca2.js.map → ClearIcon-58c33ef6.js.map} +1 -1
  11. package/amd/{Collection-764dad44.js → Collection-a530cc1c.js} +1 -1
  12. package/amd/{Collection-764dad44.js.map → Collection-a530cc1c.js.map} +1 -1
  13. package/amd/ComponentMessage-f45b3bbf.js +2 -0
  14. package/amd/{ComponentMessage-bfe206a0.js.map → ComponentMessage-f45b3bbf.js.map} +1 -1
  15. package/amd/ComponentMessageContainer-ded8d38b.js +2 -0
  16. package/amd/{ComponentMessageContainer-ac68cdf5.js.map → ComponentMessageContainer-ded8d38b.js.map} +1 -1
  17. package/amd/Divider-84e27e2d.js +2 -0
  18. package/amd/{Divider-9f59cd1d.js.map → Divider-84e27e2d.js.map} +1 -1
  19. package/amd/{FilePicker-70ea3e8d.js → FilePicker-e9a5d905.js} +2 -2
  20. package/amd/{FilePicker-70ea3e8d.js.map → FilePicker-e9a5d905.js.map} +1 -1
  21. package/amd/Flex-556d723b.js +2 -0
  22. package/amd/{Flex-3c3b5df1.js.map → Flex-556d723b.js.map} +1 -1
  23. package/amd/Floating-31eefce3.js +2 -0
  24. package/amd/{Floating-810ba93b.js.map → Floating-31eefce3.js.map} +1 -1
  25. package/amd/FocusTrap-94dc8805.js +2 -0
  26. package/amd/{FocusTrap-8787f5c7.js.map → FocusTrap-94dc8805.js.map} +1 -1
  27. package/amd/FormControlUtils-f9124d70.js +2 -0
  28. package/amd/{FormControlUtils-b4e6d54f.js.map → FormControlUtils-f9124d70.js.map} +1 -1
  29. package/amd/Heading-e317eb74.js +2 -0
  30. package/amd/{Heading-ef573200.js.map → Heading-e317eb74.js.map} +1 -1
  31. package/amd/HiddenAccessible-fd19b064.js +2 -0
  32. package/amd/{HiddenAccessible-efe88cb0.js.map → HiddenAccessible-fd19b064.js.map} +1 -1
  33. package/amd/HighlightText-c8527a97.js +2 -0
  34. package/amd/{HighlightText-695fad9f.js.map → HighlightText-c8527a97.js.map} +1 -1
  35. package/amd/Icon-b5704008.js +2 -0
  36. package/amd/{Icon-caf41588.js.map → Icon-b5704008.js.map} +1 -1
  37. package/amd/Indexer-5611d3c4.js +2 -0
  38. package/amd/{Indexer-fc905285.js.map → Indexer-5611d3c4.js.map} +1 -1
  39. package/amd/{InlineHelpSource-364f5724.js → InlineHelpSource-66c5f04f.js} +2 -2
  40. package/amd/{InlineHelpSource-364f5724.js.map → InlineHelpSource-66c5f04f.js.map} +1 -1
  41. package/amd/Link-0332b23e.js +2 -0
  42. package/amd/{Link-802eeb81.js.map → Link-0332b23e.js.map} +1 -1
  43. package/amd/List-f2a1fc9f.js +2 -0
  44. package/amd/{List-5c591342.js.map → List-f2a1fc9f.js.map} +1 -1
  45. package/amd/ListItemTextLayout-60e39a4b.js +2 -0
  46. package/amd/{ListItemTextLayout-afaa418f.js.map → ListItemTextLayout-60e39a4b.js.map} +1 -1
  47. package/amd/{ListView-8c276f2f.js → ListView-9ed346bf.js} +2 -2
  48. package/amd/{ListView-8c276f2f.js.map → ListView-9ed346bf.js.map} +1 -1
  49. package/amd/{LoadMoreCollection-263ba60c.js → LoadMoreCollection-479c6b41.js} +2 -2
  50. package/amd/{LoadMoreCollection-263ba60c.js.map → LoadMoreCollection-479c6b41.js.map} +1 -1
  51. package/amd/{Menu-20495dda.js → Menu-8031192d.js} +2 -2
  52. package/amd/{Menu-20495dda.js.map → Menu-8031192d.js.map} +1 -1
  53. package/amd/MenuDivider-92577724.js +2 -0
  54. package/amd/{MenuDivider-7f8a238e.js.map → MenuDivider-92577724.js.map} +1 -1
  55. package/amd/MenuItem-677564f5.js +2 -0
  56. package/amd/{MenuItem-744d7b06.js.map → MenuItem-677564f5.js.map} +1 -1
  57. package/amd/{Message.types-f0bba1c4.js → Message.types-4bf5e2b8.js} +1 -1
  58. package/amd/{Message.types-f0bba1c4.js.map → Message.types-4bf5e2b8.js.map} +1 -1
  59. package/amd/MessageCloseButton-256615e9.js +2 -0
  60. package/amd/{MessageCloseButton-9591aa5c.js.map → MessageCloseButton-256615e9.js.map} +1 -1
  61. package/amd/MessageDetail-8958ff27.js +2 -0
  62. package/amd/{MessageDetail-bb68d2db.js.map → MessageDetail-8958ff27.js.map} +1 -1
  63. package/amd/{MessageFormattingUtils-cccfb59f.js → MessageFormattingUtils-66993387.js} +2 -2
  64. package/amd/{MessageFormattingUtils-cccfb59f.js.map → MessageFormattingUtils-66993387.js.map} +1 -1
  65. package/amd/MessageLayer-dc38e00d.js +2 -0
  66. package/amd/{MessageLayer-e93cfd39.js.map → MessageLayer-dc38e00d.js.map} +1 -1
  67. package/amd/MessageStartIcon-9a21df9b.js +2 -0
  68. package/amd/{MessageStartIcon-c25b74a6.js.map → MessageStartIcon-9a21df9b.js.map} +1 -1
  69. package/amd/MessageSummary-34220b0d.js +2 -0
  70. package/amd/{MessageSummary-7862f0dc.js.map → MessageSummary-34220b0d.js.map} +1 -1
  71. package/amd/MessageTimestamp-271609d9.js +2 -0
  72. package/amd/{MessageTimestamp-791bef26.js.map → MessageTimestamp-271609d9.js.map} +1 -1
  73. package/amd/{MessageToast-7f97eed3.js → MessageToast-129c2477.js} +2 -2
  74. package/amd/{MessageToast-7f97eed3.js.map → MessageToast-129c2477.js.map} +1 -1
  75. package/amd/{MessageUtils-31e28fdc.js → MessageUtils-dfcb9ca9.js} +2 -2
  76. package/amd/{MessageUtils-31e28fdc.js.map → MessageUtils-dfcb9ca9.js.map} +1 -1
  77. package/amd/{MessagesManager-7cae13c7.js → MessagesManager-d521afd3.js} +2 -2
  78. package/amd/{MessagesManager-7cae13c7.js.map → MessagesManager-d521afd3.js.map} +1 -1
  79. package/amd/MeterCircle-78d7b095.js +2 -0
  80. package/amd/{MeterCircle-486e1a71.js.map → MeterCircle-78d7b095.js.map} +1 -1
  81. package/amd/Modal-1b5b6fc3.js +2 -0
  82. package/amd/{Modal-0ef435f0.js.map → Modal-1b5b6fc3.js.map} +1 -1
  83. package/amd/{NumberInputText-b8c55d7b.js → NumberInputText-9ad68cd3.js} +2 -2
  84. package/amd/{NumberInputText-b8c55d7b.js.map → NumberInputText-9ad68cd3.js.map} +1 -1
  85. package/amd/PRIVATE_Collection.js +1 -1
  86. package/amd/PRIVATE_List.css +15 -15
  87. package/amd/PRIVATE_List.js +1 -1
  88. package/amd/PRIVATE_Message.css +27 -27
  89. package/amd/PRIVATE_Message.js +1 -1
  90. package/amd/PRIVATE_Message.js.map +1 -1
  91. package/amd/PRIVATE_MessageLayer.css +7 -7
  92. package/amd/PRIVATE_MessageLayer.js +1 -1
  93. package/amd/PRIVATE_Meter.js +1 -1
  94. package/amd/PRIVATE_Meter.js.map +1 -1
  95. package/amd/PRIVATE_SelectCommon.css +13 -13
  96. package/amd/PRIVATE_SelectCommon.js +1 -1
  97. package/amd/PRIVATE_SelectCommon.js.map +1 -1
  98. package/amd/PRIVATE_TransitionGroup.js +1 -1
  99. package/amd/PRIVATE_TransitionGroup.js.map +1 -1
  100. package/amd/PRIVATE_VirtualizedCollection.js +1 -1
  101. package/amd/ReadonlyTextFieldInput-1b5e6b00.js +2 -0
  102. package/amd/{ReadonlyTextFieldInput-1ba7b3c8.js.map → ReadonlyTextFieldInput-1b5e6b00.js.map} +1 -1
  103. package/amd/SelectMenuItem-2393f161.js +2 -0
  104. package/amd/{SelectMenuItem-d0745c2b.js.map → SelectMenuItem-2393f161.js.map} +1 -1
  105. package/amd/SelectMultiple-f525d786.js +2 -0
  106. package/amd/{SelectMultiple-34ecc4ac.js.map → SelectMultiple-f525d786.js.map} +1 -1
  107. package/amd/{SelectSingle-9518ffce.js → SelectSingle-82a0e46a.js} +2 -2
  108. package/amd/{SelectSingle-9518ffce.js.map → SelectSingle-82a0e46a.js.map} +1 -1
  109. package/amd/Skeleton-d9b61f2e.js +2 -0
  110. package/amd/{Skeleton-1d1721ed.js.map → Skeleton-d9b61f2e.js.map} +1 -1
  111. package/amd/Spacer-d5dceece.js +2 -0
  112. package/amd/{Spacer-020e2d85.js.map → Spacer-d5dceece.js.map} +1 -1
  113. package/amd/SplitMenuButton-4247ca7c.js +2 -0
  114. package/amd/{SplitMenuButton-6bdc9401.js.map → SplitMenuButton-4247ca7c.js.map} +1 -1
  115. package/amd/Text-2d54c9f7.js +2 -0
  116. package/amd/{Text-533ecfd0.js.map → Text-2d54c9f7.js.map} +1 -1
  117. package/amd/{TextArea-4e645f49.js → TextArea-2fdab6db.js} +2 -2
  118. package/amd/{TextArea-4e645f49.js.map → TextArea-2fdab6db.js.map} +1 -1
  119. package/amd/{TextAreaAutosize-f757872b.js → TextAreaAutosize-50b8719d.js} +2 -2
  120. package/amd/{TextAreaAutosize-f757872b.js.map → TextAreaAutosize-50b8719d.js.map} +1 -1
  121. package/amd/TextFieldInput-e26af2be.js +2 -0
  122. package/amd/{TextFieldInput-3ae2ab4b.js.map → TextFieldInput-e26af2be.js.map} +1 -1
  123. package/amd/UNSAFE_AspectRatio.css +1 -1
  124. package/amd/UNSAFE_AspectRatio.js +1 -1
  125. package/amd/UNSAFE_Avatar.css +8 -8
  126. package/amd/UNSAFE_Avatar.js +1 -1
  127. package/amd/UNSAFE_Avatar.js.map +1 -1
  128. package/amd/UNSAFE_Badge.css +13 -13
  129. package/amd/UNSAFE_Badge.js +1 -1
  130. package/amd/UNSAFE_BaseButton.css +15 -15
  131. package/amd/UNSAFE_BaseButton.js +1 -1
  132. package/amd/UNSAFE_Button.css +8 -8
  133. package/amd/UNSAFE_Button.js +1 -1
  134. package/amd/UNSAFE_Center.js +1 -1
  135. package/amd/UNSAFE_Center.js.map +1 -1
  136. package/amd/UNSAFE_Chip.css +7 -7
  137. package/amd/UNSAFE_Chip.js +1 -1
  138. package/amd/UNSAFE_Collapsible.css +8 -8
  139. package/amd/UNSAFE_Collapsible.js +1 -1
  140. package/amd/UNSAFE_Collapsible.js.map +1 -1
  141. package/amd/UNSAFE_ComponentMessage.css +2 -2
  142. package/amd/UNSAFE_ComponentMessage.js +1 -1
  143. package/amd/UNSAFE_Divider.css +1 -1
  144. package/amd/UNSAFE_Divider.js +1 -1
  145. package/amd/UNSAFE_Environment.js.map +1 -1
  146. package/amd/UNSAFE_FilePicker.css +6 -6
  147. package/amd/UNSAFE_FilePicker.js +1 -1
  148. package/amd/UNSAFE_Flex.css +2 -2
  149. package/amd/UNSAFE_Flex.js +1 -1
  150. package/amd/UNSAFE_Floating.js +1 -1
  151. package/amd/UNSAFE_FocusTrap.css +2 -2
  152. package/amd/UNSAFE_FocusTrap.js +1 -1
  153. package/amd/UNSAFE_Grid.css +1 -1
  154. package/amd/UNSAFE_Grid.js +1 -1
  155. package/amd/UNSAFE_Grid.js.map +1 -1
  156. package/amd/UNSAFE_Heading.css +9 -9
  157. package/amd/UNSAFE_Heading.js +1 -1
  158. package/amd/UNSAFE_HiddenAccessible.css +1 -1
  159. package/amd/UNSAFE_HiddenAccessible.js +1 -1
  160. package/amd/UNSAFE_HighlightText.css +1 -1
  161. package/amd/UNSAFE_HighlightText.js +1 -1
  162. package/amd/UNSAFE_Icon.css +21 -21
  163. package/amd/UNSAFE_Icon.js +1 -1
  164. package/amd/UNSAFE_Icons.js +1 -1
  165. package/amd/UNSAFE_Indexer.css +7 -7
  166. package/amd/UNSAFE_Indexer.js +1 -1
  167. package/amd/UNSAFE_InputPassword.css +1 -1
  168. package/amd/UNSAFE_InputPassword.js +1 -1
  169. package/amd/UNSAFE_InputPassword.js.map +1 -1
  170. package/amd/UNSAFE_InputText.css +1 -1
  171. package/amd/UNSAFE_InputText.js +1 -1
  172. package/amd/UNSAFE_InputText.js.map +1 -1
  173. package/amd/UNSAFE_Label.css +13 -13
  174. package/amd/UNSAFE_Label.js +1 -1
  175. package/amd/UNSAFE_Label.js.map +1 -1
  176. package/amd/UNSAFE_LabelValueLayout.css +9 -9
  177. package/amd/UNSAFE_LabelValueLayout.js +1 -1
  178. package/amd/UNSAFE_LabelValueLayout.js.map +1 -1
  179. package/amd/UNSAFE_Link.css +5 -5
  180. package/amd/UNSAFE_Link.js +1 -1
  181. package/amd/UNSAFE_ListItemLayout.css +9 -9
  182. package/amd/UNSAFE_ListItemLayout.js +1 -1
  183. package/amd/UNSAFE_ListView.js +1 -1
  184. package/amd/UNSAFE_LiveRegion.css +1 -1
  185. package/amd/UNSAFE_LiveRegion.js +1 -1
  186. package/amd/UNSAFE_LiveRegion.js.map +1 -1
  187. package/amd/UNSAFE_LoadMoreCollection.js +1 -1
  188. package/amd/UNSAFE_Menu.css +17 -17
  189. package/amd/UNSAFE_Menu.js +1 -1
  190. package/amd/UNSAFE_MessageBanner.js +1 -1
  191. package/amd/UNSAFE_MessageBanner.js.map +1 -1
  192. package/amd/UNSAFE_MessageToast.css +1 -1
  193. package/amd/UNSAFE_MessageToast.js +1 -1
  194. package/amd/UNSAFE_MeterBar.css +43 -43
  195. package/amd/UNSAFE_MeterBar.js +1 -1
  196. package/amd/UNSAFE_MeterBar.js.map +1 -1
  197. package/amd/UNSAFE_MeterCircle.css +46 -46
  198. package/amd/UNSAFE_MeterCircle.js +1 -1
  199. package/amd/UNSAFE_Modal.css +3 -3
  200. package/amd/UNSAFE_Modal.js +1 -1
  201. package/amd/UNSAFE_NumberInputText.js +1 -1
  202. package/amd/UNSAFE_PrefixSuffix.css +8 -8
  203. package/amd/UNSAFE_PrefixSuffix.js +1 -1
  204. package/amd/UNSAFE_PrefixSuffix.js.map +1 -1
  205. package/amd/UNSAFE_ProgressBar.css +6 -6
  206. package/amd/UNSAFE_ProgressBar.js +1 -1
  207. package/amd/UNSAFE_ProgressBar.js.map +1 -1
  208. package/amd/UNSAFE_ProgressCircle.css +6 -6
  209. package/amd/UNSAFE_ProgressCircle.js +1 -1
  210. package/amd/UNSAFE_ProgressCircle.js.map +1 -1
  211. package/amd/UNSAFE_RatingGauge.css +20 -20
  212. package/amd/UNSAFE_RatingGauge.js +1 -1
  213. package/amd/UNSAFE_RatingGauge.js.map +1 -1
  214. package/amd/UNSAFE_SelectMultiple.css +1 -1
  215. package/amd/UNSAFE_SelectMultiple.js +1 -1
  216. package/amd/UNSAFE_SelectSingle.js +1 -1
  217. package/amd/UNSAFE_Selector.css +5 -5
  218. package/amd/UNSAFE_Selector.js +1 -1
  219. package/amd/UNSAFE_Selector.js.map +1 -1
  220. package/amd/UNSAFE_Skeleton.css +1 -1
  221. package/amd/UNSAFE_Skeleton.js +1 -1
  222. package/amd/UNSAFE_Spacer.js +1 -1
  223. package/amd/UNSAFE_SplitMenuButton.css +5 -5
  224. package/amd/UNSAFE_SplitMenuButton.js +1 -1
  225. package/amd/UNSAFE_Text.css +25 -25
  226. package/amd/UNSAFE_Text.js +1 -1
  227. package/amd/UNSAFE_TextArea.css +3 -3
  228. package/amd/UNSAFE_TextArea.js +1 -1
  229. package/amd/UNSAFE_TextAreaAutosize.js +1 -1
  230. package/amd/UNSAFE_TextField.css +58 -58
  231. package/amd/UNSAFE_TextField.js +1 -1
  232. package/amd/UNSAFE_TextField.js.map +1 -1
  233. package/amd/UNSAFE_ThemedIcons.js +1 -1
  234. package/amd/UNSAFE_UserAssistance.css +8 -8
  235. package/amd/UNSAFE_UserAssistance.js +1 -1
  236. package/amd/UNSAFE_UserAssistance.js.map +1 -1
  237. package/amd/UNSAFE_View.js +1 -1
  238. package/amd/UNSAFE_View.js.map +1 -1
  239. package/amd/UNSAFE_VirtualizedListView.js +1 -1
  240. package/amd/{VirtualizedCollection-7e3669c3.js → VirtualizedCollection-91797029.js} +2 -2
  241. package/amd/{VirtualizedCollection-7e3669c3.js.map → VirtualizedCollection-91797029.js.map} +1 -1
  242. package/amd/{VirtualizedListView-7db93bf1.js → VirtualizedListView-6decbb33.js} +2 -2
  243. package/amd/{VirtualizedListView-7db93bf1.js.map → VirtualizedListView-6decbb33.js.map} +1 -1
  244. package/amd/{_curry1-d6c8f4c8.js → _curry1-875b461d.js} +1 -1
  245. package/amd/{_curry1-d6c8f4c8.js.map → _curry1-875b461d.js.map} +1 -1
  246. package/amd/{_curry2-93393649.js → _curry2-ad2c6a81.js} +2 -2
  247. package/amd/{_curry2-93393649.js.map → _curry2-ad2c6a81.js.map} +1 -1
  248. package/amd/_curry3-512d483b.js +2 -0
  249. package/amd/{_curry3-cf0bce65.js.map → _curry3-512d483b.js.map} +1 -1
  250. package/amd/_has-11a7a18f.js +2 -0
  251. package/amd/{_has-5cd48c18.js.map → _has-11a7a18f.js.map} +1 -1
  252. package/amd/{classNames-19b96444.js → classNames-429bf434.js} +1 -1
  253. package/amd/{classNames-19b96444.js.map → classNames-429bf434.js.map} +1 -1
  254. package/amd/{clientHints-54772777.js → clientHints-9d985ef6.js} +1 -1
  255. package/amd/{clientHints-54772777.js.map → clientHints-9d985ef6.js.map} +1 -1
  256. package/amd/flexbox-aaa40e19.js +2 -0
  257. package/amd/{flexbox-ec205eaf.js.map → flexbox-aaa40e19.js.map} +1 -1
  258. package/amd/flexitem-d85d1561.js +2 -0
  259. package/amd/{flexitem-a85b8edd.js.map → flexitem-d85d1561.js.map} +1 -1
  260. package/amd/hooks/PRIVATE_useDvtMeterEvents.js +1 -1
  261. package/amd/hooks/PRIVATE_useDvtMeterEvents.js.map +1 -1
  262. package/amd/hooks/PRIVATE_useMessagesFocusManager.js.map +1 -1
  263. package/amd/hooks/PRIVATE_useSingleSelection.js +1 -1
  264. package/amd/hooks/UNSAFE_useActionable.js.map +1 -1
  265. package/amd/hooks/UNSAFE_useActive.js.map +1 -1
  266. package/amd/hooks/UNSAFE_useAnimation.js +1 -1
  267. package/amd/hooks/UNSAFE_useClearIcon.js.map +1 -1
  268. package/amd/hooks/UNSAFE_useContainerBreakpointValues.js.map +1 -1
  269. package/amd/hooks/UNSAFE_useCurrentValueReducer.js.map +1 -1
  270. package/amd/hooks/UNSAFE_useFloating.js +1 -1
  271. package/amd/hooks/UNSAFE_useFocus.js.map +1 -1
  272. package/amd/hooks/UNSAFE_useFocusWithin.js +1 -1
  273. package/amd/hooks/UNSAFE_useFocusableTextField.js +1 -1
  274. package/amd/hooks/UNSAFE_useFocusableTextField.js.map +1 -1
  275. package/amd/hooks/UNSAFE_useHover.js.map +1 -1
  276. package/amd/hooks/UNSAFE_useLengthFilter.js.map +1 -1
  277. package/amd/hooks/UNSAFE_useLongPress.js.map +1 -1
  278. package/amd/hooks/UNSAFE_usePan.js.map +1 -1
  279. package/amd/hooks/UNSAFE_usePrefixSuffix.js +1 -1
  280. package/amd/hooks/UNSAFE_usePrefixSuffix.js.map +1 -1
  281. package/amd/hooks/UNSAFE_useSwipe.js.map +1 -1
  282. package/amd/hooks/UNSAFE_useTextField.js.map +1 -1
  283. package/amd/hooks/UNSAFE_useTextFieldInputHandlers.js +1 -1
  284. package/amd/hooks/UNSAFE_useTextFieldInputHandlers.js.map +1 -1
  285. package/amd/hooks/UNSAFE_useTimer.js.map +1 -1
  286. package/amd/hooks/UNSAFE_useTooltip.css +4 -4
  287. package/amd/hooks/UNSAFE_useTooltip.js +1 -1
  288. package/amd/hooks/UNSAFE_useTooltip.js.map +1 -1
  289. package/amd/hooks/UNSAFE_useTouch.js.map +1 -1
  290. package/amd/hooks/UNSAFE_useTranslationBundle.js.map +1 -1
  291. package/amd/hooks/UNSAFE_useUncontrolledState.js +1 -1
  292. package/amd/hooks/UNSAFE_useUncontrolledState.js.map +1 -1
  293. package/amd/hooks/UNSAFE_useViewportIntersect.js.map +1 -1
  294. package/amd/index-4f4526ef.js +2 -0
  295. package/amd/{index-8df256a2.js.map → index-4f4526ef.js.map} +1 -1
  296. package/amd/{index-c1d2bf5b.js → index-6aed3532.js} +2 -2
  297. package/amd/{index-c1d2bf5b.js.map → index-6aed3532.js.map} +1 -1
  298. package/amd/{index-98cf3d9d.js → index-6f29250e.js} +2 -2
  299. package/amd/{index-98cf3d9d.js.map → index-6f29250e.js.map} +1 -1
  300. package/amd/{keys-a3f663bb.js → keys-83d1523f.js} +2 -2
  301. package/amd/{keys-a3f663bb.js.map → keys-83d1523f.js.map} +1 -1
  302. package/amd/listViewSelectionTests-cf59cc80.js +2 -0
  303. package/amd/{listViewSelectionTests-73b90740.js.map → listViewSelectionTests-cf59cc80.js.map} +1 -1
  304. package/amd/{listViewTabbableModeTests-49e55436.js → listViewTabbableModeTests-b1b39bd9.js} +2 -2
  305. package/amd/{listViewTabbableModeTests-49e55436.js.map → listViewTabbableModeTests-b1b39bd9.js.map} +1 -1
  306. package/amd/{listViewTestFixtures-09dcb3af.js → listViewTestFixtures-5ce87b59.js} +1 -1
  307. package/amd/{listViewTestFixtures-09dcb3af.js.map → listViewTestFixtures-5ce87b59.js.map} +1 -1
  308. package/amd/{menuTestsUtils-e1b3fe19.js → menuTestsUtils-31d41516.js} +1 -1
  309. package/amd/{menuTestsUtils-e1b3fe19.js.map → menuTestsUtils-31d41516.js.map} +1 -1
  310. package/amd/resources/nls/ar/bundle.js.map +1 -1
  311. package/amd/resources/nls/ar-XB/bundle.js.map +1 -1
  312. package/amd/resources/nls/bg/bundle.js.map +1 -1
  313. package/amd/resources/nls/bs/bundle.js.map +1 -1
  314. package/amd/resources/nls/bs-Cyrl/bundle.js.map +1 -1
  315. package/amd/resources/nls/bundle.js.map +1 -1
  316. package/amd/resources/nls/cs/bundle.js.map +1 -1
  317. package/amd/resources/nls/da/bundle.js.map +1 -1
  318. package/amd/resources/nls/de/bundle.js.map +1 -1
  319. package/amd/resources/nls/el/bundle.js.map +1 -1
  320. package/amd/resources/nls/en/bundle.js.map +1 -1
  321. package/amd/resources/nls/en-XA/bundle.js.map +1 -1
  322. package/amd/resources/nls/en-XC/bundle.js.map +1 -1
  323. package/amd/resources/nls/es/bundle.js.map +1 -1
  324. package/amd/resources/nls/et/bundle.js.map +1 -1
  325. package/amd/resources/nls/fi/bundle.js.map +1 -1
  326. package/amd/resources/nls/fr/bundle.js.map +1 -1
  327. package/amd/resources/nls/fr-CA/bundle.js.map +1 -1
  328. package/amd/resources/nls/he/bundle.js.map +1 -1
  329. package/amd/resources/nls/hr/bundle.js.map +1 -1
  330. package/amd/resources/nls/hu/bundle.js.map +1 -1
  331. package/amd/resources/nls/is/bundle.js.map +1 -1
  332. package/amd/resources/nls/it/bundle.js.map +1 -1
  333. package/amd/resources/nls/ja/bundle.js.map +1 -1
  334. package/amd/resources/nls/ko/bundle.js.map +1 -1
  335. package/amd/resources/nls/lt/bundle.js.map +1 -1
  336. package/amd/resources/nls/lv/bundle.js.map +1 -1
  337. package/amd/resources/nls/ms/bundle.js.map +1 -1
  338. package/amd/resources/nls/nl/bundle.js.map +1 -1
  339. package/amd/resources/nls/no/bundle.js.map +1 -1
  340. package/amd/resources/nls/pl/bundle.js.map +1 -1
  341. package/amd/resources/nls/pt/bundle.js.map +1 -1
  342. package/amd/resources/nls/pt-PT/bundle.js.map +1 -1
  343. package/amd/resources/nls/ro/bundle.js.map +1 -1
  344. package/amd/resources/nls/ru/bundle.js.map +1 -1
  345. package/amd/resources/nls/sk/bundle.js.map +1 -1
  346. package/amd/resources/nls/sl/bundle.js.map +1 -1
  347. package/amd/resources/nls/sr/bundle.js.map +1 -1
  348. package/amd/resources/nls/sr-Latn/bundle.js.map +1 -1
  349. package/amd/resources/nls/sv/bundle.js.map +1 -1
  350. package/amd/resources/nls/th/bundle.js.map +1 -1
  351. package/amd/resources/nls/tr/bundle.js.map +1 -1
  352. package/amd/resources/nls/uk/bundle.js.map +1 -1
  353. package/amd/resources/nls/vi/bundle.js.map +1 -1
  354. package/amd/resources/nls/zh-Hans/bundle.js.map +1 -1
  355. package/amd/resources/nls/zh-Hant/bundle.js.map +1 -1
  356. package/amd/{stringUtils-69c2004a.js → stringUtils-432c5155.js} +1 -1
  357. package/amd/{stringUtils-69c2004a.js.map → stringUtils-432c5155.js.map} +1 -1
  358. package/amd/{testHelpers-489b1b68.js → testHelpers-ea3899da.js} +1 -1
  359. package/amd/{testHelpers-489b1b68.js.map → testHelpers-ea3899da.js.map} +1 -1
  360. package/amd/{tslib.es6-160e0dcc.js → tslib.es6-6a195797.js} +1 -1
  361. package/amd/{tslib.es6-160e0dcc.js.map → tslib.es6-6a195797.js.map} +1 -1
  362. package/amd/useAnimation-5d80cd95.js +2 -0
  363. package/amd/{useAnimation-37919fbc.js.map → useAnimation-5d80cd95.js.map} +1 -1
  364. package/amd/{useFocusWithin-14403a4b.js → useFocusWithin-0a53949e.js} +1 -1
  365. package/amd/{useFocusWithin-14403a4b.js.map → useFocusWithin-0a53949e.js.map} +1 -1
  366. package/amd/{useSingleSelection-b31818e5.js → useSingleSelection-00ac27f8.js} +1 -1
  367. package/amd/{useSingleSelection-b31818e5.js.map → useSingleSelection-00ac27f8.js.map} +1 -1
  368. package/amd/utils/PRIVATE_clientHints.js +1 -1
  369. package/amd/utils/PRIVATE_collectionUtils.js.map +1 -1
  370. package/amd/utils/PRIVATE_meterUtils.js.map +1 -1
  371. package/amd/utils/PRIVATE_tabbableUtils.js +1 -1
  372. package/amd/utils/PRIVATE_tabbableUtils.js.map +1 -1
  373. package/amd/utils/UNSAFE_classNames.js +1 -1
  374. package/amd/utils/UNSAFE_componentUtils.js +1 -1
  375. package/amd/utils/UNSAFE_componentUtils.js.map +1 -1
  376. package/amd/utils/UNSAFE_filePickerUtils.js.map +1 -1
  377. package/amd/utils/UNSAFE_interpolations/boxalignment.css +15 -15
  378. package/amd/utils/UNSAFE_interpolations/boxalignment.js +1 -1
  379. package/amd/utils/UNSAFE_interpolations/boxalignment.js.map +1 -1
  380. package/amd/utils/UNSAFE_interpolations/dimensions.js +1 -1
  381. package/amd/utils/UNSAFE_interpolations/flexbox.css +7 -7
  382. package/amd/utils/UNSAFE_interpolations/flexbox.js +1 -1
  383. package/amd/utils/UNSAFE_interpolations/flexitem.css +7 -7
  384. package/amd/utils/UNSAFE_interpolations/flexitem.js +1 -1
  385. package/amd/utils/UNSAFE_interpolations/padding.js.map +1 -1
  386. package/amd/utils/UNSAFE_interpolations/text.css +3 -3
  387. package/amd/utils/UNSAFE_interpolations/text.js +1 -1
  388. package/amd/utils/UNSAFE_interpolations/text.js.map +1 -1
  389. package/amd/utils/UNSAFE_lengthFilter.js.map +1 -1
  390. package/amd/utils/UNSAFE_logger.js +1 -1
  391. package/amd/utils/UNSAFE_mergeInterpolations.js +1 -1
  392. package/amd/utils/UNSAFE_mergeInterpolations.js.map +1 -1
  393. package/amd/utils/UNSAFE_mergeProps.js +1 -1
  394. package/amd/utils/UNSAFE_mergeProps.js.map +1 -1
  395. package/amd/utils/UNSAFE_size.js.map +1 -1
  396. package/amd/utils/UNSAFE_stringUtils.js +1 -1
  397. package/amd/utils/UNSAFE_units.js +1 -1
  398. package/amd/utils/UNSAFE_units.js.map +1 -1
  399. package/cjs/{Badge-f61793e1.js → Badge-1e0540c9.js} +16 -16
  400. package/cjs/{Badge-f61793e1.js.map → Badge-1e0540c9.js.map} +1 -1
  401. package/cjs/{BaseButton-e4179f8d.js → BaseButton-581a9d1a.js} +20 -20
  402. package/cjs/{BaseButton-e4179f8d.js.map → BaseButton-581a9d1a.js.map} +1 -1
  403. package/cjs/{Button-80d5f5c7.js → Button-eaff99de.js} +13 -13
  404. package/cjs/{Button-80d5f5c7.js.map → Button-eaff99de.js.map} +1 -1
  405. package/cjs/{Chip-fc9ac3bc.js → Chip-b83161eb.js} +10 -10
  406. package/cjs/{Chip-fc9ac3bc.js.map → Chip-b83161eb.js.map} +1 -1
  407. package/cjs/{ClearIcon-a15c2a32.js → ClearIcon-06f34113.js} +3 -3
  408. package/cjs/{ClearIcon-a15c2a32.js.map → ClearIcon-06f34113.js.map} +1 -1
  409. package/cjs/{Collection-7fa87cc3.js → Collection-a47275c8.js} +2 -2
  410. package/cjs/{Collection-7fa87cc3.js.map → Collection-a47275c8.js.map} +1 -1
  411. package/cjs/{ComponentMessage-1958699b.js → ComponentMessage-fb5ce132.js} +8 -8
  412. package/cjs/{ComponentMessage-1958699b.js.map → ComponentMessage-fb5ce132.js.map} +1 -1
  413. package/cjs/{ComponentMessageContainer-f36a4c6d.js → ComponentMessageContainer-e357f6b8.js} +5 -5
  414. package/cjs/{ComponentMessageContainer-f36a4c6d.js.map → ComponentMessageContainer-e357f6b8.js.map} +1 -1
  415. package/cjs/{Divider-eae649cf.js → Divider-597985d5.js} +3 -3
  416. package/cjs/{Divider-eae649cf.js.map → Divider-597985d5.js.map} +1 -1
  417. package/cjs/{FilePicker-b2148f78.js → FilePicker-cbbd9ce6.js} +14 -14
  418. package/cjs/{FilePicker-b2148f78.js.map → FilePicker-cbbd9ce6.js.map} +1 -1
  419. package/cjs/{Flex-7659ef16.js → Flex-0344fce4.js} +8 -8
  420. package/cjs/{Flex-7659ef16.js.map → Flex-0344fce4.js.map} +1 -1
  421. package/cjs/{Floating-251fa051.js → Floating-a94d10bd.js} +3 -3
  422. package/cjs/{Floating-251fa051.js.map → Floating-a94d10bd.js.map} +1 -1
  423. package/cjs/{FocusTrap-2afd150b.js → FocusTrap-f0a108fd.js} +5 -5
  424. package/cjs/{FocusTrap-2afd150b.js.map → FocusTrap-f0a108fd.js.map} +1 -1
  425. package/cjs/{FormControlUtils-a41c91d1.js → FormControlUtils-56732174.js} +5 -5
  426. package/cjs/{FormControlUtils-a41c91d1.js.map → FormControlUtils-56732174.js.map} +1 -1
  427. package/cjs/{Heading-e76fb436.js → Heading-174b1bec.js} +13 -13
  428. package/cjs/{Heading-e76fb436.js.map → Heading-174b1bec.js.map} +1 -1
  429. package/cjs/{HiddenAccessible-58c68df1.js → HiddenAccessible-7e955a3a.js} +3 -3
  430. package/cjs/{HiddenAccessible-58c68df1.js.map → HiddenAccessible-7e955a3a.js.map} +1 -1
  431. package/cjs/{HighlightText-6fb431e3.js → HighlightText-1bad83fc.js} +3 -3
  432. package/cjs/{HighlightText-6fb431e3.js.map → HighlightText-1bad83fc.js.map} +1 -1
  433. package/cjs/{Icon-c3ff0a26.js → Icon-c73bc4c2.js} +25 -25
  434. package/cjs/{Icon-c3ff0a26.js.map → Icon-c73bc4c2.js.map} +1 -1
  435. package/cjs/{Indexer-d8a567cb.js → Indexer-f1d2ac01.js} +16 -16
  436. package/cjs/{Indexer-d8a567cb.js.map → Indexer-f1d2ac01.js.map} +1 -1
  437. package/cjs/{InlineHelpSource-edb7b903.js → InlineHelpSource-ecacd3bc.js} +3 -3
  438. package/cjs/{InlineHelpSource-edb7b903.js.map → InlineHelpSource-ecacd3bc.js.map} +1 -1
  439. package/cjs/{Link-62008553.js → Link-09bbaed7.js} +8 -8
  440. package/cjs/{Link-62008553.js.map → Link-09bbaed7.js.map} +1 -1
  441. package/cjs/{List-8a8c36d1.js → List-d1567daf.js} +23 -23
  442. package/cjs/{List-8a8c36d1.js.map → List-d1567daf.js.map} +1 -1
  443. package/cjs/{ListItemTextLayout-b230d843.js → ListItemTextLayout-76eeda3f.js} +13 -13
  444. package/cjs/{ListItemTextLayout-b230d843.js.map → ListItemTextLayout-76eeda3f.js.map} +1 -1
  445. package/cjs/{ListView-5e713361.js → ListView-40d724ec.js} +3 -3
  446. package/cjs/{ListView-5e713361.js.map → ListView-40d724ec.js.map} +1 -1
  447. package/cjs/{LoadMoreCollection-1bb9db01.js → LoadMoreCollection-14523c73.js} +3 -3
  448. package/cjs/{LoadMoreCollection-1bb9db01.js.map → LoadMoreCollection-14523c73.js.map} +1 -1
  449. package/cjs/{Menu-2915ad8c.js → Menu-b4cc26fb.js} +6 -6
  450. package/cjs/{Menu-2915ad8c.js.map → Menu-b4cc26fb.js.map} +1 -1
  451. package/cjs/{MenuDivider-154250cf.js → MenuDivider-35db419f.js} +4 -4
  452. package/cjs/{MenuDivider-154250cf.js.map → MenuDivider-35db419f.js.map} +1 -1
  453. package/cjs/{MenuItem-5c1a85c1.js → MenuItem-dc2c4810.js} +19 -19
  454. package/cjs/{MenuItem-5c1a85c1.js.map → MenuItem-dc2c4810.js.map} +1 -1
  455. package/cjs/{Message.types-ad6e8d56.js → Message.types-8624e4a6.js} +2 -2
  456. package/cjs/{Message.types-ad6e8d56.js.map → Message.types-8624e4a6.js.map} +1 -1
  457. package/cjs/{MessageCloseButton-08246e28.js → MessageCloseButton-1ff27ab8.js} +9 -9
  458. package/cjs/{MessageCloseButton-08246e28.js.map → MessageCloseButton-1ff27ab8.js.map} +1 -1
  459. package/cjs/{MessageDetail-c92ceb2a.js → MessageDetail-beb184ac.js} +7 -7
  460. package/cjs/{MessageDetail-c92ceb2a.js.map → MessageDetail-beb184ac.js.map} +1 -1
  461. package/cjs/{MessageFormattingUtils-1f68871c.js → MessageFormattingUtils-ed961138.js} +4 -4
  462. package/cjs/{MessageFormattingUtils-1f68871c.js.map → MessageFormattingUtils-ed961138.js.map} +1 -1
  463. package/cjs/{MessageLayer-7f30bba4.js → MessageLayer-d686604f.js} +11 -11
  464. package/cjs/{MessageLayer-7f30bba4.js.map → MessageLayer-d686604f.js.map} +1 -1
  465. package/cjs/{MessageStartIcon-17c99728.js → MessageStartIcon-b140563c.js} +11 -11
  466. package/cjs/{MessageStartIcon-17c99728.js.map → MessageStartIcon-b140563c.js.map} +1 -1
  467. package/cjs/{MessageSummary-1c9ab0fc.js → MessageSummary-55bf8ae4.js} +7 -7
  468. package/cjs/{MessageSummary-1c9ab0fc.js.map → MessageSummary-55bf8ae4.js.map} +1 -1
  469. package/cjs/{MessageTimestamp-04882f16.js → MessageTimestamp-dc013e2e.js} +5 -5
  470. package/cjs/{MessageTimestamp-04882f16.js.map → MessageTimestamp-dc013e2e.js.map} +1 -1
  471. package/cjs/{MessageToast-60313577.js → MessageToast-95059819.js} +9 -9
  472. package/cjs/{MessageToast-60313577.js.map → MessageToast-95059819.js.map} +1 -1
  473. package/cjs/{MessageUtils-a7250ec1.js → MessageUtils-345912e5.js} +3 -3
  474. package/cjs/{MessageUtils-a7250ec1.js.map → MessageUtils-345912e5.js.map} +1 -1
  475. package/cjs/{MessagesManager-45f95bb6.js → MessagesManager-e98104fa.js} +4 -4
  476. package/cjs/{MessagesManager-45f95bb6.js.map → MessagesManager-e98104fa.js.map} +1 -1
  477. package/cjs/{MeterCircle-61fe01a1.js → MeterCircle-f5b897e0.js} +50 -50
  478. package/cjs/{MeterCircle-61fe01a1.js.map → MeterCircle-f5b897e0.js.map} +1 -1
  479. package/cjs/{Modal-7a2d04b3.js → Modal-d06e1bf2.js} +6 -6
  480. package/cjs/{Modal-7a2d04b3.js.map → Modal-d06e1bf2.js.map} +1 -1
  481. package/cjs/{NumberInputText-6897317d.js → NumberInputText-db992384.js} +7 -7
  482. package/cjs/{NumberInputText-6897317d.js.map → NumberInputText-db992384.js.map} +1 -1
  483. package/cjs/PRIVATE_Collection.js +2 -2
  484. package/cjs/PRIVATE_List.js +23 -23
  485. package/cjs/PRIVATE_Message.js +41 -41
  486. package/cjs/PRIVATE_Message.js.map +1 -1
  487. package/cjs/PRIVATE_MessageLayer.js +12 -12
  488. package/cjs/PRIVATE_Meter.js +2 -2
  489. package/cjs/PRIVATE_SelectCommon.js +54 -54
  490. package/cjs/PRIVATE_SelectCommon.js.map +1 -1
  491. package/cjs/PRIVATE_TransitionGroup.js +1 -1
  492. package/cjs/PRIVATE_VirtualizedCollection.js +3 -3
  493. package/cjs/{ReadonlyTextFieldInput-3ac8c6d6.js → ReadonlyTextFieldInput-4b12e38d.js} +13 -13
  494. package/cjs/{ReadonlyTextFieldInput-3ac8c6d6.js.map → ReadonlyTextFieldInput-4b12e38d.js.map} +1 -1
  495. package/cjs/{SelectMenuItem-95c47961.js → SelectMenuItem-48146353.js} +5 -5
  496. package/cjs/{SelectMenuItem-95c47961.js.map → SelectMenuItem-48146353.js.map} +1 -1
  497. package/cjs/{SelectMultiple-e2f66ce6.js → SelectMultiple-d0a5bb4f.js} +8 -8
  498. package/cjs/{SelectMultiple-e2f66ce6.js.map → SelectMultiple-d0a5bb4f.js.map} +1 -1
  499. package/cjs/{SelectSingle-ff05e359.js → SelectSingle-5b98e77a.js} +4 -4
  500. package/cjs/{SelectSingle-ff05e359.js.map → SelectSingle-5b98e77a.js.map} +1 -1
  501. package/cjs/{Skeleton-3face45d.js → Skeleton-2bf357ee.js} +5 -5
  502. package/cjs/{Skeleton-3face45d.js.map → Skeleton-2bf357ee.js.map} +1 -1
  503. package/cjs/{Spacer-7d939164.js → Spacer-32db0f15.js} +4 -4
  504. package/cjs/{Spacer-7d939164.js.map → Spacer-32db0f15.js.map} +1 -1
  505. package/cjs/{SplitMenuButton-47a3071a.js → SplitMenuButton-da7db765.js} +14 -14
  506. package/cjs/{SplitMenuButton-47a3071a.js.map → SplitMenuButton-da7db765.js.map} +1 -1
  507. package/cjs/{Text-32cc23bc.js → Text-c17303e3.js} +28 -28
  508. package/cjs/{Text-32cc23bc.js.map → Text-c17303e3.js.map} +1 -1
  509. package/cjs/{TextArea-38c731e7.js → TextArea-9143cb46.js} +8 -8
  510. package/cjs/{TextArea-38c731e7.js.map → TextArea-9143cb46.js.map} +1 -1
  511. package/cjs/{TextAreaAutosize-327a3812.js → TextAreaAutosize-2a0f15a7.js} +5 -5
  512. package/cjs/{TextAreaAutosize-327a3812.js.map → TextAreaAutosize-2a0f15a7.js.map} +1 -1
  513. package/cjs/{TextFieldInput-d5b2244a.js → TextFieldInput-7c9ea713.js} +33 -33
  514. package/cjs/{TextFieldInput-d5b2244a.js.map → TextFieldInput-7c9ea713.js.map} +1 -1
  515. package/cjs/UNSAFE_AspectRatio.js +8 -8
  516. package/cjs/UNSAFE_AspectRatio.js.map +1 -1
  517. package/cjs/UNSAFE_Avatar.js +11 -11
  518. package/cjs/UNSAFE_Avatar.js.map +1 -1
  519. package/cjs/UNSAFE_Badge.js +3 -3
  520. package/cjs/UNSAFE_BaseButton.js +9 -9
  521. package/cjs/UNSAFE_Button.js +10 -10
  522. package/cjs/UNSAFE_Center.js +11 -11
  523. package/cjs/UNSAFE_Chip.js +3 -3
  524. package/cjs/UNSAFE_Collapsible.js +26 -26
  525. package/cjs/UNSAFE_Collapsible.js.map +1 -1
  526. package/cjs/UNSAFE_Collection.js +1 -1
  527. package/cjs/UNSAFE_ComponentMessage.js +33 -33
  528. package/cjs/UNSAFE_Divider.js +7 -7
  529. package/cjs/UNSAFE_EmptyList.js +1 -1
  530. package/cjs/UNSAFE_Environment.js +1 -1
  531. package/cjs/UNSAFE_FilePicker.js +14 -14
  532. package/cjs/UNSAFE_Flex.js +11 -11
  533. package/cjs/UNSAFE_Floating.js +3 -3
  534. package/cjs/UNSAFE_FocusTrap.js +6 -6
  535. package/cjs/UNSAFE_Grid.js +9 -9
  536. package/cjs/UNSAFE_Grid.js.map +1 -1
  537. package/cjs/UNSAFE_Heading.js +9 -9
  538. package/cjs/UNSAFE_HiddenAccessible.js +2 -2
  539. package/cjs/UNSAFE_HighlightText.js +2 -2
  540. package/cjs/UNSAFE_Icon.js +7 -7
  541. package/cjs/UNSAFE_Icons.js +8 -8
  542. package/cjs/UNSAFE_Indexer.js +16 -16
  543. package/cjs/UNSAFE_InputPassword.js +40 -40
  544. package/cjs/UNSAFE_InputText.js +39 -39
  545. package/cjs/UNSAFE_Label.js +16 -16
  546. package/cjs/UNSAFE_Label.js.map +1 -1
  547. package/cjs/UNSAFE_LabelValueLayout.js +20 -20
  548. package/cjs/UNSAFE_LabelValueLayout.js.map +1 -1
  549. package/cjs/UNSAFE_Layer.js +1 -1
  550. package/cjs/UNSAFE_Link.js +3 -3
  551. package/cjs/UNSAFE_ListItemLayout.js +10 -10
  552. package/cjs/UNSAFE_ListView.js +24 -24
  553. package/cjs/UNSAFE_LiveRegion.js +2 -2
  554. package/cjs/UNSAFE_LiveRegion.js.map +1 -1
  555. package/cjs/UNSAFE_LoadMoreCollection.js +3 -3
  556. package/cjs/UNSAFE_Menu.js +15 -15
  557. package/cjs/UNSAFE_MessageBanner.js +30 -30
  558. package/cjs/UNSAFE_MessageToast.js +33 -33
  559. package/cjs/UNSAFE_MeterBar.js +49 -49
  560. package/cjs/UNSAFE_MeterBar.js.map +1 -1
  561. package/cjs/UNSAFE_MeterCircle.js +7 -7
  562. package/cjs/UNSAFE_Modal.js +7 -7
  563. package/cjs/UNSAFE_NumberInputText.js +39 -39
  564. package/cjs/UNSAFE_PrefixSuffix.js +10 -10
  565. package/cjs/UNSAFE_PrefixSuffix.js.map +1 -1
  566. package/cjs/UNSAFE_ProgressBar.js +9 -9
  567. package/cjs/UNSAFE_ProgressBar.js.map +1 -1
  568. package/cjs/UNSAFE_ProgressCircle.js +9 -9
  569. package/cjs/UNSAFE_ProgressCircle.js.map +1 -1
  570. package/cjs/UNSAFE_RatingGauge.js +26 -26
  571. package/cjs/UNSAFE_RatingGauge.js.map +1 -1
  572. package/cjs/UNSAFE_SelectMultiple.js +47 -47
  573. package/cjs/UNSAFE_SelectSingle.js +46 -46
  574. package/cjs/UNSAFE_Selector.js +22 -22
  575. package/cjs/UNSAFE_Selector.js.map +1 -1
  576. package/cjs/UNSAFE_Skeleton.js +8 -8
  577. package/cjs/UNSAFE_Spacer.js +10 -10
  578. package/cjs/UNSAFE_SplitMenuButton.js +22 -22
  579. package/cjs/UNSAFE_Text.js +8 -8
  580. package/cjs/UNSAFE_TextArea.js +39 -39
  581. package/cjs/UNSAFE_TextAreaAutosize.js +40 -40
  582. package/cjs/UNSAFE_TextField.js +35 -35
  583. package/cjs/UNSAFE_TextField.js.map +1 -1
  584. package/cjs/UNSAFE_ThemedIcons.js +9 -9
  585. package/cjs/UNSAFE_UserAssistance.js +41 -41
  586. package/cjs/UNSAFE_UserAssistance.js.map +1 -1
  587. package/cjs/UNSAFE_View.js +9 -9
  588. package/cjs/UNSAFE_VirtualizedListView.js +24 -24
  589. package/cjs/UNSAFE_WindowOverlay.js +1 -1
  590. package/cjs/{VirtualizedCollection-5147e69b.js → VirtualizedCollection-711cec0c.js} +3 -3
  591. package/cjs/{VirtualizedCollection-5147e69b.js.map → VirtualizedCollection-711cec0c.js.map} +1 -1
  592. package/cjs/{VirtualizedListView-d7f4c559.js → VirtualizedListView-f5f75e14.js} +3 -3
  593. package/cjs/{VirtualizedListView-d7f4c559.js.map → VirtualizedListView-f5f75e14.js.map} +1 -1
  594. package/cjs/{_curry1-f2e1bbf5.js → _curry1-7cb69eef.js} +2 -2
  595. package/cjs/{_curry1-f2e1bbf5.js.map → _curry1-7cb69eef.js.map} +1 -1
  596. package/cjs/{_curry2-a3227fb1.js → _curry2-7f9f99a3.js} +3 -3
  597. package/cjs/{_curry2-a3227fb1.js.map → _curry2-7f9f99a3.js.map} +1 -1
  598. package/cjs/{_curry3-cbaae3c2.js → _curry3-b9a1c3c2.js} +4 -4
  599. package/cjs/{_curry3-cbaae3c2.js.map → _curry3-b9a1c3c2.js.map} +1 -1
  600. package/cjs/{_has-7e7a7416.js → _has-195d2d0c.js} +3 -3
  601. package/cjs/{_has-7e7a7416.js.map → _has-195d2d0c.js.map} +1 -1
  602. package/cjs/{classNames-b7d429e7.js → classNames-d6e0ded0.js} +2 -2
  603. package/cjs/{classNames-b7d429e7.js.map → classNames-d6e0ded0.js.map} +1 -1
  604. package/cjs/{clientHints-8f0e3c66.js → clientHints-a8929847.js} +2 -2
  605. package/cjs/{clientHints-8f0e3c66.js.map → clientHints-a8929847.js.map} +1 -1
  606. package/cjs/{flexbox-9cf3fc8f.js → flexbox-fd8f2621.js} +10 -10
  607. package/cjs/{flexbox-9cf3fc8f.js.map → flexbox-fd8f2621.js.map} +1 -1
  608. package/cjs/{flexitem-8300d390.js → flexitem-277e7f7e.js} +10 -10
  609. package/cjs/{flexitem-8300d390.js.map → flexitem-277e7f7e.js.map} +1 -1
  610. package/cjs/hooks/PRIVATE_useCollectionFocusRing.js +1 -1
  611. package/cjs/hooks/PRIVATE_useCurrentKey.js +1 -1
  612. package/cjs/hooks/PRIVATE_useDvtMeterEvents.js +6 -6
  613. package/cjs/hooks/PRIVATE_useItemAction.js +1 -1
  614. package/cjs/hooks/PRIVATE_useMessagesFocusManager.js +1 -1
  615. package/cjs/hooks/PRIVATE_useSelection.js +1 -1
  616. package/cjs/hooks/PRIVATE_useSingleSelection.js +2 -2
  617. package/cjs/hooks/PRIVATE_useTabbableModeSet.js +1 -1
  618. package/cjs/hooks/UNSAFE_useActionable.js +1 -1
  619. package/cjs/hooks/UNSAFE_useActive.js +1 -1
  620. package/cjs/hooks/UNSAFE_useAnimation.js +3 -3
  621. package/cjs/hooks/UNSAFE_useBreakpointValues.js +1 -1
  622. package/cjs/hooks/UNSAFE_useBreakpoints.js +1 -1
  623. package/cjs/hooks/UNSAFE_useClearIcon.js +1 -1
  624. package/cjs/hooks/UNSAFE_useColorScheme.js +1 -1
  625. package/cjs/hooks/UNSAFE_useContainerBreakpointValues.js +1 -1
  626. package/cjs/hooks/UNSAFE_useContainerBreakpoints.js +1 -1
  627. package/cjs/hooks/UNSAFE_useCurrentValueReducer.js +1 -1
  628. package/cjs/hooks/UNSAFE_useDebounce.js +1 -1
  629. package/cjs/hooks/UNSAFE_useFloating.js +2 -2
  630. package/cjs/hooks/UNSAFE_useFocus.js +1 -1
  631. package/cjs/hooks/UNSAFE_useFocusWithin.js +2 -2
  632. package/cjs/hooks/UNSAFE_useFocusableTextField.js +3 -3
  633. package/cjs/hooks/UNSAFE_useFormContext.js +1 -1
  634. package/cjs/hooks/UNSAFE_useFormFieldContext.js +1 -1
  635. package/cjs/hooks/UNSAFE_useFormVariantContext.js +1 -1
  636. package/cjs/hooks/UNSAFE_useHover.js +1 -1
  637. package/cjs/hooks/UNSAFE_useId.js +1 -1
  638. package/cjs/hooks/UNSAFE_useLengthFilter.js +1 -1
  639. package/cjs/hooks/UNSAFE_useLoadingIndicatorTimer.js +1 -1
  640. package/cjs/hooks/UNSAFE_useLongPress.js +1 -1
  641. package/cjs/hooks/UNSAFE_useMessagesContext.js +1 -1
  642. package/cjs/hooks/UNSAFE_useOutsideClick.js +1 -1
  643. package/cjs/hooks/UNSAFE_usePan.js +1 -1
  644. package/cjs/hooks/UNSAFE_usePrefixSuffix.js +2 -2
  645. package/cjs/hooks/UNSAFE_usePress.js +1 -1
  646. package/cjs/hooks/UNSAFE_useScale.js +1 -1
  647. package/cjs/hooks/UNSAFE_useSwipe.js +1 -1
  648. package/cjs/hooks/UNSAFE_useTabbableMode.js +1 -1
  649. package/cjs/hooks/UNSAFE_useTap.js +1 -1
  650. package/cjs/hooks/UNSAFE_useTextField.js +1 -1
  651. package/cjs/hooks/UNSAFE_useTextFieldInputHandlers.js +2 -2
  652. package/cjs/hooks/UNSAFE_useTheme.js +1 -1
  653. package/cjs/hooks/UNSAFE_useTimer.js +1 -1
  654. package/cjs/hooks/UNSAFE_useToggle.js +1 -1
  655. package/cjs/hooks/UNSAFE_useTooltip.js +10 -10
  656. package/cjs/hooks/UNSAFE_useTouch.js +1 -1
  657. package/cjs/hooks/UNSAFE_useTranslationBundle.js +1 -1
  658. package/cjs/hooks/UNSAFE_useUncontrolledState.js +1 -1
  659. package/cjs/hooks/UNSAFE_useUser.js +1 -1
  660. package/cjs/hooks/UNSAFE_useViewportIntersect.js +1 -1
  661. package/cjs/{index-c6d83b4f.js → index-0f97aeed.js} +3 -3
  662. package/cjs/{index-c6d83b4f.js.map → index-0f97aeed.js.map} +1 -1
  663. package/cjs/{index-7e594b9c.js → index-24d679ca.js} +2 -2
  664. package/cjs/{index-7e594b9c.js.map → index-24d679ca.js.map} +1 -1
  665. package/cjs/{index-0ba6ad6d.js → index-84ddc8f2.js} +3 -3
  666. package/cjs/{index-0ba6ad6d.js.map → index-84ddc8f2.js.map} +1 -1
  667. package/cjs/{keys-8c604c13.js → keys-9c77b124.js} +4 -4
  668. package/cjs/{keys-8c604c13.js.map → keys-9c77b124.js.map} +1 -1
  669. package/cjs/{listViewSelectionTests-4e18e8ba.js → listViewSelectionTests-9a641539.js} +4 -4
  670. package/cjs/{listViewSelectionTests-4e18e8ba.js.map → listViewSelectionTests-9a641539.js.map} +1 -1
  671. package/cjs/{listViewTabbableModeTests-20ce10c7.js → listViewTabbableModeTests-9a796286.js} +4 -4
  672. package/cjs/{listViewTabbableModeTests-20ce10c7.js.map → listViewTabbableModeTests-9a796286.js.map} +1 -1
  673. package/cjs/{listViewTestFixtures-11036d03.js → listViewTestFixtures-34db5497.js} +2 -2
  674. package/cjs/{listViewTestFixtures-11036d03.js.map → listViewTestFixtures-34db5497.js.map} +1 -1
  675. package/cjs/{menuTestsUtils-df374a04.js → menuTestsUtils-d25ea1f6.js} +2 -2
  676. package/cjs/{menuTestsUtils-df374a04.js.map → menuTestsUtils-d25ea1f6.js.map} +1 -1
  677. package/cjs/resources/nls/ar/bundle.js +1 -1
  678. package/cjs/resources/nls/ar-XB/bundle.js +1 -1
  679. package/cjs/resources/nls/bg/bundle.js +1 -1
  680. package/cjs/resources/nls/bs/bundle.js +1 -1
  681. package/cjs/resources/nls/bs-Cyrl/bundle.js +1 -1
  682. package/cjs/resources/nls/bundle.js +1 -1
  683. package/cjs/resources/nls/cs/bundle.js +1 -1
  684. package/cjs/resources/nls/da/bundle.js +1 -1
  685. package/cjs/resources/nls/de/bundle.js +1 -1
  686. package/cjs/resources/nls/el/bundle.js +1 -1
  687. package/cjs/resources/nls/en/bundle.js +1 -1
  688. package/cjs/resources/nls/en-XA/bundle.js +1 -1
  689. package/cjs/resources/nls/en-XC/bundle.js +1 -1
  690. package/cjs/resources/nls/es/bundle.js +1 -1
  691. package/cjs/resources/nls/et/bundle.js +1 -1
  692. package/cjs/resources/nls/fi/bundle.js +1 -1
  693. package/cjs/resources/nls/fr/bundle.js +1 -1
  694. package/cjs/resources/nls/fr-CA/bundle.js +1 -1
  695. package/cjs/resources/nls/he/bundle.js +1 -1
  696. package/cjs/resources/nls/hr/bundle.js +1 -1
  697. package/cjs/resources/nls/hu/bundle.js +1 -1
  698. package/cjs/resources/nls/is/bundle.js +1 -1
  699. package/cjs/resources/nls/it/bundle.js +1 -1
  700. package/cjs/resources/nls/ja/bundle.js +1 -1
  701. package/cjs/resources/nls/ko/bundle.js +1 -1
  702. package/cjs/resources/nls/lt/bundle.js +1 -1
  703. package/cjs/resources/nls/lv/bundle.js +1 -1
  704. package/cjs/resources/nls/ms/bundle.js +1 -1
  705. package/cjs/resources/nls/nl/bundle.js +1 -1
  706. package/cjs/resources/nls/no/bundle.js +1 -1
  707. package/cjs/resources/nls/pl/bundle.js +1 -1
  708. package/cjs/resources/nls/pt/bundle.js +1 -1
  709. package/cjs/resources/nls/pt-PT/bundle.js +1 -1
  710. package/cjs/resources/nls/ro/bundle.js +1 -1
  711. package/cjs/resources/nls/ru/bundle.js +1 -1
  712. package/cjs/resources/nls/sk/bundle.js +1 -1
  713. package/cjs/resources/nls/sl/bundle.js +1 -1
  714. package/cjs/resources/nls/sr/bundle.js +1 -1
  715. package/cjs/resources/nls/sr-Latn/bundle.js +1 -1
  716. package/cjs/resources/nls/supportedLocales.js +1 -1
  717. package/cjs/resources/nls/sv/bundle.js +1 -1
  718. package/cjs/resources/nls/th/bundle.js +1 -1
  719. package/cjs/resources/nls/tr/bundle.js +1 -1
  720. package/cjs/resources/nls/uk/bundle.js +1 -1
  721. package/cjs/resources/nls/vi/bundle.js +1 -1
  722. package/cjs/resources/nls/zh-Hans/bundle.js +1 -1
  723. package/cjs/resources/nls/zh-Hant/bundle.js +1 -1
  724. package/cjs/{stringUtils-358c7304.js → stringUtils-e3af1a05.js} +2 -2
  725. package/cjs/{stringUtils-358c7304.js.map → stringUtils-e3af1a05.js.map} +1 -1
  726. package/cjs/{testHelpers-aaac93bf.js → testHelpers-e0f9c2f8.js} +2 -2
  727. package/cjs/{testHelpers-aaac93bf.js.map → testHelpers-e0f9c2f8.js.map} +1 -1
  728. package/cjs/translationBundle.js +1 -1
  729. package/cjs/{tslib.es6-ec9a32bf.js → tslib.es6-07720b96.js} +2 -2
  730. package/cjs/{tslib.es6-ec9a32bf.js.map → tslib.es6-07720b96.js.map} +1 -1
  731. package/cjs/{useAnimation-2398240d.js → useAnimation-f0d0ff34.js} +3 -3
  732. package/cjs/{useAnimation-2398240d.js.map → useAnimation-f0d0ff34.js.map} +1 -1
  733. package/cjs/{useFocusWithin-552bf7e5.js → useFocusWithin-03b9d458.js} +2 -2
  734. package/cjs/{useFocusWithin-552bf7e5.js.map → useFocusWithin-03b9d458.js.map} +1 -1
  735. package/cjs/{useSingleSelection-c4e642d7.js → useSingleSelection-28238d87.js} +2 -2
  736. package/cjs/{useSingleSelection-c4e642d7.js.map → useSingleSelection-28238d87.js.map} +1 -1
  737. package/cjs/utils/PRIVATE_clientHints.js +2 -2
  738. package/cjs/utils/PRIVATE_collectionUtils.js +1 -1
  739. package/cjs/utils/PRIVATE_dvtTestUtils.js +1 -1
  740. package/cjs/utils/PRIVATE_floatingUtils.js +1 -1
  741. package/cjs/utils/PRIVATE_meterUtils.js +1 -1
  742. package/cjs/utils/PRIVATE_refUtils.js +1 -1
  743. package/cjs/utils/PRIVATE_tabbableUtils.js +4 -4
  744. package/cjs/utils/PRIVATE_timer.js +1 -1
  745. package/cjs/utils/UNSAFE_arrayUtils.js +1 -1
  746. package/cjs/utils/UNSAFE_attributeUtils.js +1 -1
  747. package/cjs/utils/UNSAFE_classNames.js +2 -2
  748. package/cjs/utils/UNSAFE_componentUtils.js +1 -1
  749. package/cjs/utils/UNSAFE_dataProvider.js +1 -1
  750. package/cjs/utils/UNSAFE_filePickerUtils.js +1 -1
  751. package/cjs/utils/UNSAFE_getLocale.js +1 -1
  752. package/cjs/utils/UNSAFE_interpolations/aria.js +1 -1
  753. package/cjs/utils/UNSAFE_interpolations/borders.js +1 -1
  754. package/cjs/utils/UNSAFE_interpolations/boxalignment.js +19 -19
  755. package/cjs/utils/UNSAFE_interpolations/boxalignment.js.map +1 -1
  756. package/cjs/utils/UNSAFE_interpolations/colors.js +1 -1
  757. package/cjs/utils/UNSAFE_interpolations/dimensions.js +2 -2
  758. package/cjs/utils/UNSAFE_interpolations/flexbox.js +5 -5
  759. package/cjs/utils/UNSAFE_interpolations/flexitem.js +5 -5
  760. package/cjs/utils/UNSAFE_interpolations/grid.js +1 -1
  761. package/cjs/utils/UNSAFE_interpolations/griditem.js +1 -1
  762. package/cjs/utils/UNSAFE_interpolations/padding.js +1 -1
  763. package/cjs/utils/UNSAFE_interpolations/text.js +7 -7
  764. package/cjs/utils/UNSAFE_interpolations/text.js.map +1 -1
  765. package/cjs/utils/UNSAFE_keys.js +1 -1
  766. package/cjs/utils/UNSAFE_lengthFilter.js +1 -1
  767. package/cjs/utils/UNSAFE_logger.js +3 -3
  768. package/cjs/utils/UNSAFE_matchTranslationBundle.js +1 -1
  769. package/cjs/utils/UNSAFE_mergeInterpolations.js +6 -6
  770. package/cjs/utils/UNSAFE_mergeProps.js +1 -1
  771. package/cjs/utils/UNSAFE_meterTypes.js +1 -1
  772. package/cjs/utils/UNSAFE_roles.js +1 -1
  773. package/cjs/utils/UNSAFE_selectUtils.js +1 -1
  774. package/cjs/utils/UNSAFE_size.js +1 -1
  775. package/cjs/utils/UNSAFE_soundUtils.js +1 -1
  776. package/cjs/utils/UNSAFE_stringUtils.js +2 -2
  777. package/cjs/utils/UNSAFE_typeUtils.js +1 -1
  778. package/cjs/utils/UNSAFE_units.js +2 -2
  779. package/cjs/utils/UNSAFE_valueUpdateDetail.js +1 -1
  780. package/es/{ClearIcon-39077b15.js → ClearIcon-135e7b3f.js} +3 -3
  781. package/es/{ClearIcon-39077b15.js.map → ClearIcon-135e7b3f.js.map} +1 -1
  782. package/es/{LoadMoreCollection-c9f4fe52.js → LoadMoreCollection-f7922120.js} +2 -2
  783. package/es/{LoadMoreCollection-c9f4fe52.js.map → LoadMoreCollection-f7922120.js.map} +1 -1
  784. package/es/PRIVATE_Collection.js +1 -1
  785. package/es/PRIVATE_List.css +15 -15
  786. package/es/PRIVATE_List.js +24 -24
  787. package/es/PRIVATE_List.js.map +1 -1
  788. package/es/PRIVATE_Message.css +27 -27
  789. package/es/PRIVATE_Message.js +35 -35
  790. package/es/PRIVATE_Message.js.map +1 -1
  791. package/es/PRIVATE_MessageLayer.css +7 -7
  792. package/es/PRIVATE_MessageLayer.js +14 -14
  793. package/es/PRIVATE_MessageLayer.js.map +1 -1
  794. package/es/PRIVATE_Meter.js +2 -2
  795. package/es/PRIVATE_SelectCommon.css +13 -13
  796. package/es/PRIVATE_SelectCommon.js +22 -22
  797. package/es/PRIVATE_SelectCommon.js.map +1 -1
  798. package/es/PRIVATE_TransitionGroup.js +1 -1
  799. package/es/PRIVATE_VirtualizedCollection.js +1 -1
  800. package/es/UNSAFE_AspectRatio.css +1 -1
  801. package/es/UNSAFE_AspectRatio.js +7 -7
  802. package/es/UNSAFE_AspectRatio.js.map +1 -1
  803. package/es/UNSAFE_Avatar.css +8 -8
  804. package/es/UNSAFE_Avatar.js +10 -10
  805. package/es/UNSAFE_Avatar.js.map +1 -1
  806. package/es/UNSAFE_Badge.css +13 -13
  807. package/es/UNSAFE_Badge.js +14 -14
  808. package/es/UNSAFE_Badge.js.map +1 -1
  809. package/es/UNSAFE_BaseButton.css +15 -15
  810. package/es/UNSAFE_BaseButton.js +21 -21
  811. package/es/UNSAFE_BaseButton.js.map +1 -1
  812. package/es/UNSAFE_Button.css +8 -8
  813. package/es/UNSAFE_Button.js +14 -14
  814. package/es/UNSAFE_Button.js.map +1 -1
  815. package/es/UNSAFE_Center.js +7 -7
  816. package/es/UNSAFE_Chip.css +7 -7
  817. package/es/UNSAFE_Chip.js +8 -8
  818. package/es/UNSAFE_Chip.js.map +1 -1
  819. package/es/UNSAFE_Collapsible.css +8 -8
  820. package/es/UNSAFE_Collapsible.js +16 -16
  821. package/es/UNSAFE_Collapsible.js.map +1 -1
  822. package/es/UNSAFE_Collection.js +1 -1
  823. package/es/UNSAFE_ComponentMessage.css +2 -2
  824. package/es/UNSAFE_ComponentMessage.js +10 -10
  825. package/es/UNSAFE_ComponentMessage.js.map +1 -1
  826. package/es/UNSAFE_Divider.css +1 -1
  827. package/es/UNSAFE_Divider.js +6 -6
  828. package/es/UNSAFE_EmptyList.js +1 -1
  829. package/es/UNSAFE_Environment.js +1 -1
  830. package/es/UNSAFE_FilePicker.css +6 -6
  831. package/es/UNSAFE_FilePicker.js +13 -13
  832. package/es/UNSAFE_FilePicker.js.map +1 -1
  833. package/es/UNSAFE_Flex.css +2 -2
  834. package/es/UNSAFE_Flex.js +9 -9
  835. package/es/UNSAFE_Floating.js +2 -2
  836. package/es/UNSAFE_FocusTrap.css +2 -2
  837. package/es/UNSAFE_FocusTrap.js +6 -6
  838. package/es/UNSAFE_Grid.css +1 -1
  839. package/es/UNSAFE_Grid.js +8 -8
  840. package/es/UNSAFE_Grid.js.map +1 -1
  841. package/es/UNSAFE_Heading.css +9 -9
  842. package/es/UNSAFE_Heading.js +16 -16
  843. package/es/UNSAFE_Heading.js.map +1 -1
  844. package/es/UNSAFE_HiddenAccessible.css +1 -1
  845. package/es/UNSAFE_HiddenAccessible.js +2 -2
  846. package/es/UNSAFE_HiddenAccessible.js.map +1 -1
  847. package/es/UNSAFE_HighlightText.css +1 -1
  848. package/es/UNSAFE_HighlightText.js +2 -2
  849. package/es/UNSAFE_HighlightText.js.map +1 -1
  850. package/es/UNSAFE_Icon.css +21 -21
  851. package/es/UNSAFE_Icon.js +24 -24
  852. package/es/UNSAFE_Icon.js.map +1 -1
  853. package/es/UNSAFE_Icons.js +3 -3
  854. package/es/UNSAFE_Indexer.css +7 -7
  855. package/es/UNSAFE_Indexer.js +15 -15
  856. package/es/UNSAFE_Indexer.js.map +1 -1
  857. package/es/UNSAFE_InputPassword.css +1 -1
  858. package/es/UNSAFE_InputPassword.js +10 -10
  859. package/es/UNSAFE_InputText.css +1 -1
  860. package/es/UNSAFE_InputText.js +9 -9
  861. package/es/UNSAFE_Label.css +13 -13
  862. package/es/UNSAFE_Label.js +15 -15
  863. package/es/UNSAFE_Label.js.map +1 -1
  864. package/es/UNSAFE_LabelValueLayout.css +9 -9
  865. package/es/UNSAFE_LabelValueLayout.js +16 -16
  866. package/es/UNSAFE_LabelValueLayout.js.map +1 -1
  867. package/es/UNSAFE_Layer.js +1 -1
  868. package/es/UNSAFE_Link.css +5 -5
  869. package/es/UNSAFE_Link.js +6 -6
  870. package/es/UNSAFE_Link.js.map +1 -1
  871. package/es/UNSAFE_ListItemLayout.css +9 -9
  872. package/es/UNSAFE_ListItemLayout.js +16 -16
  873. package/es/UNSAFE_ListItemLayout.js.map +1 -1
  874. package/es/UNSAFE_ListView.js +9 -9
  875. package/es/UNSAFE_LiveRegion.css +1 -1
  876. package/es/UNSAFE_LiveRegion.js +2 -2
  877. package/es/UNSAFE_LiveRegion.js.map +1 -1
  878. package/es/UNSAFE_LoadMoreCollection.js +2 -2
  879. package/es/UNSAFE_Menu.css +17 -17
  880. package/es/UNSAFE_Menu.js +24 -24
  881. package/es/UNSAFE_Menu.js.map +1 -1
  882. package/es/UNSAFE_MessageBanner.js +8 -8
  883. package/es/UNSAFE_MessageToast.css +1 -1
  884. package/es/UNSAFE_MessageToast.js +9 -9
  885. package/es/UNSAFE_MeterBar.css +43 -43
  886. package/es/UNSAFE_MeterBar.js +46 -46
  887. package/es/UNSAFE_MeterBar.js.map +1 -1
  888. package/es/UNSAFE_MeterCircle.css +46 -46
  889. package/es/UNSAFE_MeterCircle.js +49 -49
  890. package/es/UNSAFE_MeterCircle.js.map +1 -1
  891. package/es/UNSAFE_Modal.css +3 -3
  892. package/es/UNSAFE_Modal.js +7 -7
  893. package/es/UNSAFE_NumberInputText.js +8 -8
  894. package/es/UNSAFE_PrefixSuffix.css +8 -8
  895. package/es/UNSAFE_PrefixSuffix.js +9 -9
  896. package/es/UNSAFE_PrefixSuffix.js.map +1 -1
  897. package/es/UNSAFE_ProgressBar.css +6 -6
  898. package/es/UNSAFE_ProgressBar.js +8 -8
  899. package/es/UNSAFE_ProgressBar.js.map +1 -1
  900. package/es/UNSAFE_ProgressCircle.css +6 -6
  901. package/es/UNSAFE_ProgressCircle.js +8 -8
  902. package/es/UNSAFE_ProgressCircle.js.map +1 -1
  903. package/es/UNSAFE_RatingGauge.css +20 -20
  904. package/es/UNSAFE_RatingGauge.js +23 -23
  905. package/es/UNSAFE_RatingGauge.js.map +1 -1
  906. package/es/UNSAFE_SelectMultiple.css +1 -1
  907. package/es/UNSAFE_SelectMultiple.js +10 -10
  908. package/es/UNSAFE_SelectMultiple.js.map +1 -1
  909. package/es/UNSAFE_SelectSingle.js +9 -9
  910. package/es/UNSAFE_Selector.css +5 -5
  911. package/es/UNSAFE_Selector.js +13 -13
  912. package/es/UNSAFE_Selector.js.map +1 -1
  913. package/es/UNSAFE_Skeleton.css +1 -1
  914. package/es/UNSAFE_Skeleton.js +7 -7
  915. package/es/UNSAFE_Spacer.js +7 -7
  916. package/es/UNSAFE_SplitMenuButton.css +5 -5
  917. package/es/UNSAFE_SplitMenuButton.js +12 -12
  918. package/es/UNSAFE_SplitMenuButton.js.map +1 -1
  919. package/es/UNSAFE_Text.css +25 -25
  920. package/es/UNSAFE_Text.js +31 -31
  921. package/es/UNSAFE_Text.js.map +1 -1
  922. package/es/UNSAFE_TextArea.css +3 -3
  923. package/es/UNSAFE_TextArea.js +11 -11
  924. package/es/UNSAFE_TextArea.js.map +1 -1
  925. package/es/UNSAFE_TextAreaAutosize.js +8 -8
  926. package/es/UNSAFE_TextField.css +58 -58
  927. package/es/UNSAFE_TextField.js +65 -65
  928. package/es/UNSAFE_TextField.js.map +1 -1
  929. package/es/UNSAFE_ThemedIcons.js +3 -3
  930. package/es/UNSAFE_UserAssistance.css +8 -8
  931. package/es/UNSAFE_UserAssistance.js +16 -16
  932. package/es/UNSAFE_UserAssistance.js.map +1 -1
  933. package/es/UNSAFE_View.js +7 -7
  934. package/es/UNSAFE_VirtualizedListView.js +9 -9
  935. package/es/UNSAFE_WindowOverlay.js +1 -1
  936. package/es/{_curry1-700b6208.js → _curry1-3c1ddbce.js} +2 -2
  937. package/es/{_curry1-700b6208.js.map → _curry1-3c1ddbce.js.map} +1 -1
  938. package/es/{_curry2-ad83fd73.js → _curry2-56616048.js} +3 -3
  939. package/es/{_curry2-ad83fd73.js.map → _curry2-56616048.js.map} +1 -1
  940. package/es/{_curry3-9691929f.js → _curry3-0e6fcdae.js} +4 -4
  941. package/es/{_curry3-9691929f.js.map → _curry3-0e6fcdae.js.map} +1 -1
  942. package/es/{_has-854f47dc.js → _has-069b6744.js} +3 -3
  943. package/es/{_has-854f47dc.js.map → _has-069b6744.js.map} +1 -1
  944. package/es/hooks/PRIVATE_useCollectionFocusRing.js +1 -1
  945. package/es/hooks/PRIVATE_useCurrentKey.js +1 -1
  946. package/es/hooks/PRIVATE_useDvtMeterEvents.js +3 -3
  947. package/es/hooks/PRIVATE_useItemAction.js +1 -1
  948. package/es/hooks/PRIVATE_useMessagesFocusManager.js +1 -1
  949. package/es/hooks/PRIVATE_useSelection.js +1 -1
  950. package/es/hooks/PRIVATE_useSingleSelection.js +2 -2
  951. package/es/hooks/PRIVATE_useTabbableModeSet.js +1 -1
  952. package/es/hooks/UNSAFE_useActionable.js +1 -1
  953. package/es/hooks/UNSAFE_useActive.js +1 -1
  954. package/es/hooks/UNSAFE_useAnimation.js +2 -2
  955. package/es/hooks/UNSAFE_useBreakpointValues.js +1 -1
  956. package/es/hooks/UNSAFE_useBreakpoints.js +1 -1
  957. package/es/hooks/UNSAFE_useClearIcon.js +1 -1
  958. package/es/hooks/UNSAFE_useColorScheme.js +1 -1
  959. package/es/hooks/UNSAFE_useContainerBreakpointValues.js +1 -1
  960. package/es/hooks/UNSAFE_useContainerBreakpoints.js +1 -1
  961. package/es/hooks/UNSAFE_useCurrentValueReducer.js +1 -1
  962. package/es/hooks/UNSAFE_useDebounce.js +1 -1
  963. package/es/hooks/UNSAFE_useFloating.js +2 -2
  964. package/es/hooks/UNSAFE_useFocus.js +1 -1
  965. package/es/hooks/UNSAFE_useFocusWithin.js +1 -1
  966. package/es/hooks/UNSAFE_useFocusableTextField.js +2 -2
  967. package/es/hooks/UNSAFE_useFormContext.js +1 -1
  968. package/es/hooks/UNSAFE_useFormFieldContext.js +1 -1
  969. package/es/hooks/UNSAFE_useFormVariantContext.js +1 -1
  970. package/es/hooks/UNSAFE_useHover.js +1 -1
  971. package/es/hooks/UNSAFE_useId.js +1 -1
  972. package/es/hooks/UNSAFE_useLengthFilter.js +1 -1
  973. package/es/hooks/UNSAFE_useLoadingIndicatorTimer.js +1 -1
  974. package/es/hooks/UNSAFE_useLongPress.js +1 -1
  975. package/es/hooks/UNSAFE_useMessagesContext.js +1 -1
  976. package/es/hooks/UNSAFE_useOutsideClick.js +1 -1
  977. package/es/hooks/UNSAFE_usePan.js +1 -1
  978. package/es/hooks/UNSAFE_usePrefixSuffix.js +1 -1
  979. package/es/hooks/UNSAFE_usePress.js +1 -1
  980. package/es/hooks/UNSAFE_useScale.js +1 -1
  981. package/es/hooks/UNSAFE_useSwipe.js +1 -1
  982. package/es/hooks/UNSAFE_useTabbableMode.js +1 -1
  983. package/es/hooks/UNSAFE_useTap.js +1 -1
  984. package/es/hooks/UNSAFE_useTextField.js +1 -1
  985. package/es/hooks/UNSAFE_useTextFieldInputHandlers.js +1 -1
  986. package/es/hooks/UNSAFE_useTheme.js +1 -1
  987. package/es/hooks/UNSAFE_useTimer.js +1 -1
  988. package/es/hooks/UNSAFE_useToggle.js +1 -1
  989. package/es/hooks/UNSAFE_useTooltip.css +4 -4
  990. package/es/hooks/UNSAFE_useTooltip.js +7 -7
  991. package/es/hooks/UNSAFE_useTouch.js +1 -1
  992. package/es/hooks/UNSAFE_useTranslationBundle.js +1 -1
  993. package/es/hooks/UNSAFE_useUncontrolledState.js +1 -1
  994. package/es/hooks/UNSAFE_useUser.js +1 -1
  995. package/es/hooks/UNSAFE_useViewportIntersect.js +1 -1
  996. package/es/{index-dd084c83.js → index-0265edc7.js} +2 -2
  997. package/es/{index-dd084c83.js.map → index-0265edc7.js.map} +1 -1
  998. package/es/{keys-3a6a5514.js → keys-5809d237.js} +4 -4
  999. package/es/{keys-3a6a5514.js.map → keys-5809d237.js.map} +1 -1
  1000. package/es/resources/nls/ar/bundle.js +1 -1
  1001. package/es/resources/nls/ar-XB/bundle.js +1 -1
  1002. package/es/resources/nls/bg/bundle.js +1 -1
  1003. package/es/resources/nls/bs/bundle.js +1 -1
  1004. package/es/resources/nls/bs-Cyrl/bundle.js +1 -1
  1005. package/es/resources/nls/bundle.js +1 -1
  1006. package/es/resources/nls/cs/bundle.js +1 -1
  1007. package/es/resources/nls/da/bundle.js +1 -1
  1008. package/es/resources/nls/de/bundle.js +1 -1
  1009. package/es/resources/nls/el/bundle.js +1 -1
  1010. package/es/resources/nls/en/bundle.js +1 -1
  1011. package/es/resources/nls/en-XA/bundle.js +1 -1
  1012. package/es/resources/nls/en-XC/bundle.js +1 -1
  1013. package/es/resources/nls/es/bundle.js +1 -1
  1014. package/es/resources/nls/et/bundle.js +1 -1
  1015. package/es/resources/nls/fi/bundle.js +1 -1
  1016. package/es/resources/nls/fr/bundle.js +1 -1
  1017. package/es/resources/nls/fr-CA/bundle.js +1 -1
  1018. package/es/resources/nls/he/bundle.js +1 -1
  1019. package/es/resources/nls/hr/bundle.js +1 -1
  1020. package/es/resources/nls/hu/bundle.js +1 -1
  1021. package/es/resources/nls/is/bundle.js +1 -1
  1022. package/es/resources/nls/it/bundle.js +1 -1
  1023. package/es/resources/nls/ja/bundle.js +1 -1
  1024. package/es/resources/nls/ko/bundle.js +1 -1
  1025. package/es/resources/nls/lt/bundle.js +1 -1
  1026. package/es/resources/nls/lv/bundle.js +1 -1
  1027. package/es/resources/nls/ms/bundle.js +1 -1
  1028. package/es/resources/nls/nl/bundle.js +1 -1
  1029. package/es/resources/nls/no/bundle.js +1 -1
  1030. package/es/resources/nls/pl/bundle.js +1 -1
  1031. package/es/resources/nls/pt/bundle.js +1 -1
  1032. package/es/resources/nls/pt-PT/bundle.js +1 -1
  1033. package/es/resources/nls/ro/bundle.js +1 -1
  1034. package/es/resources/nls/ru/bundle.js +1 -1
  1035. package/es/resources/nls/sk/bundle.js +1 -1
  1036. package/es/resources/nls/sl/bundle.js +1 -1
  1037. package/es/resources/nls/sr/bundle.js +1 -1
  1038. package/es/resources/nls/sr-Latn/bundle.js +1 -1
  1039. package/es/resources/nls/supportedLocales.js +1 -1
  1040. package/es/resources/nls/sv/bundle.js +1 -1
  1041. package/es/resources/nls/th/bundle.js +1 -1
  1042. package/es/resources/nls/tr/bundle.js +1 -1
  1043. package/es/resources/nls/uk/bundle.js +1 -1
  1044. package/es/resources/nls/vi/bundle.js +1 -1
  1045. package/es/resources/nls/zh-Hans/bundle.js +1 -1
  1046. package/es/resources/nls/zh-Hant/bundle.js +1 -1
  1047. package/es/translationBundle.js +1 -1
  1048. package/es/{tslib.es6-01a5cabc.js → tslib.es6-f7fea2be.js} +2 -2
  1049. package/es/{tslib.es6-01a5cabc.js.map → tslib.es6-f7fea2be.js.map} +1 -1
  1050. package/es/{useSingleSelection-ddf8e546.js → useSingleSelection-4fed53c3.js} +2 -2
  1051. package/es/{useSingleSelection-ddf8e546.js.map → useSingleSelection-4fed53c3.js.map} +1 -1
  1052. package/es/utils/PRIVATE_clientHints.js +1 -1
  1053. package/es/utils/PRIVATE_collectionUtils.js +1 -1
  1054. package/es/utils/PRIVATE_dvtTestUtils.js +1 -1
  1055. package/es/utils/PRIVATE_floatingUtils.js +1 -1
  1056. package/es/utils/PRIVATE_meterUtils.js +1 -1
  1057. package/es/utils/PRIVATE_refUtils.js +1 -1
  1058. package/es/utils/PRIVATE_tabbableUtils.js +4 -4
  1059. package/es/utils/PRIVATE_timer.js +1 -1
  1060. package/es/utils/UNSAFE_arrayUtils.js +1 -1
  1061. package/es/utils/UNSAFE_attributeUtils.js +1 -1
  1062. package/es/utils/UNSAFE_classNames.js +1 -1
  1063. package/es/utils/UNSAFE_componentUtils.js +1 -1
  1064. package/es/utils/UNSAFE_dataProvider.js +1 -1
  1065. package/es/utils/UNSAFE_filePickerUtils.js +1 -1
  1066. package/es/utils/UNSAFE_getLocale.js +1 -1
  1067. package/es/utils/UNSAFE_interpolations/aria.js +1 -1
  1068. package/es/utils/UNSAFE_interpolations/borders.js +1 -1
  1069. package/es/utils/UNSAFE_interpolations/boxalignment.css +15 -15
  1070. package/es/utils/UNSAFE_interpolations/boxalignment.js +19 -19
  1071. package/es/utils/UNSAFE_interpolations/boxalignment.js.map +1 -1
  1072. package/es/utils/UNSAFE_interpolations/colors.js +1 -1
  1073. package/es/utils/UNSAFE_interpolations/dimensions.js +2 -2
  1074. package/es/utils/UNSAFE_interpolations/flexbox.css +7 -7
  1075. package/es/utils/UNSAFE_interpolations/flexbox.js +11 -11
  1076. package/es/utils/UNSAFE_interpolations/flexbox.js.map +1 -1
  1077. package/es/utils/UNSAFE_interpolations/flexitem.css +7 -7
  1078. package/es/utils/UNSAFE_interpolations/flexitem.js +11 -11
  1079. package/es/utils/UNSAFE_interpolations/flexitem.js.map +1 -1
  1080. package/es/utils/UNSAFE_interpolations/grid.js +1 -1
  1081. package/es/utils/UNSAFE_interpolations/griditem.js +1 -1
  1082. package/es/utils/UNSAFE_interpolations/padding.js +1 -1
  1083. package/es/utils/UNSAFE_interpolations/text.css +3 -3
  1084. package/es/utils/UNSAFE_interpolations/text.js +7 -7
  1085. package/es/utils/UNSAFE_interpolations/text.js.map +1 -1
  1086. package/es/utils/UNSAFE_keys.js +1 -1
  1087. package/es/utils/UNSAFE_lengthFilter.js +1 -1
  1088. package/es/utils/UNSAFE_logger.js +3 -3
  1089. package/es/utils/UNSAFE_matchTranslationBundle.js +1 -1
  1090. package/es/utils/UNSAFE_mergeInterpolations.js +5 -5
  1091. package/es/utils/UNSAFE_mergeProps.js +1 -1
  1092. package/es/utils/UNSAFE_meterTypes.js +1 -1
  1093. package/es/utils/UNSAFE_roles.js +1 -1
  1094. package/es/utils/UNSAFE_selectUtils.js +1 -1
  1095. package/es/utils/UNSAFE_size.js +1 -1
  1096. package/es/utils/UNSAFE_soundUtils.js +1 -1
  1097. package/es/utils/UNSAFE_stringUtils.js +1 -1
  1098. package/es/utils/UNSAFE_typeUtils.js +1 -1
  1099. package/es/utils/UNSAFE_units.js +1 -1
  1100. package/es/utils/UNSAFE_valueUpdateDetail.js +1 -1
  1101. package/package.json +1 -1
  1102. package/amd/Badge-fadeb6b4.js +0 -2
  1103. package/amd/BaseButton-fc90b7e6.js +0 -2
  1104. package/amd/Button-bab4ad2f.js +0 -2
  1105. package/amd/Chip-7bb92fcc.js +0 -2
  1106. package/amd/ClearIcon-0f086ca2.js +0 -2
  1107. package/amd/ComponentMessage-bfe206a0.js +0 -2
  1108. package/amd/ComponentMessageContainer-ac68cdf5.js +0 -2
  1109. package/amd/Divider-9f59cd1d.js +0 -2
  1110. package/amd/Flex-3c3b5df1.js +0 -2
  1111. package/amd/Floating-810ba93b.js +0 -2
  1112. package/amd/FocusTrap-8787f5c7.js +0 -2
  1113. package/amd/FormControlUtils-b4e6d54f.js +0 -2
  1114. package/amd/Heading-ef573200.js +0 -2
  1115. package/amd/HiddenAccessible-efe88cb0.js +0 -2
  1116. package/amd/HighlightText-695fad9f.js +0 -2
  1117. package/amd/Icon-caf41588.js +0 -2
  1118. package/amd/Indexer-fc905285.js +0 -2
  1119. package/amd/Link-802eeb81.js +0 -2
  1120. package/amd/List-5c591342.js +0 -2
  1121. package/amd/ListItemTextLayout-afaa418f.js +0 -2
  1122. package/amd/MenuDivider-7f8a238e.js +0 -2
  1123. package/amd/MenuItem-744d7b06.js +0 -2
  1124. package/amd/MessageCloseButton-9591aa5c.js +0 -2
  1125. package/amd/MessageDetail-bb68d2db.js +0 -2
  1126. package/amd/MessageLayer-e93cfd39.js +0 -2
  1127. package/amd/MessageStartIcon-c25b74a6.js +0 -2
  1128. package/amd/MessageSummary-7862f0dc.js +0 -2
  1129. package/amd/MessageTimestamp-791bef26.js +0 -2
  1130. package/amd/MeterCircle-486e1a71.js +0 -2
  1131. package/amd/Modal-0ef435f0.js +0 -2
  1132. package/amd/ReadonlyTextFieldInput-1ba7b3c8.js +0 -2
  1133. package/amd/SelectMenuItem-d0745c2b.js +0 -2
  1134. package/amd/SelectMultiple-34ecc4ac.js +0 -2
  1135. package/amd/Skeleton-1d1721ed.js +0 -2
  1136. package/amd/Spacer-020e2d85.js +0 -2
  1137. package/amd/SplitMenuButton-6bdc9401.js +0 -2
  1138. package/amd/Text-533ecfd0.js +0 -2
  1139. package/amd/TextFieldInput-3ae2ab4b.js +0 -2
  1140. package/amd/_curry3-cf0bce65.js +0 -2
  1141. package/amd/_has-5cd48c18.js +0 -2
  1142. package/amd/flexbox-ec205eaf.js +0 -2
  1143. package/amd/flexitem-a85b8edd.js +0 -2
  1144. package/amd/index-8df256a2.js +0 -2
  1145. package/amd/listViewSelectionTests-73b90740.js +0 -2
  1146. package/amd/useAnimation-37919fbc.js +0 -2
@@ -1,2 +1,2 @@
1
- define(["exports","../tslib.es6-160e0dcc","preact/hooks","./UNSAFE_useFocusWithin","../useFocusWithin-14403a4b"],function(e,u,r,s,n){"use strict";e.useFocusableTextField=function(e){var{isReadonly:s,ref:o=(()=>{})}=e,t=u.__rest(e,["isReadonly","ref"]);const{focusProps:c,isFocused:l}=n.useFocusWithin(t),i=r.useRef(l),f=r.useRef(null),d=r.useRef(null);return r.useEffect(()=>{i.current&&(s?setTimeout(()=>{var e;return null===(e=d.current)||void 0===e?void 0:e.focus()}):setTimeout(()=>{var e;return null===(e=f.current)||void 0===e?void 0:e.focus()}))},[s]),r.useEffect(()=>{i.current=l},[l]),r.useImperativeHandle(o,()=>({focus:()=>{var e,u;s?null===(e=d.current)||void 0===e||e.focus():null===(u=f.current)||void 0===u||u.focus()},blur:()=>{var e,u;s?null===(e=d.current)||void 0===e||e.blur():null===(u=f.current)||void 0===u||u.blur()}}),[s]),{enabledElementRef:f,readonlyElementRef:d,isFocused:l,focusProps:c}},Object.defineProperty(e,"__esModule",{value:!0})});
1
+ define(["exports","../tslib.es6-6a195797","preact/hooks","./UNSAFE_useFocusWithin","../useFocusWithin-0a53949e"],function(e,u,r,s,n){"use strict";e.useFocusableTextField=function(e){var{isReadonly:s,ref:o=(()=>{})}=e,t=u.__rest(e,["isReadonly","ref"]);const{focusProps:l,isFocused:c}=n.useFocusWithin(t),i=r.useRef(c),f=r.useRef(null),d=r.useRef(null);return r.useEffect(()=>{i.current&&(s?setTimeout(()=>{var e;return null===(e=d.current)||void 0===e?void 0:e.focus()}):setTimeout(()=>{var e;return null===(e=f.current)||void 0===e?void 0:e.focus()}))},[s]),r.useEffect(()=>{i.current=c},[c]),r.useImperativeHandle(o,()=>({focus:()=>{var e,u;s?null===(e=d.current)||void 0===e||e.focus():null===(u=f.current)||void 0===u||u.focus()},blur:()=>{var e,u;s?null===(e=d.current)||void 0===e||e.blur():null===(u=f.current)||void 0===u||u.blur()}}),[s]),{enabledElementRef:f,readonlyElementRef:d,isFocused:c,focusProps:l}},Object.defineProperty(e,"__esModule",{value:!0})});
2
2
  //# sourceMappingURL=UNSAFE_useFocusableTextField.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"UNSAFE_useFocusableTextField.js","sources":["../../../src/hooks/UNSAFE_useFocusableTextField/useFocusableTextField.ts"],"sourcesContent":["import { Ref } from 'preact';\nimport { useEffect, useImperativeHandle, useRef } from 'preact/hooks';\nimport { useFocusWithin } from '../UNSAFE_useFocusWithin';\n\nexport type FocusableHandle = {\n focus: () => void;\n blur: () => void;\n};\ntype UseFocusWithinProps = Parameters<typeof useFocusWithin>[0];\ntype UseFocusableTextFieldProps = UseFocusWithinProps & {\n /**\n * flag indicating whether the field is readonly\n */\n isReadonly?: boolean;\n\n /**\n * An optional ref to add imperative handles\n */\n ref?: Ref<FocusableHandle>;\n};\n\n/**\n * A custom hook that handles the focus when the text field\n * is toggled between readonly and enabled\n * @typedef E represents the type of the enabled element\n * @typedef R represents the type of the readonly element\n */\nexport function useFocusableTextField<E extends HTMLElement, R extends HTMLElement>({\n isReadonly,\n ref = () => {},\n ...useFocusWithinProps\n}: UseFocusableTextFieldProps) {\n const { focusProps, isFocused } = useFocusWithin(useFocusWithinProps);\n\n const previousIsFocusedRef = useRef(isFocused);\n const enabledElementRef = useRef<E>(null);\n const readonlyElementRef = useRef<R>(null);\n\n // Retain focus when toggling between readonly and enabled\n useEffect(() => {\n // if the readonly state is changed and previously we\n // were holding focus, set the focus to newly rendered element\n if (previousIsFocusedRef.current) {\n if (isReadonly) {\n setTimeout(() => readonlyElementRef.current?.focus());\n } else {\n setTimeout(() => enabledElementRef.current?.focus());\n }\n }\n }, [isReadonly]);\n\n // Keep the previousFocusRef in sync, but be sure to run this hook\n // after handling focus for the readonly toggling.\n useEffect(() => {\n previousIsFocusedRef.current = isFocused;\n }, [isFocused]);\n\n // Add focus and blur methods\n useImperativeHandle(\n ref,\n () => ({\n focus: () => {\n if (isReadonly) {\n readonlyElementRef.current?.focus();\n } else {\n enabledElementRef.current?.focus();\n }\n },\n blur: () => {\n if (isReadonly) {\n readonlyElementRef.current?.blur();\n } else {\n enabledElementRef.current?.blur();\n }\n }\n }),\n [isReadonly]\n );\n\n return {\n enabledElementRef,\n readonlyElementRef,\n isFocused,\n focusProps\n };\n}\n"],"names":["_a","isReadonly","ref","useFocusWithinProps","__rest","focusProps","isFocused","useFocusWithin","previousIsFocusedRef","useRef","enabledElementRef","readonlyElementRef","useEffect","current","setTimeout","focus","useImperativeHandle","_b","blur"],"mappings":"0KA2BM,SAA8EA,GAAA,IAAAC,WAClFA,EADkFC,IAElFA,EAAM,UAEqBF,EADxBG,EAAmBC,EAAAA,OAAAJ,EAH4D,sBAKlF,MAAMK,WAAEA,EAAFC,UAAcA,GAAcC,EAAcA,eAACJ,GAE3CK,EAAuBC,SAAOH,GAC9BI,EAAoBD,SAAU,MAC9BE,EAAqBF,SAAU,MA2CrC,OAxCAG,EAAAA,UAAU,KAGJJ,EAAqBK,UACnBZ,EACFa,WAAW,KAAK,IAAAd,EAAC,eAAAA,EAAAW,EAAmBE,8BAASE,UAE7CD,WAAW,KAAK,IAAAd,EAAC,eAAAA,EAAAU,EAAkBG,8BAASE,YAG/C,CAACd,IAIJW,EAAAA,UAAU,KACRJ,EAAqBK,QAAUP,GAC9B,CAACA,IAGJU,EAAmBA,oBACjBd,EACA,KAAO,CACLa,MAAO,aACDd,EAC0B,QAA5BD,EAAAW,EAAmBE,eAAS,IAAAb,GAAAA,EAAAe,QAED,QAA3BE,EAAAP,EAAkBG,eAAS,IAAAI,GAAAA,EAAAF,SAG/BG,KAAM,aACAjB,EAC0B,QAA5BD,EAAAW,EAAmBE,eAAS,IAAAb,GAAAA,EAAAkB,OAED,QAA3BD,EAAAP,EAAkBG,eAAS,IAAAI,GAAAA,EAAAC,UAIjC,CAACjB,IAGI,CACLS,kBAAAA,EACAC,mBAAAA,EACAL,UAAAA,EACAD,WAAAA"}
1
+ {"version":3,"file":"UNSAFE_useFocusableTextField.js","sources":["../../../src/hooks/UNSAFE_useFocusableTextField/useFocusableTextField.ts"],"sourcesContent":["import { Ref } from 'preact';\nimport { useEffect, useImperativeHandle, useRef } from 'preact/hooks';\nimport { useFocusWithin } from '../UNSAFE_useFocusWithin';\n\nexport type FocusableHandle = {\n focus: () => void;\n blur: () => void;\n};\ntype UseFocusWithinProps = Parameters<typeof useFocusWithin>[0];\ntype UseFocusableTextFieldProps = UseFocusWithinProps & {\n /**\n * flag indicating whether the field is readonly\n */\n isReadonly?: boolean;\n\n /**\n * An optional ref to add imperative handles\n */\n ref?: Ref<FocusableHandle>;\n};\n\n/**\n * A custom hook that handles the focus when the text field\n * is toggled between readonly and enabled\n * @typedef E represents the type of the enabled element\n * @typedef R represents the type of the readonly element\n */\nexport function useFocusableTextField<E extends HTMLElement, R extends HTMLElement>({\n isReadonly,\n ref = () => {},\n ...useFocusWithinProps\n}: UseFocusableTextFieldProps) {\n const { focusProps, isFocused } = useFocusWithin(useFocusWithinProps);\n\n const previousIsFocusedRef = useRef(isFocused);\n const enabledElementRef = useRef<E>(null);\n const readonlyElementRef = useRef<R>(null);\n\n // Retain focus when toggling between readonly and enabled\n useEffect(() => {\n // if the readonly state is changed and previously we\n // were holding focus, set the focus to newly rendered element\n if (previousIsFocusedRef.current) {\n if (isReadonly) {\n setTimeout(() => readonlyElementRef.current?.focus());\n } else {\n setTimeout(() => enabledElementRef.current?.focus());\n }\n }\n }, [isReadonly]);\n\n // Keep the previousFocusRef in sync, but be sure to run this hook\n // after handling focus for the readonly toggling.\n useEffect(() => {\n previousIsFocusedRef.current = isFocused;\n }, [isFocused]);\n\n // Add focus and blur methods\n useImperativeHandle(\n ref,\n () => ({\n focus: () => {\n if (isReadonly) {\n readonlyElementRef.current?.focus();\n } else {\n enabledElementRef.current?.focus();\n }\n },\n blur: () => {\n if (isReadonly) {\n readonlyElementRef.current?.blur();\n } else {\n enabledElementRef.current?.blur();\n }\n }\n }),\n [isReadonly]\n );\n\n return {\n enabledElementRef,\n readonlyElementRef,\n isFocused,\n focusProps\n };\n}\n"],"names":["_a","isReadonly","ref","useFocusWithinProps","__rest","focusProps","isFocused","useFocusWithin","previousIsFocusedRef","useRef","enabledElementRef","readonlyElementRef","useEffect","current","setTimeout","focus","useImperativeHandle","_b","blur"],"mappings":"0KA2BM,SAA8EA,GAAA,IAAAC,WAClFA,EAAUC,IACVA,EAAM,UAEqBF,EADxBG,EAAmBC,EAAAA,OAAAJ,EAH4D,sBAKlF,MAAMK,WAAEA,EAAUC,UAAEA,GAAcC,EAAcA,eAACJ,GAE3CK,EAAuBC,SAAOH,GAC9BI,EAAoBD,SAAU,MAC9BE,EAAqBF,SAAU,MA2CrC,OAxCAG,EAAAA,UAAU,KAGJJ,EAAqBK,UACnBZ,EACFa,WAAW,KAAK,IAAAd,EAAC,eAAAA,EAAAW,EAAmBE,8BAASE,UAE7CD,WAAW,KAAK,IAAAd,EAAC,eAAAA,EAAAU,EAAkBG,8BAASE,YAG/C,CAACd,IAIJW,EAAAA,UAAU,KACRJ,EAAqBK,QAAUP,GAC9B,CAACA,IAGJU,EAAmBA,oBACjBd,EACA,KAAO,CACLa,MAAO,aACDd,EAC0B,QAA5BD,EAAAW,EAAmBE,eAAS,IAAAb,GAAAA,EAAAe,QAED,QAA3BE,EAAAP,EAAkBG,eAAS,IAAAI,GAAAA,EAAAF,SAG/BG,KAAM,aACAjB,EAC0B,QAA5BD,EAAAW,EAAmBE,eAAS,IAAAb,GAAAA,EAAAkB,OAED,QAA3BD,EAAAP,EAAkBG,eAAS,IAAAI,GAAAA,EAAAC,UAIjC,CAACjB,IAGI,CACLS,kBAAAA,EACAC,mBAAAA,EACAL,UAAAA,EACAD,WAAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"UNSAFE_useHover.js","sources":["../../../src/hooks/UNSAFE_useHover/useHover.ts"],"sourcesContent":["import { useToggle } from '../UNSAFE_useToggle';\n\nexport type HoverOptions = {\n isDisabled?: boolean;\n};\n\n/**\n * Returns listeners and status for hover\n * If only visual changes are required, :hover is faster.\n *\n * @returns\n */\nexport function useHover(settings: HoverOptions = { isDisabled: false }): {\n isHover: boolean;\n hoverProps: Record<string, any>;\n} {\n // :hover is faster than event handlers, but doesn't work for all platforms.\n // For touch-first devices, the media query for hover is enough.\n // Hybrid devices support hover upon pointer usage, but tapping would toggle hover state\n // so disable :hover and use event handlers for such devices.\n // Use getClientHints to check if hybrid\n // const hybrid = getClientHints().isHybrid;\n // Classes can be done via :\n // !isHybrid && compStyles.pseudohover,\n // isHybrid && isHover && compStyles.hover\n // and the props can be done via:\n // const { hoverProps, isHover } = useHover( {isDisabled: isHybrid});\n //\n // For the algorithm below, There are 2 possible sequences:\n // 1. A pointer (mouse, trackpad) would generate a mouseEnter event that would initiate hover.\n // 2. A touch generates a touchstart/touchend/mouseEnter event sequence.\n // Hover has no meaning in a touch context, so the isHover state should be avoided.\n // To avoid, we set an ignore flag when a touchend is encountered.\n // Each time mouseEnter is encountered, the flag is checked.\n // If ignore, we know that it is a touch device, so don't set hover state.\n // In all cases, reset the flag for the next sequence.\n //\n const { bool, setTrue, setFalse } = useToggle(false);\n const { bool: ignore, setTrue: setIgnoreTrue, setFalse: setIgnoreFalse } = useToggle(false);\n const startHover = () => {\n if (ignore) {\n setIgnoreFalse();\n } else {\n setTrue();\n }\n };\n\n const hoverProps = settings.isDisabled\n ? {}\n : { ontouchend: setIgnoreTrue, onMouseEnter: startHover, onMouseLeave: setFalse };\n return {\n isHover: settings.isDisabled ? false : bool,\n hoverProps: hoverProps\n };\n}\n"],"names":["settings","isDisabled","bool","setTrue","setFalse","useToggle","ignore","setIgnoreTrue","setIgnoreFalse","hoverProps","ontouchend","onMouseEnter","onMouseLeave","isHover"],"mappings":"+FAYM,SAAmBA,EAAyB,CAAEC,YAAY,IAyB9D,MAAMC,KAAEA,EAAFC,QAAQA,EAARC,SAAiBA,GAAaC,EAAAA,WAAU,IACtCH,KAAMI,EAAQH,QAASI,EAAeH,SAAUI,GAAmBH,aAAU,GAS/EI,EAAaT,EAASC,WACxB,GACA,CAAES,WAAYH,EAAeI,aAVd,KACbL,EACFE,IAEAL,KAMuDS,aAAcR,GACzE,MAAO,CACLS,SAASb,EAASC,YAAqBC,EACvCO,WAAYA"}
1
+ {"version":3,"file":"UNSAFE_useHover.js","sources":["../../../src/hooks/UNSAFE_useHover/useHover.ts"],"sourcesContent":["import { useToggle } from '../UNSAFE_useToggle';\n\nexport type HoverOptions = {\n isDisabled?: boolean;\n};\n\n/**\n * Returns listeners and status for hover\n * If only visual changes are required, :hover is faster.\n *\n * @returns\n */\nexport function useHover(settings: HoverOptions = { isDisabled: false }): {\n isHover: boolean;\n hoverProps: Record<string, any>;\n} {\n // :hover is faster than event handlers, but doesn't work for all platforms.\n // For touch-first devices, the media query for hover is enough.\n // Hybrid devices support hover upon pointer usage, but tapping would toggle hover state\n // so disable :hover and use event handlers for such devices.\n // Use getClientHints to check if hybrid\n // const hybrid = getClientHints().isHybrid;\n // Classes can be done via :\n // !isHybrid && compStyles.pseudohover,\n // isHybrid && isHover && compStyles.hover\n // and the props can be done via:\n // const { hoverProps, isHover } = useHover( {isDisabled: isHybrid});\n //\n // For the algorithm below, There are 2 possible sequences:\n // 1. A pointer (mouse, trackpad) would generate a mouseEnter event that would initiate hover.\n // 2. A touch generates a touchstart/touchend/mouseEnter event sequence.\n // Hover has no meaning in a touch context, so the isHover state should be avoided.\n // To avoid, we set an ignore flag when a touchend is encountered.\n // Each time mouseEnter is encountered, the flag is checked.\n // If ignore, we know that it is a touch device, so don't set hover state.\n // In all cases, reset the flag for the next sequence.\n //\n const { bool, setTrue, setFalse } = useToggle(false);\n const { bool: ignore, setTrue: setIgnoreTrue, setFalse: setIgnoreFalse } = useToggle(false);\n const startHover = () => {\n if (ignore) {\n setIgnoreFalse();\n } else {\n setTrue();\n }\n };\n\n const hoverProps = settings.isDisabled\n ? {}\n : { ontouchend: setIgnoreTrue, onMouseEnter: startHover, onMouseLeave: setFalse };\n return {\n isHover: settings.isDisabled ? false : bool,\n hoverProps: hoverProps\n };\n}\n"],"names":["settings","isDisabled","bool","setTrue","setFalse","useToggle","ignore","setIgnoreTrue","setIgnoreFalse","hoverProps","ontouchend","onMouseEnter","onMouseLeave","isHover"],"mappings":"+FAYM,SAAmBA,EAAyB,CAAEC,YAAY,IAyB9D,MAAMC,KAAEA,EAAIC,QAAEA,EAAOC,SAAEA,GAAaC,EAAAA,WAAU,IACtCH,KAAMI,EAAQH,QAASI,EAAeH,SAAUI,GAAmBH,aAAU,GAS/EI,EAAaT,EAASC,WACxB,GACA,CAAES,WAAYH,EAAeI,aAVd,KACbL,EACFE,IAEAL,KAMuDS,aAAcR,GACzE,MAAO,CACLS,SAASb,EAASC,YAAqBC,EACvCO,WAAYA"}
@@ -1 +1 @@
1
- {"version":3,"file":"UNSAFE_useLengthFilter.js","sources":["../../../src/hooks/UNSAFE_useLengthFilter/useLengthFilter.ts"],"sourcesContent":["import { ComponentProps } from 'preact';\nimport { useCallback, useEffect, useState } from 'preact/hooks';\nimport { TextFieldInput } from '../../UNSAFE_TextField';\nimport { calcLength, CountUnit as _CountUnit, filter } from '../../utils/UNSAFE_lengthFilter';\n\nexport type CountUnit = _CountUnit;\n\ntype PickedPropsFromTextFieldInput = Pick<\n ComponentProps<typeof TextFieldInput>,\n 'onCommit' | 'onInput' | 'value'\n>;\ntype UseLengthFilterProps = PickedPropsFromTextFieldInput & {\n maxLength?: number;\n maxLengthUnit?: CountUnit;\n};\n\n/**\n * A custom hook that applies the length filter to text field input\n * @param param0 The props for the useLengthFilter hook\n * @returns The filtered event handlers\n */\nexport function useLengthFilter({\n maxLength,\n maxLengthUnit,\n onCommit,\n onInput,\n value\n}: UseLengthFilterProps) {\n const [isMaxLengthExceeded, setMaxLengthExceeded] = useState(false);\n const parse = useCallback(\n (value: string) => filter(value, maxLength, maxLengthUnit),\n [maxLength, maxLengthUnit]\n );\n // Reapply maxLength filter when the value is changed\n useEffect(() => {\n if (value === undefined) {\n return;\n }\n\n const filteredValue = parse(value);\n if (filteredValue !== value) {\n onInput?.({ previousValue: value, value: filteredValue });\n onCommit?.({ previousValue: value, value: filteredValue });\n\n // Value is filtered, means that the max length is exceeded\n setMaxLengthExceeded(true);\n } else {\n // Value is not filtered, means that the max length is not exceeded\n setMaxLengthExceeded(false);\n }\n }, [value, onCommit, onInput, parse]);\n\n const onFilteredInput = useCallback(\n (...args: Parameters<Exclude<typeof onInput, undefined>>) => {\n const { previousValue, value } = args[0];\n const filteredValue = parse(value ?? '');\n\n // Call the onInput event only when the value is changed\n if (previousValue !== filteredValue) {\n onInput?.({ ...args[0], value: filteredValue });\n // value is not filtered, so the max length is not exceeded\n setMaxLengthExceeded(false);\n } else {\n // value is changed but then filtered to previous value\n // meaning that the max length was exceeded\n setMaxLengthExceeded(true);\n }\n },\n [onInput, parse]\n );\n\n return {\n isMaxLengthExceeded,\n valueLength: value === undefined ? undefined : calcLength(value, maxLengthUnit),\n onFilteredInput\n };\n}\n"],"names":["maxLength","maxLengthUnit","onCommit","onInput","value","isMaxLengthExceeded","setMaxLengthExceeded","useState","parse","useCallback","filter","useEffect","undefined","filteredValue","previousValue","onFilteredInput","args","valueLength","calcLength"],"mappings":"gHAqBgB,UAAgBA,UAC9BA,EAD8BC,cAE9BA,EAF8BC,SAG9BA,EAH8BC,QAI9BA,EAJ8BC,MAK9BA,IAEA,MAAOC,EAAqBC,GAAwBC,EAAQA,UAAC,GACvDC,EAAQC,EAAAA,YACXL,GAAkBM,EAAAA,OAAON,EAAOJ,EAAWC,GAC5C,CAACD,EAAWC,IAGdU,EAAAA,UAAU,KACR,QAAcC,IAAVR,EACF,OAGF,MAAMS,EAAgBL,EAAMJ,GACxBS,IAAkBT,GACpBD,MAAAA,GAAAA,EAAU,CAAEW,cAAeV,EAAOA,MAAOS,IACzCX,MAAAA,GAAAA,EAAW,CAAEY,cAAeV,EAAOA,MAAOS,IAG1CP,GAAqB,IAGrBA,GAAqB,IAEtB,CAACF,EAAOF,EAAUC,EAASK,IAE9B,MAAMO,EAAkBN,EAAAA,YACtB,IAAIO,KACF,MAAMF,cAAEA,EAAFV,MAAiBA,GAAUY,EAAK,GAChCH,EAAgBL,EAAMJ,MAAAA,EAAAA,EAAS,IAGjCU,IAAkBD,GACpBV,MAAAA,GAAAA,iCAAea,EAAK,IAAI,CAAAZ,MAAOS,KAE/BP,GAAqB,IAIrBA,GAAqB,IAGzB,CAACH,EAASK,IAGZ,MAAO,CACLH,oBAAAA,EACAY,iBAAuBL,IAAVR,OAAsBQ,EAAYM,EAAUA,WAACd,EAAOH,GACjEc,gBAAAA"}
1
+ {"version":3,"file":"UNSAFE_useLengthFilter.js","sources":["../../../src/hooks/UNSAFE_useLengthFilter/useLengthFilter.ts"],"sourcesContent":["import { ComponentProps } from 'preact';\nimport { useCallback, useEffect, useState } from 'preact/hooks';\nimport { TextFieldInput } from '../../UNSAFE_TextField';\nimport { calcLength, CountUnit as _CountUnit, filter } from '../../utils/UNSAFE_lengthFilter';\n\nexport type CountUnit = _CountUnit;\n\ntype PickedPropsFromTextFieldInput = Pick<\n ComponentProps<typeof TextFieldInput>,\n 'onCommit' | 'onInput' | 'value'\n>;\ntype UseLengthFilterProps = PickedPropsFromTextFieldInput & {\n maxLength?: number;\n maxLengthUnit?: CountUnit;\n};\n\n/**\n * A custom hook that applies the length filter to text field input\n * @param param0 The props for the useLengthFilter hook\n * @returns The filtered event handlers\n */\nexport function useLengthFilter({\n maxLength,\n maxLengthUnit,\n onCommit,\n onInput,\n value\n}: UseLengthFilterProps) {\n const [isMaxLengthExceeded, setMaxLengthExceeded] = useState(false);\n const parse = useCallback(\n (value: string) => filter(value, maxLength, maxLengthUnit),\n [maxLength, maxLengthUnit]\n );\n // Reapply maxLength filter when the value is changed\n useEffect(() => {\n if (value === undefined) {\n return;\n }\n\n const filteredValue = parse(value);\n if (filteredValue !== value) {\n onInput?.({ previousValue: value, value: filteredValue });\n onCommit?.({ previousValue: value, value: filteredValue });\n\n // Value is filtered, means that the max length is exceeded\n setMaxLengthExceeded(true);\n } else {\n // Value is not filtered, means that the max length is not exceeded\n setMaxLengthExceeded(false);\n }\n }, [value, onCommit, onInput, parse]);\n\n const onFilteredInput = useCallback(\n (...args: Parameters<Exclude<typeof onInput, undefined>>) => {\n const { previousValue, value } = args[0];\n const filteredValue = parse(value ?? '');\n\n // Call the onInput event only when the value is changed\n if (previousValue !== filteredValue) {\n onInput?.({ ...args[0], value: filteredValue });\n // value is not filtered, so the max length is not exceeded\n setMaxLengthExceeded(false);\n } else {\n // value is changed but then filtered to previous value\n // meaning that the max length was exceeded\n setMaxLengthExceeded(true);\n }\n },\n [onInput, parse]\n );\n\n return {\n isMaxLengthExceeded,\n valueLength: value === undefined ? undefined : calcLength(value, maxLengthUnit),\n onFilteredInput\n };\n}\n"],"names":["maxLength","maxLengthUnit","onCommit","onInput","value","isMaxLengthExceeded","setMaxLengthExceeded","useState","parse","useCallback","filter","useEffect","undefined","filteredValue","previousValue","onFilteredInput","args","valueLength","calcLength"],"mappings":"gHAqBgB,UAAgBA,UAC9BA,EAASC,cACTA,EAAaC,SACbA,EAAQC,QACRA,EAAOC,MACPA,IAEA,MAAOC,EAAqBC,GAAwBC,EAAQA,UAAC,GACvDC,EAAQC,EAAAA,YACXL,GAAkBM,EAAAA,OAAON,EAAOJ,EAAWC,GAC5C,CAACD,EAAWC,IAGdU,EAAAA,UAAU,KACR,QAAcC,IAAVR,EACF,OAGF,MAAMS,EAAgBL,EAAMJ,GACxBS,IAAkBT,GACpBD,MAAAA,GAAAA,EAAU,CAAEW,cAAeV,EAAOA,MAAOS,IACzCX,MAAAA,GAAAA,EAAW,CAAEY,cAAeV,EAAOA,MAAOS,IAG1CP,GAAqB,IAGrBA,GAAqB,IAEtB,CAACF,EAAOF,EAAUC,EAASK,IAE9B,MAAMO,EAAkBN,EAAAA,YACtB,IAAIO,KACF,MAAMF,cAAEA,EAAaV,MAAEA,GAAUY,EAAK,GAChCH,EAAgBL,EAAMJ,MAAAA,EAAAA,EAAS,IAGjCU,IAAkBD,GACpBV,MAAAA,GAAAA,iCAAea,EAAK,IAAI,CAAAZ,MAAOS,KAE/BP,GAAqB,IAIrBA,GAAqB,IAGzB,CAACH,EAASK,IAGZ,MAAO,CACLH,oBAAAA,EACAY,iBAAuBL,IAAVR,OAAsBQ,EAAYM,EAAUA,WAACd,EAAOH,GACjEc,gBAAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"UNSAFE_useLongPress.js","sources":["../../../src/hooks/UNSAFE_useLongPress/useLongPress.ts"],"sourcesContent":["/**\n * @license\n * Copyright (c) %FIRST_YEAR% %CURRENT_YEAR%, Oracle and/or its affiliates.\n * Licensed under The Universal Permissive License (UPL), Version 1.0\n * as shown at https://oss.oracle.com/licenses/upl/\n * @ignore\n */\n\nimport { useRef, useCallback } from 'preact/hooks';\n\ntype LongPressOptions = {\n isDisabled?: boolean;\n minimumTime?: number;\n};\n\ntype LongPressInfo = {\n x: number;\n y: number;\n};\n\ntype LongPressState = {\n pointerDownId: number | null;\n startTime: number;\n};\n\nconst InitialPressState = {\n pointerDownId: null,\n startTime: 0\n};\n\nconst DefaultMinimumTime = 250;\n\nexport function useLongPress(\n onLongPress: (e: LongPressInfo) => void,\n { isDisabled = false, minimumTime = DefaultMinimumTime }: LongPressOptions = {\n isDisabled: false,\n minimumTime: DefaultMinimumTime\n }\n): { longPressProps: Record<string, any> } {\n const ref = useRef<LongPressState>(InitialPressState);\n\n const onPointerDown = useCallback((e: PointerEvent) => {\n // return if it is not a left click\n if (e.pointerType == 'mouse' && e.button != 0) {\n return;\n }\n\n ref.current = ref.current.pointerDownId\n ? InitialPressState\n : { pointerDownId: e.pointerId, startTime: e.timeStamp };\n }, []);\n\n const onPointerUp = useCallback(\n (e: PointerEvent) => {\n if (e.pointerId === ref.current.pointerDownId) {\n const longPressTime = e.timeStamp - ref.current.startTime;\n // 250ms minimum longPress time based on numbers used in Hammer\n if (longPressTime > minimumTime) {\n onLongPress({ x: e.offsetX, y: e.offsetY });\n }\n }\n clearLongPress();\n },\n [onLongPress]\n );\n\n const clearLongPress = useCallback(() => {\n ref.current = InitialPressState;\n }, []);\n\n const longPressProps = isDisabled\n ? {}\n : {\n onPointerDown,\n onPointerUp,\n onPointerLeave: clearLongPress,\n onPointerCancel: clearLongPress\n };\n\n return {\n longPressProps\n };\n}\n"],"names":["InitialPressState","pointerDownId","startTime","onLongPress","isDisabled","minimumTime","ref","useRef","onPointerDown","useCallback","e","pointerType","button","current","pointerId","timeStamp","onPointerUp","x","offsetX","y","offsetY","clearLongPress","longPressProps","onPointerLeave","onPointerCancel"],"mappings":"6DAyBA,MAAMA,EAAoB,CACxBC,cAAe,KACfC,UAAW,kBAKG,SACdC,GACAC,WAAEA,GAAa,EAAfC,YAAsBA,EAJG,KAIoD,CAC3ED,YAAY,EACZC,YANuB,MASzB,MAAMC,EAAMC,SAAuBP,GAE7BQ,EAAgBC,cAAaC,IAEZ,SAAjBA,EAAEC,aAAsC,GAAZD,EAAEE,SAIlCN,EAAIO,QAAUP,EAAIO,QAAQZ,cACtBD,EACA,CAAEC,cAAeS,EAAEI,UAAWZ,UAAWQ,EAAEK,aAC9C,IAEGC,EAAcP,cACjBC,IACC,GAAIA,EAAEI,YAAcR,EAAIO,QAAQZ,cAAe,CACvBS,EAAEK,UAAYT,EAAIO,QAAQX,UAE5BG,GAClBF,EAAY,CAAEc,EAAGP,EAAEQ,QAASC,EAAGT,EAAEU,UAGrCC,KAEF,CAAClB,IAGGkB,EAAiBZ,EAAAA,YAAY,KACjCH,EAAIO,QAAUb,GACb,IAWH,MAAO,CACLsB,eAVqBlB,EACnB,GACA,CACEI,cAAAA,EACAQ,YAAAA,EACAO,eAAgBF,EAChBG,gBAAiBH"}
1
+ {"version":3,"file":"UNSAFE_useLongPress.js","sources":["../../../src/hooks/UNSAFE_useLongPress/useLongPress.ts"],"sourcesContent":["/**\n * @license\n * Copyright (c) %FIRST_YEAR% %CURRENT_YEAR%, Oracle and/or its affiliates.\n * Licensed under The Universal Permissive License (UPL), Version 1.0\n * as shown at https://oss.oracle.com/licenses/upl/\n * @ignore\n */\n\nimport { useRef, useCallback } from 'preact/hooks';\n\ntype LongPressOptions = {\n isDisabled?: boolean;\n minimumTime?: number;\n};\n\ntype LongPressInfo = {\n x: number;\n y: number;\n};\n\ntype LongPressState = {\n pointerDownId: number | null;\n startTime: number;\n};\n\nconst InitialPressState = {\n pointerDownId: null,\n startTime: 0\n};\n\nconst DefaultMinimumTime = 250;\n\nexport function useLongPress(\n onLongPress: (e: LongPressInfo) => void,\n { isDisabled = false, minimumTime = DefaultMinimumTime }: LongPressOptions = {\n isDisabled: false,\n minimumTime: DefaultMinimumTime\n }\n): { longPressProps: Record<string, any> } {\n const ref = useRef<LongPressState>(InitialPressState);\n\n const onPointerDown = useCallback((e: PointerEvent) => {\n // return if it is not a left click\n if (e.pointerType == 'mouse' && e.button != 0) {\n return;\n }\n\n ref.current = ref.current.pointerDownId\n ? InitialPressState\n : { pointerDownId: e.pointerId, startTime: e.timeStamp };\n }, []);\n\n const onPointerUp = useCallback(\n (e: PointerEvent) => {\n if (e.pointerId === ref.current.pointerDownId) {\n const longPressTime = e.timeStamp - ref.current.startTime;\n // 250ms minimum longPress time based on numbers used in Hammer\n if (longPressTime > minimumTime) {\n onLongPress({ x: e.offsetX, y: e.offsetY });\n }\n }\n clearLongPress();\n },\n [onLongPress]\n );\n\n const clearLongPress = useCallback(() => {\n ref.current = InitialPressState;\n }, []);\n\n const longPressProps = isDisabled\n ? {}\n : {\n onPointerDown,\n onPointerUp,\n onPointerLeave: clearLongPress,\n onPointerCancel: clearLongPress\n };\n\n return {\n longPressProps\n };\n}\n"],"names":["InitialPressState","pointerDownId","startTime","onLongPress","isDisabled","minimumTime","ref","useRef","onPointerDown","useCallback","e","pointerType","button","current","pointerId","timeStamp","onPointerUp","x","offsetX","y","offsetY","clearLongPress","longPressProps","onPointerLeave","onPointerCancel"],"mappings":"6DAyBA,MAAMA,EAAoB,CACxBC,cAAe,KACfC,UAAW,kBAKG,SACdC,GACAC,WAAEA,GAAa,EAAKC,YAAEA,EAJG,KAIoD,CAC3ED,YAAY,EACZC,YANuB,MASzB,MAAMC,EAAMC,SAAuBP,GAE7BQ,EAAgBC,cAAaC,IAEZ,SAAjBA,EAAEC,aAAsC,GAAZD,EAAEE,SAIlCN,EAAIO,QAAUP,EAAIO,QAAQZ,cACtBD,EACA,CAAEC,cAAeS,EAAEI,UAAWZ,UAAWQ,EAAEK,aAC9C,IAEGC,EAAcP,cACjBC,IACC,GAAIA,EAAEI,YAAcR,EAAIO,QAAQZ,cAAe,CACvBS,EAAEK,UAAYT,EAAIO,QAAQX,UAE5BG,GAClBF,EAAY,CAAEc,EAAGP,EAAEQ,QAASC,EAAGT,EAAEU,UAGrCC,KAEF,CAAClB,IAGGkB,EAAiBZ,EAAAA,YAAY,KACjCH,EAAIO,QAAUb,GACb,IAWH,MAAO,CACLsB,eAVqBlB,EACnB,GACA,CACEI,cAAAA,EACAQ,YAAAA,EACAO,eAAgBF,EAChBG,gBAAiBH"}
@@ -1 +1 @@
1
- {"version":3,"file":"UNSAFE_usePan.js","sources":["../../../src/hooks/UNSAFE_usePan/usePan.ts"],"sourcesContent":["/**\n * @license\n * Copyright (c) %FIRST_YEAR% %CURRENT_YEAR%, Oracle and/or its affiliates.\n * Licensed under The Universal Permissive License (UPL), Version 1.0\n * as shown at https://oss.oracle.com/licenses/upl/\n * @ignore\n */\n\nimport { useRef, useCallback } from 'preact/hooks';\n\n/*\nthreshold: Minimal distance in pixels required before recognizing\n*/\ntype PanOptions = {\n threshold?: number;\n minimumTime?: number;\n isDisabled?: boolean;\n};\n\ntype PanInfo = {\n x: number;\n y: number;\n status: 'start' | 'end' | 'move';\n};\n\ntype PanState = {\n pointerDownId: number | null;\n startTime: number | null;\n prevOffsetX: number;\n prevOffsetY: number;\n};\n\nexport function usePan(\n onPan: (e: PanInfo) => void,\n { threshold = 50, minimumTime = 500, isDisabled = false }: PanOptions = {\n threshold: 50,\n minimumTime: 500,\n isDisabled: false\n }\n): { panProps: Record<string, any> } {\n const ref = useRef<PanState>({\n pointerDownId: 0,\n startTime: 0,\n prevOffsetX: 0,\n prevOffsetY: 0\n });\n\n const onPointerDown = useCallback((e: PointerEvent) => {\n if (!ref.current.pointerDownId) {\n ref.current = {\n pointerDownId: e.pointerId,\n startTime: e.timeStamp,\n prevOffsetX: e.offsetX,\n prevOffsetY: e.offsetY\n };\n onPan?.({ x: e.clientX, y: e.clientY, status: 'start' });\n } else {\n clearPan();\n }\n }, []);\n\n const onPointerMove = (e: PointerEvent) => {\n if (ref.current.pointerDownId === e.pointerId) {\n onPan?.({ x: e.clientX, y: e.clientY, status: 'move' });\n }\n };\n\n const onPointerUp = useCallback(\n (ev: PointerEvent) => {\n if (ev.pointerId === ref.current.pointerDownId) {\n if (ref.current.startTime && ev.timeStamp - ref.current.startTime >= minimumTime) {\n const horizontalThreshold = ev.offsetX - ref.current.prevOffsetX;\n const verticalThreshold = ev.offsetY - ref.current.prevOffsetY;\n if (Math.abs(horizontalThreshold) > Math.abs(verticalThreshold)) {\n // pan-left or pan-right\n if (ref.current.prevOffsetX - ev.offsetX > threshold) {\n onPan?.({ x: ev.clientX, y: ev.clientY, status: 'end' });\n } else if (ev.offsetX - ref.current.prevOffsetX > threshold) {\n onPan?.({ x: ev.clientX, y: ev.clientY, status: 'end' });\n }\n } else {\n // pan-up or pan-down\n if (ref.current.prevOffsetY - ev.offsetY > threshold) {\n onPan?.({ x: ev.clientX, y: ev.clientY, status: 'end' });\n } else if (ev.offsetY - ref.current.prevOffsetY > threshold) {\n onPan?.({ x: ev.clientX, y: ev.clientY, status: 'end' });\n }\n }\n }\n }\n // state would be reset to its original state whether pan is completed or cancelled\n clearPan();\n },\n [threshold, onPan]\n );\n\n const clearPan = useCallback(() => {\n ref.current = {\n pointerDownId: null,\n startTime: null,\n prevOffsetX: 0,\n prevOffsetY: 0\n };\n }, []);\n\n const panProps = isDisabled\n ? {}\n : {\n /** event handlers to spread on the target element. */\n onPointerDown,\n onPointerUp,\n onPointerMove,\n onPointerCancel: clearPan\n };\n\n return {\n panProps\n };\n}\n"],"names":["onPan","threshold","minimumTime","isDisabled","ref","useRef","pointerDownId","startTime","prevOffsetX","prevOffsetY","onPointerDown","useCallback","e","current","clearPan","pointerId","timeStamp","offsetX","offsetY","x","clientX","y","clientY","status","onPointerUp","ev","horizontalThreshold","verticalThreshold","Math","abs","panProps","onPointerMove","onPointerCancel"],"mappings":"+EAiCEA,GACAC,UAAEA,EAAY,GAAdC,YAAkBA,EAAc,IAAhCC,WAAqCA,GAAa,GAAsB,CACtEF,UAAW,GACXC,YAAa,IACbC,YAAY,IAGd,MAAMC,EAAMC,EAAAA,OAAiB,CAC3BC,cAAe,EACfC,UAAW,EACXC,YAAa,EACbC,YAAa,IAGTC,EAAgBC,cAAaC,IAC5BR,EAAIS,QAAQP,cASfQ,KARAV,EAAIS,QAAU,CACZP,cAAeM,EAAEG,UACjBR,UAAWK,EAAEI,UACbR,YAAaI,EAAEK,QACfR,YAAaG,EAAEM,SAEjBlB,MAAAA,GAAAA,EAAQ,CAAEmB,EAAGP,EAAEQ,QAASC,EAAGT,EAAEU,QAASC,OAAQ,YAI/C,IAQGC,EAAcb,cACjBc,IACC,GAAIA,EAAGV,YAAcX,EAAIS,QAAQP,eAC3BF,EAAIS,QAAQN,WAAakB,EAAGT,UAAYZ,EAAIS,QAAQN,WAAaL,EAAa,CAChF,MAAMwB,EAAsBD,EAAGR,QAAUb,EAAIS,QAAQL,YAC/CmB,EAAoBF,EAAGP,QAAUd,EAAIS,QAAQJ,YAC/CmB,KAAKC,IAAIH,GAAuBE,KAAKC,IAAIF,IAEvCvB,EAAIS,QAAQL,YAAciB,EAAGR,QAAUhB,GAEhCwB,EAAGR,QAAUb,EAAIS,QAAQL,YAAcP,KADhDD,MAAAA,GAAAA,EAAQ,CAAEmB,EAAGM,EAAGL,QAASC,EAAGI,EAAGH,QAASC,OAAQ,UAM9CnB,EAAIS,QAAQJ,YAAcgB,EAAGP,QAAUjB,GAEhCwB,EAAGP,QAAUd,EAAIS,QAAQJ,YAAcR,KADhDD,MAAAA,GAAAA,EAAQ,CAAEmB,EAAGM,EAAGL,QAASC,EAAGI,EAAGH,QAASC,OAAQ,SAQxDT,KAEF,CAACb,EAAWD,IAGRc,EAAWH,EAAAA,YAAY,KAC3BP,EAAIS,QAAU,CACZP,cAAe,KACfC,UAAW,KACXC,YAAa,EACbC,YAAa,IAEd,IAYH,MAAO,CACLqB,SAXe3B,EACb,GACA,CAEEO,cAAAA,EACAc,YAAAA,EACAO,cAlDiBnB,IACjBR,EAAIS,QAAQP,gBAAkBM,EAAEG,YAClCf,MAAAA,GAAAA,EAAQ,CAAEmB,EAAGP,EAAEQ,QAASC,EAAGT,EAAEU,QAASC,OAAQ,WAiD5CS,gBAAiBlB"}
1
+ {"version":3,"file":"UNSAFE_usePan.js","sources":["../../../src/hooks/UNSAFE_usePan/usePan.ts"],"sourcesContent":["/**\n * @license\n * Copyright (c) %FIRST_YEAR% %CURRENT_YEAR%, Oracle and/or its affiliates.\n * Licensed under The Universal Permissive License (UPL), Version 1.0\n * as shown at https://oss.oracle.com/licenses/upl/\n * @ignore\n */\n\nimport { useRef, useCallback } from 'preact/hooks';\n\n/*\nthreshold: Minimal distance in pixels required before recognizing\n*/\ntype PanOptions = {\n threshold?: number;\n minimumTime?: number;\n isDisabled?: boolean;\n};\n\ntype PanInfo = {\n x: number;\n y: number;\n status: 'start' | 'end' | 'move';\n};\n\ntype PanState = {\n pointerDownId: number | null;\n startTime: number | null;\n prevOffsetX: number;\n prevOffsetY: number;\n};\n\nexport function usePan(\n onPan: (e: PanInfo) => void,\n { threshold = 50, minimumTime = 500, isDisabled = false }: PanOptions = {\n threshold: 50,\n minimumTime: 500,\n isDisabled: false\n }\n): { panProps: Record<string, any> } {\n const ref = useRef<PanState>({\n pointerDownId: 0,\n startTime: 0,\n prevOffsetX: 0,\n prevOffsetY: 0\n });\n\n const onPointerDown = useCallback((e: PointerEvent) => {\n if (!ref.current.pointerDownId) {\n ref.current = {\n pointerDownId: e.pointerId,\n startTime: e.timeStamp,\n prevOffsetX: e.offsetX,\n prevOffsetY: e.offsetY\n };\n onPan?.({ x: e.clientX, y: e.clientY, status: 'start' });\n } else {\n clearPan();\n }\n }, []);\n\n const onPointerMove = (e: PointerEvent) => {\n if (ref.current.pointerDownId === e.pointerId) {\n onPan?.({ x: e.clientX, y: e.clientY, status: 'move' });\n }\n };\n\n const onPointerUp = useCallback(\n (ev: PointerEvent) => {\n if (ev.pointerId === ref.current.pointerDownId) {\n if (ref.current.startTime && ev.timeStamp - ref.current.startTime >= minimumTime) {\n const horizontalThreshold = ev.offsetX - ref.current.prevOffsetX;\n const verticalThreshold = ev.offsetY - ref.current.prevOffsetY;\n if (Math.abs(horizontalThreshold) > Math.abs(verticalThreshold)) {\n // pan-left or pan-right\n if (ref.current.prevOffsetX - ev.offsetX > threshold) {\n onPan?.({ x: ev.clientX, y: ev.clientY, status: 'end' });\n } else if (ev.offsetX - ref.current.prevOffsetX > threshold) {\n onPan?.({ x: ev.clientX, y: ev.clientY, status: 'end' });\n }\n } else {\n // pan-up or pan-down\n if (ref.current.prevOffsetY - ev.offsetY > threshold) {\n onPan?.({ x: ev.clientX, y: ev.clientY, status: 'end' });\n } else if (ev.offsetY - ref.current.prevOffsetY > threshold) {\n onPan?.({ x: ev.clientX, y: ev.clientY, status: 'end' });\n }\n }\n }\n }\n // state would be reset to its original state whether pan is completed or cancelled\n clearPan();\n },\n [threshold, onPan]\n );\n\n const clearPan = useCallback(() => {\n ref.current = {\n pointerDownId: null,\n startTime: null,\n prevOffsetX: 0,\n prevOffsetY: 0\n };\n }, []);\n\n const panProps = isDisabled\n ? {}\n : {\n /** event handlers to spread on the target element. */\n onPointerDown,\n onPointerUp,\n onPointerMove,\n onPointerCancel: clearPan\n };\n\n return {\n panProps\n };\n}\n"],"names":["onPan","threshold","minimumTime","isDisabled","ref","useRef","pointerDownId","startTime","prevOffsetX","prevOffsetY","onPointerDown","useCallback","e","current","clearPan","pointerId","timeStamp","offsetX","offsetY","x","clientX","y","clientY","status","onPointerUp","ev","horizontalThreshold","verticalThreshold","Math","abs","panProps","onPointerMove","onPointerCancel"],"mappings":"+EAiCEA,GACAC,UAAEA,EAAY,GAAEC,YAAEA,EAAc,IAAGC,WAAEA,GAAa,GAAsB,CACtEF,UAAW,GACXC,YAAa,IACbC,YAAY,IAGd,MAAMC,EAAMC,EAAAA,OAAiB,CAC3BC,cAAe,EACfC,UAAW,EACXC,YAAa,EACbC,YAAa,IAGTC,EAAgBC,cAAaC,IAC5BR,EAAIS,QAAQP,cASfQ,KARAV,EAAIS,QAAU,CACZP,cAAeM,EAAEG,UACjBR,UAAWK,EAAEI,UACbR,YAAaI,EAAEK,QACfR,YAAaG,EAAEM,SAEjBlB,MAAAA,GAAAA,EAAQ,CAAEmB,EAAGP,EAAEQ,QAASC,EAAGT,EAAEU,QAASC,OAAQ,YAI/C,IAQGC,EAAcb,cACjBc,IACC,GAAIA,EAAGV,YAAcX,EAAIS,QAAQP,eAC3BF,EAAIS,QAAQN,WAAakB,EAAGT,UAAYZ,EAAIS,QAAQN,WAAaL,EAAa,CAChF,MAAMwB,EAAsBD,EAAGR,QAAUb,EAAIS,QAAQL,YAC/CmB,EAAoBF,EAAGP,QAAUd,EAAIS,QAAQJ,YAC/CmB,KAAKC,IAAIH,GAAuBE,KAAKC,IAAIF,IAEvCvB,EAAIS,QAAQL,YAAciB,EAAGR,QAAUhB,GAEhCwB,EAAGR,QAAUb,EAAIS,QAAQL,YAAcP,KADhDD,MAAAA,GAAAA,EAAQ,CAAEmB,EAAGM,EAAGL,QAASC,EAAGI,EAAGH,QAASC,OAAQ,UAM9CnB,EAAIS,QAAQJ,YAAcgB,EAAGP,QAAUjB,GAEhCwB,EAAGP,QAAUd,EAAIS,QAAQJ,YAAcR,KADhDD,MAAAA,GAAAA,EAAQ,CAAEmB,EAAGM,EAAGL,QAASC,EAAGI,EAAGH,QAASC,OAAQ,SAQxDT,KAEF,CAACb,EAAWD,IAGRc,EAAWH,EAAAA,YAAY,KAC3BP,EAAIS,QAAU,CACZP,cAAe,KACfC,UAAW,KACXC,YAAa,EACbC,YAAa,IAEd,IAYH,MAAO,CACLqB,SAXe3B,EACb,GACA,CAEEO,cAAAA,EACAc,YAAAA,EACAO,cAlDiBnB,IACjBR,EAAIS,QAAQP,gBAAkBM,EAAEG,YAClCf,MAAAA,GAAAA,EAAQ,CAAEmB,EAAGP,EAAEQ,QAASC,EAAGT,EAAEU,QAASC,OAAQ,WAiD5CS,gBAAiBlB"}
@@ -1,2 +1,2 @@
1
- define(["exports","preact/jsx-runtime","../UNSAFE_PrefixSuffix","./UNSAFE_useUser",'module',"../utils/UNSAFE_classNames","../classNames-19b96444","preact/hooks","../UNSAFE_Environment","preact","../UNSAFE_Layer","preact/compat"],function(e,i,s,t,n,r,a,d,o,f,u,l){"use strict";e.usePrefixSuffix=({baseId:e,hasEndContent:n,hasInsideLabel:r,hasStartContent:a,hasValue:d,isDisabled:o,isFocused:f,labelId:u,prefix:l,suffix:x,value:c})=>{const{direction:v}=t.useUser(),$=`${e}-prefix`,h=`${e}-suffix`,S=void 0!==l&&""!==l,b=void 0!==x&&""!==x,p=S&&!o&&(d||f)?i.jsx(s.PrefixSuffix,{id:$,hasEndContent:n,hasInsideLabel:r,hasStartContent:a,isDisabled:o,isFocused:f,text:l,variant:"prefix"}):void 0,E=b&&!o&&(d||f)?i.jsx(s.PrefixSuffix,{id:h,hasInsideLabel:r,isDisabled:o,isFocused:f,text:x,variant:"suffix"}):void 0,F=S||b?function(e,i,s,t,n){if(!i)return n;const r="ltr"===e,a=void 0===s?"":r?`${s} `:` ${s}`,d=void 0===t?"":r?` ${t}`:`${t} `,o=`${a}${n}${d}`,f=`${d}${n}${a}`;return r?o:f}(v,d,l,x,c):c,N=S||b?function(e,i,s){const t=null!=e?e:"",n=void 0===i?"":0===t.length?i:` ${i}`,r=void 0===s?"":0===t.length&&0===n.length?s:` ${s}`,a=`${t}${n}${r}`;return 0===a.length?void 0:a}(u,S?$:void 0,b?h:void 0):void 0;return{renderedPrefix:p,renderedSuffix:E,text:F,ariaLabelledBy:N}},Object.defineProperty(e,"__esModule",{value:!0})});
1
+ define(["exports","preact/jsx-runtime","../UNSAFE_PrefixSuffix","./UNSAFE_useUser",'module',"../utils/UNSAFE_classNames","../classNames-429bf434","preact/hooks","../UNSAFE_Environment","preact","../UNSAFE_Layer","preact/compat"],function(e,i,s,t,n,r,a,d,o,f,u,l){"use strict";e.usePrefixSuffix=({baseId:e,hasEndContent:n,hasInsideLabel:r,hasStartContent:a,hasValue:d,isDisabled:o,isFocused:f,labelId:u,prefix:l,suffix:x,value:c})=>{const{direction:v}=t.useUser(),$=`${e}-prefix`,h=`${e}-suffix`,S=void 0!==l&&""!==l,b=void 0!==x&&""!==x,p=S&&!o&&(d||f)?i.jsx(s.PrefixSuffix,{id:$,hasEndContent:n,hasInsideLabel:r,hasStartContent:a,isDisabled:o,isFocused:f,text:l,variant:"prefix"}):void 0,E=b&&!o&&(d||f)?i.jsx(s.PrefixSuffix,{id:h,hasInsideLabel:r,isDisabled:o,isFocused:f,text:x,variant:"suffix"}):void 0,F=S||b?function(e,i,s,t,n){if(!i)return n;const r="ltr"===e,a=void 0===s?"":r?`${s} `:` ${s}`,d=void 0===t?"":r?` ${t}`:`${t} `,o=`${a}${n}${d}`,f=`${d}${n}${a}`;return r?o:f}(v,d,l,x,c):c,N=S||b?function(e,i,s){const t=null!=e?e:"",n=void 0===i?"":0===t.length?i:` ${i}`,r=void 0===s?"":0===t.length&&0===n.length?s:` ${s}`,a=`${t}${n}${r}`;return 0===a.length?void 0:a}(u,S?$:void 0,b?h:void 0):void 0;return{renderedPrefix:p,renderedSuffix:E,text:F,ariaLabelledBy:N}},Object.defineProperty(e,"__esModule",{value:!0})});
2
2
  //# sourceMappingURL=UNSAFE_usePrefixSuffix.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"UNSAFE_usePrefixSuffix.js","sources":["../../../src/hooks/UNSAFE_usePrefixSuffix/usePrefixSuffix.tsx"],"sourcesContent":["import { PrefixSuffix } from '../../UNSAFE_PrefixSuffix';\nimport { useUser } from '../UNSAFE_useUser';\n\ntype Props = {\n baseId: string;\n hasEndContent?: boolean;\n hasInsideLabel?: boolean;\n hasStartContent?: boolean;\n hasValue?: boolean;\n isDisabled?: boolean;\n isFocused?: boolean;\n labelId?: string;\n prefix?: string;\n suffix?: string;\n value?: string;\n};\n\n// returns the prefix and/or suffix components\n// if the condition in which they should be shown is met.\nexport const usePrefixSuffix = ({\n baseId,\n hasEndContent,\n hasInsideLabel,\n hasStartContent,\n hasValue,\n isDisabled,\n isFocused,\n labelId,\n prefix,\n suffix,\n value\n}: Props) => {\n const { direction } = useUser();\n // for accessibility, if you have a prefix, then you must have a prefixId\n const prefixId = `${baseId}-prefix`;\n const suffixId = `${baseId}-suffix`;\n const hasPrefixText = prefix !== undefined && prefix !== '';\n const hasSuffixText = suffix !== undefined && suffix !== '';\n\n const renderedPrefix =\n hasPrefixText && !isDisabled && (hasValue || isFocused) ? (\n <PrefixSuffix\n id={prefixId}\n hasEndContent={hasEndContent}\n hasInsideLabel={hasInsideLabel}\n hasStartContent={hasStartContent}\n isDisabled={isDisabled}\n isFocused={isFocused}\n text={prefix}\n variant=\"prefix\"\n />\n ) : undefined;\n\n const renderedSuffix =\n hasSuffixText && !isDisabled && (hasValue || isFocused) ? (\n <PrefixSuffix\n id={suffixId}\n hasInsideLabel={hasInsideLabel}\n isDisabled={isDisabled}\n isFocused={isFocused}\n text={suffix}\n variant=\"suffix\"\n />\n ) : undefined;\n\n // get value and prefix/suffix if available and return as plain text.\n const text =\n hasPrefixText || hasSuffixText ? getText(direction, hasValue, prefix, suffix, value) : value;\n // get aria-labelledby if there is a prefix or suffix\n const ariaLabelledBy =\n hasPrefixText || hasSuffixText\n ? getAriaLabelledBy(\n labelId,\n hasPrefixText ? prefixId : undefined,\n hasSuffixText ? suffixId : undefined\n )\n : undefined;\n\n return { renderedPrefix, renderedSuffix, text, ariaLabelledBy };\n};\n\n/**\n * Returns the value to render in plain text, taking into account the prefix and suffix\n * and reading direction. Do not add a prefix/suffix if the component doesn't have a value.\n * @returns string | undefined\n */\nfunction getText(\n direction: 'ltr' | 'rtl',\n hasValue?: boolean,\n prefix?: string,\n suffix?: string,\n value?: string\n) {\n // Do not add a prefix/suffix if the component doesn't have a value.\n if (!hasValue) {\n return value;\n }\n // TODO: direction is 'ltr' even though the storybook is rtl.\n // Test this when the storybook bug is fixed. https://jira.oraclecorp.com/jira/browse/JET-51816?src=confmacro\n const isLTR = direction === 'ltr';\n const plainPrefix = prefix === undefined ? `` : isLTR ? `${prefix} ` : ` ${prefix}`;\n const plainSuffix = suffix === undefined ? `` : isLTR ? ` ${suffix}` : `${suffix} `;\n\n const ltrPlainText = `${plainPrefix}${value}${plainSuffix}`;\n const rtlPlainText = `${plainSuffix}${value}${plainPrefix}`;\n return isLTR ? ltrPlainText : rtlPlainText;\n}\n\nfunction getAriaLabelledBy(labelId?: string, prefixId?: string, suffixId?: string) {\n const label = labelId ?? '';\n const prefix = prefixId === undefined ? '' : label.length === 0 ? prefixId : ` ${prefixId}`;\n const suffix =\n suffixId === undefined\n ? ''\n : label.length === 0 && prefix.length === 0\n ? suffixId\n : ` ${suffixId}`;\n const ariaLabelledBy = `${label}${prefix}${suffix}`;\n return ariaLabelledBy.length === 0 ? undefined : ariaLabelledBy;\n}\n"],"names":["baseId","hasEndContent","hasInsideLabel","hasStartContent","hasValue","isDisabled","isFocused","labelId","prefix","suffix","value","direction","useUser","prefixId","suffixId","hasPrefixText","undefined","hasSuffixText","renderedPrefix","_jsx","jsx","PrefixSuffix","id","text","variant","renderedSuffix","isLTR","plainPrefix","plainSuffix","ltrPlainText","rtlPlainText","getText","ariaLabelledBy","label","length","getAriaLabelledBy"],"mappings":"uSAmB+B,EAC7BA,OAAAA,EACAC,cAAAA,EACAC,eAAAA,EACAC,gBAAAA,EACAC,SAAAA,EACAC,WAAAA,EACAC,UAAAA,EACAC,QAAAA,EACAC,OAAAA,EACAC,OAAAA,EACAC,MAAAA,MAEA,MAAMC,UAAEA,GAAcC,EAAAA,UAEhBC,EAAc,GAAAb,WACdc,EAAc,GAAAd,WACde,OAA2BC,IAAXR,GAAmC,KAAXA,EACxCS,OAA2BD,IAAXP,GAAmC,KAAXA,EAExCS,EACJH,IAAkBV,IAAeD,GAAYE,GAC3Ca,EAACC,IAAAC,EAAYA,aACX,CAAAC,GAAIT,EACJZ,cAAeA,EACfC,eAAgBA,EAChBC,gBAAiBA,EACjBE,WAAYA,EACZC,UAAWA,EACXiB,KAAMf,EACNgB,QAAQ,gBAERR,EAEAS,EACJR,IAAkBZ,IAAeD,GAAYE,GAC3Ca,MAACE,EAAAA,aACC,CAAAC,GAAIR,EACJZ,eAAgBA,EAChBG,WAAYA,EACZC,UAAWA,EACXiB,KAAMd,EACNe,QAAQ,gBAERR,EAGAO,EACJR,GAAiBE,EAmBrB,SACEN,EACAP,EACAI,EACAC,EACAC,GAGA,IAAKN,EACH,OAAOM,EAIT,MAAMgB,EAAsB,QAAdf,EACRgB,OAAyBX,IAAXR,EAAyB,GAAGkB,EAAQ,GAAGlB,KAAY,IAAIA,IACrEoB,OAAyBZ,IAAXP,EAAyB,GAAGiB,EAAQ,IAAIjB,IAAW,GAAGA,KAEpEoB,EAAkB,GAAAF,IAAcjB,IAAQkB,IACxCE,EAAkB,GAAAF,IAAclB,IAAQiB,IAC9C,OAAOD,EAAQG,EAAeC,EAtCKC,CAAQpB,EAAWP,EAAUI,EAAQC,EAAQC,GAASA,EAEnFsB,EACJjB,GAAiBE,EAsCrB,SAA2BV,EAAkBM,EAAmBC,GAC9D,MAAMmB,EAAQ1B,MAAAA,EAAAA,EAAW,GACnBC,OAAsBQ,IAAbH,EAAyB,GAAsB,IAAjBoB,EAAMC,OAAerB,EAAW,IAAIA,IAC3EJ,OACSO,IAAbF,EACI,GACiB,IAAjBmB,EAAMC,QAAkC,IAAlB1B,EAAO0B,OAC7BpB,EACA,IAAIA,IACJkB,EAAoB,GAAAC,IAAQzB,IAASC,IAC3C,OAAiC,IAA1BuB,EAAeE,YAAelB,EAAYgB,EA/C3CG,CACE5B,EACAQ,EAAgBF,OAAWG,EAC3BC,EAAgBH,OAAWE,QAE7BA,EAEN,MAAO,CAAEE,eAAAA,EAAgBO,eAAAA,EAAgBF,KAAAA,EAAMS,eAAAA"}
1
+ {"version":3,"file":"UNSAFE_usePrefixSuffix.js","sources":["../../../src/hooks/UNSAFE_usePrefixSuffix/usePrefixSuffix.tsx"],"sourcesContent":["import { PrefixSuffix } from '../../UNSAFE_PrefixSuffix';\nimport { useUser } from '../UNSAFE_useUser';\n\ntype Props = {\n baseId: string;\n hasEndContent?: boolean;\n hasInsideLabel?: boolean;\n hasStartContent?: boolean;\n hasValue?: boolean;\n isDisabled?: boolean;\n isFocused?: boolean;\n labelId?: string;\n prefix?: string;\n suffix?: string;\n value?: string;\n};\n\n// returns the prefix and/or suffix components\n// if the condition in which they should be shown is met.\nexport const usePrefixSuffix = ({\n baseId,\n hasEndContent,\n hasInsideLabel,\n hasStartContent,\n hasValue,\n isDisabled,\n isFocused,\n labelId,\n prefix,\n suffix,\n value\n}: Props) => {\n const { direction } = useUser();\n // for accessibility, if you have a prefix, then you must have a prefixId\n const prefixId = `${baseId}-prefix`;\n const suffixId = `${baseId}-suffix`;\n const hasPrefixText = prefix !== undefined && prefix !== '';\n const hasSuffixText = suffix !== undefined && suffix !== '';\n\n const renderedPrefix =\n hasPrefixText && !isDisabled && (hasValue || isFocused) ? (\n <PrefixSuffix\n id={prefixId}\n hasEndContent={hasEndContent}\n hasInsideLabel={hasInsideLabel}\n hasStartContent={hasStartContent}\n isDisabled={isDisabled}\n isFocused={isFocused}\n text={prefix}\n variant=\"prefix\"\n />\n ) : undefined;\n\n const renderedSuffix =\n hasSuffixText && !isDisabled && (hasValue || isFocused) ? (\n <PrefixSuffix\n id={suffixId}\n hasInsideLabel={hasInsideLabel}\n isDisabled={isDisabled}\n isFocused={isFocused}\n text={suffix}\n variant=\"suffix\"\n />\n ) : undefined;\n\n // get value and prefix/suffix if available and return as plain text.\n const text =\n hasPrefixText || hasSuffixText ? getText(direction, hasValue, prefix, suffix, value) : value;\n // get aria-labelledby if there is a prefix or suffix\n const ariaLabelledBy =\n hasPrefixText || hasSuffixText\n ? getAriaLabelledBy(\n labelId,\n hasPrefixText ? prefixId : undefined,\n hasSuffixText ? suffixId : undefined\n )\n : undefined;\n\n return { renderedPrefix, renderedSuffix, text, ariaLabelledBy };\n};\n\n/**\n * Returns the value to render in plain text, taking into account the prefix and suffix\n * and reading direction. Do not add a prefix/suffix if the component doesn't have a value.\n * @returns string | undefined\n */\nfunction getText(\n direction: 'ltr' | 'rtl',\n hasValue?: boolean,\n prefix?: string,\n suffix?: string,\n value?: string\n) {\n // Do not add a prefix/suffix if the component doesn't have a value.\n if (!hasValue) {\n return value;\n }\n // TODO: direction is 'ltr' even though the storybook is rtl.\n // Test this when the storybook bug is fixed. https://jira.oraclecorp.com/jira/browse/JET-51816?src=confmacro\n const isLTR = direction === 'ltr';\n const plainPrefix = prefix === undefined ? `` : isLTR ? `${prefix} ` : ` ${prefix}`;\n const plainSuffix = suffix === undefined ? `` : isLTR ? ` ${suffix}` : `${suffix} `;\n\n const ltrPlainText = `${plainPrefix}${value}${plainSuffix}`;\n const rtlPlainText = `${plainSuffix}${value}${plainPrefix}`;\n return isLTR ? ltrPlainText : rtlPlainText;\n}\n\nfunction getAriaLabelledBy(labelId?: string, prefixId?: string, suffixId?: string) {\n const label = labelId ?? '';\n const prefix = prefixId === undefined ? '' : label.length === 0 ? prefixId : ` ${prefixId}`;\n const suffix =\n suffixId === undefined\n ? ''\n : label.length === 0 && prefix.length === 0\n ? suffixId\n : ` ${suffixId}`;\n const ariaLabelledBy = `${label}${prefix}${suffix}`;\n return ariaLabelledBy.length === 0 ? undefined : ariaLabelledBy;\n}\n"],"names":["baseId","hasEndContent","hasInsideLabel","hasStartContent","hasValue","isDisabled","isFocused","labelId","prefix","suffix","value","direction","useUser","prefixId","suffixId","hasPrefixText","undefined","hasSuffixText","renderedPrefix","_jsx","jsx","PrefixSuffix","id","text","variant","renderedSuffix","isLTR","plainPrefix","plainSuffix","ltrPlainText","rtlPlainText","getText","ariaLabelledBy","label","length","getAriaLabelledBy"],"mappings":"uSAmB+B,EAC7BA,OAAAA,EACAC,cAAAA,EACAC,eAAAA,EACAC,gBAAAA,EACAC,SAAAA,EACAC,WAAAA,EACAC,UAAAA,EACAC,QAAAA,EACAC,OAAAA,EACAC,OAAAA,EACAC,MAAAA,MAEA,MAAMC,UAAEA,GAAcC,EAAAA,UAEhBC,EAAW,GAAGb,WACdc,EAAW,GAAGd,WACde,OAA2BC,IAAXR,GAAmC,KAAXA,EACxCS,OAA2BD,IAAXP,GAAmC,KAAXA,EAExCS,EACJH,IAAkBV,IAAeD,GAAYE,GAC3Ca,EAACC,IAAAC,EAAYA,aACX,CAAAC,GAAIT,EACJZ,cAAeA,EACfC,eAAgBA,EAChBC,gBAAiBA,EACjBE,WAAYA,EACZC,UAAWA,EACXiB,KAAMf,EACNgB,QAAQ,gBAERR,EAEAS,EACJR,IAAkBZ,IAAeD,GAAYE,GAC3Ca,MAACE,EAAAA,aACC,CAAAC,GAAIR,EACJZ,eAAgBA,EAChBG,WAAYA,EACZC,UAAWA,EACXiB,KAAMd,EACNe,QAAQ,gBAERR,EAGAO,EACJR,GAAiBE,EAmBrB,SACEN,EACAP,EACAI,EACAC,EACAC,GAGA,IAAKN,EACH,OAAOM,EAIT,MAAMgB,EAAsB,QAAdf,EACRgB,OAAyBX,IAAXR,EAAuB,GAAKkB,EAAQ,GAAGlB,KAAY,IAAIA,IACrEoB,OAAyBZ,IAAXP,EAAuB,GAAKiB,EAAQ,IAAIjB,IAAW,GAAGA,KAEpEoB,EAAe,GAAGF,IAAcjB,IAAQkB,IACxCE,EAAe,GAAGF,IAAclB,IAAQiB,IAC9C,OAAOD,EAAQG,EAAeC,EAtCKC,CAAQpB,EAAWP,EAAUI,EAAQC,EAAQC,GAASA,EAEnFsB,EACJjB,GAAiBE,EAsCrB,SAA2BV,EAAkBM,EAAmBC,GAC9D,MAAMmB,EAAQ1B,MAAAA,EAAAA,EAAW,GACnBC,OAAsBQ,IAAbH,EAAyB,GAAsB,IAAjBoB,EAAMC,OAAerB,EAAW,IAAIA,IAC3EJ,OACSO,IAAbF,EACI,GACiB,IAAjBmB,EAAMC,QAAkC,IAAlB1B,EAAO0B,OAC7BpB,EACA,IAAIA,IACJkB,EAAiB,GAAGC,IAAQzB,IAASC,IAC3C,OAAiC,IAA1BuB,EAAeE,YAAelB,EAAYgB,EA/C3CG,CACE5B,EACAQ,EAAgBF,OAAWG,EAC3BC,EAAgBH,OAAWE,QAE7BA,EAEN,MAAO,CAAEE,eAAAA,EAAgBO,eAAAA,EAAgBF,KAAAA,EAAMS,eAAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"UNSAFE_useSwipe.js","sources":["../../../src/hooks/UNSAFE_useSwipe/useSwipe.ts"],"sourcesContent":["/**\n * @license\n * Copyright (c) %FIRST_YEAR% %CURRENT_YEAR%, Oracle and/or its affiliates.\n * Licensed under The Universal Permissive License (UPL), Version 1.0\n * as shown at https://oss.oracle.com/licenses/upl/\n * @ignore\n */\n\nimport { useRef, useCallback } from 'preact/hooks';\n\n/*\n threshold: Minimal threshold required before recognizing\n tolerance: A tolerance value which allows the user to move their finger about a length measured in pixels.\n This allows the swipe gesture to be triggered more easily since a User might not move their finger\n in a straight line.\n*/\ntype SwipeOptions = {\n threshold?: number;\n maximumTime?: number;\n tolerance?: number;\n isDisabled?: boolean;\n};\n\ntype SwipeInfo = {\n direction: 'left' | 'right' | 'up' | 'down';\n};\n\ntype SwipeState = {\n pointerDownId: number | null;\n startTime: number | null;\n prevoffsetX: number;\n prevoffsetY: number;\n};\n\nexport function useSwipe(\n onSwipe: (e: SwipeInfo) => void,\n { threshold = 10, maximumTime = 300, tolerance = 50, isDisabled = false }: SwipeOptions = {\n threshold: 10,\n maximumTime: 300,\n tolerance: 50,\n isDisabled: false\n }\n): { swipeProps: Record<string, any> } {\n const ref = useRef<SwipeState>({\n pointerDownId: 0,\n startTime: null,\n prevoffsetX: 0,\n prevoffsetY: 0\n });\n\n const onPointerDown = useCallback((e: PointerEvent) => {\n if (!ref.current.pointerDownId) {\n ref.current = {\n pointerDownId: e.pointerId,\n startTime: e.timeStamp,\n prevoffsetX: e.offsetX,\n prevoffsetY: e.offsetY\n };\n } else {\n clearSwipe();\n }\n }, []);\n\n const onPointerUp = useCallback(\n (ev: PointerEvent) => {\n if (ev.pointerId === ref.current.pointerDownId) {\n if (ref.current.startTime && ev.timeStamp - ref.current.startTime < maximumTime) {\n if (\n ref.current.prevoffsetX - ev.offsetX > threshold &&\n Math.abs(ev.offsetY - ref.current.prevoffsetY) <= tolerance\n ) {\n onSwipe?.({ direction: 'left' });\n } else if (\n ev.offsetX - ref.current.prevoffsetX > threshold &&\n Math.abs(ev.offsetY - ref.current.prevoffsetY) <= tolerance\n ) {\n onSwipe?.({ direction: 'right' });\n } else if (\n ref.current.prevoffsetY - ev.offsetY > threshold &&\n Math.abs(ev.offsetX - ref.current.prevoffsetX) <= tolerance\n ) {\n onSwipe?.({ direction: 'up' });\n } else if (\n ev.offsetY - ref.current.prevoffsetY > threshold &&\n Math.abs(ev.offsetX - ref.current.prevoffsetX) <= tolerance\n ) {\n onSwipe?.({ direction: 'down' });\n }\n }\n }\n // state would be reset to its original state whether swipe is completed or cancelled\n clearSwipe();\n },\n [threshold, onSwipe]\n );\n\n const clearSwipe = useCallback(() => {\n ref.current = {\n pointerDownId: null,\n startTime: 0,\n prevoffsetX: 0,\n prevoffsetY: 0\n };\n }, []);\n\n const swipeProps = isDisabled\n ? {}\n : {\n /** event handlers to spread on the target element. */\n onPointerDown,\n onPointerUp,\n onPointerCancel: clearSwipe\n };\n\n return {\n swipeProps\n };\n}\n"],"names":["onSwipe","threshold","maximumTime","tolerance","isDisabled","ref","useRef","pointerDownId","startTime","prevoffsetX","prevoffsetY","onPointerDown","useCallback","e","current","clearSwipe","pointerId","timeStamp","offsetX","offsetY","onPointerUp","ev","Math","abs","direction","swipeProps","onPointerCancel"],"mappings":"wEAkCM,SACJA,GACAC,UAAEA,EAAY,GAAdC,YAAkBA,EAAc,IAAhCC,UAAqCA,EAAY,GAAjDC,WAAqDA,GAAa,GAAwB,CACxFH,UAAW,GACXC,YAAa,IACbC,UAAW,GACXC,YAAY,IAGd,MAAMC,EAAMC,EAAAA,OAAmB,CAC7BC,cAAe,EACfC,UAAW,KACXC,YAAa,EACbC,YAAa,IAGTC,EAAgBC,cAAaC,IAC5BR,EAAIS,QAAQP,cAQfQ,IAPAV,EAAIS,QAAU,CACZP,cAAeM,EAAEG,UACjBR,UAAWK,EAAEI,UACbR,YAAaI,EAAEK,QACfR,YAAaG,EAAEM,UAKlB,IAEGC,EAAcR,cACjBS,IACKA,EAAGL,YAAcX,EAAIS,QAAQP,eAC3BF,EAAIS,QAAQN,WAAaa,EAAGJ,UAAYZ,EAAIS,QAAQN,UAAYN,IAEhEG,EAAIS,QAAQL,YAAcY,EAAGH,QAAUjB,GACvCqB,KAAKC,IAAIF,EAAGF,QAAUd,EAAIS,QAAQJ,cAAgBP,EAElDH,MAAAA,GAAAA,EAAU,CAAEwB,UAAW,SAEvBH,EAAGH,QAAUb,EAAIS,QAAQL,YAAcR,GACvCqB,KAAKC,IAAIF,EAAGF,QAAUd,EAAIS,QAAQJ,cAAgBP,EAElDH,MAAAA,GAAAA,EAAU,CAAEwB,UAAW,UAEvBnB,EAAIS,QAAQJ,YAAcW,EAAGF,QAAUlB,GACvCqB,KAAKC,IAAIF,EAAGH,QAAUb,EAAIS,QAAQL,cAAgBN,EAElDH,MAAAA,GAAAA,EAAU,CAAEwB,UAAW,OAEvBH,EAAGF,QAAUd,EAAIS,QAAQJ,YAAcT,GACvCqB,KAAKC,IAAIF,EAAGH,QAAUb,EAAIS,QAAQL,cAAgBN,IAElDH,MAAAA,GAAAA,EAAU,CAAEwB,UAAW,WAK7BT,KAEF,CAACd,EAAWD,IAGRe,EAAaH,EAAAA,YAAY,KAC7BP,EAAIS,QAAU,CACZP,cAAe,KACfC,UAAW,EACXC,YAAa,EACbC,YAAa,IAEd,IAWH,MAAO,CACLe,WAViBrB,EACf,GACA,CAEEO,cAAAA,EACAS,YAAAA,EACAM,gBAAiBX"}
1
+ {"version":3,"file":"UNSAFE_useSwipe.js","sources":["../../../src/hooks/UNSAFE_useSwipe/useSwipe.ts"],"sourcesContent":["/**\n * @license\n * Copyright (c) %FIRST_YEAR% %CURRENT_YEAR%, Oracle and/or its affiliates.\n * Licensed under The Universal Permissive License (UPL), Version 1.0\n * as shown at https://oss.oracle.com/licenses/upl/\n * @ignore\n */\n\nimport { useRef, useCallback } from 'preact/hooks';\n\n/*\n threshold: Minimal threshold required before recognizing\n tolerance: A tolerance value which allows the user to move their finger about a length measured in pixels.\n This allows the swipe gesture to be triggered more easily since a User might not move their finger\n in a straight line.\n*/\ntype SwipeOptions = {\n threshold?: number;\n maximumTime?: number;\n tolerance?: number;\n isDisabled?: boolean;\n};\n\ntype SwipeInfo = {\n direction: 'left' | 'right' | 'up' | 'down';\n};\n\ntype SwipeState = {\n pointerDownId: number | null;\n startTime: number | null;\n prevoffsetX: number;\n prevoffsetY: number;\n};\n\nexport function useSwipe(\n onSwipe: (e: SwipeInfo) => void,\n { threshold = 10, maximumTime = 300, tolerance = 50, isDisabled = false }: SwipeOptions = {\n threshold: 10,\n maximumTime: 300,\n tolerance: 50,\n isDisabled: false\n }\n): { swipeProps: Record<string, any> } {\n const ref = useRef<SwipeState>({\n pointerDownId: 0,\n startTime: null,\n prevoffsetX: 0,\n prevoffsetY: 0\n });\n\n const onPointerDown = useCallback((e: PointerEvent) => {\n if (!ref.current.pointerDownId) {\n ref.current = {\n pointerDownId: e.pointerId,\n startTime: e.timeStamp,\n prevoffsetX: e.offsetX,\n prevoffsetY: e.offsetY\n };\n } else {\n clearSwipe();\n }\n }, []);\n\n const onPointerUp = useCallback(\n (ev: PointerEvent) => {\n if (ev.pointerId === ref.current.pointerDownId) {\n if (ref.current.startTime && ev.timeStamp - ref.current.startTime < maximumTime) {\n if (\n ref.current.prevoffsetX - ev.offsetX > threshold &&\n Math.abs(ev.offsetY - ref.current.prevoffsetY) <= tolerance\n ) {\n onSwipe?.({ direction: 'left' });\n } else if (\n ev.offsetX - ref.current.prevoffsetX > threshold &&\n Math.abs(ev.offsetY - ref.current.prevoffsetY) <= tolerance\n ) {\n onSwipe?.({ direction: 'right' });\n } else if (\n ref.current.prevoffsetY - ev.offsetY > threshold &&\n Math.abs(ev.offsetX - ref.current.prevoffsetX) <= tolerance\n ) {\n onSwipe?.({ direction: 'up' });\n } else if (\n ev.offsetY - ref.current.prevoffsetY > threshold &&\n Math.abs(ev.offsetX - ref.current.prevoffsetX) <= tolerance\n ) {\n onSwipe?.({ direction: 'down' });\n }\n }\n }\n // state would be reset to its original state whether swipe is completed or cancelled\n clearSwipe();\n },\n [threshold, onSwipe]\n );\n\n const clearSwipe = useCallback(() => {\n ref.current = {\n pointerDownId: null,\n startTime: 0,\n prevoffsetX: 0,\n prevoffsetY: 0\n };\n }, []);\n\n const swipeProps = isDisabled\n ? {}\n : {\n /** event handlers to spread on the target element. */\n onPointerDown,\n onPointerUp,\n onPointerCancel: clearSwipe\n };\n\n return {\n swipeProps\n };\n}\n"],"names":["onSwipe","threshold","maximumTime","tolerance","isDisabled","ref","useRef","pointerDownId","startTime","prevoffsetX","prevoffsetY","onPointerDown","useCallback","e","current","clearSwipe","pointerId","timeStamp","offsetX","offsetY","onPointerUp","ev","Math","abs","direction","swipeProps","onPointerCancel"],"mappings":"wEAkCM,SACJA,GACAC,UAAEA,EAAY,GAAEC,YAAEA,EAAc,IAAGC,UAAEA,EAAY,GAAEC,WAAEA,GAAa,GAAwB,CACxFH,UAAW,GACXC,YAAa,IACbC,UAAW,GACXC,YAAY,IAGd,MAAMC,EAAMC,EAAAA,OAAmB,CAC7BC,cAAe,EACfC,UAAW,KACXC,YAAa,EACbC,YAAa,IAGTC,EAAgBC,cAAaC,IAC5BR,EAAIS,QAAQP,cAQfQ,IAPAV,EAAIS,QAAU,CACZP,cAAeM,EAAEG,UACjBR,UAAWK,EAAEI,UACbR,YAAaI,EAAEK,QACfR,YAAaG,EAAEM,UAKlB,IAEGC,EAAcR,cACjBS,IACKA,EAAGL,YAAcX,EAAIS,QAAQP,eAC3BF,EAAIS,QAAQN,WAAaa,EAAGJ,UAAYZ,EAAIS,QAAQN,UAAYN,IAEhEG,EAAIS,QAAQL,YAAcY,EAAGH,QAAUjB,GACvCqB,KAAKC,IAAIF,EAAGF,QAAUd,EAAIS,QAAQJ,cAAgBP,EAElDH,MAAAA,GAAAA,EAAU,CAAEwB,UAAW,SAEvBH,EAAGH,QAAUb,EAAIS,QAAQL,YAAcR,GACvCqB,KAAKC,IAAIF,EAAGF,QAAUd,EAAIS,QAAQJ,cAAgBP,EAElDH,MAAAA,GAAAA,EAAU,CAAEwB,UAAW,UAEvBnB,EAAIS,QAAQJ,YAAcW,EAAGF,QAAUlB,GACvCqB,KAAKC,IAAIF,EAAGH,QAAUb,EAAIS,QAAQL,cAAgBN,EAElDH,MAAAA,GAAAA,EAAU,CAAEwB,UAAW,OAEvBH,EAAGF,QAAUd,EAAIS,QAAQJ,YAAcT,GACvCqB,KAAKC,IAAIF,EAAGH,QAAUb,EAAIS,QAAQL,cAAgBN,IAElDH,MAAAA,GAAAA,EAAU,CAAEwB,UAAW,WAK7BT,KAEF,CAACd,EAAWD,IAGRe,EAAaH,EAAAA,YAAY,KAC7BP,EAAIS,QAAU,CACZP,cAAe,KACfC,UAAW,EACXC,YAAa,EACbC,YAAa,IAEd,IAWH,MAAO,CACLe,WAViBrB,EACf,GACA,CAEEO,cAAAA,EACAS,YAAAA,EACAM,gBAAiBX"}
@@ -1 +1 @@
1
- {"version":3,"file":"UNSAFE_useTextField.js","sources":["../../../src/hooks/UNSAFE_useTextField/useTextField.ts"],"sourcesContent":["import { ComponentProps } from 'preact';\nimport { useMemo } from 'preact/hooks';\nimport { Label } from '../../UNSAFE_Label';\nimport { TextField } from '../../UNSAFE_TextField';\nimport { InlineUserAssistance } from '../../UNSAFE_UserAssistance';\nimport { FormFieldContextProps } from '../UNSAFE_useFormFieldContext';\nimport { useId } from '../UNSAFE_useId';\n\ntype PickedUserAssistanceProps = Pick<ComponentProps<typeof InlineUserAssistance>, 'messages'>;\n\ntype UseTextFieldProps<V> = PickedUserAssistanceProps & {\n ariaDescribedBy?: string;\n contentVariant?: 'input' | 'textarea';\n isDisabled?: boolean;\n isFocused?: boolean;\n isLoading?: boolean;\n isReadonly?: boolean;\n labelEdge?: ComponentProps<typeof TextField>['labelEdge'] | 'none';\n styleVariant?: 'default' | 'embedded';\n value?: V;\n};\n\nconst rankedSeverities = ['error', 'warning', 'confirmation', 'info', 'none'] as const;\n\n/**\n * Merge multiple ids into a space-separated list\n * @param ids The ids to be merged\n * @returns The space separated string of ids\n */\nfunction mergeIDs(...ids: (string | undefined)[]) {\n return ids.filter(Boolean).join(' ') || undefined;\n}\n\n/**\n * A custom hook to determine the props for a component that renders\n * a text field\n */\nexport function useTextField<V>({\n ariaDescribedBy,\n contentVariant,\n isDisabled,\n isFocused,\n isLoading,\n isReadonly,\n labelEdge,\n messages,\n styleVariant,\n value\n}: UseTextFieldProps<V>) {\n const baseId = useId();\n const labelId = labelEdge !== 'none' ? `${baseId}-label` : undefined;\n const inputId = !isReadonly ? `${baseId}-input` : undefined;\n const uaId = !(isDisabled || isReadonly) ? `${baseId}-ua` : undefined;\n\n // Create the form field context\n const formFieldContext = useMemo<FormFieldContextProps>(() => {\n const hasValue = value !== undefined && (typeof value !== 'string' || value !== '');\n return isReadonly\n ? {\n hasValue: hasValue,\n isFocused: isFocused,\n isLoading,\n isReadonly: true\n }\n : isDisabled\n ? {\n hasValue: hasValue,\n isDisabled: true,\n isLoading\n }\n : {\n hasValue: hasValue,\n isFocused: isFocused,\n isLoading\n };\n }, [isDisabled, isFocused, isLoading, isReadonly, value]);\n\n // Determine the highest severity from the messages\n const messageSeverity = useMemo(() => {\n return messages === undefined\n ? undefined\n : messages.reduce<typeof rankedSeverities[number]>((accSeverity, currMessage) => {\n const currSeverity = currMessage.severity || 'error';\n return rankedSeverities.indexOf(accSeverity) < rankedSeverities.indexOf(currSeverity)\n ? accSeverity\n : currSeverity;\n }, 'none');\n }, [messages]);\n\n // Determine the label variant\n const labelVariant: ComponentProps<typeof Label>['variant'] =\n labelEdge === 'inside'\n ? messageSeverity === 'error'\n ? 'insideError'\n : messageSeverity === 'warning'\n ? 'insideWarning'\n : labelEdge\n : labelEdge !== 'none'\n ? labelEdge\n : undefined;\n\n return {\n baseId,\n formFieldContext,\n inputProps: {\n id: inputId,\n ariaDescribedBy: mergeIDs(uaId, ariaDescribedBy),\n ariaInvalid: messageSeverity === 'error' ? 'true' : undefined,\n variant: styleVariant\n },\n labelProps: {\n forId: inputId,\n id: labelId,\n variant: labelVariant\n },\n textFieldProps: {\n contentVariant,\n statusVariant: /error|warning/.test(messageSeverity ?? '')\n ? (messageSeverity as 'error' | 'warning')\n : undefined,\n styleVariant\n },\n userAssistanceProps: {\n id: uaId\n }\n };\n}\n"],"names":["rankedSeverities","mergeIDs","ids","filter","Boolean","join","undefined","ariaDescribedBy","contentVariant","isDisabled","isFocused","isLoading","isReadonly","labelEdge","messages","styleVariant","value","baseId","useId","labelId","inputId","uaId","formFieldContext","useMemo","hasValue","messageSeverity","reduce","accSeverity","currMessage","currSeverity","severity","indexOf","labelVariant","inputProps","id","ariaInvalid","variant","labelProps","forId","textFieldProps","statusVariant","test","userAssistanceProps"],"mappings":"gFAsBA,MAAMA,EAAmB,CAAC,QAAS,UAAW,eAAgB,OAAQ,QAOtE,SAASC,KAAYC,GACnB,OAAOA,EAAIC,OAAOC,SAASC,KAAK,WAAQC,iBAOpC,UAA0BC,gBAC9BA,EAD8BC,eAE9BA,EAF8BC,WAG9BA,EAH8BC,UAI9BA,EAJ8BC,UAK9BA,EAL8BC,WAM9BA,EAN8BC,UAO9BA,EAP8BC,SAQ9BA,EAR8BC,aAS9BA,EAT8BC,MAU9BA,IAEA,MAAMC,EAASC,EAAAA,QACTC,EAAwB,SAAdN,EAAuB,GAAGI,eAAiBX,EACrDc,EAAWR,OAAiCN,EAAjB,GAAAW,UAC3BI,EAASZ,GAAcG,OAA+BN,KAAdW,OAGxCK,EAAmBC,EAAAA,QAA+B,KACtD,MAAMC,OAAqBlB,IAAVU,IAAyC,iBAAVA,GAAgC,KAAVA,GACtE,OAAOJ,EACH,CACEY,SAAUA,EACVd,UAAWA,EACXC,UAAAA,EACAC,YAAY,GAEdH,EACA,CACEe,SAAUA,EACVf,YAAY,EACZE,UAAAA,GAEF,CACEa,SAAUA,EACVd,UAAWA,EACXC,UAAAA,IAEL,CAACF,EAAYC,EAAWC,EAAWC,EAAYI,IAG5CS,EAAkBF,EAAAA,QAAQ,SACVjB,IAAbQ,OACHR,EACAQ,EAASY,OAAwC,CAACC,EAAaC,KAC7D,MAAMC,EAAeD,EAAYE,UAAY,QAC7C,OAAO9B,EAAiB+B,QAAQJ,GAAe3B,EAAiB+B,QAAQF,GACpEF,EACAE,GACH,QACN,CAACf,IAGEkB,EACU,WAAdnB,EACwB,UAApBY,EACE,cACoB,YAApBA,EACA,gBACAZ,EACY,SAAdA,EACAA,OACAP,EAEN,MAAO,CACLW,OAAAA,EACAK,iBAAAA,EACAW,WAAY,CACVC,GAAId,EACJb,gBAAiBN,EAASoB,EAAMd,GAChC4B,YAAiC,UAApBV,EAA8B,YAASnB,EACpD8B,QAASrB,GAEXsB,WAAY,CACVC,MAAOlB,EACPc,GAAIf,EACJiB,QAASJ,GAEXO,eAAgB,CACd/B,eAAAA,EACAgC,cAAe,gBAAgBC,KAAKhB,MAAAA,EAAAA,EAAmB,IAClDA,OACDnB,EACJS,aAAAA,GAEF2B,oBAAqB,CACnBR,GAAIb"}
1
+ {"version":3,"file":"UNSAFE_useTextField.js","sources":["../../../src/hooks/UNSAFE_useTextField/useTextField.ts"],"sourcesContent":["import { ComponentProps } from 'preact';\nimport { useMemo } from 'preact/hooks';\nimport { Label } from '../../UNSAFE_Label';\nimport { TextField } from '../../UNSAFE_TextField';\nimport { InlineUserAssistance } from '../../UNSAFE_UserAssistance';\nimport { FormFieldContextProps } from '../UNSAFE_useFormFieldContext';\nimport { useId } from '../UNSAFE_useId';\n\ntype PickedUserAssistanceProps = Pick<ComponentProps<typeof InlineUserAssistance>, 'messages'>;\n\ntype UseTextFieldProps<V> = PickedUserAssistanceProps & {\n ariaDescribedBy?: string;\n contentVariant?: 'input' | 'textarea';\n isDisabled?: boolean;\n isFocused?: boolean;\n isLoading?: boolean;\n isReadonly?: boolean;\n labelEdge?: ComponentProps<typeof TextField>['labelEdge'] | 'none';\n styleVariant?: 'default' | 'embedded';\n value?: V;\n};\n\nconst rankedSeverities = ['error', 'warning', 'confirmation', 'info', 'none'] as const;\n\n/**\n * Merge multiple ids into a space-separated list\n * @param ids The ids to be merged\n * @returns The space separated string of ids\n */\nfunction mergeIDs(...ids: (string | undefined)[]) {\n return ids.filter(Boolean).join(' ') || undefined;\n}\n\n/**\n * A custom hook to determine the props for a component that renders\n * a text field\n */\nexport function useTextField<V>({\n ariaDescribedBy,\n contentVariant,\n isDisabled,\n isFocused,\n isLoading,\n isReadonly,\n labelEdge,\n messages,\n styleVariant,\n value\n}: UseTextFieldProps<V>) {\n const baseId = useId();\n const labelId = labelEdge !== 'none' ? `${baseId}-label` : undefined;\n const inputId = !isReadonly ? `${baseId}-input` : undefined;\n const uaId = !(isDisabled || isReadonly) ? `${baseId}-ua` : undefined;\n\n // Create the form field context\n const formFieldContext = useMemo<FormFieldContextProps>(() => {\n const hasValue = value !== undefined && (typeof value !== 'string' || value !== '');\n return isReadonly\n ? {\n hasValue: hasValue,\n isFocused: isFocused,\n isLoading,\n isReadonly: true\n }\n : isDisabled\n ? {\n hasValue: hasValue,\n isDisabled: true,\n isLoading\n }\n : {\n hasValue: hasValue,\n isFocused: isFocused,\n isLoading\n };\n }, [isDisabled, isFocused, isLoading, isReadonly, value]);\n\n // Determine the highest severity from the messages\n const messageSeverity = useMemo(() => {\n return messages === undefined\n ? undefined\n : messages.reduce<typeof rankedSeverities[number]>((accSeverity, currMessage) => {\n const currSeverity = currMessage.severity || 'error';\n return rankedSeverities.indexOf(accSeverity) < rankedSeverities.indexOf(currSeverity)\n ? accSeverity\n : currSeverity;\n }, 'none');\n }, [messages]);\n\n // Determine the label variant\n const labelVariant: ComponentProps<typeof Label>['variant'] =\n labelEdge === 'inside'\n ? messageSeverity === 'error'\n ? 'insideError'\n : messageSeverity === 'warning'\n ? 'insideWarning'\n : labelEdge\n : labelEdge !== 'none'\n ? labelEdge\n : undefined;\n\n return {\n baseId,\n formFieldContext,\n inputProps: {\n id: inputId,\n ariaDescribedBy: mergeIDs(uaId, ariaDescribedBy),\n ariaInvalid: messageSeverity === 'error' ? 'true' : undefined,\n variant: styleVariant\n },\n labelProps: {\n forId: inputId,\n id: labelId,\n variant: labelVariant\n },\n textFieldProps: {\n contentVariant,\n statusVariant: /error|warning/.test(messageSeverity ?? '')\n ? (messageSeverity as 'error' | 'warning')\n : undefined,\n styleVariant\n },\n userAssistanceProps: {\n id: uaId\n }\n };\n}\n"],"names":["rankedSeverities","mergeIDs","ids","filter","Boolean","join","undefined","ariaDescribedBy","contentVariant","isDisabled","isFocused","isLoading","isReadonly","labelEdge","messages","styleVariant","value","baseId","useId","labelId","inputId","uaId","formFieldContext","useMemo","hasValue","messageSeverity","reduce","accSeverity","currMessage","currSeverity","severity","indexOf","labelVariant","inputProps","id","ariaInvalid","variant","labelProps","forId","textFieldProps","statusVariant","test","userAssistanceProps"],"mappings":"gFAsBA,MAAMA,EAAmB,CAAC,QAAS,UAAW,eAAgB,OAAQ,QAOtE,SAASC,KAAYC,GACnB,OAAOA,EAAIC,OAAOC,SAASC,KAAK,WAAQC,iBAOpC,UAA0BC,gBAC9BA,EAAeC,eACfA,EAAcC,WACdA,EAAUC,UACVA,EAASC,UACTA,EAASC,WACTA,EAAUC,UACVA,EAASC,SACTA,EAAQC,aACRA,EAAYC,MACZA,IAEA,MAAMC,EAASC,EAAAA,QACTC,EAAwB,SAAdN,EAAuB,GAAGI,eAAiBX,EACrDc,EAAWR,OAAiCN,EAApB,GAAGW,UAC3BI,EAASZ,GAAcG,OAA+BN,EAAjB,GAAGW,OAGxCK,EAAmBC,EAAAA,QAA+B,KACtD,MAAMC,OAAqBlB,IAAVU,IAAyC,iBAAVA,GAAgC,KAAVA,GACtE,OAAOJ,EACH,CACEY,SAAUA,EACVd,UAAWA,EACXC,UAAAA,EACAC,YAAY,GAEdH,EACA,CACEe,SAAUA,EACVf,YAAY,EACZE,UAAAA,GAEF,CACEa,SAAUA,EACVd,UAAWA,EACXC,UAAAA,IAEL,CAACF,EAAYC,EAAWC,EAAWC,EAAYI,IAG5CS,EAAkBF,EAAAA,QAAQ,SACVjB,IAAbQ,OACHR,EACAQ,EAASY,OAAwC,CAACC,EAAaC,KAC7D,MAAMC,EAAeD,EAAYE,UAAY,QAC7C,OAAO9B,EAAiB+B,QAAQJ,GAAe3B,EAAiB+B,QAAQF,GACpEF,EACAE,GACH,QACN,CAACf,IAGEkB,EACU,WAAdnB,EACwB,UAApBY,EACE,cACoB,YAApBA,EACA,gBACAZ,EACY,SAAdA,EACAA,OACAP,EAEN,MAAO,CACLW,OAAAA,EACAK,iBAAAA,EACAW,WAAY,CACVC,GAAId,EACJb,gBAAiBN,EAASoB,EAAMd,GAChC4B,YAAiC,UAApBV,EAA8B,YAASnB,EACpD8B,QAASrB,GAEXsB,WAAY,CACVC,MAAOlB,EACPc,GAAIf,EACJiB,QAASJ,GAEXO,eAAgB,CACd/B,eAAAA,EACAgC,cAAe,gBAAgBC,KAAKhB,MAAAA,EAAAA,EAAmB,IAClDA,OACDnB,EACJS,aAAAA,GAEF2B,oBAAqB,CACnBR,GAAIb"}
@@ -1,2 +1,2 @@
1
- define(["exports","preact/hooks","../utils/PRIVATE_clientHints","../clientHints-54772777"],function(e,n,t,u){"use strict";e.useTextFieldInputHandlers=function({currentCommitValue:e,value:t,onInput:l,onCommit:o,onKeyDown:r}){const a=n.useRef(!1),[,s]=n.useReducer(e=>e+1,0),i=n.useCallback(n=>{const t=n.target.value;e!==t&&(null==o||o({previousValue:e,value:t}))},[o,e]),c=n.useCallback(e=>{null==r||r(e),"Enter"===e.key&&i(e)},[i,r]),p=n.useCallback(()=>{a.current=!0},[]),d=n.useCallback(e=>{a.current=!1,v(e)},[]),v=n.useCallback(e=>{if(a.current&&"android"!==u.getClientHints().platform)return;const n=e.target.value;t!==n&&(null==l||l({previousValue:t,value:n}),s(null))},[t,l]);return{onBlur:i,onKeyDown:c,oncompositionstart:p,oncompositionend:d,onInput:v}},Object.defineProperty(e,"__esModule",{value:!0})});
1
+ define(["exports","preact/hooks","../utils/PRIVATE_clientHints","../clientHints-9d985ef6"],function(e,n,t,u){"use strict";e.useTextFieldInputHandlers=function({currentCommitValue:e,value:t,onInput:l,onCommit:o,onKeyDown:r}){const a=n.useRef(!1),[,s]=n.useReducer(e=>e+1,0),i=n.useCallback(n=>{const t=n.target.value;e!==t&&(null==o||o({previousValue:e,value:t}))},[o,e]),c=n.useCallback(e=>{null==r||r(e),"Enter"===e.key&&i(e)},[i,r]),p=n.useCallback(()=>{a.current=!0},[]),d=n.useCallback(e=>{a.current=!1,f(e)},[]),f=n.useCallback(e=>{if(a.current&&"android"!==u.getClientHints().platform)return;const n=e.target.value;t!==n&&(null==l||l({previousValue:t,value:n}),s(null))},[t,l]);return{onBlur:i,onKeyDown:c,oncompositionstart:p,oncompositionend:d,onInput:f}},Object.defineProperty(e,"__esModule",{value:!0})});
2
2
  //# sourceMappingURL=UNSAFE_useTextFieldInputHandlers.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"UNSAFE_useTextFieldInputHandlers.js","sources":["../../../src/hooks/UNSAFE_useTextFieldInputHandlers/useTextFieldInputHandlers.ts"],"sourcesContent":["import { useCallback, useReducer, useRef } from 'preact/hooks';\nimport { getClientHints } from '../../utils/PRIVATE_clientHints';\nimport { ValueUpdateDetail } from '../../utils/UNSAFE_valueUpdateDetail';\n\ntype TextFieldInputProps = {\n currentCommitValue?: string;\n value?: string;\n onInput?: (detail: ValueUpdateDetail<string>) => void;\n onCommit?: (detail: ValueUpdateDetail<string>) => void;\n onKeyDown?: (event: KeyboardEvent) => void;\n};\n\nexport function useTextFieldInputHandlers({\n currentCommitValue,\n value,\n onInput,\n onCommit,\n onKeyDown\n}: TextFieldInputProps) {\n const isComposing = useRef(false);\n\n // preactjs/preact #1899 - https://github.com/preactjs/preact/issues/1899\n // Preact does not force the native input to be controlled, so we need to\n // trigger a rerender in order to keep it fully controlled.\n // Force update hack is from https://reactjs.org/docs/hooks-faq.html#is-there-something-like-forceupdate\n const [, forceUpdate] = useReducer((x) => x + 1, 0);\n\n // TODO: Currently, this assumes that the input field is a text field\n // so that the change event can be simulated by capturing blur and enter keydown\n // event. We might have to make this generic to handle other input types\n // as well like radio, select, checkbox.\n const handleChange = useCallback(\n (event: Event) => {\n const currentValue = (event.target as HTMLInputElement).value;\n // When do we *not* want to call onCommit?\n // When the input's value\n // is the same as the currentCommitValue (like if the user hits Enter over and over,\n // or if the user focuses and blurs over and over).\n // Or when the component's value is programmatically changed.\n // (currentCommitValue is updated whenever we commit or get a programmatic change.\n // See component code and useCurrentValueReducer hook)\n\n // We only need to trigger an onCommit for user interacted changes, not programmatic changes\n if (currentCommitValue !== currentValue) {\n onCommit?.({ previousValue: currentCommitValue, value: currentValue });\n }\n },\n [onCommit, currentCommitValue]\n );\n const handleKeyDown = useCallback(\n (event: KeyboardEvent) => {\n onKeyDown?.(event);\n\n if (event.key === 'Enter') {\n handleChange(event);\n }\n },\n [handleChange, onKeyDown]\n );\n const handleCompositionStart = useCallback(() => {\n isComposing.current = true;\n }, []);\n const handleCompositionEnd = useCallback((event: Event) => {\n isComposing.current = false;\n // On some browsers, compositionend event is fired before the final input event,\n // while it's the other way around on other browsers. Just call handleInput here\n // anyway since handleInput will compare the value before actually calling it.\n // When all browsers support the input event's isComposing property, we can use that.\n // https://w3c.github.io/uievents/#dom-inputevent-iscomposing\n handleInput(event);\n }, []);\n const handleInput = useCallback(\n (event: Event) => {\n // In android device we need to update input value even for composition events\n // See JET-39086 for more details.\n if (isComposing.current && getClientHints().platform !== 'android') return;\n\n const newValue = (event.target as HTMLInputElement).value;\n if (value === newValue) return;\n\n onInput?.({ previousValue: value, value: newValue });\n\n // preactjs/preact #1899 - https://github.com/preactjs/preact/issues/1899\n // Preact does not force the native input to be controlled, so we need to\n // trigger a rerender in order to keep it fully controlled.\n // Force a rerender here, so if the value was not pushed back, the input\n // will be reset to the old value mimicking a controlled input.\n // One minor issue here is that the cursor position will also be reverted\n // back to the end due to the forced value update. But this behavior should\n // be fine as it happens in our oj-input-text as well.\n forceUpdate(null);\n },\n [value, onInput]\n );\n\n return {\n // With preact/compat, we will not have an onChange event.\n // \"If you're using preact/compat, most onChange events are internally converted to onInput\n // to emulate React's behavior. This is one of the tricks we use to ensure maximum\n // compatibility with the React ecosystem.\"\n // Since we need the onChange event, we will be simulating this to match the native event\n // as best as we can. To do this, we will be capturing `blur` event and Enter `keydown` event.\n // https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n onBlur: handleChange,\n onKeyDown: handleKeyDown,\n // Since, preact does not support onCompositionStart and onCompositionEnd events\n // we need to use all lowercase event name to use the native DOM events. Also,\n // currently we do not have any need for the event object in these two handlers\n // so ignored the arguments here.\n oncompositionstart: handleCompositionStart,\n oncompositionend: handleCompositionEnd,\n onInput: handleInput\n };\n}\n"],"names":["currentCommitValue","value","onInput","onCommit","onKeyDown","isComposing","useRef","forceUpdate","useReducer","x","handleChange","useCallback","event","currentValue","target","previousValue","handleKeyDown","key","handleCompositionStart","current","handleCompositionEnd","handleInput","getClientHints","platform","newValue","onBlur","oncompositionstart","oncompositionend"],"mappings":"sJAYgB,UAA0BA,mBACxCA,EADwCC,MAExCA,EAFwCC,QAGxCA,EAHwCC,SAIxCA,EAJwCC,UAKxCA,IAEA,MAAMC,EAAcC,UAAO,KAMlBC,GAAeC,aAAYC,GAAMA,EAAI,EAAG,GAM3CC,EAAeC,cAClBC,IACC,MAAMC,EAAgBD,EAAME,OAA4Bb,MAUpDD,IAAuBa,IACzBV,MAAAA,GAAAA,EAAW,CAAEY,cAAef,EAAoBC,MAAOY,MAG3D,CAACV,EAAUH,IAEPgB,EAAgBL,cACnBC,IACCR,MAAAA,GAAAA,EAAYQ,GAEM,UAAdA,EAAMK,KACRP,EAAaE,IAGjB,CAACF,EAAcN,IAEXc,EAAyBP,EAAAA,YAAY,KACzCN,EAAYc,SAAU,GACrB,IACGC,EAAuBT,cAAaC,IACxCP,EAAYc,SAAU,EAMtBE,EAAYT,IACX,IACGS,EAAcV,cACjBC,IAGC,GAAIP,EAAYc,SAAyC,YAA9BG,mBAAiBC,SAAwB,OAEpE,MAAMC,EAAYZ,EAAME,OAA4Bb,MAChDA,IAAUuB,IAEdtB,MAAAA,GAAAA,EAAU,CAAEa,cAAed,EAAOA,MAAOuB,IAUzCjB,EAAY,QAEd,CAACN,EAAOC,IAGV,MAAO,CAQLuB,OAAQf,EACRN,UAAWY,EAKXU,mBAAoBR,EACpBS,iBAAkBP,EAClBlB,QAASmB"}
1
+ {"version":3,"file":"UNSAFE_useTextFieldInputHandlers.js","sources":["../../../src/hooks/UNSAFE_useTextFieldInputHandlers/useTextFieldInputHandlers.ts"],"sourcesContent":["import { useCallback, useReducer, useRef } from 'preact/hooks';\nimport { getClientHints } from '../../utils/PRIVATE_clientHints';\nimport { ValueUpdateDetail } from '../../utils/UNSAFE_valueUpdateDetail';\n\ntype TextFieldInputProps = {\n currentCommitValue?: string;\n value?: string;\n onInput?: (detail: ValueUpdateDetail<string>) => void;\n onCommit?: (detail: ValueUpdateDetail<string>) => void;\n onKeyDown?: (event: KeyboardEvent) => void;\n};\n\nexport function useTextFieldInputHandlers({\n currentCommitValue,\n value,\n onInput,\n onCommit,\n onKeyDown\n}: TextFieldInputProps) {\n const isComposing = useRef(false);\n\n // preactjs/preact #1899 - https://github.com/preactjs/preact/issues/1899\n // Preact does not force the native input to be controlled, so we need to\n // trigger a rerender in order to keep it fully controlled.\n // Force update hack is from https://reactjs.org/docs/hooks-faq.html#is-there-something-like-forceupdate\n const [, forceUpdate] = useReducer((x) => x + 1, 0);\n\n // TODO: Currently, this assumes that the input field is a text field\n // so that the change event can be simulated by capturing blur and enter keydown\n // event. We might have to make this generic to handle other input types\n // as well like radio, select, checkbox.\n const handleChange = useCallback(\n (event: Event) => {\n const currentValue = (event.target as HTMLInputElement).value;\n // When do we *not* want to call onCommit?\n // When the input's value\n // is the same as the currentCommitValue (like if the user hits Enter over and over,\n // or if the user focuses and blurs over and over).\n // Or when the component's value is programmatically changed.\n // (currentCommitValue is updated whenever we commit or get a programmatic change.\n // See component code and useCurrentValueReducer hook)\n\n // We only need to trigger an onCommit for user interacted changes, not programmatic changes\n if (currentCommitValue !== currentValue) {\n onCommit?.({ previousValue: currentCommitValue, value: currentValue });\n }\n },\n [onCommit, currentCommitValue]\n );\n const handleKeyDown = useCallback(\n (event: KeyboardEvent) => {\n onKeyDown?.(event);\n\n if (event.key === 'Enter') {\n handleChange(event);\n }\n },\n [handleChange, onKeyDown]\n );\n const handleCompositionStart = useCallback(() => {\n isComposing.current = true;\n }, []);\n const handleCompositionEnd = useCallback((event: Event) => {\n isComposing.current = false;\n // On some browsers, compositionend event is fired before the final input event,\n // while it's the other way around on other browsers. Just call handleInput here\n // anyway since handleInput will compare the value before actually calling it.\n // When all browsers support the input event's isComposing property, we can use that.\n // https://w3c.github.io/uievents/#dom-inputevent-iscomposing\n handleInput(event);\n }, []);\n const handleInput = useCallback(\n (event: Event) => {\n // In android device we need to update input value even for composition events\n // See JET-39086 for more details.\n if (isComposing.current && getClientHints().platform !== 'android') return;\n\n const newValue = (event.target as HTMLInputElement).value;\n if (value === newValue) return;\n\n onInput?.({ previousValue: value, value: newValue });\n\n // preactjs/preact #1899 - https://github.com/preactjs/preact/issues/1899\n // Preact does not force the native input to be controlled, so we need to\n // trigger a rerender in order to keep it fully controlled.\n // Force a rerender here, so if the value was not pushed back, the input\n // will be reset to the old value mimicking a controlled input.\n // One minor issue here is that the cursor position will also be reverted\n // back to the end due to the forced value update. But this behavior should\n // be fine as it happens in our oj-input-text as well.\n forceUpdate(null);\n },\n [value, onInput]\n );\n\n return {\n // With preact/compat, we will not have an onChange event.\n // \"If you're using preact/compat, most onChange events are internally converted to onInput\n // to emulate React's behavior. This is one of the tricks we use to ensure maximum\n // compatibility with the React ecosystem.\"\n // Since we need the onChange event, we will be simulating this to match the native event\n // as best as we can. To do this, we will be capturing `blur` event and Enter `keydown` event.\n // https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event\n onBlur: handleChange,\n onKeyDown: handleKeyDown,\n // Since, preact does not support onCompositionStart and onCompositionEnd events\n // we need to use all lowercase event name to use the native DOM events. Also,\n // currently we do not have any need for the event object in these two handlers\n // so ignored the arguments here.\n oncompositionstart: handleCompositionStart,\n oncompositionend: handleCompositionEnd,\n onInput: handleInput\n };\n}\n"],"names":["currentCommitValue","value","onInput","onCommit","onKeyDown","isComposing","useRef","forceUpdate","useReducer","x","handleChange","useCallback","event","currentValue","target","previousValue","handleKeyDown","key","handleCompositionStart","current","handleCompositionEnd","handleInput","getClientHints","platform","newValue","onBlur","oncompositionstart","oncompositionend"],"mappings":"sJAYgB,UAA0BA,mBACxCA,EAAkBC,MAClBA,EAAKC,QACLA,EAAOC,SACPA,EAAQC,UACRA,IAEA,MAAMC,EAAcC,UAAO,IAMlB,CAAAC,GAAeC,aAAYC,GAAMA,EAAI,EAAG,GAM3CC,EAAeC,cAClBC,IACC,MAAMC,EAAgBD,EAAME,OAA4Bb,MAUpDD,IAAuBa,IACzBV,MAAAA,GAAAA,EAAW,CAAEY,cAAef,EAAoBC,MAAOY,MAG3D,CAACV,EAAUH,IAEPgB,EAAgBL,cACnBC,IACCR,MAAAA,GAAAA,EAAYQ,GAEM,UAAdA,EAAMK,KACRP,EAAaE,IAGjB,CAACF,EAAcN,IAEXc,EAAyBP,EAAAA,YAAY,KACzCN,EAAYc,SAAU,GACrB,IACGC,EAAuBT,cAAaC,IACxCP,EAAYc,SAAU,EAMtBE,EAAYT,IACX,IACGS,EAAcV,cACjBC,IAGC,GAAIP,EAAYc,SAAyC,YAA9BG,mBAAiBC,SAAwB,OAEpE,MAAMC,EAAYZ,EAAME,OAA4Bb,MAChDA,IAAUuB,IAEdtB,MAAAA,GAAAA,EAAU,CAAEa,cAAed,EAAOA,MAAOuB,IAUzCjB,EAAY,QAEd,CAACN,EAAOC,IAGV,MAAO,CAQLuB,OAAQf,EACRN,UAAWY,EAKXU,mBAAoBR,EACpBS,iBAAkBP,EAClBlB,QAASmB"}
@@ -1 +1 @@
1
- {"version":3,"file":"UNSAFE_useTimer.js","sources":["../../../src/hooks/UNSAFE_useTimer/useTimer.ts"],"sourcesContent":["/**\n * @license\n * Copyright (c) %FIRST_YEAR% %CURRENT_YEAR%, Oracle and/or its affiliates.\n * The Universal Permissive License (UPL), Version 1.0\n * as shown at https://oss.oracle.com/licenses/upl/\n * @ignore\n */\n\nimport { useEffect, useRef, useState } from 'preact/hooks';\n\ntype Props = {\n isStarted: boolean;\n delay?: number;\n};\n\n/**\n * Hook for a timer.\n * @param isStarted Specifies whether the timer should be started: true to start it, false to stop\n * it.\n * @param delay Specifies the delay after which the timer should expire.\n * @returns True if the timer expires, false if it was stopped before that.\n *\n */\nexport function useTimer({ isStarted, delay = 0 }: Props): boolean {\n const timeoutId = useRef<ReturnType<typeof setTimeout> | null>(null);\n const [isExpired, setExpired] = useState(false);\n useEffect(() => {\n if (!isStarted) {\n // if not started, clear the current timeout\n if (timeoutId.current) {\n clearTimeout(timeoutId.current);\n timeoutId.current = null;\n }\n setExpired(false);\n } else {\n // if started, only create a new timeout if we don't already have one\n if (!timeoutId.current) {\n timeoutId.current = setTimeout(() => {\n setExpired(true);\n }, delay);\n }\n }\n return () => {\n if (timeoutId.current) {\n clearTimeout(timeoutId.current);\n timeoutId.current = null;\n }\n };\n }, [isStarted, delay]);\n\n return isExpired;\n}\n"],"names":["isStarted","delay","timeoutId","useRef","isExpired","setExpired","useState","useEffect","current","setTimeout","clearTimeout"],"mappings":"wEAuBM,UAAmBA,UAAEA,EAAFC,MAAaA,EAAQ,IAC5C,MAAMC,EAAYC,SAA6C,OACxDC,EAAWC,GAAcC,EAAQA,UAAC,GAyBzC,OAxBAC,EAAAA,UAAU,KACHP,EASEE,EAAUM,UACbN,EAAUM,QAAUC,WAAW,KAC7BJ,GAAW,IACVJ,KAVDC,EAAUM,UACZE,aAAaR,EAAUM,SACvBN,EAAUM,QAAU,MAEtBH,GAAW,IASN,KACDH,EAAUM,UACZE,aAAaR,EAAUM,SACvBN,EAAUM,QAAU,QAGvB,CAACR,EAAWC,IAERG"}
1
+ {"version":3,"file":"UNSAFE_useTimer.js","sources":["../../../src/hooks/UNSAFE_useTimer/useTimer.ts"],"sourcesContent":["/**\n * @license\n * Copyright (c) %FIRST_YEAR% %CURRENT_YEAR%, Oracle and/or its affiliates.\n * The Universal Permissive License (UPL), Version 1.0\n * as shown at https://oss.oracle.com/licenses/upl/\n * @ignore\n */\n\nimport { useEffect, useRef, useState } from 'preact/hooks';\n\ntype Props = {\n isStarted: boolean;\n delay?: number;\n};\n\n/**\n * Hook for a timer.\n * @param isStarted Specifies whether the timer should be started: true to start it, false to stop\n * it.\n * @param delay Specifies the delay after which the timer should expire.\n * @returns True if the timer expires, false if it was stopped before that.\n *\n */\nexport function useTimer({ isStarted, delay = 0 }: Props): boolean {\n const timeoutId = useRef<ReturnType<typeof setTimeout> | null>(null);\n const [isExpired, setExpired] = useState(false);\n useEffect(() => {\n if (!isStarted) {\n // if not started, clear the current timeout\n if (timeoutId.current) {\n clearTimeout(timeoutId.current);\n timeoutId.current = null;\n }\n setExpired(false);\n } else {\n // if started, only create a new timeout if we don't already have one\n if (!timeoutId.current) {\n timeoutId.current = setTimeout(() => {\n setExpired(true);\n }, delay);\n }\n }\n return () => {\n if (timeoutId.current) {\n clearTimeout(timeoutId.current);\n timeoutId.current = null;\n }\n };\n }, [isStarted, delay]);\n\n return isExpired;\n}\n"],"names":["isStarted","delay","timeoutId","useRef","isExpired","setExpired","useState","useEffect","current","setTimeout","clearTimeout"],"mappings":"wEAuBM,UAAmBA,UAAEA,EAASC,MAAEA,EAAQ,IAC5C,MAAMC,EAAYC,SAA6C,OACxDC,EAAWC,GAAcC,EAAQA,UAAC,GAyBzC,OAxBAC,EAAAA,UAAU,KACHP,EASEE,EAAUM,UACbN,EAAUM,QAAUC,WAAW,KAC7BJ,GAAW,IACVJ,KAVDC,EAAUM,UACZE,aAAaR,EAAUM,SACvBN,EAAUM,QAAU,MAEtBH,GAAW,IASN,KACDH,EAAUM,UACZE,aAAaR,EAAUM,SACvBN,EAAUM,QAAU,QAGvB,CAACR,EAAWC,IAERG"}
@@ -1,4 +1,4 @@
1
- ._1o1f9e0{display:flex;align-items:flex-end;overflow-y:hidden;}
2
- .t05jzf{opacity:0;max-height:0;}
3
- .e4morw{color:var(--oj-c-PRIVATE-DO-NOT-USE-tooltip-text-color);background-color:var(--oj-c-PRIVATE-DO-NOT-USE-tooltip-bg-color);white-space:nowrap;padding-top:var(--oj-c-PRIVATE-DO-NOT-USE-tooltip-padding-vertical);padding-left:var(--oj-c-PRIVATE-DO-NOT-USE-tooltip-padding-horizontal);padding-right:var(--oj-c-PRIVATE-DO-NOT-USE-tooltip-padding-horizontal);padding-bottom:var(--oj-c-PRIVATE-DO-NOT-USE-tooltip-padding-vertical);border-radius:var(--oj-c-PRIVATE-DO-NOT-USE-tooltip-border-radius);border-color:var(--oj-c-PRIVATE-DO-NOT-USE-tooltip-border-color);font-size:var(--oj-c-PRIVATE-DO-NOT-USE-tooltip-font-size);border-width:var(--oj-c-PRIVATE-DO-NOT-USE-tooltip-border-width);border-style:solid;}
4
- ._3br29c{--oj-c-PRIVATE-DO-NOT-USE-tooltip-bg-color:rgb(var(--oj-c-PRIVATE-DO-NOT-USE-palette-neutral-rgb-0));--oj-c-PRIVATE-DO-NOT-USE-tooltip-text-color:rgb(var(--oj-c-PRIVATE-DO-NOT-USE-palette-neutral-rgb-190));--oj-c-PRIVATE-DO-NOT-USE-tooltip-padding-vertical:var(--oj-c-PRIVATE-DO-NOT-USE-core-spacing-2x);--oj-c-PRIVATE-DO-NOT-USE-tooltip-border-radius:var(--oj-c-PRIVATE-DO-NOT-USE-core-border-radius-md);--oj-c-PRIVATE-DO-NOT-USE-tooltip-border-color:rgba(var(--oj-c-PRIVATE-DO-NOT-USE-palette-neutral-rgb-190),0.65);--oj-c-PRIVATE-DO-NOT-USE-tooltip-font-size:var(--oj-c-PRIVATE-DO-NOT-USE-typography-body-xs-font-size);}
1
+ ._1fuqfe2{display:flex;align-items:flex-end;overflow-y:hidden;}
2
+ .qg2wq1{opacity:0;max-height:0;}
3
+ .orlifg{color:var(--oj-c-PRIVATE-DO-NOT-USE-tooltip-text-color);background-color:var(--oj-c-PRIVATE-DO-NOT-USE-tooltip-bg-color);white-space:nowrap;padding-top:var(--oj-c-PRIVATE-DO-NOT-USE-tooltip-padding-vertical);padding-left:var(--oj-c-PRIVATE-DO-NOT-USE-tooltip-padding-horizontal);padding-right:var(--oj-c-PRIVATE-DO-NOT-USE-tooltip-padding-horizontal);padding-bottom:var(--oj-c-PRIVATE-DO-NOT-USE-tooltip-padding-vertical);border-radius:var(--oj-c-PRIVATE-DO-NOT-USE-tooltip-border-radius);border-color:var(--oj-c-PRIVATE-DO-NOT-USE-tooltip-border-color);font-size:var(--oj-c-PRIVATE-DO-NOT-USE-tooltip-font-size);border-width:var(--oj-c-PRIVATE-DO-NOT-USE-tooltip-border-width);border-style:solid;}
4
+ ._1mawfrq{--oj-c-PRIVATE-DO-NOT-USE-tooltip-bg-color:rgb(var(--oj-c-PRIVATE-DO-NOT-USE-palette-neutral-rgb-0));--oj-c-PRIVATE-DO-NOT-USE-tooltip-text-color:rgb(var(--oj-c-PRIVATE-DO-NOT-USE-palette-neutral-rgb-190));--oj-c-PRIVATE-DO-NOT-USE-tooltip-padding-vertical:var(--oj-c-PRIVATE-DO-NOT-USE-core-spacing-2x);--oj-c-PRIVATE-DO-NOT-USE-tooltip-border-radius:var(--oj-c-PRIVATE-DO-NOT-USE-core-border-radius-md);--oj-c-PRIVATE-DO-NOT-USE-tooltip-border-color:rgba(var(--oj-c-PRIVATE-DO-NOT-USE-palette-neutral-rgb-190),0.65);--oj-c-PRIVATE-DO-NOT-USE-tooltip-font-size:var(--oj-c-PRIVATE-DO-NOT-USE-typography-body-xs-font-size);}
@@ -1,2 +1,2 @@
1
- define(["exports","preact/hooks","preact/jsx-runtime","./UNSAFE_useId","../UNSAFE_Floating","../UNSAFE_Layer","./UNSAFE_useHover","./UNSAFE_useFocus","./UNSAFE_useTouch","../utils/UNSAFE_mergeProps","../utils/UNSAFE_arrayUtils","../tslib.es6-160e0dcc","./UNSAFE_useAnimation","css!./UNSAFE_useTooltip.css","../utils/UNSAFE_classNames","../useAnimation-37919fbc","../classNames-19b96444","../Floating-810ba93b","preact/compat","preact","./UNSAFE_useToggle","../index-8df256a2","./UNSAFE_useUser","../UNSAFE_Environment","../utils/PRIVATE_floatingUtils","../utils/PRIVATE_refUtils","./UNSAFE_useOutsideClick"],function(e,t,n,o,s,i,u,r,a,l,c,d,m,p,f,g,v,b,h,E,A,P,x,T,_,y,F){"use strict";const N="_1o1f9e0",S="t05jzf",U="e4morw",R="_3br29c",j=e=>{var{children:s,isOpen:i,isDatatip:u,onTransitionEnd:r}=e,a=d.__rest(e,["children","isOpen","isDatatip","onTransitionEnd"]);const l=o.useId(),c=t.useRef(null),m=t.useRef(null),{nodeRef:p}=g.useAnimation(i?"mounted":"unmounted",{animationStates:{mounted:e=>{const t=e.firstChild;return{from:{maxHeight:"0",opacity:"0%"},to:{maxHeight:`${null==t?void 0:t.offsetHeight}px`,opacity:u?"100%":"95%"},options:{duration:u?1:100,easing:[0,0,.2,1]}}},unmounted:e=>({from:{opacity:u?"100%":"95%"},to:{maxHeight:"0",opacity:"0%"},options:{duration:u?1:100,easing:[0,0,.2,1]}})},isAnimatedOnMount:!0,onAnimationEnd:()=>null==r?void 0:r()});return t.useEffect(()=>{var e,t;c.current&&(null===(e=m.current)||void 0===e?void 0:e.offsetHeight)&&(c.current.style.height=`${null===(t=m.current)||void 0===t?void 0:t.offsetHeight}px`)},[]),n.jsx("div",Object.assign({ref:c,id:l,role:"tooltip",class:N},{children:n.jsx("div",Object.assign({ref:p,class:v.classNames([S])},a,{children:n.jsx("div",Object.assign({ref:m,class:v.classNames([U,u?R:""])},{children:s}))}))}))},O=(c.stringLiteralArray(["start","top-start","top","top-end","end","bottom-end","bottom","bottom-start"]),c.stringLiteralArray(["element","pointer"]),({text:e,isOpen:s=!1,variant:c="tooltip",position:d="bottom",isDisabled:m=!1,anchor:p={x:"element",y:"element"},offset:f={mainAxis:0,crossAxis:0},onToggle:g})=>{const v=m||!e,h=t.useRef(!0),[E,A]=t.useState(!v&&s?"mounting":"unmounted"),[P,x]=t.useState(!1);x(!1);const T="datatip"===c,_=t.useRef(!0),{hoverProps:y,isHover:F}=u.useHover({isDisabled:m}),{touchProps:N,isTouch:S}=a.useTouch({isDisabled:m}),{focusProps:U,isFocus:R}=r.useFocus({isDisabled:F||S}),{hoverProps:O,isHover:H}=u.useHover({isDisabled:m}),B="pointer"===p.x||"pointer"===p.y,D=o.useId(),L=t.useRef(null),k=t.useRef({x:0,y:0}),C=B&&!R?k:L,I=T?0:250,G=t.useRef(null),M=t.useRef(null),w=()=>{G.current&&clearTimeout(G.current)},V=t.useCallback(e=>{if(e)switch(E){case"unmounting":case"unmounted":A("mountPending");break;case"unmountPending":w(),A("mounted")}else switch(E){case"mounting":case"mounted":A("unmountPending");break;case"mountPending":w(),A("unmounted")}},[E]);t.useEffect(()=>{h.current?h.current=!1:A(s?"mounting":"unmounting")},[s]),t.useEffect(()=>{_.current?_.current=!1:B&&F&&"unmounted"===E||(M.current&&clearTimeout(M.current),M.current=setTimeout(()=>{V(F||R||H||S)},20))},[F,R,H,S,B,E,V]),t.useLayoutEffect(()=>{"mountPending"!==E&&"unmountPending"!==E||(G.current=setTimeout(()=>null==g?void 0:g({value:"mountPending"===E}),I))},[E,I,g]);const $={onFocus:e=>{(e.eventPhase===Event.AT_TARGET||e.eventPhase===Event.BUBBLING_PHASE&&T)&&(L.current=e.target)}};let z;if(v)z=l.mergeProps(U,$);else{const e=Object.assign({"aria-describedby":D,onMouseEnter:e=>{(e.eventPhase===Event.AT_TARGET||e.eventPhase===Event.BUBBLING_PHASE&&T)&&(L.current=e.target)}},B&&{onMouseLeave:()=>{"mounting"!==E&&w()},onMouseMove:e=>{(e.eventPhase===Event.AT_TARGET||e.eventPhase===Event.BUBBLING_PHASE&&T)&&(e=>{var t;if("unmounted"!==E&&("datatip"!==c||"mounted"!==E))return;const n=null===(t=null==L?void 0:L.current)||void 0===t?void 0:t.getBoundingClientRect(),o=document.body.scrollLeft+((null==n?void 0:n.left)||0)+((null==n?void 0:n.width)||0),s=document.body.scrollTop+((null==n?void 0:n.top)||0)+((null==n?void 0:n.height)||0),i="pointer"===p.x?e.clientX:o,u="pointer"===p.y?e.clientY:s;"mounted"===E?(k.current={x:i,y:u},!0!==P&&x(!0)):"unmounted"===E&&(w(),G.current=setTimeout(()=>{"unmounted"===E&&(k.current={x:i,y:u},null==g||g({value:!0}))},I))})(e)}});z=l.mergeProps(y,U,N,$,e)}if(v)return w(),{tooltipContent:null,tooltipProps:z};const X=(e=>{let t="bottom";switch(e){case"top":case"end":case"bottom":case"start":t=e;break;case"top-end":t="top-end-corner";break;case"bottom-end":t="bottom-end-corner";break;case"bottom-start":t="bottom-start-corner";break;case"top-start":t="top-start-corner"}return t})(d),Y=n.jsx(i.Layer,Object.assign({logicalParentRef:L},{children:n.jsx(b.Floating,Object.assign({anchorRef:C,placement:X,offsetValue:f},{children:n.jsx(j,Object.assign({isOpen:["mounting","mounted","unmountPending"].includes(E)},O,{isDatatip:T,onTransitionEnd:()=>{"mounting"===E&&A("mounted"),"unmounting"===E&&A("unmounted")}},{children:e}))}))}));return{tooltipContent:!["unmounted","mountPending"].includes(E)&&Y,tooltipProps:z}});e.useTooltip=({text:e,position:n="bottom",isDisabled:o=!1,anchor:s={x:"element",y:"element"},offset:i={mainAxis:0,crossAxis:0},variant:u="tooltip"})=>{const[r,a]=t.useState(!1),l=o||!e,{tooltipContent:c,tooltipProps:d}=O({text:e,isOpen:r,position:n,isDisabled:l,offset:i,anchor:s,variant:u,onToggle:({value:e})=>a(e)});return{tooltipContent:c,tooltipProps:d}},e.useTooltipControlled=O,Object.defineProperty(e,"__esModule",{value:!0})});
1
+ define(["exports","preact/hooks","preact/jsx-runtime","./UNSAFE_useId","../UNSAFE_Floating","../UNSAFE_Layer","./UNSAFE_useHover","./UNSAFE_useFocus","./UNSAFE_useTouch","../utils/UNSAFE_mergeProps","../utils/UNSAFE_arrayUtils","../tslib.es6-6a195797","./UNSAFE_useAnimation","css!./UNSAFE_useTooltip.css","../utils/UNSAFE_classNames","../useAnimation-5d80cd95","../classNames-429bf434","../Floating-31eefce3","preact/compat","preact","./UNSAFE_useToggle","../index-4f4526ef","./UNSAFE_useUser","../UNSAFE_Environment","../utils/PRIVATE_floatingUtils","../utils/PRIVATE_refUtils","./UNSAFE_useOutsideClick"],function(e,t,n,o,s,i,u,r,a,l,c,d,m,p,f,g,v,h,b,E,A,P,x,T,_,y,F){"use strict";const N="_1fuqfe2",S="qg2wq1",U="orlifg",R="_1mawfrq",j=e=>{var{children:s,isOpen:i,isDatatip:u,onTransitionEnd:r}=e,a=d.__rest(e,["children","isOpen","isDatatip","onTransitionEnd"]);const l=o.useId(),c=t.useRef(null),m=t.useRef(null),{nodeRef:p}=g.useAnimation(i?"mounted":"unmounted",{animationStates:{mounted:e=>{const t=e.firstChild;return{from:{maxHeight:"0",opacity:"0%"},to:{maxHeight:`${null==t?void 0:t.offsetHeight}px`,opacity:u?"100%":"95%"},options:{duration:u?1:100,easing:[0,0,.2,1]}}},unmounted:e=>({from:{opacity:u?"100%":"95%"},to:{maxHeight:"0",opacity:"0%"},options:{duration:u?1:100,easing:[0,0,.2,1]}})},isAnimatedOnMount:!0,onAnimationEnd:()=>null==r?void 0:r()});return t.useEffect(()=>{var e,t;c.current&&(null===(e=m.current)||void 0===e?void 0:e.offsetHeight)&&(c.current.style.height=`${null===(t=m.current)||void 0===t?void 0:t.offsetHeight}px`)},[]),n.jsx("div",Object.assign({ref:c,id:l,role:"tooltip",class:N},{children:n.jsx("div",Object.assign({ref:p,class:v.classNames([S])},a,{children:n.jsx("div",Object.assign({ref:m,class:v.classNames([U,u?R:""])},{children:s}))}))}))},O=(c.stringLiteralArray(["start","top-start","top","top-end","end","bottom-end","bottom","bottom-start"]),c.stringLiteralArray(["element","pointer"]),({text:e,isOpen:s=!1,variant:c="tooltip",position:d="bottom",isDisabled:m=!1,anchor:p={x:"element",y:"element"},offset:f={mainAxis:0,crossAxis:0},onToggle:g})=>{const v=m||!e,b=t.useRef(!0),[E,A]=t.useState(!v&&s?"mounting":"unmounted"),[P,x]=t.useState(!1);x(!1);const T="datatip"===c,_=t.useRef(!0),{hoverProps:y,isHover:F}=u.useHover({isDisabled:m}),{touchProps:N,isTouch:S}=a.useTouch({isDisabled:m}),{focusProps:U,isFocus:R}=r.useFocus({isDisabled:F||S}),{hoverProps:O,isHover:H}=u.useHover({isDisabled:m}),B="pointer"===p.x||"pointer"===p.y,D=o.useId(),L=t.useRef(null),k=t.useRef({x:0,y:0}),C=B&&!R?k:L,I=T?0:250,w=t.useRef(null),G=t.useRef(null),M=()=>{w.current&&clearTimeout(w.current)},q=t.useCallback(e=>{if(e)switch(E){case"unmounting":case"unmounted":A("mountPending");break;case"unmountPending":M(),A("mounted")}else switch(E){case"mounting":case"mounted":A("unmountPending");break;case"mountPending":M(),A("unmounted")}},[E]);t.useEffect(()=>{b.current?b.current=!1:A(s?"mounting":"unmounting")},[s]),t.useEffect(()=>{_.current?_.current=!1:B&&F&&"unmounted"===E||(G.current&&clearTimeout(G.current),G.current=setTimeout(()=>{q(F||R||H||S)},20))},[F,R,H,S,B,E,q]),t.useLayoutEffect(()=>{"mountPending"!==E&&"unmountPending"!==E||(w.current=setTimeout(()=>null==g?void 0:g({value:"mountPending"===E}),I))},[E,I,g]);const V={onFocus:e=>{(e.eventPhase===Event.AT_TARGET||e.eventPhase===Event.BUBBLING_PHASE&&T)&&(L.current=e.target)}};let $;if(v)$=l.mergeProps(U,V);else{const e=Object.assign({"aria-describedby":D,onMouseEnter:e=>{(e.eventPhase===Event.AT_TARGET||e.eventPhase===Event.BUBBLING_PHASE&&T)&&(L.current=e.target)}},B&&{onMouseLeave:()=>{"mounting"!==E&&M()},onMouseMove:e=>{(e.eventPhase===Event.AT_TARGET||e.eventPhase===Event.BUBBLING_PHASE&&T)&&(e=>{var t;if("unmounted"!==E&&("datatip"!==c||"mounted"!==E))return;const n=null===(t=null==L?void 0:L.current)||void 0===t?void 0:t.getBoundingClientRect(),o=document.body.scrollLeft+((null==n?void 0:n.left)||0)+((null==n?void 0:n.width)||0),s=document.body.scrollTop+((null==n?void 0:n.top)||0)+((null==n?void 0:n.height)||0),i="pointer"===p.x?e.clientX:o,u="pointer"===p.y?e.clientY:s;"mounted"===E?(k.current={x:i,y:u},!0!==P&&x(!0)):"unmounted"===E&&(M(),w.current=setTimeout(()=>{"unmounted"===E&&(k.current={x:i,y:u},null==g||g({value:!0}))},I))})(e)}});$=l.mergeProps(y,U,N,V,e)}if(v)return M(),{tooltipContent:null,tooltipProps:$};const X=(e=>{let t="bottom";switch(e){case"top":case"end":case"bottom":case"start":t=e;break;case"top-end":t="top-end-corner";break;case"bottom-end":t="bottom-end-corner";break;case"bottom-start":t="bottom-start-corner";break;case"top-start":t="top-start-corner"}return t})(d),Y=n.jsx(i.Layer,Object.assign({logicalParentRef:L},{children:n.jsx(h.Floating,Object.assign({anchorRef:C,placement:X,offsetValue:f},{children:n.jsx(j,Object.assign({isOpen:["mounting","mounted","unmountPending"].includes(E)},O,{isDatatip:T,onTransitionEnd:()=>{"mounting"===E&&A("mounted"),"unmounting"===E&&A("unmounted")}},{children:e}))}))}));return{tooltipContent:!["unmounted","mountPending"].includes(E)&&Y,tooltipProps:$}});e.useTooltip=({text:e,position:n="bottom",isDisabled:o=!1,anchor:s={x:"element",y:"element"},offset:i={mainAxis:0,crossAxis:0},variant:u="tooltip"})=>{const[r,a]=t.useState(!1),l=o||!e,{tooltipContent:c,tooltipProps:d}=O({text:e,isOpen:r,position:n,isDisabled:l,offset:i,anchor:s,variant:u,onToggle:({value:e})=>a(e)});return{tooltipContent:c,tooltipProps:d}},e.useTooltipControlled=O,Object.defineProperty(e,"__esModule",{value:!0})});
2
2
  //# sourceMappingURL=UNSAFE_useTooltip.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"UNSAFE_useTooltip.js","sources":["../../../src/hooks/UNSAFE_useTooltip/TooltipContent.tsx","../../../src/hooks/UNSAFE_useTooltip/useTooltipControlled.tsx","../../../src/hooks/UNSAFE_useTooltip/useTooltip.tsx"],"sourcesContent":["import { useAnimation } from '../UNSAFE_useAnimation';\nimport { useId } from '../UNSAFE_useId';\nimport { cssProps } from '@oracle/oraclejet-cssprops';\nimport { classNames } from '../../utils/UNSAFE_classNames';\nimport { useEffect, useRef } from 'preact/hooks';\nimport { HTMLAttributesSignalExcluded } from '../../utils/UNSAFE_attributeUtils';\n\ntype IntrinsicProps = Pick<HTMLAttributesSignalExcluded<HTMLDivElement>, 'children'>;\n\ntype Status = 'mounted' | 'unmounted';\n\ntype ContentProps = IntrinsicProps & {\n isOpen: boolean;\n isDatatip: boolean;\n onTransitionEnd: () => void;\n};\n\nconst styles = {\n wrapper: cssProps`${{\n display: 'flex',\n alignItems: 'flex-end',\n overflowY: 'hidden'\n }}`,\n inner: cssProps`${{\n opacity: '0',\n maxHeight: '0'\n }}`,\n base: cssProps`${{\n color: 'var(--oj-c-PRIVATE-DO-NOT-USE-tooltip-text-color)',\n backgroundColor: 'var(--oj-c-PRIVATE-DO-NOT-USE-tooltip-bg-color)',\n whiteSpace: 'nowrap',\n paddingTop: 'var(--oj-c-PRIVATE-DO-NOT-USE-tooltip-padding-vertical)',\n paddingLeft: 'var(--oj-c-PRIVATE-DO-NOT-USE-tooltip-padding-horizontal)',\n paddingRight: 'var(--oj-c-PRIVATE-DO-NOT-USE-tooltip-padding-horizontal)',\n paddingBottom: 'var(--oj-c-PRIVATE-DO-NOT-USE-tooltip-padding-vertical)',\n borderRadius: 'var(--oj-c-PRIVATE-DO-NOT-USE-tooltip-border-radius)',\n borderColor: 'var(--oj-c-PRIVATE-DO-NOT-USE-tooltip-border-color)',\n fontSize: 'var(--oj-c-PRIVATE-DO-NOT-USE-tooltip-font-size)',\n borderWidth: 'var(--oj-c-PRIVATE-DO-NOT-USE-tooltip-border-width)',\n borderStyle: 'solid'\n }}`,\n datatip: cssProps`${{\n '--oj-c-PRIVATE-DO-NOT-USE-tooltip-bg-color':\n 'rgb(var(--oj-c-PRIVATE-DO-NOT-USE-palette-neutral-rgb-0))',\n '--oj-c-PRIVATE-DO-NOT-USE-tooltip-text-color':\n 'rgb(var(--oj-c-PRIVATE-DO-NOT-USE-palette-neutral-rgb-190))',\n '--oj-c-PRIVATE-DO-NOT-USE-tooltip-padding-vertical':\n 'var(--oj-c-PRIVATE-DO-NOT-USE-core-spacing-2x)',\n '--oj-c-PRIVATE-DO-NOT-USE-tooltip-border-radius':\n 'var(--oj-c-PRIVATE-DO-NOT-USE-core-border-radius-md)',\n '--oj-c-PRIVATE-DO-NOT-USE-tooltip-border-color':\n 'rgba(var(--oj-c-PRIVATE-DO-NOT-USE-palette-neutral-rgb-190), 0.65)',\n '--oj-c-PRIVATE-DO-NOT-USE-tooltip-font-size':\n 'var(--oj-c-PRIVATE-DO-NOT-USE-typography-body-xs-font-size)'\n }}`\n};\n\nexport const TooltipContent = ({\n children,\n isOpen,\n isDatatip,\n onTransitionEnd,\n ...props\n}: ContentProps) => {\n const uniqueID = useId();\n const wrapperRef = useRef<HTMLDivElement>(null);\n const popoverRef = useRef<HTMLDivElement>(null);\n\n const { nodeRef } = useAnimation<Status, HTMLDivElement>(isOpen ? 'mounted' : 'unmounted', {\n animationStates: {\n mounted: (_node) => {\n const childNode = _node.firstChild as HTMLDivElement;\n return {\n from: {\n maxHeight: '0',\n opacity: '0%'\n },\n to: {\n maxHeight: `${childNode?.offsetHeight}px`,\n opacity: isDatatip ? '100%' : '95%'\n },\n options: {\n duration: isDatatip ? 1 : 100,\n easing: [0.0, 0.0, 0.2, 1]\n }\n };\n },\n unmounted: (_node) => {\n return {\n from: {\n opacity: isDatatip ? '100%' : '95%'\n },\n to: {\n maxHeight: '0',\n opacity: '0%'\n },\n options: {\n duration: isDatatip ? 1 : 100,\n easing: [0.0, 0.0, 0.2, 1]\n }\n };\n }\n },\n isAnimatedOnMount: true,\n onAnimationEnd: () => onTransitionEnd?.()\n });\n\n // Set up initial wrapper height so Tooltip can animate from the bottom to the top\n useEffect(() => {\n if (wrapperRef.current && popoverRef.current?.offsetHeight) {\n wrapperRef.current.style.height = `${popoverRef.current?.offsetHeight}px`;\n }\n }, []);\n\n return (\n <div ref={wrapperRef} id={uniqueID} role=\"tooltip\" class={styles.wrapper}>\n <div ref={nodeRef} class={classNames([styles.inner])} {...props}>\n <div ref={popoverRef} class={classNames([styles.base, isDatatip ? styles.datatip : ''])}>\n {children}\n </div>\n </div>\n </div>\n );\n};\n","import { ComponentChild } from 'preact';\nimport { useState, useRef, useEffect, useLayoutEffect, useCallback } from 'preact/hooks';\nimport { useId } from '../UNSAFE_useId';\nimport { Floating, Placement, Coords } from '../../UNSAFE_Floating';\nimport { Layer } from '../../UNSAFE_Layer';\nimport { useHover } from '../UNSAFE_useHover';\nimport { useFocus } from '../UNSAFE_useFocus';\nimport { useTouch } from '../UNSAFE_useTouch';\nimport { mergeProps } from '../../utils/UNSAFE_mergeProps';\nimport { stringLiteralArray } from '../../utils/UNSAFE_arrayUtils';\nimport { TooltipContent } from './TooltipContent';\n\nexport const positions = stringLiteralArray([\n 'start',\n 'top-start',\n 'top',\n 'top-end',\n 'end',\n 'bottom-end',\n 'bottom',\n 'bottom-start'\n]);\ntype Position = typeof positions[number];\n\nconst positionToPlacement = (position: Position) => {\n let placement: Placement = 'bottom';\n\n switch (position) {\n case 'top':\n case 'end':\n case 'bottom':\n case 'start':\n placement = position as Placement;\n break;\n\n case 'top-end':\n placement = 'top-end-corner';\n break;\n\n case 'bottom-end':\n placement = 'bottom-end-corner';\n break;\n\n case 'bottom-start':\n placement = 'bottom-start-corner';\n break;\n\n case 'top-start':\n placement = 'top-start-corner';\n break;\n }\n\n return placement;\n};\n\nexport const anchorTos = stringLiteralArray(['element', 'pointer']);\ntype AnchorTo = typeof anchorTos[number];\n\ntype AnchorModel = { x: AnchorTo; y: AnchorTo };\n\ntype Props = {\n text?: string;\n variant?: 'tooltip' | 'datatip';\n isOpen: boolean;\n position?: Position;\n isDisabled?: boolean;\n anchor?: AnchorModel;\n offset?: { mainAxis?: number; crossAxis?: number };\n onToggle?: (details: { value: boolean }) => void;\n};\n\n/**\n * The 'mounting' and 'unmounting' states are related to the animation. The 'unmounted' state\n * is used for conditional rendering. In this state, the Tooltip content is completely removed\n * from the DOM. The 'mountPending' and 'unmountPending' are used when timeout is active.\n * The 'reposition' state is used to trigger a transition with new coordinates within\n * the same element.\n */\ntype Status =\n | 'unmounted'\n | 'mountPending'\n | 'mounting'\n | 'mounted'\n | 'unmountPending'\n | 'unmounting';\n\nexport const useTooltipControlled = ({\n text,\n isOpen = false,\n variant = 'tooltip',\n position = 'bottom',\n isDisabled = false,\n anchor = { x: 'element', y: 'element' },\n offset = { mainAxis: 0, crossAxis: 0 },\n onToggle\n}: Props): {\n tooltipContent: ComponentChild;\n tooltipProps: Record<string, any>;\n} => {\n const disabled = isDisabled || !text;\n const isInitialRenderState = useRef<boolean>(true);\n const [state, setState] = useState<Status>(!disabled && isOpen ? 'mounting' : 'unmounted');\n const [needsUpdate, setNeedsUpdate] = useState<boolean>(false);\n setNeedsUpdate(false);\n\n const isDatatip = variant === 'datatip';\n const isInitialRenderTrigger = useRef<boolean>(true);\n const { hoverProps, isHover } = useHover({ isDisabled });\n const { touchProps, isTouch } = useTouch({ isDisabled }); // TODO replace by useLongPress actionhook\n // we only care about keyboard focus, don't enable useFocus hook if isHover or isTouch are active\n const { focusProps, isFocus } = useFocus({ isDisabled: isHover || isTouch });\n const { hoverProps: popoverHoverProps, isHover: popoverIsHover } = useHover({ isDisabled });\n\n const isPointer = anchor.x === 'pointer' || anchor.y === 'pointer';\n\n const uniqueID = useId();\n const targetRef = useRef<HTMLElement | null>(null);\n const coordsRef = useRef<Coords>({ x: 0, y: 0 });\n // if anchor is set to pointer and target does not have keyboard focus, use coords\n const usedRef = isPointer && !isFocus ? coordsRef : targetRef;\n const delay = isDatatip ? 0 : 250;\n const toggleTimeoutRef = useRef<ReturnType<typeof setTimeout> | null>(null);\n const updateTimeoutRef = useRef<ReturnType<typeof setTimeout> | null>(null);\n\n const toggleTimeoutClear = () => {\n if (toggleTimeoutRef.current) {\n clearTimeout(toggleTimeoutRef.current);\n }\n };\n\n const updateTimeoutClear = () => {\n if (updateTimeoutRef.current) {\n clearTimeout(updateTimeoutRef.current);\n }\n };\n\n const updateState = useCallback(\n (open: boolean) => {\n if (open) {\n // At least one toggle event is set to true\n switch (state) {\n case 'unmounting':\n case 'unmounted':\n setState('mountPending'); // Set mount pending state if tooltip is unmounted or in unmounting transition\n break;\n case 'unmountPending':\n toggleTimeoutClear();\n setState('mounted'); // Clear timers immediately and keep the tooltip mounted\n break;\n }\n } else {\n // No toggle events are set to true\n switch (state) {\n case 'mounting':\n case 'mounted':\n setState('unmountPending'); // Set unmount pending state if tooltip is mounted or in mounting transition\n break;\n case 'mountPending':\n toggleTimeoutClear();\n setState('unmounted'); // Unmount tooltip immediately if mounting is pending\n break;\n }\n }\n },\n [state]\n );\n\n useEffect(() => {\n if (isInitialRenderState.current) {\n // On onitial render do not trigger rerender\n isInitialRenderState.current = false;\n return;\n }\n setState(isOpen ? 'mounting' : 'unmounting');\n }, [isOpen]);\n\n useEffect(() => {\n if (isInitialRenderTrigger.current) {\n // On onitial render do not trigger rerender\n isInitialRenderTrigger.current = false;\n return;\n }\n // When pointer is used, handleMouseMove method is responsible for state updates\n // until the tooltip is mounted\n if (isPointer && isHover && state === 'unmounted') {\n return;\n }\n updateTimeoutClear();\n // isHover and popoverIsHover may change rapidly as the pointer moves between the target\n // and tooltip. Need to wait for changes to settle to avoid flashing.\n updateTimeoutRef.current = setTimeout(() => {\n updateState(isHover || isFocus || popoverIsHover || isTouch);\n }, 20);\n }, [isHover, isFocus, popoverIsHover, isTouch, isPointer, state, updateState]);\n\n /*\n In some cases, several state transitions can occur at once. Due to the asynchronous nature\n of hooks, this can create a race condition. For example, when the cursor leaves the target\n element and immediately moves to the tooltip itself, the following sequence occurs:\n 1. isHover is set to false and a new render is triggered\n 2. The state is set to 'unmountPending' and a new render is triggered\n 3. Pending timeout is set\n 4. isHover is set to true and a new render is triggered\n 5. Pending timeout is cleared\n However, sometimes the timeout is cleared before it is set. The useLayoutEffect prevents this\n race condition by always scheduling the timeout synchronously.\n */\n useLayoutEffect(() => {\n if (state === 'mountPending' || state === 'unmountPending') {\n toggleTimeoutRef.current = setTimeout(\n () => onToggle?.({ value: state === 'mountPending' }),\n delay\n );\n }\n }, [state, delay, onToggle]);\n\n const handleMouseMove = (event: MouseEvent) => {\n // we only want track mouse move while the state is 'unmounted' or when moving a 'mounted' datatip\n if (state !== 'unmounted' && !(variant === 'datatip' && state === 'mounted')) {\n return;\n }\n const targetRect = targetRef?.current?.getBoundingClientRect();\n\n // Tooltip maintains static offset from left side of window\n const distanceX = document.body.scrollLeft + (targetRect?.left || 0) + (targetRect?.width || 0);\n\n // Tooltip maintains static offset from top side of the window\n const distanceY = document.body.scrollTop + (targetRect?.top || 0) + (targetRect?.height || 0);\n\n // Display tooltip at the mouse position if both anchors are set to pointer\n const x = anchor.x === 'pointer' ? event.clientX : distanceX;\n const y = anchor.y === 'pointer' ? event.clientY : distanceY;\n\n if (state === 'mounted') {\n coordsRef.current = { x, y };\n if (needsUpdate !== true) setNeedsUpdate(true);\n } else if (state === 'unmounted') {\n toggleTimeoutClear();\n toggleTimeoutRef.current = setTimeout(() => {\n if (state === 'unmounted') {\n coordsRef.current = { x, y };\n onToggle?.({ value: true });\n }\n }, delay);\n }\n };\n\n const focusInitProps = {\n onFocus: (event: FocusEvent) => {\n if (\n event.eventPhase === Event.AT_TARGET ||\n (event.eventPhase === Event.BUBBLING_PHASE && isDatatip)\n ) {\n targetRef.current = event.target as HTMLElement;\n }\n }\n };\n\n let actionableProps;\n if (disabled) {\n actionableProps = mergeProps(focusProps, focusInitProps);\n } else {\n const anchorInitProps = {\n 'aria-describedby': uniqueID,\n onMouseEnter: (event: MouseEvent) => {\n if (\n event.eventPhase === Event.AT_TARGET ||\n (event.eventPhase === Event.BUBBLING_PHASE && isDatatip)\n ) {\n targetRef.current = event.target as HTMLElement;\n }\n },\n ...(isPointer && {\n onMouseLeave: () => {\n if (state === 'mounting') {\n return;\n }\n toggleTimeoutClear();\n },\n onMouseMove: (event: MouseEvent) => {\n if (\n event.eventPhase === Event.AT_TARGET ||\n (event.eventPhase === Event.BUBBLING_PHASE && isDatatip)\n ) {\n handleMouseMove(event);\n }\n }\n })\n };\n actionableProps = mergeProps(\n hoverProps,\n focusProps,\n touchProps,\n focusInitProps,\n anchorInitProps\n );\n }\n\n // No need to process tooltip if disabled or no text is provided\n // Include actionableProps to detect mouseenter in components\n // hovered state won't update unless actionableProps are already present in the component when mouse enters\n if (disabled) {\n toggleTimeoutClear();\n return {\n tooltipContent: null,\n tooltipProps: actionableProps\n };\n }\n\n const placement = positionToPlacement(position);\n\n const handleTransitionEnd = () => {\n if (state === 'mounting') {\n setState('mounted');\n }\n if (state === 'unmounting') {\n setState('unmounted');\n }\n };\n\n const renderContent = (\n <Layer logicalParentRef={targetRef}>\n <Floating anchorRef={usedRef} placement={placement} offsetValue={offset}>\n <TooltipContent\n isOpen={['mounting', 'mounted', 'unmountPending'].includes(state)}\n {...popoverHoverProps}\n isDatatip={isDatatip}\n onTransitionEnd={handleTransitionEnd}>\n {text}\n </TooltipContent>\n </Floating>\n </Layer>\n );\n\n return {\n tooltipContent: !['unmounted', 'mountPending'].includes(state) && renderContent,\n tooltipProps: actionableProps\n };\n};\n","import { useState } from 'preact/hooks';\nimport { useTooltipControlled } from './useTooltipControlled';\n\ntype tooltipParameters = Parameters<typeof useTooltipControlled>[0];\n\ntype Props = {\n text?: string;\n position?: tooltipParameters['position'];\n isDisabled?: boolean;\n anchor?: tooltipParameters['anchor'];\n offset?: { mainAxis?: number; crossAxis?: number };\n variant?: tooltipParameters['variant'];\n};\n\nexport const useTooltip = ({\n text,\n position = 'bottom',\n isDisabled = false,\n anchor = { x: 'element', y: 'element' },\n offset = { mainAxis: 0, crossAxis: 0 },\n variant = 'tooltip'\n}: Props): ReturnType<typeof useTooltipControlled> => {\n const [isOpen, setIsOpen] = useState<boolean>(false);\n const disabled = isDisabled || !text;\n const { tooltipContent, tooltipProps } = useTooltipControlled({\n text,\n isOpen,\n position,\n isDisabled: disabled,\n offset,\n anchor,\n variant,\n onToggle: ({ value }) => setIsOpen(value)\n });\n\n return {\n tooltipContent,\n tooltipProps\n };\n};\n"],"names":["styles","TooltipContent","_a","children","isOpen","isDatatip","onTransitionEnd","props","__rest","uniqueID","useId","wrapperRef","useRef","popoverRef","nodeRef","useAnimation","animationStates","mounted","_node","childNode","firstChild","from","maxHeight","opacity","to","options","unmounted","isAnimatedOnMount","current","style","height","_b","offsetHeight","_jsx","Object","assign","ref","id","role","class","jsx","classNames","useTooltipControlled","stringLiteralArray","text","variant","position","isDisabled","anchor","x","y","offset","mainAxis","crossAxis","onToggle","disabled","isInitialRenderState","state","setState","useState","needsUpdate","setNeedsUpdate","isInitialRenderTrigger","hoverProps","isHover","useHover","touchProps","isTouch","useTouch","focusProps","isFocus","useFocus","popoverHoverProps","popoverIsHover","isPointer","targetRef","coordsRef","usedRef","delay","toggleTimeoutRef","updateTimeoutRef","toggleTimeoutClear","clearTimeout","updateState","useCallback","open","useEffect","setTimeout","useLayoutEffect","value","focusInitProps","onFocus","event","eventPhase","Event","AT_TARGET","BUBBLING_PHASE","target","actionableProps","mergeProps","anchorInitProps","onMouseEnter","onMouseLeave","onMouseMove","targetRect","getBoundingClientRect","distanceX","document","body","scrollLeft","left","width","distanceY","scrollTop","top","clientX","clientY","handleMouseMove","tooltipContent","tooltipProps","placement","positionToPlacement","renderContent","Layer","logicalParentRef","Floating","anchorRef","offsetValue","includes","setIsOpen"],"mappings":"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"}
1
+ {"version":3,"file":"UNSAFE_useTooltip.js","sources":["../../../src/hooks/UNSAFE_useTooltip/TooltipContent.tsx","../../../src/hooks/UNSAFE_useTooltip/useTooltipControlled.tsx","../../../src/hooks/UNSAFE_useTooltip/useTooltip.tsx"],"sourcesContent":["import { useAnimation } from '../UNSAFE_useAnimation';\nimport { useId } from '../UNSAFE_useId';\nimport { cssProps } from '@oracle/oraclejet-cssprops';\nimport { classNames } from '../../utils/UNSAFE_classNames';\nimport { useEffect, useRef } from 'preact/hooks';\nimport { HTMLAttributesSignalExcluded } from '../../utils/UNSAFE_attributeUtils';\n\ntype IntrinsicProps = Pick<HTMLAttributesSignalExcluded<HTMLDivElement>, 'children'>;\n\ntype Status = 'mounted' | 'unmounted';\n\ntype ContentProps = IntrinsicProps & {\n isOpen: boolean;\n isDatatip: boolean;\n onTransitionEnd: () => void;\n};\n\nconst styles = {\n wrapper: cssProps`${{\n display: 'flex',\n alignItems: 'flex-end',\n overflowY: 'hidden'\n }}`,\n inner: cssProps`${{\n opacity: '0',\n maxHeight: '0'\n }}`,\n base: cssProps`${{\n color: 'var(--oj-c-PRIVATE-DO-NOT-USE-tooltip-text-color)',\n backgroundColor: 'var(--oj-c-PRIVATE-DO-NOT-USE-tooltip-bg-color)',\n whiteSpace: 'nowrap',\n paddingTop: 'var(--oj-c-PRIVATE-DO-NOT-USE-tooltip-padding-vertical)',\n paddingLeft: 'var(--oj-c-PRIVATE-DO-NOT-USE-tooltip-padding-horizontal)',\n paddingRight: 'var(--oj-c-PRIVATE-DO-NOT-USE-tooltip-padding-horizontal)',\n paddingBottom: 'var(--oj-c-PRIVATE-DO-NOT-USE-tooltip-padding-vertical)',\n borderRadius: 'var(--oj-c-PRIVATE-DO-NOT-USE-tooltip-border-radius)',\n borderColor: 'var(--oj-c-PRIVATE-DO-NOT-USE-tooltip-border-color)',\n fontSize: 'var(--oj-c-PRIVATE-DO-NOT-USE-tooltip-font-size)',\n borderWidth: 'var(--oj-c-PRIVATE-DO-NOT-USE-tooltip-border-width)',\n borderStyle: 'solid'\n }}`,\n datatip: cssProps`${{\n '--oj-c-PRIVATE-DO-NOT-USE-tooltip-bg-color':\n 'rgb(var(--oj-c-PRIVATE-DO-NOT-USE-palette-neutral-rgb-0))',\n '--oj-c-PRIVATE-DO-NOT-USE-tooltip-text-color':\n 'rgb(var(--oj-c-PRIVATE-DO-NOT-USE-palette-neutral-rgb-190))',\n '--oj-c-PRIVATE-DO-NOT-USE-tooltip-padding-vertical':\n 'var(--oj-c-PRIVATE-DO-NOT-USE-core-spacing-2x)',\n '--oj-c-PRIVATE-DO-NOT-USE-tooltip-border-radius':\n 'var(--oj-c-PRIVATE-DO-NOT-USE-core-border-radius-md)',\n '--oj-c-PRIVATE-DO-NOT-USE-tooltip-border-color':\n 'rgba(var(--oj-c-PRIVATE-DO-NOT-USE-palette-neutral-rgb-190), 0.65)',\n '--oj-c-PRIVATE-DO-NOT-USE-tooltip-font-size':\n 'var(--oj-c-PRIVATE-DO-NOT-USE-typography-body-xs-font-size)'\n }}`\n};\n\nexport const TooltipContent = ({\n children,\n isOpen,\n isDatatip,\n onTransitionEnd,\n ...props\n}: ContentProps) => {\n const uniqueID = useId();\n const wrapperRef = useRef<HTMLDivElement>(null);\n const popoverRef = useRef<HTMLDivElement>(null);\n\n const { nodeRef } = useAnimation<Status, HTMLDivElement>(isOpen ? 'mounted' : 'unmounted', {\n animationStates: {\n mounted: (_node) => {\n const childNode = _node.firstChild as HTMLDivElement;\n return {\n from: {\n maxHeight: '0',\n opacity: '0%'\n },\n to: {\n maxHeight: `${childNode?.offsetHeight}px`,\n opacity: isDatatip ? '100%' : '95%'\n },\n options: {\n duration: isDatatip ? 1 : 100,\n easing: [0.0, 0.0, 0.2, 1]\n }\n };\n },\n unmounted: (_node) => {\n return {\n from: {\n opacity: isDatatip ? '100%' : '95%'\n },\n to: {\n maxHeight: '0',\n opacity: '0%'\n },\n options: {\n duration: isDatatip ? 1 : 100,\n easing: [0.0, 0.0, 0.2, 1]\n }\n };\n }\n },\n isAnimatedOnMount: true,\n onAnimationEnd: () => onTransitionEnd?.()\n });\n\n // Set up initial wrapper height so Tooltip can animate from the bottom to the top\n useEffect(() => {\n if (wrapperRef.current && popoverRef.current?.offsetHeight) {\n wrapperRef.current.style.height = `${popoverRef.current?.offsetHeight}px`;\n }\n }, []);\n\n return (\n <div ref={wrapperRef} id={uniqueID} role=\"tooltip\" class={styles.wrapper}>\n <div ref={nodeRef} class={classNames([styles.inner])} {...props}>\n <div ref={popoverRef} class={classNames([styles.base, isDatatip ? styles.datatip : ''])}>\n {children}\n </div>\n </div>\n </div>\n );\n};\n","import { ComponentChild } from 'preact';\nimport { useState, useRef, useEffect, useLayoutEffect, useCallback } from 'preact/hooks';\nimport { useId } from '../UNSAFE_useId';\nimport { Floating, Placement, Coords } from '../../UNSAFE_Floating';\nimport { Layer } from '../../UNSAFE_Layer';\nimport { useHover } from '../UNSAFE_useHover';\nimport { useFocus } from '../UNSAFE_useFocus';\nimport { useTouch } from '../UNSAFE_useTouch';\nimport { mergeProps } from '../../utils/UNSAFE_mergeProps';\nimport { stringLiteralArray } from '../../utils/UNSAFE_arrayUtils';\nimport { TooltipContent } from './TooltipContent';\n\nexport const positions = stringLiteralArray([\n 'start',\n 'top-start',\n 'top',\n 'top-end',\n 'end',\n 'bottom-end',\n 'bottom',\n 'bottom-start'\n]);\ntype Position = typeof positions[number];\n\nconst positionToPlacement = (position: Position) => {\n let placement: Placement = 'bottom';\n\n switch (position) {\n case 'top':\n case 'end':\n case 'bottom':\n case 'start':\n placement = position as Placement;\n break;\n\n case 'top-end':\n placement = 'top-end-corner';\n break;\n\n case 'bottom-end':\n placement = 'bottom-end-corner';\n break;\n\n case 'bottom-start':\n placement = 'bottom-start-corner';\n break;\n\n case 'top-start':\n placement = 'top-start-corner';\n break;\n }\n\n return placement;\n};\n\nexport const anchorTos = stringLiteralArray(['element', 'pointer']);\ntype AnchorTo = typeof anchorTos[number];\n\ntype AnchorModel = { x: AnchorTo; y: AnchorTo };\n\ntype Props = {\n text?: string;\n variant?: 'tooltip' | 'datatip';\n isOpen: boolean;\n position?: Position;\n isDisabled?: boolean;\n anchor?: AnchorModel;\n offset?: { mainAxis?: number; crossAxis?: number };\n onToggle?: (details: { value: boolean }) => void;\n};\n\n/**\n * The 'mounting' and 'unmounting' states are related to the animation. The 'unmounted' state\n * is used for conditional rendering. In this state, the Tooltip content is completely removed\n * from the DOM. The 'mountPending' and 'unmountPending' are used when timeout is active.\n * The 'reposition' state is used to trigger a transition with new coordinates within\n * the same element.\n */\ntype Status =\n | 'unmounted'\n | 'mountPending'\n | 'mounting'\n | 'mounted'\n | 'unmountPending'\n | 'unmounting';\n\nexport const useTooltipControlled = ({\n text,\n isOpen = false,\n variant = 'tooltip',\n position = 'bottom',\n isDisabled = false,\n anchor = { x: 'element', y: 'element' },\n offset = { mainAxis: 0, crossAxis: 0 },\n onToggle\n}: Props): {\n tooltipContent: ComponentChild;\n tooltipProps: Record<string, any>;\n} => {\n const disabled = isDisabled || !text;\n const isInitialRenderState = useRef<boolean>(true);\n const [state, setState] = useState<Status>(!disabled && isOpen ? 'mounting' : 'unmounted');\n const [needsUpdate, setNeedsUpdate] = useState<boolean>(false);\n setNeedsUpdate(false);\n\n const isDatatip = variant === 'datatip';\n const isInitialRenderTrigger = useRef<boolean>(true);\n const { hoverProps, isHover } = useHover({ isDisabled });\n const { touchProps, isTouch } = useTouch({ isDisabled }); // TODO replace by useLongPress actionhook\n // we only care about keyboard focus, don't enable useFocus hook if isHover or isTouch are active\n const { focusProps, isFocus } = useFocus({ isDisabled: isHover || isTouch });\n const { hoverProps: popoverHoverProps, isHover: popoverIsHover } = useHover({ isDisabled });\n\n const isPointer = anchor.x === 'pointer' || anchor.y === 'pointer';\n\n const uniqueID = useId();\n const targetRef = useRef<HTMLElement | null>(null);\n const coordsRef = useRef<Coords>({ x: 0, y: 0 });\n // if anchor is set to pointer and target does not have keyboard focus, use coords\n const usedRef = isPointer && !isFocus ? coordsRef : targetRef;\n const delay = isDatatip ? 0 : 250;\n const toggleTimeoutRef = useRef<ReturnType<typeof setTimeout> | null>(null);\n const updateTimeoutRef = useRef<ReturnType<typeof setTimeout> | null>(null);\n\n const toggleTimeoutClear = () => {\n if (toggleTimeoutRef.current) {\n clearTimeout(toggleTimeoutRef.current);\n }\n };\n\n const updateTimeoutClear = () => {\n if (updateTimeoutRef.current) {\n clearTimeout(updateTimeoutRef.current);\n }\n };\n\n const updateState = useCallback(\n (open: boolean) => {\n if (open) {\n // At least one toggle event is set to true\n switch (state) {\n case 'unmounting':\n case 'unmounted':\n setState('mountPending'); // Set mount pending state if tooltip is unmounted or in unmounting transition\n break;\n case 'unmountPending':\n toggleTimeoutClear();\n setState('mounted'); // Clear timers immediately and keep the tooltip mounted\n break;\n }\n } else {\n // No toggle events are set to true\n switch (state) {\n case 'mounting':\n case 'mounted':\n setState('unmountPending'); // Set unmount pending state if tooltip is mounted or in mounting transition\n break;\n case 'mountPending':\n toggleTimeoutClear();\n setState('unmounted'); // Unmount tooltip immediately if mounting is pending\n break;\n }\n }\n },\n [state]\n );\n\n useEffect(() => {\n if (isInitialRenderState.current) {\n // On onitial render do not trigger rerender\n isInitialRenderState.current = false;\n return;\n }\n setState(isOpen ? 'mounting' : 'unmounting');\n }, [isOpen]);\n\n useEffect(() => {\n if (isInitialRenderTrigger.current) {\n // On onitial render do not trigger rerender\n isInitialRenderTrigger.current = false;\n return;\n }\n // When pointer is used, handleMouseMove method is responsible for state updates\n // until the tooltip is mounted\n if (isPointer && isHover && state === 'unmounted') {\n return;\n }\n updateTimeoutClear();\n // isHover and popoverIsHover may change rapidly as the pointer moves between the target\n // and tooltip. Need to wait for changes to settle to avoid flashing.\n updateTimeoutRef.current = setTimeout(() => {\n updateState(isHover || isFocus || popoverIsHover || isTouch);\n }, 20);\n }, [isHover, isFocus, popoverIsHover, isTouch, isPointer, state, updateState]);\n\n /*\n In some cases, several state transitions can occur at once. Due to the asynchronous nature\n of hooks, this can create a race condition. For example, when the cursor leaves the target\n element and immediately moves to the tooltip itself, the following sequence occurs:\n 1. isHover is set to false and a new render is triggered\n 2. The state is set to 'unmountPending' and a new render is triggered\n 3. Pending timeout is set\n 4. isHover is set to true and a new render is triggered\n 5. Pending timeout is cleared\n However, sometimes the timeout is cleared before it is set. The useLayoutEffect prevents this\n race condition by always scheduling the timeout synchronously.\n */\n useLayoutEffect(() => {\n if (state === 'mountPending' || state === 'unmountPending') {\n toggleTimeoutRef.current = setTimeout(\n () => onToggle?.({ value: state === 'mountPending' }),\n delay\n );\n }\n }, [state, delay, onToggle]);\n\n const handleMouseMove = (event: MouseEvent) => {\n // we only want track mouse move while the state is 'unmounted' or when moving a 'mounted' datatip\n if (state !== 'unmounted' && !(variant === 'datatip' && state === 'mounted')) {\n return;\n }\n const targetRect = targetRef?.current?.getBoundingClientRect();\n\n // Tooltip maintains static offset from left side of window\n const distanceX = document.body.scrollLeft + (targetRect?.left || 0) + (targetRect?.width || 0);\n\n // Tooltip maintains static offset from top side of the window\n const distanceY = document.body.scrollTop + (targetRect?.top || 0) + (targetRect?.height || 0);\n\n // Display tooltip at the mouse position if both anchors are set to pointer\n const x = anchor.x === 'pointer' ? event.clientX : distanceX;\n const y = anchor.y === 'pointer' ? event.clientY : distanceY;\n\n if (state === 'mounted') {\n coordsRef.current = { x, y };\n if (needsUpdate !== true) setNeedsUpdate(true);\n } else if (state === 'unmounted') {\n toggleTimeoutClear();\n toggleTimeoutRef.current = setTimeout(() => {\n if (state === 'unmounted') {\n coordsRef.current = { x, y };\n onToggle?.({ value: true });\n }\n }, delay);\n }\n };\n\n const focusInitProps = {\n onFocus: (event: FocusEvent) => {\n if (\n event.eventPhase === Event.AT_TARGET ||\n (event.eventPhase === Event.BUBBLING_PHASE && isDatatip)\n ) {\n targetRef.current = event.target as HTMLElement;\n }\n }\n };\n\n let actionableProps;\n if (disabled) {\n actionableProps = mergeProps(focusProps, focusInitProps);\n } else {\n const anchorInitProps = {\n 'aria-describedby': uniqueID,\n onMouseEnter: (event: MouseEvent) => {\n if (\n event.eventPhase === Event.AT_TARGET ||\n (event.eventPhase === Event.BUBBLING_PHASE && isDatatip)\n ) {\n targetRef.current = event.target as HTMLElement;\n }\n },\n ...(isPointer && {\n onMouseLeave: () => {\n if (state === 'mounting') {\n return;\n }\n toggleTimeoutClear();\n },\n onMouseMove: (event: MouseEvent) => {\n if (\n event.eventPhase === Event.AT_TARGET ||\n (event.eventPhase === Event.BUBBLING_PHASE && isDatatip)\n ) {\n handleMouseMove(event);\n }\n }\n })\n };\n actionableProps = mergeProps(\n hoverProps,\n focusProps,\n touchProps,\n focusInitProps,\n anchorInitProps\n );\n }\n\n // No need to process tooltip if disabled or no text is provided\n // Include actionableProps to detect mouseenter in components\n // hovered state won't update unless actionableProps are already present in the component when mouse enters\n if (disabled) {\n toggleTimeoutClear();\n return {\n tooltipContent: null,\n tooltipProps: actionableProps\n };\n }\n\n const placement = positionToPlacement(position);\n\n const handleTransitionEnd = () => {\n if (state === 'mounting') {\n setState('mounted');\n }\n if (state === 'unmounting') {\n setState('unmounted');\n }\n };\n\n const renderContent = (\n <Layer logicalParentRef={targetRef}>\n <Floating anchorRef={usedRef} placement={placement} offsetValue={offset}>\n <TooltipContent\n isOpen={['mounting', 'mounted', 'unmountPending'].includes(state)}\n {...popoverHoverProps}\n isDatatip={isDatatip}\n onTransitionEnd={handleTransitionEnd}>\n {text}\n </TooltipContent>\n </Floating>\n </Layer>\n );\n\n return {\n tooltipContent: !['unmounted', 'mountPending'].includes(state) && renderContent,\n tooltipProps: actionableProps\n };\n};\n","import { useState } from 'preact/hooks';\nimport { useTooltipControlled } from './useTooltipControlled';\n\ntype tooltipParameters = Parameters<typeof useTooltipControlled>[0];\n\ntype Props = {\n text?: string;\n position?: tooltipParameters['position'];\n isDisabled?: boolean;\n anchor?: tooltipParameters['anchor'];\n offset?: { mainAxis?: number; crossAxis?: number };\n variant?: tooltipParameters['variant'];\n};\n\nexport const useTooltip = ({\n text,\n position = 'bottom',\n isDisabled = false,\n anchor = { x: 'element', y: 'element' },\n offset = { mainAxis: 0, crossAxis: 0 },\n variant = 'tooltip'\n}: Props): ReturnType<typeof useTooltipControlled> => {\n const [isOpen, setIsOpen] = useState<boolean>(false);\n const disabled = isDisabled || !text;\n const { tooltipContent, tooltipProps } = useTooltipControlled({\n text,\n isOpen,\n position,\n isDisabled: disabled,\n offset,\n anchor,\n variant,\n onToggle: ({ value }) => setIsOpen(value)\n });\n\n return {\n tooltipContent,\n tooltipProps\n };\n};\n"],"names":["styles","TooltipContent","_a","children","isOpen","isDatatip","onTransitionEnd","props","__rest","uniqueID","useId","wrapperRef","useRef","popoverRef","nodeRef","useAnimation","animationStates","mounted","_node","childNode","firstChild","from","maxHeight","opacity","to","options","unmounted","isAnimatedOnMount","current","style","height","_b","offsetHeight","_jsx","Object","assign","ref","id","role","class","jsx","classNames","useTooltipControlled","stringLiteralArray","text","variant","position","isDisabled","anchor","x","y","offset","mainAxis","crossAxis","onToggle","disabled","isInitialRenderState","state","setState","useState","needsUpdate","setNeedsUpdate","isInitialRenderTrigger","hoverProps","isHover","useHover","touchProps","isTouch","useTouch","focusProps","isFocus","useFocus","popoverHoverProps","popoverIsHover","isPointer","targetRef","coordsRef","usedRef","delay","toggleTimeoutRef","updateTimeoutRef","toggleTimeoutClear","clearTimeout","updateState","useCallback","open","useEffect","setTimeout","useLayoutEffect","value","focusInitProps","onFocus","event","eventPhase","Event","AT_TARGET","BUBBLING_PHASE","target","actionableProps","mergeProps","anchorInitProps","onMouseEnter","onMouseLeave","onMouseMove","targetRect","getBoundingClientRect","distanceX","document","body","scrollLeft","left","width","distanceY","scrollTop","top","clientX","clientY","handleMouseMove","tooltipContent","tooltipProps","placement","positionToPlacement","renderContent","Layer","logicalParentRef","Floating","anchorRef","offsetValue","includes","setIsOpen"],"mappings":"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"}
@@ -1 +1 @@
1
- {"version":3,"file":"UNSAFE_useTouch.js","sources":["../../../src/hooks/UNSAFE_useTouch/useTouch.ts"],"sourcesContent":["import { useToggle } from '../UNSAFE_useToggle';\n\nexport type TouchOptions = {\n isDisabled?: boolean;\n};\n\n/**\n * Get status on whether target has touch or not\n * @returns\n */\nexport function useTouch(settings: TouchOptions = { isDisabled: false }): {\n isTouch: boolean;\n touchProps: Record<string, any>;\n} {\n const { bool, setTrue, setFalse } = useToggle(false);\n const touchProps = settings.isDisabled\n ? {}\n : {\n onTouchStart: setTrue,\n onTouchEnd: setFalse\n };\n return {\n isTouch: settings.isDisabled ? false : bool,\n touchProps: touchProps\n };\n}\n"],"names":["settings","isDisabled","bool","setTrue","setFalse","useToggle","touchProps","onTouchStart","onTouchEnd","isTouch"],"mappings":"+FAUM,SAAmBA,EAAyB,CAAEC,YAAY,IAI9D,MAAMC,KAAEA,EAAFC,QAAQA,EAARC,SAAiBA,GAAaC,EAAAA,WAAU,GACxCC,EAAaN,EAASC,WACxB,GACA,CACEM,aAAcJ,EACdK,WAAYJ,GAElB,MAAO,CACLK,SAAST,EAASC,YAAqBC,EACvCI,WAAYA"}
1
+ {"version":3,"file":"UNSAFE_useTouch.js","sources":["../../../src/hooks/UNSAFE_useTouch/useTouch.ts"],"sourcesContent":["import { useToggle } from '../UNSAFE_useToggle';\n\nexport type TouchOptions = {\n isDisabled?: boolean;\n};\n\n/**\n * Get status on whether target has touch or not\n * @returns\n */\nexport function useTouch(settings: TouchOptions = { isDisabled: false }): {\n isTouch: boolean;\n touchProps: Record<string, any>;\n} {\n const { bool, setTrue, setFalse } = useToggle(false);\n const touchProps = settings.isDisabled\n ? {}\n : {\n onTouchStart: setTrue,\n onTouchEnd: setFalse\n };\n return {\n isTouch: settings.isDisabled ? false : bool,\n touchProps: touchProps\n };\n}\n"],"names":["settings","isDisabled","bool","setTrue","setFalse","useToggle","touchProps","onTouchStart","onTouchEnd","isTouch"],"mappings":"+FAUM,SAAmBA,EAAyB,CAAEC,YAAY,IAI9D,MAAMC,KAAEA,EAAIC,QAAEA,EAAOC,SAAEA,GAAaC,EAAAA,WAAU,GACxCC,EAAaN,EAASC,WACxB,GACA,CACEM,aAAcJ,EACdK,WAAYJ,GAElB,MAAO,CACLK,SAAST,EAASC,YAAqBC,EACvCI,WAAYA"}
@@ -1 +1 @@
1
- {"version":3,"file":"UNSAFE_useTranslationBundle.js","sources":["../../../src/hooks/UNSAFE_useTranslationBundle/useTranslationBundle.ts"],"sourcesContent":["/**\n * @license\n * Copyright (c) %FIRST_YEAR% %CURRENT_YEAR%, Oracle and/or its affiliates.\n * The Universal Permissive License (UPL), Version 1.0\n * as shown at https://oss.oracle.com/licenses/upl/\n * @ignore\n */\nimport { useContext } from 'preact/hooks';\nimport { EnvironmentContext } from '../../UNSAFE_Environment';\nimport type { TranslationBundle } from '../../UNSAFE_Environment';\n\n/**\n * useTranslationBundle is a hook to get a translation bundle from the EnvironmentProvider\n * @param bundleId\n * @returns a translation bundle of type T\n */\nexport function useTranslationBundle<T extends TranslationBundle>(bundleId: string) {\n const translations = useContext(EnvironmentContext).translations;\n const bundle = translations?.[bundleId];\n if (!bundle) {\n throw new Error(`Translation bundle ${bundleId} is not loaded.`);\n }\n return bundle as T;\n}\n"],"names":["bundleId","translations","useContext","EnvironmentContext","bundle","Error"],"mappings":"sLAgBM,SAA4DA,GAChE,MAAMC,EAAeC,EAAAA,WAAWC,EAAkBA,oBAAEF,aAC9CG,EAASH,MAAAA,SAAAA,EAAeD,GAC9B,IAAKI,EACH,MAAM,IAAIC,4BAA4BL,oBAExC,OAAOI"}
1
+ {"version":3,"file":"UNSAFE_useTranslationBundle.js","sources":["../../../src/hooks/UNSAFE_useTranslationBundle/useTranslationBundle.ts"],"sourcesContent":["/**\n * @license\n * Copyright (c) %FIRST_YEAR% %CURRENT_YEAR%, Oracle and/or its affiliates.\n * The Universal Permissive License (UPL), Version 1.0\n * as shown at https://oss.oracle.com/licenses/upl/\n * @ignore\n */\nimport { useContext } from 'preact/hooks';\nimport { EnvironmentContext } from '../../UNSAFE_Environment';\nimport type { TranslationBundle } from '../../UNSAFE_Environment';\n\n/**\n * useTranslationBundle is a hook to get a translation bundle from the EnvironmentProvider\n * @param bundleId\n * @returns a translation bundle of type T\n */\nexport function useTranslationBundle<T extends TranslationBundle>(bundleId: string) {\n const translations = useContext(EnvironmentContext).translations;\n const bundle = translations?.[bundleId];\n if (!bundle) {\n throw new Error(`Translation bundle ${bundleId} is not loaded.`);\n }\n return bundle as T;\n}\n"],"names":["bundleId","translations","useContext","EnvironmentContext","bundle","Error"],"mappings":"sLAgBM,SAA4DA,GAChE,MAAMC,EAAeC,EAAAA,WAAWC,EAAkBA,oBAAEF,aAC9CG,EAASH,MAAAA,SAAAA,EAAeD,GAC9B,IAAKI,EACH,MAAM,IAAIC,MAAM,sBAAsBL,oBAExC,OAAOI"}
@@ -1,2 +1,2 @@
1
- define(["exports","preact/hooks"],function(e,t){"use strict";e.useUncontrolledState=function(e,r){const[n,u]=t.useState(e),c=t.useRef(n),o=t.useRef(r);return o.current=r,[n,t.useCallback((e,...t)=>{var r,n;(u(e),c.current!==e)&&(null===(r=o.current)||void 0===r||(n=r).call.apply(n,[o,e].concat(t)),c.current=e)},[])]},Object.defineProperty(e,"__esModule",{value:!0})});
1
+ define(["exports","preact/hooks"],function(e,t){"use strict";e.useUncontrolledState=function(e,r){const[u,n]=t.useState(e),c=t.useRef(u),o=t.useRef(r);return o.current=r,[u,t.useCallback((e,...t)=>{var r;n(e),c.current!==e&&(null===(r=o.current)||void 0===r||r.call(o,e,...t),c.current=e)},[])]},Object.defineProperty(e,"__esModule",{value:!0})});
2
2
  //# sourceMappingURL=UNSAFE_useUncontrolledState.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"UNSAFE_useUncontrolledState.js","sources":["../../../src/hooks/UNSAFE_useUncontrolledState/useUncontrolledState.ts"],"sourcesContent":["import { useCallback, useRef, useState } from 'preact/hooks';\n\n/**\n * A custom hook for handling uncontrolled properties. These are the properties for which\n * we need to maintain an internal state and also trigger certain callbacks whenever we\n * update the internal state.\n *\n * Examples:\n * 1. The `value` property in an uncontrolled InputText\n *\n * Here, we will have `value` property and a corresponding `onValueChanged` callback. When\n * one interacts with the component and updates the value on the UI, we need to update the\n * `value` prop accordingly. Being uncontrolled, we do not have to rely on the parent to push\n * back the value, so we maintain an internal state for it and update the internal state.\n * Even though we are maintaining an internal state, we still need to invoke the callback\n * so we do that when the new value is different from the current value.\n *\n * We use useUncontrolledState hook for getting this behavior like follows:\n * ```\n * const [uncontrolledValue, setUncontrolledValue] = useUncontrolledState(value, onValueChanged);\n * ```\n *\n * Whenever you want to change this value, you would simply do:\n * ```\n * // set the new value\n * setUncontrolledValue(newValue);\n * ```\n * This call automatically calls the `onValueChanged` callback for you when the new value is different.\n * Essentially, you might want to consider using this method if your property supports writeback. This\n * way, whenever we update the internal state, the onPropertyChanged will be invoked automatically with\n * the new value which would in turn writes back the new value on the prop.\n *\n * @param initialState The initial value for the internal state. Calling this hook again with a different\n * value for this argument will not update the internal state.\n * @param onStateChange The callback function that needs to be called whenever the state value is updated.\n * @returns A stateful value and a setter function to update it. Here the setter function identity\n * is stable and won't change on re-renders (similar to useState's setter function)\n */\nexport function useUncontrolledState<V>(\n initialState?: V,\n onStateChange?: (value: V, ...args: any[]) => void\n): [V | undefined, (value: V, ...args: any[]) => void] {\n // Internal state for storing the value\n const [stateValue, setStateValue] = useState(initialState);\n // Internal ref to store value. This is to know what the previous value was.\n const stateRef = useRef(stateValue);\n\n // In order to make the setter function returned by this hook stable, we need to remove\n // any external dependency from it. So, we use a ref that gets updated every render\n // to store the onStateChange callback function. This way we can refer to this function\n // without making it a dependency.\n const onStateChangeRef = useRef(onStateChange);\n onStateChangeRef.current = onStateChange;\n\n // A setter function for updating the state\n const setUncontrolledValue = useCallback((state: V, ...args: any[]) => {\n // update the internal state\n setStateValue(state);\n // Call the onChange callback only if the value is changed\n if (stateRef.current !== state) {\n onStateChangeRef.current?.(state, ...args);\n stateRef.current = state;\n }\n }, []);\n\n // The setUncontrolledValue function returned here is guaranteed to\n // be the same.\n return [stateValue, setUncontrolledValue];\n}\n"],"names":["initialState","onStateChange","stateValue","setStateValue","useState","stateRef","useRef","onStateChangeRef","current","useCallback","state","args","_a2","_a","call"],"mappings":"oFAsCgB,SACdA,EACAC,GAGA,MAAOC,EAAYC,GAAiBC,EAAQA,SAACJ,GAEvCK,EAAWC,SAAOJ,GAMlBK,EAAmBD,SAAOL,GAgBhC,OAfAM,EAAiBC,QAAUP,EAepB,CAACC,EAZqBO,EAAWA,YAAC,CAACC,KAAaC,WAIrBC,GAFhCT,EAAcO,GAEVL,EAASG,UAAYE,KACC,QAAxBG,EAAAN,EAAiBC,eAAO,IAAAK,IAAAA,EAAAA,GAAAC,KAAAP,MAAAA,EAAAA,CAAAA,EAAGG,GAAUC,OAAAA,IACrCN,EAASG,QAAUE,IAEpB"}
1
+ {"version":3,"file":"UNSAFE_useUncontrolledState.js","sources":["../../../src/hooks/UNSAFE_useUncontrolledState/useUncontrolledState.ts"],"sourcesContent":["import { useCallback, useRef, useState } from 'preact/hooks';\n\n/**\n * A custom hook for handling uncontrolled properties. These are the properties for which\n * we need to maintain an internal state and also trigger certain callbacks whenever we\n * update the internal state.\n *\n * Examples:\n * 1. The `value` property in an uncontrolled InputText\n *\n * Here, we will have `value` property and a corresponding `onValueChanged` callback. When\n * one interacts with the component and updates the value on the UI, we need to update the\n * `value` prop accordingly. Being uncontrolled, we do not have to rely on the parent to push\n * back the value, so we maintain an internal state for it and update the internal state.\n * Even though we are maintaining an internal state, we still need to invoke the callback\n * so we do that when the new value is different from the current value.\n *\n * We use useUncontrolledState hook for getting this behavior like follows:\n * ```\n * const [uncontrolledValue, setUncontrolledValue] = useUncontrolledState(value, onValueChanged);\n * ```\n *\n * Whenever you want to change this value, you would simply do:\n * ```\n * // set the new value\n * setUncontrolledValue(newValue);\n * ```\n * This call automatically calls the `onValueChanged` callback for you when the new value is different.\n * Essentially, you might want to consider using this method if your property supports writeback. This\n * way, whenever we update the internal state, the onPropertyChanged will be invoked automatically with\n * the new value which would in turn writes back the new value on the prop.\n *\n * @param initialState The initial value for the internal state. Calling this hook again with a different\n * value for this argument will not update the internal state.\n * @param onStateChange The callback function that needs to be called whenever the state value is updated.\n * @returns A stateful value and a setter function to update it. Here the setter function identity\n * is stable and won't change on re-renders (similar to useState's setter function)\n */\nexport function useUncontrolledState<V>(\n initialState?: V,\n onStateChange?: (value: V, ...args: any[]) => void\n): [V | undefined, (value: V, ...args: any[]) => void] {\n // Internal state for storing the value\n const [stateValue, setStateValue] = useState(initialState);\n // Internal ref to store value. This is to know what the previous value was.\n const stateRef = useRef(stateValue);\n\n // In order to make the setter function returned by this hook stable, we need to remove\n // any external dependency from it. So, we use a ref that gets updated every render\n // to store the onStateChange callback function. This way we can refer to this function\n // without making it a dependency.\n const onStateChangeRef = useRef(onStateChange);\n onStateChangeRef.current = onStateChange;\n\n // A setter function for updating the state\n const setUncontrolledValue = useCallback((state: V, ...args: any[]) => {\n // update the internal state\n setStateValue(state);\n // Call the onChange callback only if the value is changed\n if (stateRef.current !== state) {\n onStateChangeRef.current?.(state, ...args);\n stateRef.current = state;\n }\n }, []);\n\n // The setUncontrolledValue function returned here is guaranteed to\n // be the same.\n return [stateValue, setUncontrolledValue];\n}\n"],"names":["initialState","onStateChange","stateValue","setStateValue","useState","stateRef","useRef","onStateChangeRef","current","useCallback","state","args","_a","call"],"mappings":"oFAsCgB,SACdA,EACAC,GAGA,MAAOC,EAAYC,GAAiBC,EAAQA,SAACJ,GAEvCK,EAAWC,SAAOJ,GAMlBK,EAAmBD,SAAOL,GAgBhC,OAfAM,EAAiBC,QAAUP,EAepB,CAACC,EAZqBO,EAAWA,YAAC,CAACC,KAAaC,WAErDR,EAAcO,GAEVL,EAASG,UAAYE,IACC,QAAxBE,EAAAL,EAAiBC,eAAO,IAAAI,GAAAA,EAAAC,KAAAN,EAAGG,KAAUC,GACrCN,EAASG,QAAUE,IAEpB"}
@@ -1 +1 @@
1
- {"version":3,"file":"UNSAFE_useViewportIntersect.js","sources":["../../../src/hooks/UNSAFE_useViewportIntersect/useViewportIntersect.ts"],"sourcesContent":["/**\n * @license\n * Copyright (c) %FIRST_YEAR% %CURRENT_YEAR%, Oracle and/or its affiliates.\n * Licensed under The Universal Permissive License (UPL), Version 1.0\n * as shown at https://oss.oracle.com/licenses/upl/\n * @ignore\n */\nimport { useEffect } from 'preact/hooks';\n\n/**\n * Configuration about the viewport. For now, it only has a field that returns the viewport element.\n */\nexport type ViewportConfig = {\n scroller: () => HTMLElement | null;\n};\n\n/**\n * Hook to detect when the specified viewport element intersects elements that matches the specified css selector.\n * This is currently used by IncrementalLoader and VirtualizeViewportCollection.\n * Note options to IntersectionObsever such as rootMargin is not exposed now but can be added in the future as\n * needed. (for example, with sticky footer we want to specify a wider margin so it won't trigger intersect)\n *\n * @param viewport an object which provide information about the viewport including what the viewport element is\n * @param onIntersect callback when an intersection with an element that has the specified target\n * style class occurred\n * @param targetSelector the CSS querySelector string used to identify the element where IntersectionObserver\n * observes\n * @param margin the top and bottom margin surrounding the viewport element in which the intersect detection takes into account.\n */\nexport function useViewportIntersect(\n viewport: ViewportConfig,\n margin = 0,\n targetSelector: string,\n onIntersect: () => void\n) {\n // create an IntersectionObserver. Note for now we are creating it on every render (instead of once\n // on mounted) due to an issue we encountered where sometimes IntersectionObserver will not invoke\n // the intersect callback (possibly due to the root might have been detach/re-attached?), see JET-49951.\n useEffect(() => {\n let observer: IntersectionObserver;\n const root = viewport.scroller();\n if (root) {\n const options = {\n // specifying null to cause ResizeObserver to use document viewport\n root: root === document.body || root === document.documentElement ? null : root,\n rootMargin: `${margin}px 0px`,\n threshold: 0\n };\n observer = new IntersectionObserver((entries) => {\n for (const entry of entries) {\n if (entry.isIntersecting) {\n onIntersect();\n return;\n }\n }\n }, options);\n\n // start observing the element with certain class is scrolled into viewport\n root.querySelectorAll(targetSelector).forEach((target) => {\n observer.observe(target);\n });\n }\n\n return () => {\n observer?.disconnect();\n };\n });\n}\n"],"names":["viewport","margin","targetSelector","onIntersect","useEffect","observer","root","scroller","options","document","body","documentElement","rootMargin","threshold","IntersectionObserver","entries","entry","isIntersecting","querySelectorAll","forEach","target","observe","disconnect"],"mappings":"oFA6BM,SACJA,EACAC,EAAS,EACTC,EACAC,GAKAC,EAAAA,UAAU,KACR,IAAIC,EACJ,MAAMC,EAAON,EAASO,WACtB,GAAID,EAAM,CACR,MAAME,EAAU,CAEdF,KAAMA,IAASG,SAASC,MAAQJ,IAASG,SAASE,gBAAkB,KAAOL,EAC3EM,WAAe,GAAAX,UACfY,UAAW,GAEbR,EAAW,IAAIS,qBAAsBC,IACnC,IAAK,MAAMC,KAASD,EAClB,GAAIC,EAAMC,eAER,YADAd,KAIHK,GAGHF,EAAKY,iBAAiBhB,GAAgBiB,QAASC,IAC7Cf,EAASgB,QAAQD,KAIrB,MAAO,KACLf,MAAAA,GAAAA,EAAUiB"}
1
+ {"version":3,"file":"UNSAFE_useViewportIntersect.js","sources":["../../../src/hooks/UNSAFE_useViewportIntersect/useViewportIntersect.ts"],"sourcesContent":["/**\n * @license\n * Copyright (c) %FIRST_YEAR% %CURRENT_YEAR%, Oracle and/or its affiliates.\n * Licensed under The Universal Permissive License (UPL), Version 1.0\n * as shown at https://oss.oracle.com/licenses/upl/\n * @ignore\n */\nimport { useEffect } from 'preact/hooks';\n\n/**\n * Configuration about the viewport. For now, it only has a field that returns the viewport element.\n */\nexport type ViewportConfig = {\n scroller: () => HTMLElement | null;\n};\n\n/**\n * Hook to detect when the specified viewport element intersects elements that matches the specified css selector.\n * This is currently used by IncrementalLoader and VirtualizeViewportCollection.\n * Note options to IntersectionObsever such as rootMargin is not exposed now but can be added in the future as\n * needed. (for example, with sticky footer we want to specify a wider margin so it won't trigger intersect)\n *\n * @param viewport an object which provide information about the viewport including what the viewport element is\n * @param onIntersect callback when an intersection with an element that has the specified target\n * style class occurred\n * @param targetSelector the CSS querySelector string used to identify the element where IntersectionObserver\n * observes\n * @param margin the top and bottom margin surrounding the viewport element in which the intersect detection takes into account.\n */\nexport function useViewportIntersect(\n viewport: ViewportConfig,\n margin = 0,\n targetSelector: string,\n onIntersect: () => void\n) {\n // create an IntersectionObserver. Note for now we are creating it on every render (instead of once\n // on mounted) due to an issue we encountered where sometimes IntersectionObserver will not invoke\n // the intersect callback (possibly due to the root might have been detach/re-attached?), see JET-49951.\n useEffect(() => {\n let observer: IntersectionObserver;\n const root = viewport.scroller();\n if (root) {\n const options = {\n // specifying null to cause ResizeObserver to use document viewport\n root: root === document.body || root === document.documentElement ? null : root,\n rootMargin: `${margin}px 0px`,\n threshold: 0\n };\n observer = new IntersectionObserver((entries) => {\n for (const entry of entries) {\n if (entry.isIntersecting) {\n onIntersect();\n return;\n }\n }\n }, options);\n\n // start observing the element with certain class is scrolled into viewport\n root.querySelectorAll(targetSelector).forEach((target) => {\n observer.observe(target);\n });\n }\n\n return () => {\n observer?.disconnect();\n };\n });\n}\n"],"names":["viewport","margin","targetSelector","onIntersect","useEffect","observer","root","scroller","options","document","body","documentElement","rootMargin","threshold","IntersectionObserver","entries","entry","isIntersecting","querySelectorAll","forEach","target","observe","disconnect"],"mappings":"oFA6BM,SACJA,EACAC,EAAS,EACTC,EACAC,GAKAC,EAAAA,UAAU,KACR,IAAIC,EACJ,MAAMC,EAAON,EAASO,WACtB,GAAID,EAAM,CACR,MAAME,EAAU,CAEdF,KAAMA,IAASG,SAASC,MAAQJ,IAASG,SAASE,gBAAkB,KAAOL,EAC3EM,WAAY,GAAGX,UACfY,UAAW,GAEbR,EAAW,IAAIS,qBAAsBC,IACnC,IAAK,MAAMC,KAASD,EAClB,GAAIC,EAAMC,eAER,YADAd,KAIHK,GAGHF,EAAKY,iBAAiBhB,GAAgBiB,QAASC,IAC7Cf,EAASgB,QAAQD,KAIrB,MAAO,KACLf,MAAAA,GAAAA,EAAUiB"}