lawgic-dev-kit 0.21.6 → 0.22.4

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 (299) hide show
  1. package/README.md +54 -54
  2. package/dist/_virtual/index2.js +2 -3
  3. package/dist/_virtual/index3.js +3 -3
  4. package/dist/_virtual/index4.js +3 -5
  5. package/dist/_virtual/index5.js +5 -2
  6. package/dist/components/atoms/Checkbox/Checkbox.d.ts +3 -2
  7. package/dist/components/atoms/Checkbox/Checkbox.js +43 -30
  8. package/dist/components/atoms/Chip/Chip.d.ts +13 -0
  9. package/dist/components/atoms/Chip/Chip.js +32 -0
  10. package/dist/components/atoms/Chip/index.d.ts +1 -0
  11. package/dist/components/atoms/InformationDisclaimer/InformationDisclaimer.js +17 -30
  12. package/dist/components/atoms/InformationDisclaimer/InformationDisclaimer.styles.d.ts +8 -2
  13. package/dist/components/atoms/InformationDisclaimer/InformationDisclaimer.styles.js +46 -12
  14. package/dist/components/atoms/InformationDisclaimer/InformationDisclaimer.types.d.ts +3 -3
  15. package/dist/components/atoms/LoadingSpinner/LoadingSpinner.d.ts +1 -1
  16. package/dist/components/atoms/LoadingSpinner/LoadingSpinner.js +56 -12
  17. package/dist/components/atoms/PasswordInput/PasswordInput.d.ts +1 -1
  18. package/dist/components/atoms/PasswordInput/PasswordInput.js +57 -41
  19. package/dist/components/atoms/PasswordInput/PasswordInput.types.d.ts +1 -0
  20. package/dist/components/atoms/SelectInput/SelectInput.d.ts +1 -1
  21. package/dist/components/atoms/SelectInput/SelectInput.js +125 -140
  22. package/dist/components/atoms/SelectInput/SelectInput.types.d.ts +2 -0
  23. package/dist/components/atoms/StepIndicator/StepIndicator.d.ts +5 -0
  24. package/dist/components/atoms/StepIndicator/StepIndicator.js +58 -0
  25. package/dist/components/atoms/StepIndicator/index.d.ts +1 -0
  26. package/dist/components/atoms/TextInput/TextInput.js +33 -33
  27. package/dist/components/atoms/TextInput/TextInput.types.d.ts +1 -1
  28. package/dist/components/atoms/Toast/Toast.d.ts +2 -3
  29. package/dist/components/atoms/Toast/Toast.js +46 -53
  30. package/dist/components/atoms/UncontrolledSelector/UncontrolledSelector.d.ts +1 -0
  31. package/dist/components/atoms/UncontrolledSelector/UncontrolledSelector.js +98 -84
  32. package/dist/components/atoms/UncontrolledTextInput/UncontrolledTextInput.js +29 -35
  33. package/dist/components/atoms/UncontrolledTextInput/UncontrolledTextInput.types.d.ts +1 -1
  34. package/dist/components/atoms/UploadContainer/UploadContainer.js +4 -4
  35. package/dist/components/atoms/index.d.ts +2 -1
  36. package/dist/components/molecules/CalendarSelector/CalendarSelector.js +8 -8
  37. package/dist/components/molecules/DateInput/DateInput.d.ts +1 -1
  38. package/dist/components/molecules/EmptyState/EmptyState.d.ts +9 -0
  39. package/dist/components/molecules/EmptyState/EmptyState.js +16 -0
  40. package/dist/components/molecules/EmptyState/index.d.ts +1 -0
  41. package/dist/components/molecules/MultiSelectDropdown/MultiSelectDropdown.d.ts +24 -0
  42. package/dist/components/molecules/MultiSelectDropdown/MultiSelectDropdown.js +208 -0
  43. package/dist/components/molecules/MultiSelectDropdown/index.d.ts +1 -0
  44. package/dist/components/molecules/SingleSelectDropdown/SingleSelectDropdown.d.ts +25 -0
  45. package/dist/components/molecules/SingleSelectDropdown/SingleSelectDropdown.js +212 -0
  46. package/dist/components/molecules/SingleSelectDropdown/index.d.ts +1 -0
  47. package/dist/components/molecules/Stepper/Stepper.d.ts +1 -1
  48. package/dist/components/molecules/Stepper/Stepper.js +78 -231
  49. package/dist/components/molecules/Stepper/Stepper.styles.d.ts +7 -3
  50. package/dist/components/molecules/Stepper/Stepper.styles.js +23 -15
  51. package/dist/components/molecules/Tooltip/Tooltip.d.ts +20 -0
  52. package/dist/components/molecules/Tooltip/Tooltip.js +41 -0
  53. package/dist/components/molecules/UncontrolledDateInput/UncontrolledDateInput.d.ts +1 -1
  54. package/dist/components/molecules/index.d.ts +4 -0
  55. package/dist/index.js +139 -129
  56. package/dist/lawgic-dev-kit.css +1 -1
  57. package/dist/lawgic-dev-kit.umd.js +109 -97
  58. package/dist/node_modules/@floating-ui/react/dist/floating-ui.react.js +396 -712
  59. package/dist/node_modules/@floating-ui/react/dist/floating-ui.react.utils.js +33 -81
  60. package/dist/node_modules/@fortawesome/free-solid-svg-icons/index.js +7 -2
  61. package/dist/node_modules/@fortawesome/pro-light-svg-icons/index.js +14 -49
  62. package/dist/node_modules/@fortawesome/pro-regular-svg-icons/index.js +32 -12
  63. package/dist/node_modules/@fortawesome/pro-solid-svg-icons/index.js +14 -9
  64. package/dist/node_modules/prop-types/index.js +1 -1
  65. package/dist/node_modules/yup/index.esm.js +3 -3
  66. package/dist/src/Root.d.ts +2 -0
  67. package/dist/src/app.d.ts +1 -0
  68. package/dist/src/components/atoms/ActionButton/ActionButton.d.ts +11 -0
  69. package/dist/src/components/atoms/ActionButton/index.d.ts +1 -0
  70. package/dist/src/components/atoms/AsyncToast/index.d.ts +11 -0
  71. package/dist/src/components/atoms/Avatar/Avatar.d.ts +11 -0
  72. package/dist/src/components/atoms/Avatar/index.d.ts +1 -0
  73. package/dist/src/components/atoms/BoxContainer/BoxContainer.d.ts +4 -0
  74. package/dist/src/components/atoms/BoxContainer/BoxContainer.types.d.ts +6 -0
  75. package/dist/src/components/atoms/BoxContainer/index.d.ts +1 -0
  76. package/dist/src/components/atoms/Button/Button.d.ts +4 -0
  77. package/dist/src/components/atoms/Button/Button.styles.d.ts +26 -0
  78. package/dist/src/components/atoms/Button/Button.types.d.ts +12 -0
  79. package/dist/src/components/atoms/Button/index.d.ts +1 -0
  80. package/dist/src/components/atoms/CenterModal/CenterModal.d.ts +4 -0
  81. package/dist/src/components/atoms/CenterModal/CenterModal.types.d.ts +6 -0
  82. package/dist/src/components/atoms/CenterModal/index.d.ts +1 -0
  83. package/dist/src/components/atoms/Checkbox/Checkbox.d.ts +13 -0
  84. package/dist/src/components/atoms/Checkbox/index.d.ts +1 -0
  85. package/dist/src/components/atoms/Chip/Chip.d.ts +13 -0
  86. package/dist/src/components/atoms/Chip/index.d.ts +1 -0
  87. package/dist/src/components/atoms/CircleProgress/CircleProgress.d.ts +22 -0
  88. package/dist/src/components/atoms/CircleProgress/index.d.ts +1 -0
  89. package/dist/src/components/atoms/ClickAwayListener/ClickAwayListener.d.ts +4 -0
  90. package/dist/src/components/atoms/ClickAwayListener/ClickAwayListener.types.d.ts +7 -0
  91. package/dist/src/components/atoms/ClickAwayListener/index.d.ts +1 -0
  92. package/dist/src/components/atoms/CountryInput/CountryInput.d.ts +4 -0
  93. package/dist/src/components/atoms/CountryInput/CountryInput.types.d.ts +37 -0
  94. package/dist/src/components/atoms/CountryInput/index.d.ts +1 -0
  95. package/dist/src/components/atoms/CountryLabel/CountryLabel.d.ts +6 -0
  96. package/dist/src/components/atoms/CountryLabel/index.d.ts +1 -0
  97. package/dist/src/components/atoms/CountrySelectInput/CountryDropdown.d.ts +4 -0
  98. package/dist/src/components/atoms/CountrySelectInput/CountryDropdown.types.d.ts +36 -0
  99. package/dist/src/components/atoms/CountrySelectInput/index.d.ts +1 -0
  100. package/dist/src/components/atoms/Divider/Divider.d.ts +7 -0
  101. package/dist/src/components/atoms/Divider/index.d.ts +1 -0
  102. package/dist/src/components/atoms/FilterPill/FilterPill.d.ts +8 -0
  103. package/dist/src/components/atoms/FilterPill/index.d.ts +1 -0
  104. package/dist/src/components/atoms/FloatingCard/FloatingCard.d.ts +4 -0
  105. package/dist/{components/atoms/Tooltip/Tooltip.types.d.ts → src/components/atoms/FloatingCard/FloatingCard.types.d.ts} +3 -3
  106. package/dist/src/components/atoms/FloatingCard/index.d.ts +1 -0
  107. package/dist/src/components/atoms/IconButton/IconButton.d.ts +4 -0
  108. package/dist/src/components/atoms/IconButton/IconButton.styles.d.ts +10 -0
  109. package/dist/src/components/atoms/IconButton/IconButton.types.d.ts +11 -0
  110. package/dist/src/components/atoms/IconButton/index.d.ts +1 -0
  111. package/dist/src/components/atoms/ImageProfileInput/ImageProfileInput.d.ts +4 -0
  112. package/dist/src/components/atoms/ImageProfileInput/ImageProfileInput.types.d.ts +12 -0
  113. package/dist/src/components/atoms/ImageProfileInput/ImageProfileInput.validators.d.ts +9 -0
  114. package/dist/src/components/atoms/ImageProfileInput/index.d.ts +2 -0
  115. package/dist/src/components/atoms/IndexedStep/IndexedStep.d.ts +9 -0
  116. package/dist/src/components/atoms/IndexedStep/index.d.ts +1 -0
  117. package/dist/src/components/atoms/InfoCard/InfoCard.d.ts +3 -0
  118. package/dist/src/components/atoms/InfoCard/InfoCard.types.d.ts +6 -0
  119. package/dist/src/components/atoms/InfoCard/index.d.ts +1 -0
  120. package/dist/src/components/atoms/InformationDisclaimer/InformationDisclaimer.d.ts +4 -0
  121. package/dist/src/components/atoms/InformationDisclaimer/InformationDisclaimer.styles.d.ts +9 -0
  122. package/dist/src/components/atoms/InformationDisclaimer/InformationDisclaimer.types.d.ts +10 -0
  123. package/dist/src/components/atoms/InformationDisclaimer/index.d.ts +1 -0
  124. package/dist/src/components/atoms/LoadingProgress/LoadingProgress.d.ts +13 -0
  125. package/dist/src/components/atoms/LoadingProgress/index.d.ts +1 -0
  126. package/dist/src/components/atoms/LoadingSpinner/LoadingSpinner.d.ts +8 -0
  127. package/dist/src/components/atoms/LoadingSpinner/index.d.ts +1 -0
  128. package/dist/src/components/atoms/PasswordInput/PasswordInput.d.ts +5 -0
  129. package/dist/src/components/atoms/PasswordInput/PasswordInput.types.d.ts +12 -0
  130. package/dist/src/components/atoms/PasswordInput/index.d.ts +1 -0
  131. package/dist/src/components/atoms/PhoneInput/PhoneInput.d.ts +5 -0
  132. package/dist/src/components/atoms/PhoneInput/PhoneInput.types.d.ts +12 -0
  133. package/dist/src/components/atoms/PhoneInput/index.d.ts +1 -0
  134. package/dist/src/components/atoms/Pill/Pill.d.ts +8 -0
  135. package/dist/src/components/atoms/Pill/index.d.ts +1 -0
  136. package/dist/src/components/atoms/ProgressBar/ProgressBar.d.ts +3 -0
  137. package/dist/src/components/atoms/ProgressBar/ProgressBar.styles.d.ts +7 -0
  138. package/dist/src/components/atoms/ProgressBar/ProgressBar.types.d.ts +6 -0
  139. package/dist/src/components/atoms/ProgressBar/index.d.ts +1 -0
  140. package/dist/src/components/atoms/SearchBar/index.d.ts +2 -0
  141. package/dist/src/components/atoms/SectionButton/SectionButton.d.ts +12 -0
  142. package/dist/src/components/atoms/SectionButton/desktop/SectionButton.d.ts +3 -0
  143. package/dist/src/components/atoms/SectionButton/desktop/SectionButton.styles.d.ts +2 -0
  144. package/dist/src/components/atoms/SectionButton/desktop/SectionButton.types.d.ts +37 -0
  145. package/dist/src/components/atoms/SectionButton/desktop/index.d.ts +2 -0
  146. package/dist/src/components/atoms/SectionButton/index.d.ts +1 -0
  147. package/dist/src/components/atoms/SectionButton/mobile/MobileSectionButton.styles.d.ts +3 -0
  148. package/dist/src/components/atoms/SectionButton/mobile/SectionButton.d.ts +3 -0
  149. package/dist/src/components/atoms/SectionButton/mobile/SectionButton.types.d.ts +37 -0
  150. package/dist/src/components/atoms/SectionButton/mobile/index.d.ts +2 -0
  151. package/dist/src/components/atoms/SelectInput/SelectInput.d.ts +1 -1
  152. package/dist/src/components/atoms/SelectInput/SelectInput.types.d.ts +2 -0
  153. package/dist/src/components/atoms/SelectInput/index.d.ts +1 -0
  154. package/dist/src/components/atoms/SidebarButton/SidebarButton.d.ts +13 -0
  155. package/dist/src/components/atoms/SidebarButton/SidebarButton.styles.d.ts +9 -0
  156. package/dist/src/components/atoms/SidebarButton/index.d.ts +1 -0
  157. package/dist/src/components/atoms/StepIndicator/StepIndicator.d.ts +5 -0
  158. package/dist/src/components/atoms/StepIndicator/index.d.ts +1 -0
  159. package/dist/src/components/atoms/Switch/Switch.d.ts +7 -0
  160. package/dist/src/components/atoms/Switch/index.d.ts +1 -0
  161. package/dist/src/components/atoms/Tab/Tab.d.ts +3 -0
  162. package/dist/src/components/atoms/Tab/Tab.styles.d.ts +6 -0
  163. package/dist/src/components/atoms/Tab/Tab.types.d.ts +11 -0
  164. package/dist/src/components/atoms/Tab/index.d.ts +1 -0
  165. package/dist/src/components/atoms/TextButton/TextButton.d.ts +4 -0
  166. package/dist/src/components/atoms/TextButton/TextButton.styles.d.ts +2 -0
  167. package/dist/src/components/atoms/TextButton/TextButton.types.d.ts +6 -0
  168. package/dist/src/components/atoms/TextButton/index.d.ts +1 -0
  169. package/dist/src/components/atoms/TextInput/TextInput.d.ts +5 -0
  170. package/dist/src/components/atoms/TextInput/TextInput.types.d.ts +13 -0
  171. package/dist/src/components/atoms/TextInput/index.d.ts +1 -0
  172. package/dist/src/components/atoms/TextStaticInput/TextStaticInput.d.ts +3 -0
  173. package/dist/src/components/atoms/TextStaticInput/TextStaticInput.types.d.ts +5 -0
  174. package/dist/src/components/atoms/TextStaticInput/index.d.ts +1 -0
  175. package/dist/src/components/atoms/ThresholdCircleProgress/ThresholdCircleProgress.d.ts +4 -0
  176. package/dist/src/components/atoms/ThresholdCircleProgress/ThresholdCircleProgress.types.d.ts +30 -0
  177. package/dist/src/components/atoms/ThresholdCircleProgress/index.d.ts +1 -0
  178. package/dist/src/components/atoms/ThresholdProgressBar/ThresholdProgressBar.d.ts +4 -0
  179. package/dist/src/components/atoms/ThresholdProgressBar/ThresholdProgressBar.types.d.ts +22 -0
  180. package/dist/src/components/atoms/ThresholdProgressBar/index.d.ts +1 -0
  181. package/dist/src/components/atoms/Toast/Toast.d.ts +20 -0
  182. package/dist/src/components/atoms/Toast/index.d.ts +1 -0
  183. package/dist/src/components/atoms/UncontrolledSelector/UncontrolledSelector.d.ts +1 -0
  184. package/dist/src/components/atoms/UncontrolledSelector/index.d.ts +1 -0
  185. package/dist/src/components/atoms/UncontrolledTextInput/UncontrolledTextInput.d.ts +4 -0
  186. package/dist/src/components/atoms/UncontrolledTextInput/UncontrolledTextInput.types.d.ts +14 -0
  187. package/dist/src/components/atoms/UncontrolledTextInput/index.d.ts +1 -0
  188. package/dist/src/components/atoms/UploadContainer/UploadContainer.d.ts +4 -0
  189. package/dist/src/components/atoms/UploadContainer/UploadContainer.types.d.ts +37 -0
  190. package/dist/src/components/atoms/UploadContainer/index.d.ts +1 -0
  191. package/dist/src/components/atoms/index.d.ts +43 -0
  192. package/dist/src/components/index.d.ts +3 -0
  193. package/dist/src/components/molecules/AlertModal/AlertModal.d.ts +3 -0
  194. package/dist/src/components/molecules/AlertModal/AlertModal.types.d.ts +9 -0
  195. package/dist/src/components/molecules/AlertModal/index.d.ts +2 -0
  196. package/dist/src/components/molecules/AutocompleteInput/AutocompleteInput.d.ts +3 -0
  197. package/dist/src/components/molecules/AutocompleteInput/AutocompleteInput.types.d.ts +28 -0
  198. package/dist/src/components/molecules/AutocompleteInput/index.d.ts +1 -0
  199. package/dist/src/components/molecules/CalendarSelector/CalendarSelector.d.ts +14 -0
  200. package/dist/src/components/molecules/CalendarSelector/CalendarSelector.styles.d.ts +36 -0
  201. package/dist/src/components/molecules/CalendarSelector/PeriodToggle.d.ts +15 -0
  202. package/dist/src/components/molecules/CalendarSelector/TimeDisplay.d.ts +7 -0
  203. package/dist/src/components/molecules/CalendarSelector/index.d.ts +1 -0
  204. package/dist/src/components/molecules/DateInput/DateInput.d.ts +14 -0
  205. package/dist/src/components/molecules/DateInput/index.d.ts +1 -0
  206. package/dist/src/components/molecules/DialogModal/DialogModal.d.ts +3 -0
  207. package/dist/src/components/molecules/DialogModal/DialogModal.types.d.ts +11 -0
  208. package/dist/src/components/molecules/DialogModal/index.d.ts +1 -0
  209. package/dist/src/components/molecules/Dropdown/Dropdown.d.ts +3 -0
  210. package/dist/src/components/molecules/Dropdown/Dropdown.types.d.ts +9 -0
  211. package/dist/src/components/molecules/Dropdown/index.d.ts +1 -0
  212. package/dist/src/components/molecules/EmptyState/EmptyState.d.ts +9 -0
  213. package/dist/src/components/molecules/EmptyState/index.d.ts +1 -0
  214. package/dist/src/components/molecules/FileUpload/FileUpload.d.ts +4 -0
  215. package/dist/src/components/molecules/FileUpload/FileUpload.types.d.ts +17 -0
  216. package/dist/src/components/molecules/FileUpload/index.d.ts +1 -0
  217. package/dist/src/components/molecules/FiltersMenu/FiltersMenu.d.ts +13 -0
  218. package/dist/src/components/molecules/FiltersMenu/index.d.ts +1 -0
  219. package/dist/src/components/molecules/FloatingMenu/FloatingMenu.d.ts +4 -0
  220. package/dist/src/components/molecules/FloatingMenu/FloatingMenu.types.d.ts +13 -0
  221. package/dist/src/components/molecules/FloatingMenu/index.d.ts +1 -0
  222. package/dist/src/components/molecules/IndexedStepper/IndexedStepper.d.ts +7 -0
  223. package/dist/src/components/molecules/IndexedStepper/index.d.ts +1 -0
  224. package/dist/src/components/molecules/InformationContainer/InformationContainer.d.ts +14 -0
  225. package/dist/src/components/molecules/InformationContainer/index.d.ts +1 -0
  226. package/dist/src/components/molecules/MultiSelectDropdown/MultiSelectDropdown.d.ts +24 -0
  227. package/dist/src/components/molecules/MultiSelectDropdown/index.d.ts +1 -0
  228. package/dist/src/components/molecules/PillsContainer/PillsContainer.d.ts +9 -0
  229. package/dist/src/components/molecules/PillsContainer/index.d.ts +1 -0
  230. package/dist/src/components/molecules/SearchModal/SearchModal.d.ts +4 -0
  231. package/dist/src/components/molecules/SearchModal/SearchModal.types.d.ts +5 -0
  232. package/dist/src/components/molecules/SearchModal/index.d.ts +1 -0
  233. package/dist/src/components/molecules/SideModal/SideModal.d.ts +4 -0
  234. package/dist/src/components/molecules/SideModal/SideModal.types.d.ts +11 -0
  235. package/dist/src/components/molecules/SideModal/index.d.ts +1 -0
  236. package/dist/src/components/molecules/SingleSelectDropdown/SingleSelectDropdown.d.ts +25 -0
  237. package/dist/src/components/molecules/SingleSelectDropdown/index.d.ts +1 -0
  238. package/dist/src/components/molecules/Stepper/Stepper.d.ts +3 -0
  239. package/dist/src/components/molecules/Stepper/Stepper.styles.d.ts +15 -0
  240. package/dist/src/components/molecules/Stepper/index.d.ts +1 -0
  241. package/dist/src/components/molecules/Tabs/Tabs.d.ts +21 -0
  242. package/dist/src/components/molecules/Tabs/index.d.ts +1 -0
  243. package/dist/src/components/molecules/Tooltip/Tooltip.d.ts +20 -0
  244. package/dist/src/components/molecules/Tooltip/index.d.ts +1 -0
  245. package/dist/src/components/molecules/UncontrolledDateInput/UncontrolledDateInput.d.ts +16 -0
  246. package/dist/src/components/molecules/UncontrolledDateInput/index.d.ts +1 -0
  247. package/dist/src/components/molecules/index.d.ts +23 -0
  248. package/dist/src/components/organisms/index.d.ts +1 -0
  249. package/dist/src/constants/countries.d.ts +30 -0
  250. package/dist/src/contexts/index.d.ts +1 -0
  251. package/dist/src/contexts/themeContext.d.ts +3 -0
  252. package/dist/src/hooks/index.d.ts +2 -0
  253. package/dist/src/hooks/useFilterToggler.d.ts +5 -0
  254. package/dist/src/hooks/useTheme.d.ts +1 -0
  255. package/dist/src/index.d.ts +8 -0
  256. package/dist/src/lab/Laboratory.d.ts +2 -0
  257. package/dist/src/lab/LaboratoryLayout.d.ts +5 -0
  258. package/dist/src/lab/index.lab.d.ts +1 -0
  259. package/dist/src/providers/ThemeProvider.d.ts +7 -0
  260. package/dist/src/providers/index.d.ts +1 -0
  261. package/dist/src/themes/default.d.ts +2 -0
  262. package/dist/src/themes/index.d.ts +2 -0
  263. package/dist/src/themes/types.d.ts +6 -0
  264. package/dist/src/types/baseModalProps.d.ts +4 -0
  265. package/dist/src/types/cycles.d.ts +103 -0
  266. package/dist/src/types/display.d.ts +2 -0
  267. package/dist/src/types/fileInfo.d.ts +2 -0
  268. package/dist/src/types/filters.d.ts +22 -0
  269. package/dist/src/types/i18n.d.ts +1 -0
  270. package/dist/src/types/index.d.ts +10 -0
  271. package/dist/src/types/modal.d.ts +34 -0
  272. package/dist/src/types/modalType.d.ts +1 -0
  273. package/dist/src/types/navbarOption.d.ts +7 -0
  274. package/dist/src/types/sidebarOption.d.ts +7 -0
  275. package/dist/src/types/stepper.d.ts +23 -0
  276. package/dist/src/types/styleValues.d.ts +4 -0
  277. package/dist/src/types/toast.d.ts +29 -0
  278. package/dist/src/utils/cycles.d.ts +2 -0
  279. package/dist/src/utils/dates.d.ts +1 -0
  280. package/dist/src/utils/files.d.ts +8 -0
  281. package/dist/src/utils/images.d.ts +1 -0
  282. package/dist/src/utils/index.d.ts +7 -0
  283. package/dist/src/utils/modal.d.ts +13 -0
  284. package/dist/src/utils/renderContentOptions.d.ts +3 -0
  285. package/dist/src/utils/stepper.d.ts +2 -0
  286. package/dist/src/utils/strings.d.ts +2 -0
  287. package/dist/src/utils/toast.d.ts +15 -0
  288. package/dist/types/index.d.ts +1 -0
  289. package/dist/types/stepper.d.ts +23 -0
  290. package/dist/types/toast.d.ts +6 -3
  291. package/dist/utils/stepper.d.ts +2 -0
  292. package/dist/utils/toast.js +3 -3
  293. package/dist/vite-env.d.ts +1 -1
  294. package/dist/vite.config.d.ts +2 -0
  295. package/package.json +157 -157
  296. package/dist/components/atoms/Tooltip/Tooltip.d.ts +0 -4
  297. package/dist/components/atoms/Tooltip/Tooltip.js +0 -121
  298. package/dist/components/molecules/Stepper/Stepper.types.d.ts +0 -9
  299. /package/dist/components/{atoms → molecules}/Tooltip/index.d.ts +0 -0
@@ -1,902 +1,586 @@
1
1
  import * as c from "react";
2
- import { useLayoutEffect as Oe, useEffect as _e, useRef as Ae } from "react";
3
- import { isMouseLikePointerType as Q, getDocument as X, activeElement as me, contains as z, getTarget as G, isSafari as Ke, isMac as Fe, isTypeableElement as we, isVirtualPointerEvent as Ne, isReactEvent as $e, isRootElement as He, isEventTargetWithin as te } from "./floating-ui.react.utils.js";
2
+ import { useLayoutEffect as De, useEffect as Se, useRef as xe } from "react";
3
+ import { isMouseLikePointerType as oe, getDocument as re, isTypeableElement as Te, getTarget as W, isReactEvent as ke, isRootElement as Ie, contains as se, isEventTargetWithin as q } from "./floating-ui.react.utils.js";
4
4
  import "../../../../_virtual/jsx-runtime.js";
5
- import { isElement as L, getOverflowAncestors as ne, getWindow as Be, isHTMLElement as ue, isWebKit as We, isLastTraversableNode as oe, getParentNode as Ue, getComputedStyle as Ve } from "../../utils/dist/floating-ui.utils.dom.js";
5
+ import { isElement as M, getOverflowAncestors as Z, isHTMLElement as pe, isWebKit as Me, isLastTraversableNode as G, getParentNode as _e, getComputedStyle as Oe } from "../../utils/dist/floating-ui.utils.dom.js";
6
6
  import "react-dom";
7
- import { useFloating as Ye } from "../../react-dom/dist/floating-ui.react-dom.js";
8
- import { arrow as Mt, flip as Pt, offset as xt, shift as Tt, size as Dt } from "../../react-dom/dist/floating-ui.react-dom.js";
9
- const Me = {
7
+ import { useFloating as Ke } from "../../react-dom/dist/floating-ui.react-dom.js";
8
+ import { arrow as dt, flip as mt, offset as pt, shift as gt, size as vt } from "../../react-dom/dist/floating-ui.react-dom.js";
9
+ const ge = {
10
10
  ...c
11
- }, Xe = Me.useInsertionEffect, je = Xe || ((e) => e());
12
- function V(e) {
13
- const i = c.useRef(() => {
11
+ }, Ae = ge.useInsertionEffect, Le = Ae || ((e) => e());
12
+ function F(e) {
13
+ const o = c.useRef(() => {
14
14
  if (process.env.NODE_ENV !== "production")
15
15
  throw new Error("Cannot call an event handler while rendering.");
16
16
  });
17
- return je(() => {
18
- i.current = e;
17
+ return Le(() => {
18
+ o.current = e;
19
19
  }), c.useCallback(function() {
20
- for (var o = arguments.length, t = new Array(o), n = 0; n < o; n++)
20
+ for (var r = arguments.length, t = new Array(r), n = 0; n < r; n++)
21
21
  t[n] = arguments[n];
22
- return i.current == null ? void 0 : i.current(...t);
22
+ return o.current == null ? void 0 : o.current(...t);
23
23
  }, []);
24
24
  }
25
- var Y = typeof document < "u" ? Oe : _e;
26
- let ve = !1, qe = 0;
27
- const pe = () => (
25
+ var B = typeof document < "u" ? De : Se;
26
+ let ce = !1, Ne = 0;
27
+ const ie = () => (
28
28
  // Ensure the id is unique with multiple independent versions of Floating UI
29
29
  // on <React 18
30
- "floating-ui-" + Math.random().toString(36).slice(2, 6) + qe++
30
+ "floating-ui-" + Math.random().toString(36).slice(2, 6) + Ne++
31
31
  );
32
- function Ge() {
33
- const [e, i] = c.useState(() => ve ? pe() : void 0);
34
- return Y(() => {
35
- e == null && i(pe());
32
+ function $e() {
33
+ const [e, o] = c.useState(() => ce ? ie() : void 0);
34
+ return B(() => {
35
+ e == null && o(ie());
36
36
  }, []), c.useEffect(() => {
37
- ve = !0;
37
+ ce = !0;
38
38
  }, []), e;
39
39
  }
40
- const Ze = Me.useId, Pe = Ze || Ge;
41
- let ie;
42
- process.env.NODE_ENV !== "production" && (ie = /* @__PURE__ */ new Set());
43
- function Je() {
44
- for (var e, i = arguments.length, o = new Array(i), t = 0; t < i; t++)
45
- o[t] = arguments[t];
46
- const n = "Floating UI: " + o.join(" ");
47
- if (!((e = ie) != null && e.has(n))) {
48
- var d;
49
- (d = ie) == null || d.add(n), console.error(n);
40
+ const Fe = ge.useId, Be = Fe || $e;
41
+ let z;
42
+ process.env.NODE_ENV !== "production" && (z = /* @__PURE__ */ new Set());
43
+ function He() {
44
+ for (var e, o = arguments.length, r = new Array(o), t = 0; t < o; t++)
45
+ r[t] = arguments[t];
46
+ const n = "Floating UI: " + r.join(" ");
47
+ if (!((e = z) != null && e.has(n))) {
48
+ var a;
49
+ (a = z) == null || a.add(n), console.error(n);
50
50
  }
51
51
  }
52
- function Qe() {
52
+ function Ue() {
53
53
  const e = /* @__PURE__ */ new Map();
54
54
  return {
55
- emit(i, o) {
55
+ emit(o, r) {
56
56
  var t;
57
- (t = e.get(i)) == null || t.forEach((n) => n(o));
57
+ (t = e.get(o)) == null || t.forEach((n) => n(r));
58
58
  },
59
- on(i, o) {
60
- e.set(i, [...e.get(i) || [], o]);
59
+ on(o, r) {
60
+ e.set(o, [...e.get(o) || [], r]);
61
61
  },
62
- off(i, o) {
62
+ off(o, r) {
63
63
  var t;
64
- e.set(i, ((t = e.get(i)) == null ? void 0 : t.filter((n) => n !== o)) || []);
64
+ e.set(o, ((t = e.get(o)) == null ? void 0 : t.filter((n) => n !== r)) || []);
65
65
  }
66
66
  };
67
67
  }
68
- const ze = /* @__PURE__ */ c.createContext(null), et = /* @__PURE__ */ c.createContext(null), le = () => {
68
+ const We = /* @__PURE__ */ c.createContext(null), Ve = /* @__PURE__ */ c.createContext(null), je = () => {
69
69
  var e;
70
- return ((e = c.useContext(ze)) == null ? void 0 : e.id) || null;
71
- }, ae = () => c.useContext(et);
72
- function fe(e) {
70
+ return ((e = c.useContext(We)) == null ? void 0 : e.id) || null;
71
+ }, ve = () => c.useContext(Ve);
72
+ function Ye(e) {
73
73
  return "data-floating-ui-" + e;
74
74
  }
75
- function A(e) {
76
- e.current !== -1 && (clearTimeout(e.current), e.current = -1);
77
- }
78
75
  function j(e) {
79
- const i = Ae(e);
80
- return Y(() => {
81
- i.current = e;
82
- }), i;
83
- }
84
- const ge = /* @__PURE__ */ fe("safe-polygon");
85
- function re(e, i, o) {
86
- return o && !Q(o) ? 0 : typeof e == "number" ? e : e == null ? void 0 : e[i];
76
+ const o = xe(e);
77
+ return B(() => {
78
+ o.current = e;
79
+ }), o;
87
80
  }
88
- function vt(e, i) {
89
- i === void 0 && (i = {});
90
- const {
91
- open: o,
92
- onOpenChange: t,
93
- dataRef: n,
94
- events: d,
95
- elements: s
96
- } = e, {
97
- enabled: r = !0,
98
- delay: E = 0,
99
- handleClose: f = null,
100
- mouseOnly: R = !1,
101
- restMs: y = 0,
102
- move: C = !0
103
- } = i, l = ae(), m = le(), u = j(f), w = j(E), P = j(o), x = c.useRef(), h = c.useRef(-1), S = c.useRef(), _ = c.useRef(-1), K = c.useRef(!0), I = c.useRef(!1), H = c.useRef(() => {
104
- }), T = c.useRef(!1), B = c.useCallback(() => {
105
- var v;
106
- const p = (v = n.current.openEvent) == null ? void 0 : v.type;
107
- return (p == null ? void 0 : p.includes("mouse")) && p !== "mousedown";
108
- }, [n]);
109
- c.useEffect(() => {
110
- if (!r) return;
111
- function v(p) {
112
- let {
113
- open: a
114
- } = p;
115
- a || (A(h), A(_), K.current = !0, T.current = !1);
116
- }
117
- return d.on("openchange", v), () => {
118
- d.off("openchange", v);
119
- };
120
- }, [r, d]), c.useEffect(() => {
121
- if (!r || !u.current || !o) return;
122
- function v(a) {
123
- B() && t(!1, a, "hover");
124
- }
125
- const p = X(s.floating).documentElement;
126
- return p.addEventListener("mouseleave", v), () => {
127
- p.removeEventListener("mouseleave", v);
128
- };
129
- }, [s.floating, o, t, r, u, B]);
130
- const F = c.useCallback(function(v, p, a) {
131
- p === void 0 && (p = !0), a === void 0 && (a = "hover");
132
- const M = re(w.current, "close", x.current);
133
- M && !S.current ? (A(h), h.current = window.setTimeout(() => t(!1, v, a), M)) : p && (A(h), t(!1, v, a));
134
- }, [w, t]), N = V(() => {
135
- H.current(), S.current = void 0;
136
- }), W = V(() => {
137
- if (I.current) {
138
- const v = X(s.floating).body;
139
- v.style.pointerEvents = "", v.removeAttribute(ge), I.current = !1;
140
- }
141
- }), $ = V(() => n.current.openEvent ? ["click", "mousedown"].includes(n.current.openEvent.type) : !1);
142
- c.useEffect(() => {
143
- if (!r) return;
144
- function v(g) {
145
- if (A(h), K.current = !1, R && !Q(x.current) || y > 0 && !re(w.current, "open"))
146
- return;
147
- const D = re(w.current, "open", x.current);
148
- D ? h.current = window.setTimeout(() => {
149
- P.current || t(!0, g, "hover");
150
- }, D) : o || t(!0, g, "hover");
151
- }
152
- function p(g) {
153
- if ($()) return;
154
- H.current();
155
- const D = X(s.floating);
156
- if (A(_), T.current = !1, u.current && n.current.floatingContext) {
157
- o || A(h), S.current = u.current({
158
- ...n.current.floatingContext,
159
- tree: l,
160
- x: g.clientX,
161
- y: g.clientY,
162
- onClose() {
163
- W(), N(), $() || F(g, !0, "safe-polygon");
164
- }
165
- });
166
- const ee = S.current;
167
- D.addEventListener("mousemove", ee), H.current = () => {
168
- D.removeEventListener("mousemove", ee);
169
- };
170
- return;
171
- }
172
- (x.current === "touch" ? !z(s.floating, g.relatedTarget) : !0) && F(g);
173
- }
174
- function a(g) {
175
- $() || n.current.floatingContext && (u.current == null || u.current({
176
- ...n.current.floatingContext,
177
- tree: l,
178
- x: g.clientX,
179
- y: g.clientY,
180
- onClose() {
181
- W(), N(), $() || F(g);
182
- }
183
- })(g));
184
- }
185
- if (L(s.domReference)) {
186
- var M;
187
- const g = s.domReference;
188
- return o && g.addEventListener("mouseleave", a), (M = s.floating) == null || M.addEventListener("mouseleave", a), C && g.addEventListener("mousemove", v, {
189
- once: !0
190
- }), g.addEventListener("mouseenter", v), g.addEventListener("mouseleave", p), () => {
191
- var D;
192
- o && g.removeEventListener("mouseleave", a), (D = s.floating) == null || D.removeEventListener("mouseleave", a), C && g.removeEventListener("mousemove", v), g.removeEventListener("mouseenter", v), g.removeEventListener("mouseleave", p);
193
- };
194
- }
195
- }, [s, r, e, R, y, C, F, N, W, t, o, P, l, w, u, n, $]), Y(() => {
196
- var v;
197
- if (r && o && (v = u.current) != null && v.__options.blockPointerEvents && B()) {
198
- I.current = !0;
199
- const a = s.floating;
200
- if (L(s.domReference) && a) {
201
- var p;
202
- const M = X(s.floating).body;
203
- M.setAttribute(ge, "");
204
- const g = s.domReference, D = l == null || (p = l.nodesRef.current.find((Z) => Z.id === m)) == null || (p = p.context) == null ? void 0 : p.elements.floating;
205
- return D && (D.style.pointerEvents = ""), M.style.pointerEvents = "none", g.style.pointerEvents = "auto", a.style.pointerEvents = "auto", () => {
206
- M.style.pointerEvents = "", g.style.pointerEvents = "", a.style.pointerEvents = "";
207
- };
208
- }
209
- }
210
- }, [r, o, m, s, l, u, B]), Y(() => {
211
- o || (x.current = void 0, T.current = !1, N(), W());
212
- }, [o, N, W]), c.useEffect(() => () => {
213
- N(), A(h), A(_), W();
214
- }, [r, s.domReference, N, W]);
215
- const b = c.useMemo(() => {
216
- function v(p) {
217
- x.current = p.pointerType;
218
- }
219
- return {
220
- onPointerDown: v,
221
- onPointerEnter: v,
222
- onMouseMove(p) {
223
- const {
224
- nativeEvent: a
225
- } = p;
226
- function M() {
227
- !K.current && !P.current && t(!0, a, "hover");
228
- }
229
- R && !Q(x.current) || o || y === 0 || T.current && p.movementX ** 2 + p.movementY ** 2 < 2 || (A(_), x.current === "touch" ? M() : (T.current = !0, _.current = window.setTimeout(M, y)));
230
- }
231
- };
232
- }, [R, t, o, P, y]), k = c.useMemo(() => ({
233
- onMouseEnter() {
234
- A(h);
235
- },
236
- onMouseLeave(v) {
237
- $() || F(v.nativeEvent, !1);
238
- }
239
- }), [F, $]);
240
- return c.useMemo(() => r ? {
241
- reference: b,
242
- floating: k
243
- } : {}, [r, b, k]);
244
- }
245
- function se(e, i) {
246
- let o = e.filter((n) => {
247
- var d;
248
- return n.parentId === i && ((d = n.context) == null ? void 0 : d.open);
249
- }), t = o;
81
+ function J(e, o) {
82
+ let r = e.filter((n) => {
83
+ var a;
84
+ return n.parentId === o && ((a = n.context) == null ? void 0 : a.open);
85
+ }), t = r;
250
86
  for (; t.length; )
251
87
  t = e.filter((n) => {
252
- var d;
253
- return (d = t) == null ? void 0 : d.some((s) => {
254
- var r;
255
- return n.parentId === s.id && ((r = n.context) == null ? void 0 : r.open);
88
+ var a;
89
+ return (a = t) == null ? void 0 : a.some((u) => {
90
+ var s;
91
+ return n.parentId === u.id && ((s = n.context) == null ? void 0 : s.open);
256
92
  });
257
- }), o = o.concat(t);
258
- return o;
93
+ }), r = r.concat(t);
94
+ return r;
259
95
  }
260
- const tt = "data-floating-ui-focusable";
261
- function Ee(e) {
262
- return ue(e.target) && e.target.tagName === "BUTTON";
96
+ const Xe = "data-floating-ui-focusable";
97
+ function ue(e) {
98
+ return pe(e.target) && e.target.tagName === "BUTTON";
263
99
  }
264
- function Re(e) {
265
- return we(e);
100
+ function le(e) {
101
+ return Te(e);
266
102
  }
267
- function pt(e, i) {
268
- i === void 0 && (i = {});
103
+ function st(e, o) {
104
+ o === void 0 && (o = {});
269
105
  const {
270
- open: o,
106
+ open: r,
271
107
  onOpenChange: t,
272
108
  dataRef: n,
273
109
  elements: {
274
- domReference: d
110
+ domReference: a
275
111
  }
276
112
  } = e, {
277
- enabled: s = !0,
278
- event: r = "click",
279
- toggle: E = !0,
280
- ignoreMouse: f = !1,
281
- keyboardHandlers: R = !0,
282
- stickIfOpen: y = !0
283
- } = i, C = c.useRef(), l = c.useRef(!1), m = c.useMemo(() => ({
284
- onPointerDown(u) {
285
- C.current = u.pointerType;
113
+ enabled: u = !0,
114
+ event: s = "click",
115
+ toggle: p = !0,
116
+ ignoreMouse: l = !1,
117
+ keyboardHandlers: g = !0,
118
+ stickIfOpen: R = !0
119
+ } = o, E = c.useRef(), f = c.useRef(!1), b = c.useMemo(() => ({
120
+ onPointerDown(i) {
121
+ E.current = i.pointerType;
286
122
  },
287
- onMouseDown(u) {
288
- const w = C.current;
289
- u.button === 0 && r !== "click" && (Q(w, !0) && f || (o && E && (!(n.current.openEvent && y) || n.current.openEvent.type === "mousedown") ? t(!1, u.nativeEvent, "click") : (u.preventDefault(), t(!0, u.nativeEvent, "click"))));
123
+ onMouseDown(i) {
124
+ const y = E.current;
125
+ i.button === 0 && s !== "click" && (oe(y) && l || (r && p && (!(n.current.openEvent && R) || n.current.openEvent.type === "mousedown") ? t(!1, i.nativeEvent, "click") : (i.preventDefault(), t(!0, i.nativeEvent, "click"))));
290
126
  },
291
- onClick(u) {
292
- const w = C.current;
293
- if (r === "mousedown" && C.current) {
294
- C.current = void 0;
127
+ onClick(i) {
128
+ const y = E.current;
129
+ if (s === "mousedown" && E.current) {
130
+ E.current = void 0;
295
131
  return;
296
132
  }
297
- Q(w, !0) && f || (o && E && (!(n.current.openEvent && y) || n.current.openEvent.type === "click") ? t(!1, u.nativeEvent, "click") : t(!0, u.nativeEvent, "click"));
133
+ oe(y) && l || (r && p && (!(n.current.openEvent && R) || n.current.openEvent.type === "click") ? t(!1, i.nativeEvent, "click") : t(!0, i.nativeEvent, "click"));
298
134
  },
299
- onKeyDown(u) {
300
- C.current = void 0, !(u.defaultPrevented || !R || Ee(u)) && (u.key === " " && !Re(d) && (u.preventDefault(), l.current = !0), u.key === "Enter" && t(!(o && E), u.nativeEvent, "click"));
135
+ onKeyDown(i) {
136
+ E.current = void 0, !(i.defaultPrevented || !g || ue(i)) && (i.key === " " && !le(a) && (i.preventDefault(), f.current = !0), i.key === "Enter" && t(!(r && p), i.nativeEvent, "click"));
301
137
  },
302
- onKeyUp(u) {
303
- u.defaultPrevented || !R || Ee(u) || Re(d) || u.key === " " && l.current && (l.current = !1, t(!(o && E), u.nativeEvent, "click"));
138
+ onKeyUp(i) {
139
+ i.defaultPrevented || !g || ue(i) || le(a) || i.key === " " && f.current && (f.current = !1, t(!(r && p), i.nativeEvent, "click"));
304
140
  }
305
- }), [n, d, r, f, R, t, o, y, E]);
306
- return c.useMemo(() => s ? {
307
- reference: m
308
- } : {}, [s, m]);
141
+ }), [n, a, s, l, g, t, r, R, p]);
142
+ return c.useMemo(() => u ? {
143
+ reference: b
144
+ } : {}, [u, b]);
309
145
  }
310
- const nt = {
146
+ const qe = {
311
147
  pointerdown: "onPointerDown",
312
148
  mousedown: "onMouseDown",
313
149
  click: "onClick"
314
- }, ot = {
150
+ }, Ze = {
315
151
  pointerdown: "onPointerDownCapture",
316
152
  mousedown: "onMouseDownCapture",
317
153
  click: "onClickCapture"
318
- }, be = (e) => {
319
- var i, o;
154
+ }, ae = (e) => {
155
+ var o, r;
320
156
  return {
321
- escapeKey: typeof e == "boolean" ? e : (i = e == null ? void 0 : e.escapeKey) != null ? i : !1,
322
- outsidePress: typeof e == "boolean" ? e : (o = e == null ? void 0 : e.outsidePress) != null ? o : !0
157
+ escapeKey: typeof e == "boolean" ? e : (o = e == null ? void 0 : e.escapeKey) != null ? o : !1,
158
+ outsidePress: typeof e == "boolean" ? e : (r = e == null ? void 0 : e.outsidePress) != null ? r : !0
323
159
  };
324
160
  };
325
- function gt(e, i) {
326
- i === void 0 && (i = {});
161
+ function ct(e, o) {
162
+ o === void 0 && (o = {});
327
163
  const {
328
- open: o,
164
+ open: r,
329
165
  onOpenChange: t,
330
166
  elements: n,
331
- dataRef: d
167
+ dataRef: a
332
168
  } = e, {
333
- enabled: s = !0,
334
- escapeKey: r = !0,
335
- outsidePress: E = !0,
336
- outsidePressEvent: f = "pointerdown",
337
- referencePress: R = !1,
338
- referencePressEvent: y = "pointerdown",
339
- ancestorScroll: C = !1,
340
- bubbles: l,
341
- capture: m
342
- } = i, u = ae(), w = V(typeof E == "function" ? E : () => !1), P = typeof E == "function" ? w : E, x = c.useRef(!1), h = c.useRef(!1), {
343
- escapeKey: S,
169
+ enabled: u = !0,
170
+ escapeKey: s = !0,
171
+ outsidePress: p = !0,
172
+ outsidePressEvent: l = "pointerdown",
173
+ referencePress: g = !1,
174
+ referencePressEvent: R = "pointerdown",
175
+ ancestorScroll: E = !1,
176
+ bubbles: f,
177
+ capture: b
178
+ } = o, i = ve(), y = F(typeof p == "function" ? p : () => !1), h = typeof p == "function" ? y : p, T = c.useRef(!1), v = c.useRef(!1), {
179
+ escapeKey: I,
180
+ outsidePress: L
181
+ } = ae(f), {
182
+ escapeKey: A,
344
183
  outsidePress: _
345
- } = be(l), {
346
- escapeKey: K,
347
- outsidePress: I
348
- } = be(m), H = c.useRef(!1), T = V((b) => {
349
- var k;
350
- if (!o || !s || !r || b.key !== "Escape" || H.current)
184
+ } = ae(b), N = c.useRef(!1), C = F((d) => {
185
+ var w;
186
+ if (!r || !u || !s || d.key !== "Escape" || N.current)
351
187
  return;
352
- const v = (k = d.current.floatingContext) == null ? void 0 : k.nodeId, p = u ? se(u.nodesRef.current, v) : [];
353
- if (!S && (b.stopPropagation(), p.length > 0)) {
354
- let a = !0;
355
- if (p.forEach((M) => {
356
- var g;
357
- if ((g = M.context) != null && g.open && !M.context.dataRef.current.__escapeKeyBubbles) {
358
- a = !1;
188
+ const k = (w = a.current.floatingContext) == null ? void 0 : w.nodeId, D = i ? J(i.nodesRef.current, k) : [];
189
+ if (!I && (d.stopPropagation(), D.length > 0)) {
190
+ let m = !0;
191
+ if (D.forEach((P) => {
192
+ var S;
193
+ if ((S = P.context) != null && S.open && !P.context.dataRef.current.__escapeKeyBubbles) {
194
+ m = !1;
359
195
  return;
360
196
  }
361
- }), !a)
197
+ }), !m)
362
198
  return;
363
199
  }
364
- t(!1, $e(b) ? b.nativeEvent : b, "escape-key");
365
- }), B = V((b) => {
366
- var k;
367
- const v = () => {
368
- var p;
369
- T(b), (p = G(b)) == null || p.removeEventListener("keydown", v);
200
+ t(!1, ke(d) ? d.nativeEvent : d, "escape-key");
201
+ }), H = F((d) => {
202
+ var w;
203
+ const k = () => {
204
+ var D;
205
+ C(d), (D = W(d)) == null || D.removeEventListener("keydown", k);
370
206
  };
371
- (k = G(b)) == null || k.addEventListener("keydown", v);
372
- }), F = V((b) => {
373
- var k;
374
- const v = x.current;
375
- x.current = !1;
376
- const p = h.current;
377
- if (h.current = !1, f === "click" && p || v || typeof P == "function" && !P(b))
207
+ (w = W(d)) == null || w.addEventListener("keydown", k);
208
+ }), V = F((d) => {
209
+ var w;
210
+ const k = T.current;
211
+ T.current = !1;
212
+ const D = v.current;
213
+ if (v.current = !1, l === "click" && D || k || typeof h == "function" && !h(d))
378
214
  return;
379
- const a = G(b), M = "[" + fe("inert") + "]", g = X(n.floating).querySelectorAll(M);
380
- let D = L(a) ? a : null;
381
- for (; D && !oe(D); ) {
382
- const O = Ue(D);
383
- if (oe(O) || !L(O))
215
+ const m = W(d), P = "[" + Ye("inert") + "]", S = re(n.floating).querySelectorAll(P);
216
+ let K = M(m) ? m : null;
217
+ for (; K && !G(K); ) {
218
+ const x = _e(K);
219
+ if (G(x) || !M(x))
384
220
  break;
385
- D = O;
221
+ K = x;
386
222
  }
387
- if (g.length && L(a) && !He(a) && // Clicked on a direct ancestor (e.g. FloatingOverlay).
388
- !z(a, n.floating) && // If the target root element contains none of the markers, then the
223
+ if (S.length && M(m) && !Ie(m) && // Clicked on a direct ancestor (e.g. FloatingOverlay).
224
+ !se(m, n.floating) && // If the target root element contains none of the markers, then the
389
225
  // element was injected after the floating element rendered.
390
- Array.from(g).every((O) => !z(D, O)))
226
+ Array.from(S).every((x) => !se(K, x)))
391
227
  return;
392
- if (ue(a) && $) {
393
- const O = oe(a), U = Ve(a), J = /auto|scroll/, xe = O || J.test(U.overflowX), Te = O || J.test(U.overflowY), De = xe && a.clientWidth > 0 && a.scrollWidth > a.clientWidth, ke = Te && a.clientHeight > 0 && a.scrollHeight > a.clientHeight, Se = U.direction === "rtl", Le = ke && (Se ? b.offsetX <= a.offsetWidth - a.clientWidth : b.offsetX > a.clientWidth), Ie = De && b.offsetY > a.clientHeight;
394
- if (Le || Ie)
228
+ if (pe(m) && X) {
229
+ const x = G(m), O = Oe(m), U = /auto|scroll/, Re = x || U.test(O.overflowX), ye = x || U.test(O.overflowY), be = Re && m.clientWidth > 0 && m.scrollWidth > m.clientWidth, Ce = ye && m.clientHeight > 0 && m.scrollHeight > m.clientHeight, he = O.direction === "rtl", we = Ce && (he ? d.offsetX <= m.offsetWidth - m.clientWidth : d.offsetX > m.clientWidth), Pe = be && d.offsetY > m.clientHeight;
230
+ if (we || Pe)
395
231
  return;
396
232
  }
397
- const Z = (k = d.current.floatingContext) == null ? void 0 : k.nodeId, ee = u && se(u.nodesRef.current, Z).some((O) => {
398
- var U;
399
- return te(b, (U = O.context) == null ? void 0 : U.elements.floating);
233
+ const te = (w = a.current.floatingContext) == null ? void 0 : w.nodeId, Ee = i && J(i.nodesRef.current, te).some((x) => {
234
+ var O;
235
+ return q(d, (O = x.context) == null ? void 0 : O.elements.floating);
400
236
  });
401
- if (te(b, n.floating) || te(b, n.domReference) || ee)
237
+ if (q(d, n.floating) || q(d, n.domReference) || Ee)
402
238
  return;
403
- const de = u ? se(u.nodesRef.current, Z) : [];
404
- if (de.length > 0) {
405
- let O = !0;
406
- if (de.forEach((U) => {
407
- var J;
408
- if ((J = U.context) != null && J.open && !U.context.dataRef.current.__outsidePressBubbles) {
409
- O = !1;
239
+ const ne = i ? J(i.nodesRef.current, te) : [];
240
+ if (ne.length > 0) {
241
+ let x = !0;
242
+ if (ne.forEach((O) => {
243
+ var U;
244
+ if ((U = O.context) != null && U.open && !O.context.dataRef.current.__outsidePressBubbles) {
245
+ x = !1;
410
246
  return;
411
247
  }
412
- }), !O)
248
+ }), !x)
413
249
  return;
414
250
  }
415
- t(!1, b, "outside-press");
416
- }), N = V((b) => {
417
- var k;
418
- const v = () => {
419
- var p;
420
- F(b), (p = G(b)) == null || p.removeEventListener(f, v);
251
+ t(!1, d, "outside-press");
252
+ }), Y = F((d) => {
253
+ var w;
254
+ const k = () => {
255
+ var D;
256
+ V(d), (D = W(d)) == null || D.removeEventListener(l, k);
421
257
  };
422
- (k = G(b)) == null || k.addEventListener(f, v);
258
+ (w = W(d)) == null || w.addEventListener(l, k);
423
259
  });
424
260
  c.useEffect(() => {
425
- if (!o || !s)
261
+ if (!r || !u)
426
262
  return;
427
- d.current.__escapeKeyBubbles = S, d.current.__outsidePressBubbles = _;
428
- let b = -1;
429
- function k(g) {
430
- t(!1, g, "ancestor-scroll");
263
+ a.current.__escapeKeyBubbles = I, a.current.__outsidePressBubbles = L;
264
+ let d = -1;
265
+ function w(S) {
266
+ t(!1, S, "ancestor-scroll");
431
267
  }
432
- function v() {
433
- window.clearTimeout(b), H.current = !0;
268
+ function k() {
269
+ window.clearTimeout(d), N.current = !0;
434
270
  }
435
- function p() {
436
- b = window.setTimeout(
271
+ function D() {
272
+ d = window.setTimeout(
437
273
  () => {
438
- H.current = !1;
274
+ N.current = !1;
439
275
  },
440
276
  // 0ms or 1ms don't work in Safari. 5ms appears to consistently work.
441
277
  // Only apply to WebKit for the test to remain 0ms.
442
- We() ? 5 : 0
278
+ Me() ? 5 : 0
443
279
  );
444
280
  }
445
- const a = X(n.floating);
446
- r && (a.addEventListener("keydown", K ? B : T, K), a.addEventListener("compositionstart", v), a.addEventListener("compositionend", p)), P && a.addEventListener(f, I ? N : F, I);
447
- let M = [];
448
- return C && (L(n.domReference) && (M = ne(n.domReference)), L(n.floating) && (M = M.concat(ne(n.floating))), !L(n.reference) && n.reference && n.reference.contextElement && (M = M.concat(ne(n.reference.contextElement)))), M = M.filter((g) => {
449
- var D;
450
- return g !== ((D = a.defaultView) == null ? void 0 : D.visualViewport);
451
- }), M.forEach((g) => {
452
- g.addEventListener("scroll", k, {
281
+ const m = re(n.floating);
282
+ s && (m.addEventListener("keydown", A ? H : C, A), m.addEventListener("compositionstart", k), m.addEventListener("compositionend", D)), h && m.addEventListener(l, _ ? Y : V, _);
283
+ let P = [];
284
+ return E && (M(n.domReference) && (P = Z(n.domReference)), M(n.floating) && (P = P.concat(Z(n.floating))), !M(n.reference) && n.reference && n.reference.contextElement && (P = P.concat(Z(n.reference.contextElement)))), P = P.filter((S) => {
285
+ var K;
286
+ return S !== ((K = m.defaultView) == null ? void 0 : K.visualViewport);
287
+ }), P.forEach((S) => {
288
+ S.addEventListener("scroll", w, {
453
289
  passive: !0
454
290
  });
455
291
  }), () => {
456
- r && (a.removeEventListener("keydown", K ? B : T, K), a.removeEventListener("compositionstart", v), a.removeEventListener("compositionend", p)), P && a.removeEventListener(f, I ? N : F, I), M.forEach((g) => {
457
- g.removeEventListener("scroll", k);
458
- }), window.clearTimeout(b);
292
+ s && (m.removeEventListener("keydown", A ? H : C, A), m.removeEventListener("compositionstart", k), m.removeEventListener("compositionend", D)), h && m.removeEventListener(l, _ ? Y : V, _), P.forEach((S) => {
293
+ S.removeEventListener("scroll", w);
294
+ }), window.clearTimeout(d);
459
295
  };
460
- }, [d, n, r, P, f, o, t, C, s, S, _, T, K, B, F, I, N]), c.useEffect(() => {
461
- x.current = !1;
462
- }, [P, f]);
463
- const W = c.useMemo(() => ({
464
- onKeyDown: T,
465
- ...R && {
466
- [nt[y]]: (b) => {
467
- t(!1, b.nativeEvent, "reference-press");
296
+ }, [a, n, s, h, l, r, t, E, u, I, L, C, A, H, V, _, Y]), c.useEffect(() => {
297
+ T.current = !1;
298
+ }, [h, l]);
299
+ const ee = c.useMemo(() => ({
300
+ onKeyDown: C,
301
+ ...g && {
302
+ [qe[R]]: (d) => {
303
+ t(!1, d.nativeEvent, "reference-press");
468
304
  },
469
- ...y !== "click" && {
470
- onClick(b) {
471
- t(!1, b.nativeEvent, "reference-press");
305
+ ...R !== "click" && {
306
+ onClick(d) {
307
+ t(!1, d.nativeEvent, "reference-press");
472
308
  }
473
309
  }
474
310
  }
475
- }), [T, t, R, y]), $ = c.useMemo(() => ({
476
- onKeyDown: T,
311
+ }), [C, t, g, R]), X = c.useMemo(() => ({
312
+ onKeyDown: C,
477
313
  onMouseDown() {
478
- h.current = !0;
314
+ v.current = !0;
479
315
  },
480
316
  onMouseUp() {
481
- h.current = !0;
317
+ v.current = !0;
482
318
  },
483
- [ot[f]]: () => {
484
- x.current = !0;
485
- }
486
- }), [T, f]);
487
- return c.useMemo(() => s ? {
488
- reference: W,
489
- floating: $
490
- } : {}, [s, W, $]);
319
+ [Ze[l]]: () => {
320
+ T.current = !0;
321
+ }
322
+ }), [C, l]);
323
+ return c.useMemo(() => u ? {
324
+ reference: ee,
325
+ floating: X
326
+ } : {}, [u, ee, X]);
491
327
  }
492
- function rt(e) {
328
+ function Ge(e) {
493
329
  const {
494
- open: i = !1,
495
- onOpenChange: o,
330
+ open: o = !1,
331
+ onOpenChange: r,
496
332
  elements: t
497
- } = e, n = Pe(), d = c.useRef({}), [s] = c.useState(() => Qe()), r = le() != null;
333
+ } = e, n = Be(), a = c.useRef({}), [u] = c.useState(() => Ue()), s = je() != null;
498
334
  if (process.env.NODE_ENV !== "production") {
499
- const l = t.reference;
500
- l && !L(l) && Je("Cannot pass a virtual element to the `elements.reference` option,", "as it must be a real DOM element. Use `refs.setPositionReference()`", "instead.");
335
+ const f = t.reference;
336
+ f && !M(f) && He("Cannot pass a virtual element to the `elements.reference` option,", "as it must be a real DOM element. Use `refs.setPositionReference()`", "instead.");
501
337
  }
502
- const [E, f] = c.useState(t.reference), R = V((l, m, u) => {
503
- d.current.openEvent = l ? m : void 0, s.emit("openchange", {
504
- open: l,
505
- event: m,
506
- reason: u,
507
- nested: r
508
- }), o == null || o(l, m, u);
509
- }), y = c.useMemo(() => ({
510
- setPositionReference: f
511
- }), []), C = c.useMemo(() => ({
512
- reference: E || t.reference || null,
338
+ const [p, l] = c.useState(t.reference), g = F((f, b, i) => {
339
+ a.current.openEvent = f ? b : void 0, u.emit("openchange", {
340
+ open: f,
341
+ event: b,
342
+ reason: i,
343
+ nested: s
344
+ }), r == null || r(f, b, i);
345
+ }), R = c.useMemo(() => ({
346
+ setPositionReference: l
347
+ }), []), E = c.useMemo(() => ({
348
+ reference: p || t.reference || null,
513
349
  floating: t.floating || null,
514
350
  domReference: t.reference
515
- }), [E, t.reference, t.floating]);
351
+ }), [p, t.reference, t.floating]);
516
352
  return c.useMemo(() => ({
517
- dataRef: d,
518
- open: i,
519
- onOpenChange: R,
520
- elements: C,
521
- events: s,
353
+ dataRef: a,
354
+ open: o,
355
+ onOpenChange: g,
356
+ elements: E,
357
+ events: u,
522
358
  floatingId: n,
523
- refs: y
524
- }), [i, R, C, s, n, y]);
359
+ refs: R
360
+ }), [o, g, E, u, n, R]);
525
361
  }
526
- function Et(e) {
362
+ function it(e) {
527
363
  e === void 0 && (e = {});
528
364
  const {
529
- nodeId: i
530
- } = e, o = rt({
365
+ nodeId: o
366
+ } = e, r = Ge({
531
367
  ...e,
532
368
  elements: {
533
369
  reference: null,
534
370
  floating: null,
535
371
  ...e.elements
536
372
  }
537
- }), t = e.rootContext || o, n = t.elements, [d, s] = c.useState(null), [r, E] = c.useState(null), R = (n == null ? void 0 : n.domReference) || d, y = c.useRef(null), C = ae();
538
- Y(() => {
539
- R && (y.current = R);
540
- }, [R]);
541
- const l = Ye({
373
+ }), t = e.rootContext || r, n = t.elements, [a, u] = c.useState(null), [s, p] = c.useState(null), g = (n == null ? void 0 : n.domReference) || a, R = c.useRef(null), E = ve();
374
+ B(() => {
375
+ g && (R.current = g);
376
+ }, [g]);
377
+ const f = Ke({
542
378
  ...e,
543
379
  elements: {
544
380
  ...n,
545
- ...r && {
546
- reference: r
381
+ ...s && {
382
+ reference: s
547
383
  }
548
384
  }
549
- }), m = c.useCallback((h) => {
550
- const S = L(h) ? {
551
- getBoundingClientRect: () => h.getBoundingClientRect(),
552
- contextElement: h
553
- } : h;
554
- E(S), l.refs.setReference(S);
555
- }, [l.refs]), u = c.useCallback((h) => {
556
- (L(h) || h === null) && (y.current = h, s(h)), (L(l.refs.reference.current) || l.refs.reference.current === null || // Don't allow setting virtual elements using the old technique back to
385
+ }), b = c.useCallback((v) => {
386
+ const I = M(v) ? {
387
+ getBoundingClientRect: () => v.getBoundingClientRect(),
388
+ contextElement: v
389
+ } : v;
390
+ p(I), f.refs.setReference(I);
391
+ }, [f.refs]), i = c.useCallback((v) => {
392
+ (M(v) || v === null) && (R.current = v, u(v)), (M(f.refs.reference.current) || f.refs.reference.current === null || // Don't allow setting virtual elements using the old technique back to
557
393
  // `null` to support `positionReference` + an unstable `reference`
558
394
  // callback ref.
559
- h !== null && !L(h)) && l.refs.setReference(h);
560
- }, [l.refs]), w = c.useMemo(() => ({
561
- ...l.refs,
562
- setReference: u,
563
- setPositionReference: m,
564
- domReference: y
565
- }), [l.refs, u, m]), P = c.useMemo(() => ({
566
- ...l.elements,
395
+ v !== null && !M(v)) && f.refs.setReference(v);
396
+ }, [f.refs]), y = c.useMemo(() => ({
397
+ ...f.refs,
398
+ setReference: i,
399
+ setPositionReference: b,
567
400
  domReference: R
568
- }), [l.elements, R]), x = c.useMemo(() => ({
569
- ...l,
401
+ }), [f.refs, i, b]), h = c.useMemo(() => ({
402
+ ...f.elements,
403
+ domReference: g
404
+ }), [f.elements, g]), T = c.useMemo(() => ({
405
+ ...f,
570
406
  ...t,
571
- refs: w,
572
- elements: P,
573
- nodeId: i
574
- }), [l, w, P, i, t]);
575
- return Y(() => {
576
- t.dataRef.current.floatingContext = x;
577
- const h = C == null ? void 0 : C.nodesRef.current.find((S) => S.id === i);
578
- h && (h.context = x);
407
+ refs: y,
408
+ elements: h,
409
+ nodeId: o
410
+ }), [f, y, h, o, t]);
411
+ return B(() => {
412
+ t.dataRef.current.floatingContext = T;
413
+ const v = E == null ? void 0 : E.nodesRef.current.find((I) => I.id === o);
414
+ v && (v.context = T);
579
415
  }), c.useMemo(() => ({
580
- ...l,
581
- context: x,
582
- refs: w,
583
- elements: P
584
- }), [l, w, P, x]);
416
+ ...f,
417
+ context: T,
418
+ refs: y,
419
+ elements: h
420
+ }), [f, y, h, T]);
585
421
  }
586
- function Rt(e, i) {
587
- i === void 0 && (i = {});
588
- const {
589
- open: o,
590
- onOpenChange: t,
591
- events: n,
592
- dataRef: d,
593
- elements: s
594
- } = e, {
595
- enabled: r = !0,
596
- visibleOnly: E = !0
597
- } = i, f = c.useRef(!1), R = c.useRef(-1), y = c.useRef(!0);
598
- c.useEffect(() => {
599
- if (!r) return;
600
- const l = Be(s.domReference);
601
- function m() {
602
- !o && ue(s.domReference) && s.domReference === me(X(s.domReference)) && (f.current = !0);
603
- }
604
- function u() {
605
- y.current = !0;
606
- }
607
- return l.addEventListener("blur", m), l.addEventListener("keydown", u, !0), () => {
608
- l.removeEventListener("blur", m), l.removeEventListener("keydown", u, !0);
609
- };
610
- }, [s.domReference, o, r]), c.useEffect(() => {
611
- if (!r) return;
612
- function l(m) {
613
- let {
614
- reason: u
615
- } = m;
616
- (u === "reference-press" || u === "escape-key") && (f.current = !0);
617
- }
618
- return n.on("openchange", l), () => {
619
- n.off("openchange", l);
620
- };
621
- }, [n, r]), c.useEffect(() => () => {
622
- A(R);
623
- }, []);
624
- const C = c.useMemo(() => ({
625
- onPointerDown(l) {
626
- Ne(l.nativeEvent) || (y.current = !1);
627
- },
628
- onMouseLeave() {
629
- f.current = !1;
630
- },
631
- onFocus(l) {
632
- if (f.current) return;
633
- const m = G(l.nativeEvent);
634
- if (E && L(m))
635
- try {
636
- if (Ke() && Fe()) throw Error();
637
- if (!m.matches(":focus-visible")) return;
638
- } catch {
639
- if (!y.current && !we(m))
640
- return;
641
- }
642
- t(!0, l.nativeEvent, "focus");
643
- },
644
- onBlur(l) {
645
- f.current = !1;
646
- const m = l.relatedTarget, u = l.nativeEvent, w = L(m) && m.hasAttribute(fe("focus-guard")) && m.getAttribute("data-type") === "outside";
647
- R.current = window.setTimeout(() => {
648
- var P;
649
- const x = me(s.domReference ? s.domReference.ownerDocument : document);
650
- !m && x === s.domReference || z((P = d.current.floatingContext) == null ? void 0 : P.refs.floating.current, x) || z(s.domReference, x) || w || t(!1, u, "focus");
651
- });
652
- }
653
- }), [d, s.domReference, t, E]);
654
- return c.useMemo(() => r ? {
655
- reference: C
656
- } : {}, [r, C]);
657
- }
658
- const ye = "active", he = "selected";
659
- function ce(e, i, o) {
660
- const t = /* @__PURE__ */ new Map(), n = o === "item";
661
- let d = e;
422
+ const fe = "active", de = "selected";
423
+ function Q(e, o, r) {
424
+ const t = /* @__PURE__ */ new Map(), n = r === "item";
425
+ let a = e;
662
426
  if (n && e) {
663
427
  const {
664
- [ye]: s,
665
- [he]: r,
666
- ...E
428
+ [fe]: u,
429
+ [de]: s,
430
+ ...p
667
431
  } = e;
668
- d = E;
432
+ a = p;
669
433
  }
670
434
  return {
671
- ...o === "floating" && {
435
+ ...r === "floating" && {
672
436
  tabIndex: -1,
673
- [tt]: ""
437
+ [Xe]: ""
674
438
  },
675
- ...d,
676
- ...i.map((s) => {
677
- const r = s ? s[o] : null;
678
- return typeof r == "function" ? e ? r(e) : null : r;
679
- }).concat(e).reduce((s, r) => (r && Object.entries(r).forEach((E) => {
680
- let [f, R] = E;
681
- if (!(n && [ye, he].includes(f)))
682
- if (f.indexOf("on") === 0) {
683
- if (t.has(f) || t.set(f, []), typeof R == "function") {
684
- var y;
685
- (y = t.get(f)) == null || y.push(R), s[f] = function() {
686
- for (var C, l = arguments.length, m = new Array(l), u = 0; u < l; u++)
687
- m[u] = arguments[u];
688
- return (C = t.get(f)) == null ? void 0 : C.map((w) => w(...m)).find((w) => w !== void 0);
439
+ ...a,
440
+ ...o.map((u) => {
441
+ const s = u ? u[r] : null;
442
+ return typeof s == "function" ? e ? s(e) : null : s;
443
+ }).concat(e).reduce((u, s) => (s && Object.entries(s).forEach((p) => {
444
+ let [l, g] = p;
445
+ if (!(n && [fe, de].includes(l)))
446
+ if (l.indexOf("on") === 0) {
447
+ if (t.has(l) || t.set(l, []), typeof g == "function") {
448
+ var R;
449
+ (R = t.get(l)) == null || R.push(g), u[l] = function() {
450
+ for (var E, f = arguments.length, b = new Array(f), i = 0; i < f; i++)
451
+ b[i] = arguments[i];
452
+ return (E = t.get(l)) == null ? void 0 : E.map((y) => y(...b)).find((y) => y !== void 0);
689
453
  };
690
454
  }
691
455
  } else
692
- s[f] = R;
693
- }), s), {})
456
+ u[l] = g;
457
+ }), u), {})
694
458
  };
695
459
  }
696
- function bt(e) {
460
+ function ut(e) {
697
461
  e === void 0 && (e = []);
698
- const i = e.map((r) => r == null ? void 0 : r.reference), o = e.map((r) => r == null ? void 0 : r.floating), t = e.map((r) => r == null ? void 0 : r.item), n = c.useCallback(
699
- (r) => ce(r, e, "reference"),
700
- // eslint-disable-next-line react-hooks/exhaustive-deps
701
- i
702
- ), d = c.useCallback(
703
- (r) => ce(r, e, "floating"),
462
+ const o = e.map((s) => s == null ? void 0 : s.reference), r = e.map((s) => s == null ? void 0 : s.floating), t = e.map((s) => s == null ? void 0 : s.item), n = c.useCallback(
463
+ (s) => Q(s, e, "reference"),
704
464
  // eslint-disable-next-line react-hooks/exhaustive-deps
705
465
  o
706
- ), s = c.useCallback(
707
- (r) => ce(r, e, "item"),
466
+ ), a = c.useCallback(
467
+ (s) => Q(s, e, "floating"),
468
+ // eslint-disable-next-line react-hooks/exhaustive-deps
469
+ r
470
+ ), u = c.useCallback(
471
+ (s) => Q(s, e, "item"),
708
472
  // eslint-disable-next-line react-hooks/exhaustive-deps
709
473
  t
710
474
  );
711
475
  return c.useMemo(() => ({
712
476
  getReferenceProps: n,
713
- getFloatingProps: d,
714
- getItemProps: s
715
- }), [n, d, s]);
477
+ getFloatingProps: a,
478
+ getItemProps: u
479
+ }), [n, a, u]);
716
480
  }
717
- const st = /* @__PURE__ */ new Map([["select", "listbox"], ["combobox", "listbox"], ["label", !1]]);
718
- function yt(e, i) {
719
- var o;
720
- i === void 0 && (i = {});
721
- const {
722
- open: t,
723
- floatingId: n
724
- } = e, {
725
- enabled: d = !0,
726
- role: s = "dialog"
727
- } = i, r = (o = st.get(s)) != null ? o : s, E = Pe(), R = le() != null, y = c.useMemo(() => r === "tooltip" || s === "label" ? {
728
- ["aria-" + (s === "label" ? "labelledby" : "describedby")]: t ? n : void 0
729
- } : {
730
- "aria-expanded": t ? "true" : "false",
731
- "aria-haspopup": r === "alertdialog" ? "dialog" : r,
732
- "aria-controls": t ? n : void 0,
733
- ...r === "listbox" && {
734
- role: "combobox"
735
- },
736
- ...r === "menu" && {
737
- id: E
738
- },
739
- ...r === "menu" && R && {
740
- role: "menuitem"
741
- },
742
- ...s === "select" && {
743
- "aria-autocomplete": "none"
744
- },
745
- ...s === "combobox" && {
746
- "aria-autocomplete": "list"
747
- }
748
- }, [r, n, R, t, E, s]), C = c.useMemo(() => {
749
- const m = {
750
- id: n,
751
- ...r && {
752
- role: r
753
- }
754
- };
755
- return r === "tooltip" || s === "label" ? m : {
756
- ...m,
757
- ...r === "menu" && {
758
- "aria-labelledby": E
759
- }
760
- };
761
- }, [r, n, E, s]), l = c.useCallback((m) => {
762
- let {
763
- active: u,
764
- selected: w
765
- } = m;
766
- const P = {
767
- role: "option",
768
- ...u && {
769
- id: n + "-option"
770
- }
771
- };
772
- switch (s) {
773
- case "select":
774
- return {
775
- ...P,
776
- "aria-selected": u && w
777
- };
778
- case "combobox":
779
- return {
780
- ...P,
781
- ...u && {
782
- "aria-selected": !0
783
- }
784
- };
785
- }
786
- return {};
787
- }, [n, s]);
788
- return c.useMemo(() => d ? {
789
- reference: y,
790
- floating: C,
791
- item: l
792
- } : {}, [d, y, C, l]);
481
+ const me = (e) => e.replace(/[A-Z]+(?![a-z])|[A-Z]/g, (o, r) => (r ? "-" : "") + o.toLowerCase());
482
+ function $(e, o) {
483
+ return typeof e == "function" ? e(o) : e;
793
484
  }
794
- const Ce = (e) => e.replace(/[A-Z]+(?![a-z])|[A-Z]/g, (i, o) => (o ? "-" : "") + i.toLowerCase());
795
- function q(e, i) {
796
- return typeof e == "function" ? e(i) : e;
797
- }
798
- function ct(e, i) {
799
- const [o, t] = c.useState(e);
800
- return e && !o && t(!0), c.useEffect(() => {
801
- if (!e && o) {
802
- const n = setTimeout(() => t(!1), i);
485
+ function Je(e, o) {
486
+ const [r, t] = c.useState(e);
487
+ return e && !r && t(!0), c.useEffect(() => {
488
+ if (!e && r) {
489
+ const n = setTimeout(() => t(!1), o);
803
490
  return () => clearTimeout(n);
804
491
  }
805
- }, [e, o, i]), o;
492
+ }, [e, r, o]), r;
806
493
  }
807
- function it(e, i) {
808
- i === void 0 && (i = {});
494
+ function Qe(e, o) {
495
+ o === void 0 && (o = {});
809
496
  const {
810
- open: o,
497
+ open: r,
811
498
  elements: {
812
499
  floating: t
813
500
  }
814
501
  } = e, {
815
502
  duration: n = 250
816
- } = i, s = (typeof n == "number" ? n : n.close) || 0, [r, E] = c.useState("unmounted"), f = ct(o, s);
817
- return !f && r === "close" && E("unmounted"), Y(() => {
503
+ } = o, u = (typeof n == "number" ? n : n.close) || 0, [s, p] = c.useState("unmounted"), l = Je(r, u);
504
+ return !l && s === "close" && p("unmounted"), B(() => {
818
505
  if (t) {
819
- if (o) {
820
- E("initial");
821
- const R = requestAnimationFrame(() => {
822
- E("open");
506
+ if (r) {
507
+ p("initial");
508
+ const g = requestAnimationFrame(() => {
509
+ p("open");
823
510
  });
824
511
  return () => {
825
- cancelAnimationFrame(R);
512
+ cancelAnimationFrame(g);
826
513
  };
827
514
  }
828
- E("close");
515
+ p("close");
829
516
  }
830
- }, [o, t]), {
831
- isMounted: f,
832
- status: r
517
+ }, [r, t]), {
518
+ isMounted: l,
519
+ status: s
833
520
  };
834
521
  }
835
- function ht(e, i) {
836
- i === void 0 && (i = {});
522
+ function lt(e, o) {
523
+ o === void 0 && (o = {});
837
524
  const {
838
- initial: o = {
525
+ initial: r = {
839
526
  opacity: 0
840
527
  },
841
528
  open: t,
842
529
  close: n,
843
- common: d,
844
- duration: s = 250
845
- } = i, r = e.placement, E = r.split("-")[0], f = c.useMemo(() => ({
846
- side: E,
847
- placement: r
848
- }), [E, r]), R = typeof s == "number", y = (R ? s : s.open) || 0, C = (R ? s : s.close) || 0, [l, m] = c.useState(() => ({
849
- ...q(d, f),
850
- ...q(o, f)
530
+ common: a,
531
+ duration: u = 250
532
+ } = o, s = e.placement, p = s.split("-")[0], l = c.useMemo(() => ({
533
+ side: p,
534
+ placement: s
535
+ }), [p, s]), g = typeof u == "number", R = (g ? u : u.open) || 0, E = (g ? u : u.close) || 0, [f, b] = c.useState(() => ({
536
+ ...$(a, l),
537
+ ...$(r, l)
851
538
  })), {
852
- isMounted: u,
853
- status: w
854
- } = it(e, {
855
- duration: s
856
- }), P = j(o), x = j(t), h = j(n), S = j(d);
857
- return Y(() => {
858
- const _ = q(P.current, f), K = q(h.current, f), I = q(S.current, f), H = q(x.current, f) || Object.keys(_).reduce((T, B) => (T[B] = "", T), {});
859
- if (w === "initial" && m((T) => ({
860
- transitionProperty: T.transitionProperty,
861
- ...I,
862
- ..._
863
- })), w === "open" && m({
864
- transitionProperty: Object.keys(H).map(Ce).join(","),
865
- transitionDuration: y + "ms",
866
- ...I,
867
- ...H
868
- }), w === "close") {
869
- const T = K || _;
870
- m({
871
- transitionProperty: Object.keys(T).map(Ce).join(","),
872
- transitionDuration: C + "ms",
873
- ...I,
874
- ...T
539
+ isMounted: i,
540
+ status: y
541
+ } = Qe(e, {
542
+ duration: u
543
+ }), h = j(r), T = j(t), v = j(n), I = j(a);
544
+ return B(() => {
545
+ const L = $(h.current, l), A = $(v.current, l), _ = $(I.current, l), N = $(T.current, l) || Object.keys(L).reduce((C, H) => (C[H] = "", C), {});
546
+ if (y === "initial" && b((C) => ({
547
+ transitionProperty: C.transitionProperty,
548
+ ..._,
549
+ ...L
550
+ })), y === "open" && b({
551
+ transitionProperty: Object.keys(N).map(me).join(","),
552
+ transitionDuration: R + "ms",
553
+ ..._,
554
+ ...N
555
+ }), y === "close") {
556
+ const C = A || L;
557
+ b({
558
+ transitionProperty: Object.keys(C).map(me).join(","),
559
+ transitionDuration: E + "ms",
560
+ ..._,
561
+ ...C
875
562
  });
876
563
  }
877
- }, [C, h, P, x, S, y, w, f]), {
878
- isMounted: u,
879
- styles: l
564
+ }, [E, v, h, T, I, R, y, l]), {
565
+ isMounted: i,
566
+ styles: f
880
567
  };
881
568
  }
882
569
  export {
883
- Mt as arrow,
884
- Pt as flip,
885
- ne as getOverflowAncestors,
886
- xt as offset,
887
- Tt as shift,
888
- Dt as size,
889
- pt as useClick,
890
- gt as useDismiss,
891
- Et as useFloating,
892
- le as useFloatingParentNodeId,
893
- rt as useFloatingRootContext,
894
- ae as useFloatingTree,
895
- Rt as useFocus,
896
- vt as useHover,
897
- Pe as useId,
898
- bt as useInteractions,
899
- yt as useRole,
900
- it as useTransitionStatus,
901
- ht as useTransitionStyles
570
+ dt as arrow,
571
+ mt as flip,
572
+ Z as getOverflowAncestors,
573
+ pt as offset,
574
+ gt as shift,
575
+ vt as size,
576
+ st as useClick,
577
+ ct as useDismiss,
578
+ it as useFloating,
579
+ je as useFloatingParentNodeId,
580
+ Ge as useFloatingRootContext,
581
+ ve as useFloatingTree,
582
+ Be as useId,
583
+ ut as useInteractions,
584
+ Qe as useTransitionStatus,
585
+ lt as useTransitionStyles
902
586
  };