@ryuzaki13/react-foundation-ui 1.10.1 → 1.11.1

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 (301) hide show
  1. package/dist/advanced-search/index.js +4 -4
  2. package/dist/base-table/index.js +1 -1
  3. package/dist/button/index.js +1 -1
  4. package/dist/chunks/{CalendarView-BK-Q6GVc.js → CalendarView-Bhaov_XE.js} +2 -2
  5. package/dist/chunks/{CalendarView-BK-Q6GVc.js.map → CalendarView-Bhaov_XE.js.map} +1 -1
  6. package/dist/chunks/{TextEditorLexicalClient-C8jKCbsp.js → TextEditorLexicalClient-CqPOrgcQ.js} +3 -3
  7. package/dist/chunks/{TextEditorLexicalClient-C8jKCbsp.js.map → TextEditorLexicalClient-CqPOrgcQ.js.map} +1 -1
  8. package/dist/chunks/{base-table-BNtd1xSl.js → base-table-DswaYoH-.js} +3 -3
  9. package/dist/chunks/{base-table-BNtd1xSl.js.map → base-table-DswaYoH-.js.map} +1 -1
  10. package/dist/chunks/{button-BYWHD2TV.js → button-BaUlN-nt.js} +2 -2
  11. package/dist/chunks/{button-BYWHD2TV.js.map → button-BaUlN-nt.js.map} +1 -1
  12. package/dist/chunks/{context-menu-CCAr_R-t.js → context-menu-HC7Vteb5.js} +66 -59
  13. package/dist/chunks/context-menu-HC7Vteb5.js.map +1 -0
  14. package/dist/chunks/{date-input-DXXKeLcq.js → date-input-DkLfO3Ng.js} +3 -3
  15. package/dist/chunks/{date-input-DXXKeLcq.js.map → date-input-DkLfO3Ng.js.map} +1 -1
  16. package/dist/chunks/{misc-CV0XwJf3.js → misc-DeGboAt-.js} +2 -2
  17. package/dist/chunks/{misc-CV0XwJf3.js.map → misc-DeGboAt-.js.map} +1 -1
  18. package/dist/chunks/{modal-Bmd9iBw1.js → modal-BGAi96zR.js} +3 -3
  19. package/dist/chunks/{modal-Bmd9iBw1.js.map → modal-BGAi96zR.js.map} +1 -1
  20. package/dist/chunks/{popover-BMboZXoQ.js → popover-Bne-Ljbs.js} +62 -61
  21. package/dist/chunks/{popover-BMboZXoQ.js.map → popover-Bne-Ljbs.js.map} +1 -1
  22. package/dist/chunks/{table-C3sKpYHL.js → table-aozLLSJk.js} +2 -2
  23. package/dist/chunks/{table-C3sKpYHL.js.map → table-aozLLSJk.js.map} +1 -1
  24. package/dist/context-menu/components/ContextMenuTrigger.d.ts +2 -0
  25. package/dist/context-menu/components/ContextMenuTrigger.d.ts.map +1 -1
  26. package/dist/context-menu/components/MenuContext.d.ts +2 -2
  27. package/dist/context-menu/components/MenuContext.d.ts.map +1 -1
  28. package/dist/context-menu/components/MenuRoot.d.ts.map +1 -1
  29. package/dist/context-menu/index.js +1 -1
  30. package/dist/date-input/index.js +2 -2
  31. package/dist/date-time-input/index.js +2 -2
  32. package/dist/expandable-action-panel/index.js +2 -2
  33. package/dist/image/index.js +2 -2
  34. package/dist/list/index.js +1 -1
  35. package/dist/misc/index.js +1 -1
  36. package/dist/modal/index.js +1 -1
  37. package/dist/notifications/index.js +1 -1
  38. package/dist/popover/FloatingPopover.d.ts.map +1 -1
  39. package/dist/popover/index.js +1 -1
  40. package/dist/preset-range-date-input/index.js +1 -1
  41. package/dist/simple-table/index.js +1 -1
  42. package/dist/slider/index.js +1 -1
  43. package/dist/table/index.js +1 -1
  44. package/dist/table-sorting/index.js +1 -1
  45. package/dist/tabs/index.js +1 -1
  46. package/dist/text/index.js +1 -1
  47. package/dist/text-editor/index.js +2 -2
  48. package/dist/tree-table/index.js +1 -1
  49. package/package.json +1 -1
  50. package/storybook-static/assets/{Badge-jMoGaWlH.js → Badge-B0pMNo6u.js} +1 -1
  51. package/storybook-static/assets/{Badge.stories-DCRYgiFn.js → Badge.stories-DmJySgC9.js} +1 -1
  52. package/storybook-static/assets/{BadgeList-hUxkrQKk.js → BadgeList-CPMgBZNy.js} +1 -1
  53. package/storybook-static/assets/{Button-CN90zPTE.js → Button-BQCqsOSh.js} +1 -1
  54. package/storybook-static/assets/{Button-BLZxiBx_.js → Button-DdP87Kjo.js} +1 -1
  55. package/storybook-static/assets/{Button.stories-C3IDTh6L.js → Button.stories-B95Gfrv6.js} +1 -1
  56. package/storybook-static/assets/{CalendarView-Da3lEn5n.js → CalendarView-Dkx103Eo.js} +1 -1
  57. package/storybook-static/assets/{CheckBox-C88r1nU9.js → CheckBox-6jhHJHNx.js} +1 -1
  58. package/storybook-static/assets/{CheckBox-BDPsgkY9.js → CheckBox-CEiyvt0g.js} +1 -1
  59. package/storybook-static/assets/{CheckBox.stories-CLL1W22k.js → CheckBox.stories-C-ry0F3S.js} +1 -1
  60. package/storybook-static/assets/{Color-6AOWCN3U-BeYazCuF.js → Color-6AOWCN3U-C7ZBfvPD.js} +1 -1
  61. package/storybook-static/assets/{ContextMenu-CEmrtmjw.js → ContextMenu-B7zzWFcl.js} +1 -1
  62. package/storybook-static/assets/ContextMenu-BXr3AZy_.js +1 -0
  63. package/storybook-static/assets/{ContextMenu.stories-CJdQ3DxK.js → ContextMenu.stories-BixTxzOj.js} +1 -1
  64. package/storybook-static/assets/{CustomOptionButton-BlBnyItt.js → CustomOptionButton-B4TQxEG7.js} +1 -1
  65. package/storybook-static/assets/{DateInput-BOeTDc10.js → DateInput-CiNA_ASr.js} +1 -1
  66. package/storybook-static/assets/{DateInput-BplJWRap.js → DateInput-Dd18xSEj.js} +1 -1
  67. package/storybook-static/assets/{DateInput.stories-Dvsg67Q7.js → DateInput.stories-BEsG3vsL.js} +1 -1
  68. package/storybook-static/assets/{DateRangePresetSelect-BNAtaJ9P.js → DateRangePresetSelect-CPYFDKex.js} +1 -1
  69. package/storybook-static/assets/{DateRangePresetSelect-CQlubR_0.js → DateRangePresetSelect-Ccz7NfDd.js} +1 -1
  70. package/storybook-static/assets/{DateRangePresetSelect.stories-iaVAJzrk.js → DateRangePresetSelect.stories-opQhou6g.js} +1 -1
  71. package/storybook-static/assets/{Detail-DDYBXrvC.js → Detail-iNp-Y0oX.js} +1 -1
  72. package/storybook-static/assets/{Detail.stories-DNRTPZcT.js → Detail.stories-wMP_UVa0.js} +1 -1
  73. package/storybook-static/assets/{Dialog-_8-5uCF4.js → Dialog-C61I39GX.js} +1 -1
  74. package/storybook-static/assets/{Dialog-D60NKiU7.js → Dialog-DvJy6JL7.js} +1 -1
  75. package/storybook-static/assets/{Dialog.stories-LMG0RjuL.js → Dialog.stories-BA49irYS.js} +1 -1
  76. package/storybook-static/assets/{Disclosure-DTCWb38a.js → Disclosure-CuKVlkDs.js} +1 -1
  77. package/storybook-static/assets/{Disclosure.stories-D98Sqa6B.js → Disclosure.stories-DGEYHdsF.js} +1 -1
  78. package/storybook-static/assets/{DisclosureGroup-rjsQrwwz.js → DisclosureGroup-DhU1dNC8.js} +1 -1
  79. package/storybook-static/assets/{DocsRenderer-JROSPFPF-C8rtPh64.js → DocsRenderer-JROSPFPF-BkpUvEnq.js} +1 -1
  80. package/storybook-static/assets/{DropZone-Cc-Nr7qt.js → DropZone-7ceW1dn3.js} +1 -1
  81. package/storybook-static/assets/{DropZone-xZSakToS.js → DropZone-C78CmTpa.js} +1 -1
  82. package/storybook-static/assets/{DropZone.stories-BrNYMWdp.js → DropZone.stories-ufjhh7h-.js} +1 -1
  83. package/storybook-static/assets/{DropdownMenu-CKHgBr1G.js → DropdownMenu-n6JW93BD.js} +1 -1
  84. package/storybook-static/assets/{ExpandableActionPanel-CaRPw6Wm.js → ExpandableActionPanel-Hr0krU6W.js} +1 -1
  85. package/storybook-static/assets/{ExpandableActionPanel.stories-D84EsMIi.js → ExpandableActionPanel.stories-DhvuWFNv.js} +1 -1
  86. package/storybook-static/assets/{Flex-ksn1ULug.js → Flex-B94m_qyY.js} +1 -1
  87. package/storybook-static/assets/{Flex.stories-CImsjHxn.js → Flex.stories-B8AaUI7D.js} +1 -1
  88. package/storybook-static/assets/FloatingPopover-DJiX84PM.js +1 -0
  89. package/storybook-static/assets/{FormattedTableCell-DIPPfMCP.js → FormattedTableCell-_E06deOh.js} +1 -1
  90. package/storybook-static/assets/{Grid-COjPAy0V.js → Grid-kT9nG3ti.js} +1 -1
  91. package/storybook-static/assets/{Grid.stories-DInra2zZ.js → Grid.stories-CIpqBZEV.js} +1 -1
  92. package/storybook-static/assets/{ImageCropper.stories-BaN5T0Sj.js → ImageCropper.stories-lLmE-m8y.js} +1 -1
  93. package/storybook-static/assets/{ImageRenderer-BiX7KYHn.js → ImageRenderer-CumAPDzJ.js} +1 -1
  94. package/storybook-static/assets/{ImageRenderer.stories-DRA0tvY5.js → ImageRenderer.stories-DRBkO7a5.js} +1 -1
  95. package/storybook-static/assets/{ImageView.stories-DmgrraU8.js → ImageView.stories-CJPbRo4F.js} +1 -1
  96. package/storybook-static/assets/{ImageViewer.stories-B1lcBTZL.js → ImageViewer.stories-Dga7I4WU.js} +2 -2
  97. package/storybook-static/assets/{ImageViewerRuntime-Ba0P6JkW.js → ImageViewerRuntime-B2Mqo_WZ.js} +1 -1
  98. package/storybook-static/assets/{Input-BE3ev4c3.js → Input-C1R3JI6C.js} +1 -1
  99. package/storybook-static/assets/{Input-DWaSzRT6.js → Input-aN_k-nwG.js} +1 -1
  100. package/storybook-static/assets/{Input.stories-BwSh-rG5.js → Input.stories-CamuqrIq.js} +1 -1
  101. package/storybook-static/assets/{InputDateTime-Bzcathpr.js → InputDateTime-DLGntd6J.js} +1 -1
  102. package/storybook-static/assets/{InputDateTime.stories-BKSNyeGW.js → InputDateTime.stories-DKS2OEea.js} +1 -1
  103. package/storybook-static/assets/{InputFile-BkcqAe9e.js → InputFile-Co7tvxPX.js} +1 -1
  104. package/storybook-static/assets/{InputFile-B1xshCl7.js → InputFile-VpaVOpAd.js} +1 -1
  105. package/storybook-static/assets/{InputFile.stories-DNzDLdnM.js → InputFile.stories-DXdlBxEU.js} +1 -1
  106. package/storybook-static/assets/{InputFiles-Beh9VGnI.js → InputFiles-BTCuD668.js} +1 -1
  107. package/storybook-static/assets/{InputFiles-DoIpCwD8.js → InputFiles-DvkMwKO7.js} +1 -1
  108. package/storybook-static/assets/{InputFiles.stories-D463o_2j.js → InputFiles.stories-DrTZMej-.js} +1 -1
  109. package/storybook-static/assets/{InputFilesList-XBhxIwzm.js → InputFilesList-CGjnqnzc.js} +1 -1
  110. package/storybook-static/assets/{InputImage-BxplZPLz.js → InputImage-DiEO91jk.js} +1 -1
  111. package/storybook-static/assets/{InputImage-DFOKaSvG.js → InputImage-Ipb-FcJa.js} +1 -1
  112. package/storybook-static/assets/{InputImage.stories-9_4PdNVX.js → InputImage.stories-ttixjbus.js} +1 -1
  113. package/storybook-static/assets/{InteractiveComponents-gVX-Co65.js → InteractiveComponents-B4gMe903.js} +1 -1
  114. package/storybook-static/assets/{InteractiveComponents.stories-xGm6Qn3p.js → InteractiveComponents.stories-Bao1bjuz.js} +1 -1
  115. package/storybook-static/assets/{LayoutPicker-CAIUGlYR.js → LayoutPicker-CbOMOuPf.js} +1 -1
  116. package/storybook-static/assets/{LayoutPicker-DyNgBEDt.js → LayoutPicker-CuHY0iUU.js} +1 -1
  117. package/storybook-static/assets/{LayoutPicker.stories-DjWIoqq_.js → LayoutPicker.stories-DYrG4wtT.js} +1 -1
  118. package/storybook-static/assets/{Listbox-DdUSWuvx.js → Listbox-BL0ioHxs.js} +1 -1
  119. package/storybook-static/assets/{Listbox-C1nug1gi.js → Listbox-BxHmY5ET.js} +1 -1
  120. package/storybook-static/assets/{Listbox.stories-CgXZhffL.js → Listbox.stories-DJyYFh1U.js} +1 -1
  121. package/storybook-static/assets/{Modal-C2JN8byf.js → Modal-Q7o1iqet.js} +1 -1
  122. package/storybook-static/assets/{Modal.stories-CEF1CDMw.js → Modal.stories-DwIrHxPr.js} +1 -1
  123. package/storybook-static/assets/{ModalManagerProvider-DpQegT4s.js → ModalManagerProvider-41HvR5kw.js} +1 -1
  124. package/storybook-static/assets/{MultiSelect-DI65H684.js → MultiSelect-CJesPVwA.js} +1 -1
  125. package/storybook-static/assets/{MultiSelect-4BySiqWq.js → MultiSelect-HPQ3mNkL.js} +1 -1
  126. package/storybook-static/assets/{MultiSelect.stories-BMINO4tp.js → MultiSelect.stories-Bb2GHyNF.js} +1 -1
  127. package/storybook-static/assets/{NoData-BF8QLM-6.js → NoData-CGqnBZTW.js} +1 -1
  128. package/storybook-static/assets/{NotificationsHost-CoKBvP6W.js → NotificationsHost-CwzaWa75.js} +1 -1
  129. package/storybook-static/assets/{NotificationsHost.stories-ABBuJJZn.js → NotificationsHost.stories-CcPBctyV.js} +1 -1
  130. package/storybook-static/assets/{ODataMultiSelect-8jdLzrag.js → ODataMultiSelect-C_M7IJ-E.js} +1 -1
  131. package/storybook-static/assets/{ODataMultiSelect.stories-Bbx2pEhr.js → ODataMultiSelect.stories-CEWZoIYN.js} +1 -1
  132. package/storybook-static/assets/{ODataSelect-CCBMuL_6.js → ODataSelect-CeQ91U4i.js} +1 -1
  133. package/storybook-static/assets/{ODataSelect.stories-IRVdMUYS.js → ODataSelect.stories-OpbcMtd0.js} +1 -1
  134. package/storybook-static/assets/{ODataTreeMultiSelect-CMYSul4g.js → ODataTreeMultiSelect-By-iwUlb.js} +1 -1
  135. package/storybook-static/assets/{ODataTreeMultiSelect.stories-B-7VuEMx.js → ODataTreeMultiSelect.stories-DjediQp3.js} +1 -1
  136. package/storybook-static/assets/{ODataTreeSelect-wABuQQ8m.js → ODataTreeSelect-C4fBiCfR.js} +1 -1
  137. package/storybook-static/assets/{ODataTreeSelect.stories-B4PexyPP.js → ODataTreeSelect.stories-BRVIyV0K.js} +1 -1
  138. package/storybook-static/assets/{OneStepScroller-Bsx2cAbW.js → OneStepScroller-BeOhzxOb.js} +1 -1
  139. package/storybook-static/assets/{Option-Bi34xfha.js → Option-BALI2Izw.js} +1 -1
  140. package/storybook-static/assets/{OptionButton-sAMQ-B-2.js → OptionButton-Cu_hyVYx.js} +1 -1
  141. package/storybook-static/assets/{PeriodSelect-DvbYBRp0.js → PeriodSelect-C0tZpOZ2.js} +1 -1
  142. package/storybook-static/assets/{PeriodSelect-D8M2m7Ae.js → PeriodSelect-D7ZyNQQj.js} +1 -1
  143. package/storybook-static/assets/{PeriodSelect.stories-CF9om3YB.js → PeriodSelect.stories-CaKpWoBI.js} +1 -1
  144. package/storybook-static/assets/{PickerTriggerActions-DQ6Irt2H.js → PickerTriggerActions-CouIkvlG.js} +1 -1
  145. package/storybook-static/assets/Popover-BNl3GC6I.js +2 -0
  146. package/storybook-static/assets/{Popover-CoKI13TR.js → Popover-VojsocpB.js} +1 -1
  147. package/storybook-static/assets/{Popover.stories-D8WTwZ-k.js → Popover.stories-voeYCJAG.js} +1 -1
  148. package/storybook-static/assets/{PresetRangeDateInput-kYlehlXI.js → PresetRangeDateInput-BAsiw0m9.js} +1 -1
  149. package/storybook-static/assets/{PresetRangeDateInput-C8-UkEaY.js → PresetRangeDateInput-DTFvAuEG.js} +1 -1
  150. package/storybook-static/assets/{PresetRangeDateInput.stories-Bw2Olt9n.js → PresetRangeDateInput.stories-BpytrxVn.js} +1 -1
  151. package/storybook-static/assets/{PresetSelect-L0tuYJEl.js → PresetSelect-DqsBg04y.js} +1 -1
  152. package/storybook-static/assets/{README-D5yuEPPv.js → README-6evrAby4.js} +1 -1
  153. package/storybook-static/assets/{README-D_zvxXbp.js → README-822aEKM9.js} +1 -1
  154. package/storybook-static/assets/{README-DdW8haTK.js → README-B2JDHSDg.js} +1 -1
  155. package/storybook-static/assets/{README-ChqY7Icu.js → README-B4L4Qms9.js} +1 -1
  156. package/storybook-static/assets/{README-VcApJaXd.js → README-BH_ofrva.js} +1 -1
  157. package/storybook-static/assets/{README-BxwHKa3w.js → README-BIY0CXzT.js} +1 -1
  158. package/storybook-static/assets/{README-CrYAH16i.js → README-BRJb1GLe.js} +1 -1
  159. package/storybook-static/assets/{README-CO3dUhsD.js → README-BV9yMaZH.js} +1 -1
  160. package/storybook-static/assets/{README-C33_zdBH.js → README-BVJkWNdT.js} +1 -1
  161. package/storybook-static/assets/{README-1v-Ux6-4.js → README-BVZEvH2e.js} +1 -1
  162. package/storybook-static/assets/{README-CZLMmuEJ.js → README-BuA3_CmY.js} +1 -1
  163. package/storybook-static/assets/{README-q3ocfiGy.js → README-BvWWZXkg.js} +1 -1
  164. package/storybook-static/assets/{README-DvMUuU1d.js → README-BvwvQC0S.js} +1 -1
  165. package/storybook-static/assets/{README-BN-M1WU0.js → README-Bwn32UEx.js} +1 -1
  166. package/storybook-static/assets/{README-CFpRXUWW.js → README-C-Pfk84O.js} +1 -1
  167. package/storybook-static/assets/{README-CjqrGvr8.js → README-C78L4rcb.js} +1 -1
  168. package/storybook-static/assets/{README-DIlnpVMH.js → README-C9NwfMMB.js} +1 -1
  169. package/storybook-static/assets/{README-Dp6_DOef.js → README-CBcr-aZ-.js} +1 -1
  170. package/storybook-static/assets/{README-BQsFSC9n.js → README-CFx77m4x.js} +1 -1
  171. package/storybook-static/assets/{README-CXPodKHT.js → README-CGU1FPkG.js} +1 -1
  172. package/storybook-static/assets/{README-Cab4zgqv.js → README-CNGBJoj9.js} +1 -1
  173. package/storybook-static/assets/{README-BocI24Kg.js → README-CNwWDpPA.js} +1 -1
  174. package/storybook-static/assets/{README-BQ2U05OE.js → README-CP8A3pUx.js} +1 -1
  175. package/storybook-static/assets/{README-BrCC1uJU.js → README-CRPSrjud.js} +1 -1
  176. package/storybook-static/assets/{README-Cyb-5mOG.js → README-CSnzw2D-.js} +1 -1
  177. package/storybook-static/assets/{README-NmcS3YJ6.js → README-CZrtJjG5.js} +1 -1
  178. package/storybook-static/assets/{README-gpDcs_LH.js → README-CshGb2DJ.js} +1 -1
  179. package/storybook-static/assets/{README-CDufFsWQ.js → README-CxvHN56L.js} +1 -1
  180. package/storybook-static/assets/{README-B10YW1sd.js → README-D01CDD_h.js} +1 -1
  181. package/storybook-static/assets/{README-CmhWsQkb.js → README-D0tDmHet.js} +1 -1
  182. package/storybook-static/assets/{README-0xG00EW_.js → README-D1eYEpJo.js} +1 -1
  183. package/storybook-static/assets/{README-BzHuSALx.js → README-D2ulcVfy.js} +1 -1
  184. package/storybook-static/assets/{README-B1ksGK8E.js → README-D5JHlt8a.js} +1 -1
  185. package/storybook-static/assets/{README-gft7Uab5.js → README-D6Vv7boA.js} +1 -1
  186. package/storybook-static/assets/{README-CjCfW25k.js → README-D95b9s0-.js} +1 -1
  187. package/storybook-static/assets/{README-xgO81XJN.js → README-DLMl2PNQ.js} +1 -1
  188. package/storybook-static/assets/{README-DBqfDDoK.js → README-DPWMkaF9.js} +1 -1
  189. package/storybook-static/assets/{README-BnVbW7Gs.js → README-DTdq97bt.js} +1 -1
  190. package/storybook-static/assets/{README-UELPBLbA.js → README-DaTftOiF.js} +1 -1
  191. package/storybook-static/assets/{README-BVQt8mtd.js → README-DlSdPLoj.js} +1 -1
  192. package/storybook-static/assets/{README-DZwnGvV1.js → README-DpbDg5ce.js} +1 -1
  193. package/storybook-static/assets/{README-DrwiMWd7.js → README-Dt7VgalJ.js} +1 -1
  194. package/storybook-static/assets/{README-BXPXMULk.js → README-JfTIbTxa.js} +1 -1
  195. package/storybook-static/assets/{README-S2VOLhWx.js → README-KslesuPp.js} +1 -1
  196. package/storybook-static/assets/{README-CHEiSVyW.js → README-RqmpGW_K.js} +1 -1
  197. package/storybook-static/assets/{README-N9wZCeCb.js → README-SmqCd027.js} +1 -1
  198. package/storybook-static/assets/{README-BPWfZ4-n.js → README-V9-IwPwN.js} +1 -1
  199. package/storybook-static/assets/{README-D13Q95J6.js → README-eGS9MpcY.js} +1 -1
  200. package/storybook-static/assets/{README-DlIoOZ58.js → README-pEhV0D6Q.js} +1 -1
  201. package/storybook-static/assets/{README-DIa084ap.js → README-qYd4IxwX.js} +1 -1
  202. package/storybook-static/assets/{README-rfp-yzSZ.js → README-y2sdEYQd.js} +1 -1
  203. package/storybook-static/assets/{README-DSqT3qTl.js → README-ymNGc5K0.js} +1 -1
  204. package/storybook-static/assets/{RadioButton-DJEpCllJ.js → RadioButton-Ba9QfrAy.js} +1 -1
  205. package/storybook-static/assets/{RadioButton-CoPal8pt.js → RadioButton-CnpzlpUJ.js} +1 -1
  206. package/storybook-static/assets/{RadioButton.stories-CrNbB_Qs.js → RadioButton.stories-BnN4pgGe.js} +1 -1
  207. package/storybook-static/assets/{RadioGroup-DBlvBC8z.js → RadioGroup-BykHY9bQ.js} +1 -1
  208. package/storybook-static/assets/{RadioGroup-Dv_q57B4.js → RadioGroup-Snp96mXk.js} +1 -1
  209. package/storybook-static/assets/{RadioGroup.stories-CdafywwL.js → RadioGroup.stories-ElfRHSzd.js} +1 -1
  210. package/storybook-static/assets/{Scrollable-CVZxkb7b.js → Scrollable-CZQNMT37.js} +1 -1
  211. package/storybook-static/assets/{Select-BtuStcTW.js → Select-7gK0WOKA.js} +1 -1
  212. package/storybook-static/assets/{Select-B7fM7XXA.js → Select-DB19StkW.js} +1 -1
  213. package/storybook-static/assets/{Select.stories-D2i9D1wO.js → Select.stories-B-x2u4Ka.js} +1 -1
  214. package/storybook-static/assets/{SerializableSelect-DsjutVwZ.js → SerializableSelect-RdiASBU7.js} +1 -1
  215. package/storybook-static/assets/{SerializableSelect.stories-C4qr93lP.js → SerializableSelect.stories-D3oi1vVq.js} +1 -1
  216. package/storybook-static/assets/{SingleDateTimeInput-jOTDUNrw.js → SingleDateTimeInput-ekp5dih9.js} +1 -1
  217. package/storybook-static/assets/{SingleDateTimeInput-CV1HjRhb.js → SingleDateTimeInput-lU6cGbfx.js} +1 -1
  218. package/storybook-static/assets/{SingleDateTimeInput.stories-yb4i7Se-.js → SingleDateTimeInput.stories-CL-wJh62.js} +1 -1
  219. package/storybook-static/assets/{Slider-DGAxIRgF.js → Slider-BaGjYkeA.js} +1 -1
  220. package/storybook-static/assets/{Slider-DbiTyk2d.js → Slider-TYTl3yDT.js} +1 -1
  221. package/storybook-static/assets/{Slider.stories-BIPqFQgF.js → Slider.stories-B1Q15yer.js} +1 -1
  222. package/storybook-static/assets/{SliderInput-DPmmdNSI.js → SliderInput-D7HC0Qy7.js} +1 -1
  223. package/storybook-static/assets/{SliderInput-DEbF8pTt.js → SliderInput-DQCecLsI.js} +1 -1
  224. package/storybook-static/assets/{SliderInput.stories-DpNI0YBv.js → SliderInput.stories-Dks-x9HE.js} +1 -1
  225. package/storybook-static/assets/{Sortable-BYYO2Rd5.js → Sortable-BNy1ZMbQ.js} +1 -1
  226. package/storybook-static/assets/{Sortable.stories-CAig11WS.js → Sortable.stories-Cb6IiB1t.js} +1 -1
  227. package/storybook-static/assets/{Splitter-k76UJpxB.js → Splitter-DIgl2n1Z.js} +1 -1
  228. package/storybook-static/assets/{Splitter.stories-CuaNuNp7.js → Splitter.stories-BIjaaFzl.js} +1 -1
  229. package/storybook-static/assets/{StateSelect-BSx0a0xn.js → StateSelect-B6gJ8hJa.js} +1 -1
  230. package/storybook-static/assets/{StateSelect-BdvIKDtX.js → StateSelect-zOqdyaQn.js} +1 -1
  231. package/storybook-static/assets/{StateSelect.stories-Cn2k7xLt.js → StateSelect.stories-BO-IgbhM.js} +1 -1
  232. package/storybook-static/assets/{StringToggle.stories-BzYQZVOT.js → StringToggle.stories-D4f7Fbw8.js} +1 -1
  233. package/storybook-static/assets/{Switch-DtsM7AlJ.js → Switch-CJrR8E7p.js} +1 -1
  234. package/storybook-static/assets/{Switch-WXicw9j3.js → Switch-D5xdNKsi.js} +1 -1
  235. package/storybook-static/assets/{Switch.stories-DSJ6cmJH.js → Switch.stories-9rHvE9GC.js} +1 -1
  236. package/storybook-static/assets/{Table-DG3Ysl0M.js → Table-BndDbNw8.js} +1 -1
  237. package/storybook-static/assets/{Table.stories-DZld4Wa8.js → Table.stories-CJCfJUjh.js} +1 -1
  238. package/storybook-static/assets/{Tabs-BUkYwc0R.js → Tabs-CP10ZNq4.js} +1 -1
  239. package/storybook-static/assets/{Tabs.stories-Bxj65iOe.js → Tabs.stories-C9yRAUoL.js} +1 -1
  240. package/storybook-static/assets/{TabsBox-BufsM8ff.js → TabsBox-CF6lsJX9.js} +1 -1
  241. package/storybook-static/assets/{TagInput-ButGKwPX.js → TagInput-CNuIR1Js.js} +1 -1
  242. package/storybook-static/assets/{TagInput.stories-BdBPL9C4.js → TagInput.stories-EHAVYqjD.js} +1 -1
  243. package/storybook-static/assets/{Text-CfVgVnx4.js → Text-Dk57_ZbR.js} +1 -1
  244. package/storybook-static/assets/{Textarea-BlRdt8GB.js → Textarea-BE9dNCqI.js} +1 -1
  245. package/storybook-static/assets/{Textarea-Cw0dpv9O.js → Textarea-C62-_iti.js} +1 -1
  246. package/storybook-static/assets/{Textarea.stories-DIztJwoG.js → Textarea.stories-DKvABJTj.js} +1 -1
  247. package/storybook-static/assets/{TimePanel-BaHjWmQy.js → TimePanel-x3TlepfZ.js} +1 -1
  248. package/storybook-static/assets/{TimePanel.stories-CLhOwXWZ.js → TimePanel.stories-DaZB0D5G.js} +1 -1
  249. package/storybook-static/assets/{Toggle-DS0d4WQL.js → Toggle-BC4e-JyH.js} +1 -1
  250. package/storybook-static/assets/{Toggle-CeEIN_2z.js → Toggle-FZ3jr9eC.js} +1 -1
  251. package/storybook-static/assets/{Toggle.stories-qQruW7gc.js → Toggle.stories-bBbcFQPg.js} +1 -1
  252. package/storybook-static/assets/{TreeMultiSelect-C19YnmWz.js → TreeMultiSelect-BY0kKT3J.js} +1 -1
  253. package/storybook-static/assets/{TreeMultiSelect-xvnFdWRY.js → TreeMultiSelect-BsA8SRFS.js} +1 -1
  254. package/storybook-static/assets/{TreeMultiSelect.stories-CfvfyxYD.js → TreeMultiSelect.stories-CuYZx8Ye.js} +1 -1
  255. package/storybook-static/assets/{TreePickerBase-CtEPKSbm.js → TreePickerBase-Cy2h0kPW.js} +1 -1
  256. package/storybook-static/assets/{TreeSelect-BnLvixZ5.js → TreeSelect-CurHAVQd.js} +1 -1
  257. package/storybook-static/assets/{TreeSelect-CBkH-AEV.js → TreeSelect-DFQ3bXsn.js} +1 -1
  258. package/storybook-static/assets/{TreeSelect.stories-Ee033WTq.js → TreeSelect.stories-CWIRI6gz.js} +1 -1
  259. package/storybook-static/assets/{TreeTable-Bj-wmrBR.js → TreeTable-cuDoXkMK.js} +1 -1
  260. package/storybook-static/assets/{TreeTable.stories-BIOrVNfx.js → TreeTable.stories-C2QEYgml.js} +1 -1
  261. package/storybook-static/assets/{blocks-DFW8ghoN.js → blocks-Bc4j9MF9.js} +3 -3
  262. package/storybook-static/assets/{check-7oGyK4Lh.js → check-BgL33jfp.js} +1 -1
  263. package/storybook-static/assets/{chevron-down-BBUXCskk.js → chevron-down-R3Jdqzrn.js} +1 -1
  264. package/storybook-static/assets/{chevron-left-C9RcDRYm.js → chevron-left-mLWJvyEZ.js} +1 -1
  265. package/storybook-static/assets/{chevron-right-Bz2dxTCT.js → chevron-right-CPZF-d1L.js} +1 -1
  266. package/storybook-static/assets/{chunk-W22LQPXL-BFc9wUX9.js → chunk-W22LQPXL-C62lx28p.js} +1 -1
  267. package/storybook-static/assets/{circle-alert-DxODWI3W.js → circle-alert-F3LNsip3.js} +1 -1
  268. package/storybook-static/assets/{circle-check-Dt98F3HY.js → circle-check-B-PCEcP6.js} +1 -1
  269. package/storybook-static/assets/{components-C9PL8fDL.js → components-EKvM9m9t.js} +3 -3
  270. package/storybook-static/assets/contextMenu-DXU_cSyO.js +2 -0
  271. package/storybook-static/assets/{download-Cicfr3Yq.js → download-_gpfOcUw.js} +1 -1
  272. package/storybook-static/assets/floating-ui.react-DWG5_l50.js +1 -0
  273. package/storybook-static/assets/{foundationApi-Czup-_8C.js → foundationApi-Bf1RvCy6.js} +1 -1
  274. package/storybook-static/assets/{foundationLib-CvOU0kH6.js → foundationLib-BqFATCRV.js} +1 -1
  275. package/storybook-static/assets/{hooks-D1LxuSK1.js → hooks-CVQS96HT.js} +2 -2
  276. package/storybook-static/assets/iframe-C-PXkEVa.js +1 -0
  277. package/storybook-static/assets/{iframe-CB9pifff.js → iframe-DB62bexO.js} +3 -3
  278. package/storybook-static/assets/{info-H3kL_ony.js → info-_jHhDMxQ.js} +1 -1
  279. package/storybook-static/assets/{odata-DZHQPho8.js → odata-CSE2o56k.js} +1 -1
  280. package/storybook-static/assets/{odataStoryFixtures-Dv4IyA2E.js → odataStoryFixtures-CnD5g3U7.js} +1 -1
  281. package/storybook-static/assets/{react-D9ony7ur.js → react-CKPG354p.js} +1 -1
  282. package/storybook-static/assets/{refresh-cw-C1wTVwsA.js → refresh-cw-gwn6yl4E.js} +1 -1
  283. package/storybook-static/assets/{settings-2-CYAxQ8JZ.js → settings-2-CI-uItnb.js} +1 -1
  284. package/storybook-static/assets/{sortable-D3dOipv-.js → sortable-D9YLnSq2.js} +1 -1
  285. package/storybook-static/assets/{syntaxhighlighter-QEQV7K2Y-BEAJBt17.js → syntaxhighlighter-QEQV7K2Y-D1Qwwr3j.js} +1 -1
  286. package/storybook-static/assets/{trash-2-DFYiqA7Y.js → trash-2-C8HzUkes.js} +1 -1
  287. package/storybook-static/assets/{triangle-alert-DT66rGfn.js → triangle-alert-CiqmLtau.js} +1 -1
  288. package/storybook-static/assets/{useODataSelectBase-SGoINsPA.js → useODataSelectBase-CIQ0s0Kh.js} +1 -1
  289. package/storybook-static/assets/{useODataTreeData-Bd0rjQ8C.js → useODataTreeData-DrVyNvfl.js} +1 -1
  290. package/storybook-static/assets/{usePickerQuery-jINMRgys.js → usePickerQuery-DgtD9ozg.js} +1 -1
  291. package/storybook-static/assets/{usePickerTriggerController-C0xxhsv5.js → usePickerTriggerController-CeQZVvq6.js} +1 -1
  292. package/storybook-static/assets/{x-DgcBZVW3.js → x-fspKtNh2.js} +1 -1
  293. package/storybook-static/iframe.html +2 -2
  294. package/storybook-static/project.json +1 -1
  295. package/dist/chunks/context-menu-CCAr_R-t.js.map +0 -1
  296. package/storybook-static/assets/ContextMenu-BvDbyzAk.js +0 -1
  297. package/storybook-static/assets/FloatingPopover-Cmz412EM.js +0 -1
  298. package/storybook-static/assets/Popover-Y5ZKg3I8.js +0 -2
  299. package/storybook-static/assets/contextMenu-BOrF5Hzw.js +0 -2
  300. package/storybook-static/assets/floating-ui.react-j2x4WoIe.js +0 -1
  301. package/storybook-static/assets/iframe-BhNcQkWA.js +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"modal-Bmd9iBw1.js","names":[],"sources":["../../src/modal/Modal.module.scss","../../src/modal/modalMotion.ts","../../src/modal/useModalManager.ts","../../src/modal/Modal.tsx","../../src/modal/ModalManagerProvider.tsx"],"sourcesContent":["@use \"@/styles/mixins\" as *;\n\n.modal {\n\t--modal-border-radius: 0;\n\n\tdisplay: grid;\n\tgrid-auto-rows: auto 1fr;\n\n\tposition: fixed;\n\tinset: 0;\n\tmargin: auto;\n\tz-index: var(--z-modal);\n\t\n\tborder: var(--border);\n\tborder-radius: var(--modal-border-radius);\n\tbackground-color: var(--surface-1);\n\tbox-shadow: var(--shadow-lg);\n\n\t&:not(:last-child) {\n\t\tpointer-events: none;\n\t\tfilter: grayscale(0.5) opacity(0.75);\n\t\t// opacity: 0.5;\n\t}\n\n\twidth: 100%;\n\theight: 100%;\n\tmax-width: none;\n\tmax-height: none;\n}\n\n.header {\n\tdisplay: flex;\n\talign-items: center;\n\tjustify-content: space-between;\n\tbackground-color: var(--surface-2);\n\tborder-top-left-radius: var(--modal-border-radius);\n\tborder-top-right-radius: var(--modal-border-radius);\n}\n\n.headerText {\n\tmargin: 0;\n\tpadding-inline: var(--space-md);\n\tfont-size: var(--font-size-md);\n\tfont-variation-settings: \"wght\" 600;\n}\n\n.headerButton {\n\tmargin-block: var(--space-xs);\n\tmargin-inline: var(--space-sm);\n\tflex: 0;\n}\n\n.body {\n\toverflow: hidden;\n\tborder-bottom-left-radius: var(--modal-border-radius);\n\tborder-bottom-right-radius: var(--modal-border-radius);\n}\n\n@include mobile-above {\n\t.modal {\n\t\theight: fit-content;\n\t\tmax-height: calc(100dvh - var(--space-lg));\n\t\t--modal-border-radius: var(--radius-md);\n\t\t\n\n\t\t&.sm {\n\t\t\tmax-width: min(30em, 93dvw);\n\t\t}\n\n\t\t&.md {\n\t\t\tmax-width: min(50em, 93dvw);\n\t\t}\n\n\t\t&.lg {\n\t\t\tmax-width: min(70em, 93dvw);\n\t\t}\n\n\t\t&.xl {\n\t\t\tmax-width: min(80em, 93dvw);\n\t\t}\n\n\t\t&.xxl {\n\t\t\twidth: 95dvw;\n\t\t\theight: 92dvh;\n\t\t\tmax-width: none;\n\t\t\tmax-height: none;\n\t\t}\n\n\t\t&.inside {\n\t\t\twidth: 100%;\n\t\t\theight: 100%;\n\t\t\tmax-width: none;\n\t\t\tmax-height: none;\n\n\t\t\t--modal-border-radius: 0;\n\t\t}\n\t}\n}\n","import { type Transition, type Variants } from \"motion/react\";\n\n/**\n * Варианты задают единый спокойный переход для появления и удаления modal-панели.\n * Конфигурация приватна для primitive: потребители управляют только состоянием `isOpen`.\n */\nexport const modalMotionVariants = {\n\thidden: {\n\t\topacity: 0,\n\t\tscale: 0.96,\n\t\ty: 12\n\t},\n\tvisible: {\n\t\topacity: 1,\n\t\tscale: 1,\n\t\ty: 0\n\t}\n} satisfies Variants;\n\n/** Переход сохраняет отзывчивое открытие и дает exit-анимации завершиться до удаления portal content. */\nexport const modalMotionTransition = {\n\tduration: 0.18,\n\tease: [0.22, 1, 0.36, 1]\n} satisfies Transition;\n\n/** При системном reduced-motion остается только мгновенная смена видимости без пространственного движения. */\nexport const reducedModalMotionTransition = {\n\tduration: 0\n} satisfies Transition;\n","import { createContext, useContext } from \"react\";\n\nexport const ModalManagerContext = createContext<{\n\tmodals: string[];\n\topenModal: (id: string) => void;\n\tcloseModal: (id: string) => void;\n\tisTopModal: (id: string) => boolean;\n}>({\n\tmodals: [],\n\topenModal: () => {},\n\tcloseModal: () => {},\n\tisTopModal: () => false\n});\n\nexport const useModalManager = () => useContext(ModalManagerContext);\n","import React, { Children, useEffect, useId, useRef } from \"react\";\n\nimport { getOrCreatePortalRoot, useEscapeDismiss, useOverlayFocus } from \"@ryuzaki13/react-foundation-lib/dom\";\nimport { cn } from \"@ryuzaki13/react-foundation-lib/utils\";\nimport { X } from \"lucide-react\";\nimport { AnimatePresence, motion, useReducedMotion } from \"motion/react\";\nimport { createPortal } from \"react-dom\";\n\nimport { Button } from \"../button\";\nimport { FlexContainer } from \"../flex\";\nimport { GridContainer } from \"../grid\";\nimport { Scrollable } from \"../misc\";\n\nimport styles from \"./Modal.module.scss\";\nimport { modalMotionTransition, modalMotionVariants, reducedModalMotionTransition } from \"./modalMotion\";\nimport { ModalSize } from \"./types\";\nimport { useModalManager } from \"./useModalManager\";\n\n// Подкомпоненты\nexport interface ModalCompositionProps {\n\tchildren: React.ReactNode;\n\tclassName?: string;\n}\n\nexport const ModalToolbar: React.FC<ModalCompositionProps> = ({ children, className }) => {\n\treturn <div className={cn(\"surface2 paddingMd borderBottom\", className)}>{children}</div>;\n};\nModalToolbar.displayName = \"Modal.Toolbar\";\n\nexport const ModalContent: React.FC<ModalCompositionProps & { scrollable?: boolean }> = ({ children, className, scrollable }) => {\n\treturn (\n\t\t<div className={cn(\"paddingMd h100 overflowHidden\", className)}>\n\t\t\t{scrollable ? <Scrollable className=\"h100\">{children}</Scrollable> : children}\n\t\t</div>\n\t);\n};\nModalContent.displayName = \"Modal.Content\";\n\nexport const ModalFooter: React.FC<ModalCompositionProps> = ({ children, className }) => {\n\treturn (\n\t\t<div className={cn(\"surface2 borderTop paddingMd\", className)}>\n\t\t\t<FlexContainer gap=\"sm\" align=\"center\" justify=\"end\">\n\t\t\t\t{children}\n\t\t\t</FlexContainer>\n\t\t</div>\n\t);\n};\nModalFooter.displayName = \"Modal.Footer\";\n\ntype ToolbarElement = React.ReactElement<ModalCompositionProps, typeof ModalToolbar>;\ntype ContentElement = React.ReactElement<ModalCompositionProps, typeof ModalContent>;\ntype FooterElement = React.ReactElement<ModalCompositionProps, typeof ModalFooter>;\n\ntype ModalChildren =\n\t[ToolbarElement, ContentElement, FooterElement] | [ToolbarElement, ContentElement] | [ContentElement, FooterElement] | ContentElement;\n\nexport interface ModalProps {\n\t/** Открыто ли модальное окно */\n\tisOpen?: boolean;\n\t/** Заголовок */\n\ttitle?: string;\n\t/** Размер модального окна */\n\tsize?: keyof typeof ModalSize;\n\theight?: string;\n\t/** Обработчик закрытия */\n\tonClose: () => void;\n\tchildren: ModalChildren;\n}\n\nexport const Modal: React.FC<ModalProps> = ({ isOpen, title, size = \"sm\", height, onClose, children }) => {\n\tconst modalId = useId();\n\tconst titleId = useId();\n\n\tconst { modals, openModal, closeModal, isTopModal } = useModalManager();\n\tconst shouldReduceMotion = useReducedMotion();\n\tconst restoreFocusTargetRef = useRef<HTMLElement | null>(null);\n\tconst restoreFocusAnimationFrameRef = useRef(0);\n\n\t/**\n\t * Если provider менеджера не подключен, считаем одиночную модалку активной,\n\t * иначе логика Escape/focus trap никогда не включится.\n\t */\n\tconst isActive = isOpen && (modals.length === 0 || isTopModal(modalId));\n\n\tuseEffect(() => {\n\t\tif (isOpen) {\n\t\t\trestoreFocusTargetRef.current = document.activeElement instanceof HTMLElement ? document.activeElement : null;\n\t\t}\n\t}, [isOpen]);\n\n\tconst modalRef = useOverlayFocus<HTMLDivElement>({ active: isOpen || false, trapFocus: true, restoreFocus: false });\n\n\tuseEscapeDismiss({\n\t\tactive: isActive || false,\n\t\tonDismiss: onClose,\n\t\tcontainerRef: modalRef\n\t});\n\n\tuseEffect(() => {\n\t\tif (isOpen) {\n\t\t\topenModal(modalId);\n\t\t}\n\t}, [isOpen, modalId, openModal]);\n\n\tuseEffect(() => {\n\t\treturn () => {\n\t\t\twindow.cancelAnimationFrame(restoreFocusAnimationFrameRef.current);\n\t\t\tcloseModal(modalId);\n\t\t};\n\t}, [closeModal, modalId]);\n\n\tfunction handleExitComplete() {\n\t\tcloseModal(modalId);\n\t\tconst restoreFocusTarget = restoreFocusTargetRef.current;\n\n\t\t/**\n\t\t * Менеджер снимает inert в passive effect после обновления стека.\n\t\t * Следующий animation frame гарантирует, что trigger снова доступен для фокуса.\n\t\t */\n\t\trestoreFocusAnimationFrameRef.current = window.requestAnimationFrame(() => {\n\t\t\tif (restoreFocusTarget?.isConnected) {\n\t\t\t\trestoreFocusTarget.focus();\n\t\t\t}\n\t\t\trestoreFocusTargetRef.current = null;\n\t\t});\n\t}\n\n\tconst modalRoot = getOrCreatePortalRoot(\"modal-root\");\n\n\tif (!modalRoot) {\n\t\treturn null;\n\t}\n\n\tlet toolbar: React.ReactNode = null;\n\tlet content: React.ReactNode = null;\n\tlet footer: React.ReactNode = null;\n\n\tconst childArray = Children.toArray(children) as (ToolbarElement | ContentElement | FooterElement)[];\n\n\tfor (const child of childArray) {\n\t\tconst typeName = child.type.displayName;\n\n\t\tswitch (typeName) {\n\t\t\tcase ModalToolbar.displayName:\n\t\t\t\tif (toolbar) throw new Error(\"Modal: duplicate <Toolbar> found\");\n\t\t\t\ttoolbar = child; //.props.children;\n\t\t\t\tbreak;\n\t\t\tcase ModalFooter.displayName:\n\t\t\t\tif (footer) throw new Error(\"Modal: duplicate <Footer> found\");\n\t\t\t\tfooter = child; //props.children;\n\t\t\t\tbreak;\n\t\t\tcase ModalContent.displayName:\n\t\t\t\tif (content) throw new Error(\"Modal: duplicate <Content> found\");\n\t\t\t\tcontent = child; //.props.children;\n\t\t\t\tbreak;\n\t\t}\n\t}\n\n\treturn createPortal(\n\t\t<AnimatePresence onExitComplete={handleExitComplete}>\n\t\t\t{isOpen ? (\n\t\t\t\t<motion.div\n\t\t\t\t\tref={modalRef}\n\t\t\t\t\tclassName={cn(styles.modal, styles[size])}\n\t\t\t\t\tstyle={{ height }}\n\t\t\t\t\trole=\"dialog\"\n\t\t\t\t\taria-modal=\"true\"\n\t\t\t\t\taria-labelledby={titleId}\n\t\t\t\t\taria-describedby={`${titleId}-content`}\n\t\t\t\t\tinitial=\"hidden\"\n\t\t\t\t\tanimate=\"visible\"\n\t\t\t\t\texit=\"hidden\"\n\t\t\t\t\tvariants={modalMotionVariants}\n\t\t\t\t\ttransition={shouldReduceMotion ? reducedModalMotionTransition : modalMotionTransition}>\n\t\t\t\t\t<div className={cn(styles.header, toolbar ? \"\" : \"borderBottom\")}>\n\t\t\t\t\t\t<h3 className={styles.headerText} id={titleId}>\n\t\t\t\t\t\t\t{title}\n\t\t\t\t\t\t</h3>\n\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\ticon={<X />}\n\t\t\t\t\t\t\tclassName={styles.headerButton}\n\t\t\t\t\t\t\tvariant={\"ghost\"}\n\t\t\t\t\t\t\taria-label={\"Закрыть модальное окно\"}\n\t\t\t\t\t\t\tonClick={onClose}\n\t\t\t\t\t\t/>\n\t\t\t\t\t</div>\n\n\t\t\t\t\t<GridContainer\n\t\t\t\t\t\tid={`${titleId}-content`}\n\t\t\t\t\t\ttemplateRows={`${toolbar ? \"auto\" : \"\"} 1fr ${footer ? \"auto\" : \"\"}`.trim()}\n\t\t\t\t\t\t// gap=\"md\"\n\t\t\t\t\t\tclassName={styles.body}>\n\t\t\t\t\t\t{toolbar}\n\t\t\t\t\t\t{content}\n\t\t\t\t\t\t{footer}\n\t\t\t\t\t</GridContainer>\n\t\t\t\t</motion.div>\n\t\t\t) : null}\n\t\t</AnimatePresence>,\n\t\tmodalRoot\n\t);\n};\n","// ModalManagerContext.tsx\nimport React, { useCallback, useEffect, useRef, useState } from \"react\";\n\nimport { ModalManagerContext } from \"./useModalManager\";\n\nexport interface ModalManagerProviderProps {\n\tchildren: React.ReactNode;\n\t/** Компенсирует исчезновение скроллбара правым padding у body. */\n\tcompensateScrollbar?: boolean;\n}\n\n/**\n * Провайдер для централизованного управления стеком модальных окон. Дает вложенным компонентам доступ к открытию и закрытию модалок через контекст.\n */\nexport function ModalManagerProvider({ children, compensateScrollbar = false }: ModalManagerProviderProps) {\n\tconst [modals, setModals] = useState<string[]>([]);\n\tconst prevModalsLength = useRef(0);\n\tconst scrollbarWidth = useRef(0);\n\tconst bodyPaddingRight = useRef(\"\");\n\tconst isScrollbarCompensated = useRef(false);\n\n\tconst openModal = useCallback((id: string) => {\n\t\tsetModals((prev) => [...prev, id]);\n\t}, []);\n\n\tconst closeModal = useCallback((id: string) => {\n\t\tsetModals((prev) => prev.filter((mid) => mid !== id));\n\t}, []);\n\n\tconst isTopModal = useCallback(\n\t\t(id: string) => {\n\t\t\treturn modals[modals.length - 1] === id;\n\t\t},\n\t\t[modals]\n\t);\n\n\tuseEffect(() => {\n\t\tconst wasEmpty = prevModalsLength.current === 0;\n\n\t\tif (wasEmpty && modals.length > 0) {\n\t\t\t// первая модалка открыта — ставим стили\n\t\t\tconst scrollY = window.scrollY;\n\t\t\tconst appRoot = document.querySelector(\"#app-root\");\n\t\t\tscrollbarWidth.current = Math.max(0, window.innerWidth - document.documentElement.clientWidth);\n\t\t\tbodyPaddingRight.current = document.body.style.paddingRight;\n\n\t\t\tdocument.body.style.position = \"fixed\";\n\t\t\tdocument.body.style.top = `-${scrollY}px`;\n\t\t\tdocument.body.style.width = \"100%\";\n\n\t\t\tif (compensateScrollbar) {\n\t\t\t\tdocument.body.style.paddingRight = `${scrollbarWidth.current}px`;\n\t\t\t\tisScrollbarCompensated.current = true;\n\t\t\t}\n\n\t\t\tappRoot?.setAttribute(\"inert\", \"true\");\n\n\t\t\tprevModalsLength.current = modals.length;\n\t\t\treturn;\n\t\t}\n\n\t\tif (!wasEmpty && modals.length > 0 && compensateScrollbar !== isScrollbarCompensated.current) {\n\t\t\tdocument.body.style.paddingRight = compensateScrollbar ? `${scrollbarWidth.current}px` : bodyPaddingRight.current;\n\t\t\tisScrollbarCompensated.current = compensateScrollbar;\n\t\t}\n\n\t\tif (!wasEmpty && modals.length === 0) {\n\t\t\t// последняя модалка закрыта — снимаем стили\n\t\t\tconst appRoot = document.querySelector(\"#app-root\");\n\t\t\tconst scrollY = parseInt(document.body.style.top || \"0\") * -1;\n\n\t\t\tdocument.body.style.position = \"\";\n\t\t\tdocument.body.style.top = \"\";\n\t\t\tdocument.body.style.width = \"\";\n\n\t\t\tif (isScrollbarCompensated.current) {\n\t\t\t\tdocument.body.style.paddingRight = bodyPaddingRight.current;\n\t\t\t\tisScrollbarCompensated.current = false;\n\t\t\t}\n\n\t\t\tappRoot?.removeAttribute(\"inert\");\n\n\t\t\twindow.scrollTo({ top: scrollY, left: 0, behavior: \"instant\" });\n\t\t}\n\n\t\tprevModalsLength.current = modals.length;\n\t}, [compensateScrollbar, modals.length]);\n\n\treturn <ModalManagerContext.Provider value={{ modals, openModal, closeModal, isTopModal }}>{children}</ModalManagerContext.Provider>;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;GCMa,IAAsB;CAClC,QAAQ;EACP,SAAS;EACT,OAAO;EACP,GAAG;CACJ;CACA,SAAS;EACR,SAAS;EACT,OAAO;EACP,GAAG;CACJ;AACD,GAGa,IAAwB;CACpC,UAAU;CACV,MAAM;EAAC;EAAM;EAAG;EAAM;CAAC;AACxB,GAGa,IAA+B,EAC3C,UAAU,EACX,GC1Ba,IAAsB,EAKhC;CACF,QAAQ,CAAC;CACT,iBAAiB,CAAC;CAClB,kBAAkB,CAAC;CACnB,kBAAkB;AACnB,CAAC,GAEY,UAAwB,EAAW,CAAmB,GCUtD,KAAiD,EAAE,aAAU,mBAClE,kBAAC,OAAD;CAAK,WAAW,EAAG,mCAAmC,CAAS;CAAI;AAAc,CAAA;AAEzF,EAAa,cAAc;AAE3B,IAAa,KAA4E,EAAE,aAAU,cAAW,oBAE9G,kBAAC,OAAD;CAAK,WAAW,EAAG,iCAAiC,CAAS;CAC3D,UAAA,IAAa,kBAAC,GAAD;EAAY,WAAU;EAAQ;CAAqB,CAAA,IAAI;AACjE,CAAA;AAGP,EAAa,cAAc;AAE3B,IAAa,KAAgD,EAAE,aAAU,mBAEvE,kBAAC,OAAD;CAAK,WAAW,EAAG,gCAAgC,CAAS;CAC3D,UAAA,kBAAC,GAAD;EAAe,KAAI;EAAK,OAAM;EAAS,SAAQ;EAC7C;CACa,CAAA;AACX,CAAA;AAGP,EAAY,cAAc;AAsB1B,IAAa,KAA+B,EAAE,WAAQ,UAAO,UAAO,MAAM,WAAQ,YAAS,kBAAe;CACzG,IAAM,IAAU,EAAM,GAChB,IAAU,EAAM,GAEhB,EAAE,WAAQ,cAAW,eAAY,kBAAe,EAAgB,GAChE,IAAqB,EAAiB,GACtC,IAAwB,E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ources":["../../src/modal/Modal.module.scss","../../src/modal/modalMotion.ts","../../src/modal/useModalManager.ts","../../src/modal/Modal.tsx","../../src/modal/ModalManagerProvider.tsx"],"sourcesContent":["@use \"@/styles/mixins\" as *;\n\n.modal {\n\t--modal-border-radius: 0;\n\n\tdisplay: grid;\n\tgrid-auto-rows: auto 1fr;\n\n\tposition: fixed;\n\tinset: 0;\n\tmargin: auto;\n\tz-index: var(--z-modal);\n\t\n\tborder: var(--border);\n\tborder-radius: var(--modal-border-radius);\n\tbackground-color: var(--surface-1);\n\tbox-shadow: var(--shadow-lg);\n\n\t&:not(:last-child) {\n\t\tpointer-events: none;\n\t\tfilter: grayscale(0.5) opacity(0.75);\n\t\t// opacity: 0.5;\n\t}\n\n\twidth: 100%;\n\theight: 100%;\n\tmax-width: none;\n\tmax-height: none;\n}\n\n.header {\n\tdisplay: flex;\n\talign-items: center;\n\tjustify-content: space-between;\n\tbackground-color: var(--surface-2);\n\tborder-top-left-radius: var(--modal-border-radius);\n\tborder-top-right-radius: var(--modal-border-radius);\n}\n\n.headerText {\n\tmargin: 0;\n\tpadding-inline: var(--space-md);\n\tfont-size: var(--font-size-md);\n\tfont-variation-settings: \"wght\" 600;\n}\n\n.headerButton {\n\tmargin-block: var(--space-xs);\n\tmargin-inline: var(--space-sm);\n\tflex: 0;\n}\n\n.body {\n\toverflow: hidden;\n\tborder-bottom-left-radius: var(--modal-border-radius);\n\tborder-bottom-right-radius: var(--modal-border-radius);\n}\n\n@include mobile-above {\n\t.modal {\n\t\theight: fit-content;\n\t\tmax-height: calc(100dvh - var(--space-lg));\n\t\t--modal-border-radius: var(--radius-md);\n\t\t\n\n\t\t&.sm {\n\t\t\tmax-width: min(30em, 93dvw);\n\t\t}\n\n\t\t&.md {\n\t\t\tmax-width: min(50em, 93dvw);\n\t\t}\n\n\t\t&.lg {\n\t\t\tmax-width: min(70em, 93dvw);\n\t\t}\n\n\t\t&.xl {\n\t\t\tmax-width: min(80em, 93dvw);\n\t\t}\n\n\t\t&.xxl {\n\t\t\twidth: 95dvw;\n\t\t\theight: 92dvh;\n\t\t\tmax-width: none;\n\t\t\tmax-height: none;\n\t\t}\n\n\t\t&.inside {\n\t\t\twidth: 100%;\n\t\t\theight: 100%;\n\t\t\tmax-width: none;\n\t\t\tmax-height: none;\n\n\t\t\t--modal-border-radius: 0;\n\t\t}\n\t}\n}\n","import { type Transition, type Variants } from \"motion/react\";\n\n/**\n * Варианты задают единый спокойный переход для появления и удаления modal-панели.\n * Конфигурация приватна для primitive: потребители управляют только состоянием `isOpen`.\n */\nexport const modalMotionVariants = {\n\thidden: {\n\t\topacity: 0,\n\t\tscale: 0.96,\n\t\ty: 12\n\t},\n\tvisible: {\n\t\topacity: 1,\n\t\tscale: 1,\n\t\ty: 0\n\t}\n} satisfies Variants;\n\n/** Переход сохраняет отзывчивое открытие и дает exit-анимации завершиться до удаления portal content. */\nexport const modalMotionTransition = {\n\tduration: 0.18,\n\tease: [0.22, 1, 0.36, 1]\n} satisfies Transition;\n\n/** При системном reduced-motion остается только мгновенная смена видимости без пространственного движения. */\nexport const reducedModalMotionTransition = {\n\tduration: 0\n} satisfies Transition;\n","import { createContext, useContext } from \"react\";\n\nexport const ModalManagerContext = createContext<{\n\tmodals: string[];\n\topenModal: (id: string) => void;\n\tcloseModal: (id: string) => void;\n\tisTopModal: (id: string) => boolean;\n}>({\n\tmodals: [],\n\topenModal: () => {},\n\tcloseModal: () => {},\n\tisTopModal: () => false\n});\n\nexport const useModalManager = () => useContext(ModalManagerContext);\n","import React, { Children, useEffect, useId, useRef } from \"react\";\n\nimport { getOrCreatePortalRoot, useEscapeDismiss, useOverlayFocus } from \"@ryuzaki13/react-foundation-lib/dom\";\nimport { cn } from \"@ryuzaki13/react-foundation-lib/utils\";\nimport { X } from \"lucide-react\";\nimport { AnimatePresence, motion, useReducedMotion } from \"motion/react\";\nimport { createPortal } from \"react-dom\";\n\nimport { Button } from \"../button\";\nimport { FlexContainer } from \"../flex\";\nimport { GridContainer } from \"../grid\";\nimport { Scrollable } from \"../misc\";\n\nimport styles from \"./Modal.module.scss\";\nimport { modalMotionTransition, modalMotionVariants, reducedModalMotionTransition } from \"./modalMotion\";\nimport { ModalSize } from \"./types\";\nimport { useModalManager } from \"./useModalManager\";\n\n// Подкомпоненты\nexport interface ModalCompositionProps {\n\tchildren: React.ReactNode;\n\tclassName?: string;\n}\n\nexport const ModalToolbar: React.FC<ModalCompositionProps> = ({ children, className }) => {\n\treturn <div className={cn(\"surface2 paddingMd borderBottom\", className)}>{children}</div>;\n};\nModalToolbar.displayName = \"Modal.Toolbar\";\n\nexport const ModalContent: React.FC<ModalCompositionProps & { scrollable?: boolean }> = ({ children, className, scrollable }) => {\n\treturn (\n\t\t<div className={cn(\"paddingMd h100 overflowHidden\", className)}>\n\t\t\t{scrollable ? <Scrollable className=\"h100\">{children}</Scrollable> : children}\n\t\t</div>\n\t);\n};\nModalContent.displayName = \"Modal.Content\";\n\nexport const ModalFooter: React.FC<ModalCompositionProps> = ({ children, className }) => {\n\treturn (\n\t\t<div className={cn(\"surface2 borderTop paddingMd\", className)}>\n\t\t\t<FlexContainer gap=\"sm\" align=\"center\" justify=\"end\">\n\t\t\t\t{children}\n\t\t\t</FlexContainer>\n\t\t</div>\n\t);\n};\nModalFooter.displayName = \"Modal.Footer\";\n\ntype ToolbarElement = React.ReactElement<ModalCompositionProps, typeof ModalToolbar>;\ntype ContentElement = React.ReactElement<ModalCompositionProps, typeof ModalContent>;\ntype FooterElement = React.ReactElement<ModalCompositionProps, typeof ModalFooter>;\n\ntype ModalChildren =\n\t[ToolbarElement, ContentElement, FooterElement] | [ToolbarElement, ContentElement] | [ContentElement, FooterElement] | ContentElement;\n\nexport interface ModalProps {\n\t/** Открыто ли модальное окно */\n\tisOpen?: boolean;\n\t/** Заголовок */\n\ttitle?: string;\n\t/** Размер модального окна */\n\tsize?: keyof typeof ModalSize;\n\theight?: string;\n\t/** Обработчик закрытия */\n\tonClose: () => void;\n\tchildren: ModalChildren;\n}\n\nexport const Modal: React.FC<ModalProps> = ({ isOpen, title, size = \"sm\", height, onClose, children }) => {\n\tconst modalId = useId();\n\tconst titleId = useId();\n\n\tconst { modals, openModal, closeModal, isTopModal } = useModalManager();\n\tconst shouldReduceMotion = useReducedMotion();\n\tconst restoreFocusTargetRef = useRef<HTMLElement | null>(null);\n\tconst restoreFocusAnimationFrameRef = useRef(0);\n\n\t/**\n\t * Если provider менеджера не подключен, считаем одиночную модалку активной,\n\t * иначе логика Escape/focus trap никогда не включится.\n\t */\n\tconst isActive = isOpen && (modals.length === 0 || isTopModal(modalId));\n\n\tuseEffect(() => {\n\t\tif (isOpen) {\n\t\t\trestoreFocusTargetRef.current = document.activeElement instanceof HTMLElement ? document.activeElement : null;\n\t\t}\n\t}, [isOpen]);\n\n\tconst modalRef = useOverlayFocus<HTMLDivElement>({ active: isOpen || false, trapFocus: true, restoreFocus: false });\n\n\tuseEscapeDismiss({\n\t\tactive: isActive || false,\n\t\tonDismiss: onClose,\n\t\tcontainerRef: modalRef\n\t});\n\n\tuseEffect(() => {\n\t\tif (isOpen) {\n\t\t\topenModal(modalId);\n\t\t}\n\t}, [isOpen, modalId, openModal]);\n\n\tuseEffect(() => {\n\t\treturn () => {\n\t\t\twindow.cancelAnimationFrame(restoreFocusAnimationFrameRef.current);\n\t\t\tcloseModal(modalId);\n\t\t};\n\t}, [closeModal, modalId]);\n\n\tfunction handleExitComplete() {\n\t\tcloseModal(modalId);\n\t\tconst restoreFocusTarget = restoreFocusTargetRef.current;\n\n\t\t/**\n\t\t * Менеджер снимает inert в passive effect после обновления стека.\n\t\t * Следующий animation frame гарантирует, что trigger снова доступен для фокуса.\n\t\t */\n\t\trestoreFocusAnimationFrameRef.current = window.requestAnimationFrame(() => {\n\t\t\tif (restoreFocusTarget?.isConnected) {\n\t\t\t\trestoreFocusTarget.focus();\n\t\t\t}\n\t\t\trestoreFocusTargetRef.current = null;\n\t\t});\n\t}\n\n\tconst modalRoot = getOrCreatePortalRoot(\"modal-root\");\n\n\tif (!modalRoot) {\n\t\treturn null;\n\t}\n\n\tlet toolbar: React.ReactNode = null;\n\tlet content: React.ReactNode = null;\n\tlet footer: React.ReactNode = null;\n\n\tconst childArray = Children.toArray(children) as (ToolbarElement | ContentElement | FooterElement)[];\n\n\tfor (const child of childArray) {\n\t\tconst typeName = child.type.displayName;\n\n\t\tswitch (typeName) {\n\t\t\tcase ModalToolbar.displayName:\n\t\t\t\tif (toolbar) throw new Error(\"Modal: duplicate <Toolbar> found\");\n\t\t\t\ttoolbar = child; //.props.children;\n\t\t\t\tbreak;\n\t\t\tcase ModalFooter.displayName:\n\t\t\t\tif (footer) throw new Error(\"Modal: duplicate <Footer> found\");\n\t\t\t\tfooter = child; //props.children;\n\t\t\t\tbreak;\n\t\t\tcase ModalContent.displayName:\n\t\t\t\tif (content) throw new Error(\"Modal: duplicate <Content> found\");\n\t\t\t\tcontent = child; //.props.children;\n\t\t\t\tbreak;\n\t\t}\n\t}\n\n\treturn createPortal(\n\t\t<AnimatePresence onExitComplete={handleExitComplete}>\n\t\t\t{isOpen ? (\n\t\t\t\t<motion.div\n\t\t\t\t\tref={modalRef}\n\t\t\t\t\tclassName={cn(styles.modal, styles[size])}\n\t\t\t\t\tstyle={{ height }}\n\t\t\t\t\trole=\"dialog\"\n\t\t\t\t\taria-modal=\"true\"\n\t\t\t\t\taria-labelledby={titleId}\n\t\t\t\t\taria-describedby={`${titleId}-content`}\n\t\t\t\t\tinitial=\"hidden\"\n\t\t\t\t\tanimate=\"visible\"\n\t\t\t\t\texit=\"hidden\"\n\t\t\t\t\tvariants={modalMotionVariants}\n\t\t\t\t\ttransition={shouldReduceMotion ? reducedModalMotionTransition : modalMotionTransition}>\n\t\t\t\t\t<div className={cn(styles.header, toolbar ? \"\" : \"borderBottom\")}>\n\t\t\t\t\t\t<h3 className={styles.headerText} id={titleId}>\n\t\t\t\t\t\t\t{title}\n\t\t\t\t\t\t</h3>\n\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\ticon={<X />}\n\t\t\t\t\t\t\tclassName={styles.headerButton}\n\t\t\t\t\t\t\tvariant={\"ghost\"}\n\t\t\t\t\t\t\taria-label={\"Закрыть модальное окно\"}\n\t\t\t\t\t\t\tonClick={onClose}\n\t\t\t\t\t\t/>\n\t\t\t\t\t</div>\n\n\t\t\t\t\t<GridContainer\n\t\t\t\t\t\tid={`${titleId}-content`}\n\t\t\t\t\t\ttemplateRows={`${toolbar ? \"auto\" : \"\"} 1fr ${footer ? \"auto\" : \"\"}`.trim()}\n\t\t\t\t\t\t// gap=\"md\"\n\t\t\t\t\t\tclassName={styles.body}>\n\t\t\t\t\t\t{toolbar}\n\t\t\t\t\t\t{content}\n\t\t\t\t\t\t{footer}\n\t\t\t\t\t</GridContainer>\n\t\t\t\t</motion.div>\n\t\t\t) : null}\n\t\t</AnimatePresence>,\n\t\tmodalRoot\n\t);\n};\n","// ModalManagerContext.tsx\nimport React, { useCallback, useEffect, useRef, useState } from \"react\";\n\nimport { ModalManagerContext } from \"./useModalManager\";\n\nexport interface ModalManagerProviderProps {\n\tchildren: React.ReactNode;\n\t/** Компенсирует исчезновение скроллбара правым padding у body. */\n\tcompensateScrollbar?: boolean;\n}\n\n/**\n * Провайдер для централизованного управления стеком модальных окон. Дает вложенным компонентам доступ к открытию и закрытию модалок через контекст.\n */\nexport function ModalManagerProvider({ children, compensateScrollbar = false }: ModalManagerProviderProps) {\n\tconst [modals, setModals] = useState<string[]>([]);\n\tconst prevModalsLength = useRef(0);\n\tconst scrollbarWidth = useRef(0);\n\tconst bodyPaddingRight = useRef(\"\");\n\tconst isScrollbarCompensated = useRef(false);\n\n\tconst openModal = useCallback((id: string) => {\n\t\tsetModals((prev) => [...prev, id]);\n\t}, []);\n\n\tconst closeModal = useCallback((id: string) => {\n\t\tsetModals((prev) => prev.filter((mid) => mid !== id));\n\t}, []);\n\n\tconst isTopModal = useCallback(\n\t\t(id: string) => {\n\t\t\treturn modals[modals.length - 1] === id;\n\t\t},\n\t\t[modals]\n\t);\n\n\tuseEffect(() => {\n\t\tconst wasEmpty = prevModalsLength.current === 0;\n\n\t\tif (wasEmpty && modals.length > 0) {\n\t\t\t// первая модалка открыта — ставим стили\n\t\t\tconst scrollY = window.scrollY;\n\t\t\tconst appRoot = document.querySelector(\"#app-root\");\n\t\t\tscrollbarWidth.current = Math.max(0, window.innerWidth - document.documentElement.clientWidth);\n\t\t\tbodyPaddingRight.current = document.body.style.paddingRight;\n\n\t\t\tdocument.body.style.position = \"fixed\";\n\t\t\tdocument.body.style.top = `-${scrollY}px`;\n\t\t\tdocument.body.style.width = \"100%\";\n\n\t\t\tif (compensateScrollbar) {\n\t\t\t\tdocument.body.style.paddingRight = `${scrollbarWidth.current}px`;\n\t\t\t\tisScrollbarCompensated.current = true;\n\t\t\t}\n\n\t\t\tappRoot?.setAttribute(\"inert\", \"true\");\n\n\t\t\tprevModalsLength.current = modals.length;\n\t\t\treturn;\n\t\t}\n\n\t\tif (!wasEmpty && modals.length > 0 && compensateScrollbar !== isScrollbarCompensated.current) {\n\t\t\tdocument.body.style.paddingRight = compensateScrollbar ? `${scrollbarWidth.current}px` : bodyPaddingRight.current;\n\t\t\tisScrollbarCompensated.current = compensateScrollbar;\n\t\t}\n\n\t\tif (!wasEmpty && modals.length === 0) {\n\t\t\t// последняя модалка закрыта — снимаем стили\n\t\t\tconst appRoot = document.querySelector(\"#app-root\");\n\t\t\tconst scrollY = parseInt(document.body.style.top || \"0\") * -1;\n\n\t\t\tdocument.body.style.position = \"\";\n\t\t\tdocument.body.style.top = \"\";\n\t\t\tdocument.body.style.width = \"\";\n\n\t\t\tif (isScrollbarCompensated.current) {\n\t\t\t\tdocument.body.style.paddingRight = bodyPaddingRight.current;\n\t\t\t\tisScrollbarCompensated.current = false;\n\t\t\t}\n\n\t\t\tappRoot?.removeAttribute(\"inert\");\n\n\t\t\twindow.scrollTo({ top: scrollY, left: 0, behavior: \"instant\" });\n\t\t}\n\n\t\tprevModalsLength.current = modals.length;\n\t}, [compensateScrollbar, modals.length]);\n\n\treturn <ModalManagerContext.Provider value={{ modals, openModal, closeModal, isTopModal }}>{children}</ModalManagerContext.Provider>;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;GCMa,IAAsB;CAClC,QAAQ;EACP,SAAS;EACT,OAAO;EACP,GAAG;CACJ;CACA,SAAS;EACR,SAAS;EACT,OAAO;EACP,GAAG;CACJ;AACD,GAGa,IAAwB;CACpC,UAAU;CACV,MAAM;EAAC;EAAM;EAAG;EAAM;CAAC;AACxB,GAGa,IAA+B,EAC3C,UAAU,EACX,GC1Ba,IAAsB,EAKhC;CACF,QAAQ,CAAC;CACT,iBAAiB,CAAC;CAClB,kBAAkB,CAAC;CACnB,kBAAkB;AACnB,CAAC,GAEY,UAAwB,EAAW,CAAmB,GCUtD,KAAiD,EAAE,aAAU,mBAClE,kBAAC,OAAD;CAAK,WAAW,EAAG,mCAAmC,CAAS;CAAI;AAAc,CAAA;AAEzF,EAAa,cAAc;AAE3B,IAAa,KAA4E,EAAE,aAAU,cAAW,oBAE9G,kBAAC,OAAD;CAAK,WAAW,EAAG,iCAAiC,CAAS;CAC3D,UAAA,IAAa,kBAAC,GAAD;EAAY,WAAU;EAAQ;CAAqB,CAAA,IAAI;AACjE,CAAA;AAGP,EAAa,cAAc;AAE3B,IAAa,KAAgD,EAAE,aAAU,mBAEvE,kBAAC,OAAD;CAAK,WAAW,EAAG,gCAAgC,CAAS;CAC3D,UAAA,kBAAC,GAAD;EAAe,KAAI;EAAK,OAAM;EAAS,SAAQ;EAC7C;CACa,CAAA;AACX,CAAA;AAGP,EAAY,cAAc;AAsB1B,IAAa,KAA+B,EAAE,WAAQ,UAAO,UAAO,MAAM,WAAQ,YAAS,kBAAe;CACzG,IAAM,IAAU,EAAM,GAChB,IAAU,EAAM,GAEhB,EAAE,WAAQ,cAAW,eAAY,kBAAe,EAAgB,GAChE,IAAqB,EAAiB,GACtC,IAAwB,EAA2B,IAAI,GACvD,IAAgC,EAAO,CAAC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createContext as n, useCallback as r, useContext as i, useEffect as a, useLayoutEffect as o, useRef as s, useState as c } from "react";
3
3
  import { cn as l } from "@ryuzaki13/react-foundation-lib/utils";
4
- import { FloatingPortal as u, arrow as d, autoUpdate as f, flip as p, offset as m, shift as h, size as g, useDismiss as _, useFloating as v, useHover as y, useInteractions as b, useRole as x } from "@floating-ui/react";
5
- import { useClickOutside as S, useEscapeDismiss as C, useOverlayFocus as w } from "@ryuzaki13/react-foundation-lib/dom";
6
- import { Fragment as T, jsx as E, jsxs as D } from "react/jsx-runtime";
7
- import { createMissingContextError as O } from "@ryuzaki13/react-foundation-lib/error";
8
- import { createPortal as k } from "react-dom";
4
+ import { FloatingPortal as u, arrow as d, autoUpdate as f, flip as p, offset as m, shift as h, size as g, useDismiss as _, useFloating as v, useFocus as y, useHover as b, useInteractions as x, useRole as S } from "@floating-ui/react";
5
+ import { useClickOutside as C, useEscapeDismiss as w, useOverlayFocus as T } from "@ryuzaki13/react-foundation-lib/dom";
6
+ import { Fragment as E, jsx as D, jsxs as O } from "react/jsx-runtime";
7
+ import { createMissingContextError as k } from "@ryuzaki13/react-foundation-lib/error";
8
+ import { createPortal as A } from "react-dom";
9
9
  //#region src/popover/lib/applyPopoverAvailableSize.ts
10
- function A({ availableWidth: e, availableHeight: t, floating: n }) {
10
+ function j({ availableWidth: e, availableHeight: t, floating: n }) {
11
11
  n.style.setProperty("--popover-available-width", `${Math.max(0, e)}px`), n.style.setProperty("--popover-available-height", `${Math.max(0, t)}px`);
12
12
  }
13
- var j = {
13
+ var M = {
14
14
  popover: "JK2Y7t",
15
15
  primary: "_5QtpCJ",
16
16
  secondary: "hZuysP"
17
- }, M = n(null);
18
- function N() {
19
- let e = i(M);
20
- if (!e) throw O({
17
+ }, N = n(null);
18
+ function P() {
19
+ let e = i(N);
20
+ if (!e) throw k({
21
21
  hookName: "usePopoverContext",
22
22
  providerName: "Popover"
23
23
  });
@@ -25,10 +25,10 @@ function N() {
25
25
  }
26
26
  //#endregion
27
27
  //#region src/popover/components/PopoverContent.tsx
28
- var P = ({ children: t, onClose: n, closeOnOutside: i = !0, closeOnEscape: a = !0, disableOutsideClick: o = !1, background: c = "secondary" }) => {
29
- let { open: d, setOpen: f, refs: p, floatingStyles: m, middlewareData: h, placement: g, arrowRef: _ } = N(), v = s(null), y = r((e) => {
28
+ var F = ({ children: t, onClose: n, closeOnOutside: i = !0, closeOnEscape: a = !0, disableOutsideClick: o = !1, background: c = "secondary" }) => {
29
+ let { open: d, setOpen: f, refs: p, floatingStyles: m, middlewareData: h, placement: g, arrowRef: _ } = P(), v = s(null), y = r((e) => {
30
30
  v.current = e, p.setFloating(e);
31
- }, [p]), b = w({
31
+ }, [p]), b = T({
32
32
  active: d,
33
33
  initialFocus: "container",
34
34
  restoreFocus: !0,
@@ -40,13 +40,13 @@ var P = ({ children: t, onClose: n, closeOnOutside: i = !0, closeOnEscape: a = !
40
40
  n,
41
41
  d
42
42
  ]);
43
- C({
43
+ w({
44
44
  active: d,
45
45
  enabled: a,
46
46
  onDismiss: x,
47
47
  containerRef: b
48
48
  });
49
- let T = r(() => {
49
+ let S = r(() => {
50
50
  !d || o || i && x();
51
51
  }, [
52
52
  d,
@@ -54,21 +54,21 @@ var P = ({ children: t, onClose: n, closeOnOutside: i = !0, closeOnEscape: a = !
54
54
  i,
55
55
  x
56
56
  ]);
57
- return S([p.floating, p.reference], T), d ? /* @__PURE__ */ E(u, { children: /* @__PURE__ */ D("div", {
57
+ return C([p.floating, p.reference], S), d ? /* @__PURE__ */ D(u, { children: /* @__PURE__ */ O("div", {
58
58
  ref: y,
59
59
  style: m,
60
- className: l(j.popover, j[c]),
60
+ className: l(M.popover, M[c]),
61
61
  role: "dialog",
62
62
  "aria-modal": "true",
63
63
  tabIndex: -1,
64
- children: [typeof t == "function" ? t({ setClose: x }) : t, /* @__PURE__ */ E(e, {
64
+ children: [typeof t == "function" ? t({ setClose: x }) : t, /* @__PURE__ */ D(e, {
65
65
  ref: _,
66
66
  placement: g,
67
67
  middlewareData: h
68
68
  })]
69
69
  }) }) : null;
70
- }, F = ({ passive: e, children: n }) => {
71
- let { open: i, setOpen: a, refs: o } = N(), s = r((t) => {
70
+ }, I = ({ passive: e, children: n }) => {
71
+ let { open: i, setOpen: a, refs: o } = P(), s = r((t) => {
72
72
  n.props.onClick && n.props.onClick(t), !t.defaultPrevented && (t.preventDefault(), t.stopPropagation(), !e && a((e) => !e));
73
73
  }, [
74
74
  n,
@@ -80,7 +80,7 @@ var P = ({ children: t, onClose: n, closeOnOutside: i = !0, closeOnEscape: a = !
80
80
  "aria-expanded": i,
81
81
  onClick: s
82
82
  });
83
- }, I = 16, L = Object.assign(({ children: e, open: t, defaultOpen: n, onOpenChange: i, placement: a = "bottom" }) => {
83
+ }, L = 16, R = Object.assign(({ children: e, open: t, defaultOpen: n, onOpenChange: i, placement: a = "bottom" }) => {
84
84
  let [o, l] = c(n ?? !1), u = t !== void 0, _ = u ? t : o, y = r((e) => {
85
85
  let t = typeof e == "function" ? e(_) : e;
86
86
  u || l(t), i?.(t);
@@ -94,12 +94,12 @@ var P = ({ children: t, onClose: n, closeOnOutside: i = !0, closeOnEscape: a = !
94
94
  placement: a,
95
95
  middleware: [
96
96
  m(8),
97
- p({ padding: I }),
98
- h({ padding: I }),
97
+ p({ padding: L }),
98
+ h({ padding: L }),
99
99
  g({
100
- padding: I,
100
+ padding: L,
101
101
  apply({ availableWidth: e, availableHeight: t, elements: n }) {
102
- A({
102
+ j({
103
103
  availableWidth: e,
104
104
  availableHeight: t,
105
105
  floating: n.floating
@@ -110,7 +110,7 @@ var P = ({ children: t, onClose: n, closeOnOutside: i = !0, closeOnEscape: a = !
110
110
  ],
111
111
  whileElementsMounted: f
112
112
  });
113
- return /* @__PURE__ */ E(M.Provider, {
113
+ return /* @__PURE__ */ D(N.Provider, {
114
114
  value: {
115
115
  open: _,
116
116
  setOpen: y,
@@ -123,9 +123,9 @@ var P = ({ children: t, onClose: n, closeOnOutside: i = !0, closeOnEscape: a = !
123
123
  children: e
124
124
  });
125
125
  }, {
126
- Trigger: F,
127
- Content: P
128
- }), R = {
126
+ Trigger: I,
127
+ Content: F
128
+ }), z = {
129
129
  tooltipPanel: "sZ0x6w",
130
130
  tooltip: "_538Ejd",
131
131
  negative: "fqciCO",
@@ -133,10 +133,10 @@ var P = ({ children: t, onClose: n, closeOnOutside: i = !0, closeOnEscape: a = !
133
133
  error: "bpGNoX",
134
134
  warning: "tYnRg-",
135
135
  success: "_8lflEh"
136
- }, z = ({ content: t, children: n, openOnHover: r = !0, placement: i = "bottom", openDelay: a = 200, closeDelay: u = 100, maxWidth: g, state: S, tooltip: C, positionUpdateKey: w }) => {
137
- let [O, A] = c(!1), j = s(null), { refs: M, floatingStyles: N, middlewareData: P, context: F, placement: I, update: L } = v({
138
- open: O,
139
- onOpenChange: A,
136
+ }, B = ({ content: t, children: n, openOnHover: r = !0, placement: i = "bottom", openDelay: a = 200, closeDelay: u = 100, maxWidth: g, state: C, tooltip: w, positionUpdateKey: T }) => {
137
+ let [k, j] = c(!1), M = s(null), { refs: N, floatingStyles: P, middlewareData: F, context: I, placement: L, update: R } = v({
138
+ open: k,
139
+ onOpenChange: j,
140
140
  placement: i,
141
141
  middleware: [
142
142
  m(8),
@@ -150,53 +150,54 @@ var P = ({ children: t, onClose: n, closeOnOutside: i = !0, closeOnEscape: a = !
150
150
  }),
151
151
  h({ padding: 8 }),
152
152
  d({
153
- element: j,
153
+ element: M,
154
154
  padding: 8
155
155
  })
156
156
  ],
157
157
  whileElementsMounted: f
158
158
  });
159
159
  o(() => {
160
- O && L();
160
+ k && R();
161
161
  }, [
162
- O,
163
- w,
164
- L
162
+ k,
163
+ T,
164
+ R
165
165
  ]);
166
- let z = y(F, {
166
+ let B = b(I, {
167
167
  enabled: r,
168
168
  move: !1,
169
169
  delay: {
170
170
  open: a,
171
171
  close: u
172
172
  }
173
- }), B = _(F), V = x(F), { getReferenceProps: H, getFloatingProps: U } = b([
174
- z,
173
+ }), V = y(I, { enabled: r }), H = _(I), U = S(I), { getReferenceProps: W, getFloatingProps: G } = x([
175
174
  B,
176
- V
175
+ V,
176
+ H,
177
+ U
177
178
  ]);
178
- return /* @__PURE__ */ D(T, { children: [/* @__PURE__ */ E("span", {
179
- ref: M.setReference,
180
- ...H(),
179
+ return /* @__PURE__ */ O(E, { children: [/* @__PURE__ */ D("span", {
180
+ ref: N.setReference,
181
+ ...W(),
181
182
  style: { lineHeight: 1 },
182
183
  children: n
183
- }), O && k(/* @__PURE__ */ D("div", {
184
- ref: M.setFloating,
184
+ }), k && A(/* @__PURE__ */ O("div", {
185
+ ref: N.setFloating,
185
186
  style: {
186
- ...N,
187
+ ...P,
187
188
  zIndex: "var(--z-tooltip)",
188
189
  maxWidth: g ? `${g}em` : void 0
189
190
  },
190
- ...U(),
191
+ ...G(),
191
192
  role: "tooltip",
192
- className: l(R.tooltipPanel, C && R.tooltip, S && R[S]),
193
- children: [t, /* @__PURE__ */ E(e, {
194
- ref: j,
195
- placement: I,
196
- middlewareData: P
193
+ className: l(z.tooltipPanel, w && z.tooltip, C && z[C]),
194
+ children: [t, /* @__PURE__ */ D(e, {
195
+ ref: M,
196
+ placement: L,
197
+ middlewareData: F
197
198
  })]
198
199
  }), document.body)] });
199
- }, B = ({ x: t, y: n, children: r }) => {
200
+ }, V = ({ x: t, y: n, children: r }) => {
200
201
  let i = s(null), { refs: o, floatingStyles: c, middlewareData: l, placement: u } = v({
201
202
  strategy: "absolute",
202
203
  placement: "top",
@@ -223,15 +224,15 @@ var P = ({ children: t, onClose: n, closeOnOutside: i = !0, closeOnEscape: a = !
223
224
  t,
224
225
  n,
225
226
  o
226
- ]), /* @__PURE__ */ D("div", {
227
+ ]), /* @__PURE__ */ O("div", {
227
228
  ref: o.setFloating,
228
229
  style: {
229
230
  ...c,
230
231
  position: "absolute",
231
232
  pointerEvents: "none"
232
233
  },
233
- className: R.tooltip,
234
- children: [r, /* @__PURE__ */ E(e, {
234
+ className: z.tooltip,
235
+ children: [r, /* @__PURE__ */ D(e, {
235
236
  ref: i,
236
237
  placement: u,
237
238
  middlewareData: l
@@ -239,6 +240,6 @@ var P = ({ children: t, onClose: n, closeOnOutside: i = !0, closeOnEscape: a = !
239
240
  });
240
241
  };
241
242
  //#endregion
242
- export { P as a, F as i, z as n, N as o, L as r, B as t };
243
+ export { F as a, I as i, B as n, P as o, R as r, V as t };
243
244
 
244
- //# sourceMappingURL=popover-BMboZXoQ.js.map
245
+ //# sourceMappingURL=popover-Bne-Ljbs.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"popover-BMboZXoQ.js","names":[],"sources":["../../src/popover/lib/applyPopoverAvailableSize.ts","../../src/popover/components/Popover.module.scss","../../src/popover/components/PopoverContext.tsx","../../src/popover/components/PopoverContent.tsx","../../src/popover/components/PopoverTrigger.tsx","../../src/popover/components/Popover.tsx","../../src/popover/Popover.module.scss","../../src/popover/FloatingPopover.tsx","../../src/popover/FloatingTooltip.tsx"],"sourcesContent":["type ApplyPopoverAvailableSizeOptions = {\n\treadonly availableWidth: number;\n\treadonly availableHeight: number;\n\treadonly floating: HTMLElement;\n};\n\n/**\n * Передаёт вычисленную Floating UI доступную область самому popover через CSS-переменные.\n * Потребитель может совместить эти границы со своим размером и режимом прокрутки,\n * не дублируя `size()` middleware и правила clipping context.\n */\nexport function applyPopoverAvailableSize({ availableWidth, availableHeight, floating }: ApplyPopoverAvailableSizeOptions) {\n\tfloating.style.setProperty(\"--popover-available-width\", `${Math.max(0, availableWidth)}px`);\n\tfloating.style.setProperty(\"--popover-available-height\", `${Math.max(0, availableHeight)}px`);\n}\n",".popover {\n\tpadding: var(--space-sm);\n\t// background-image: radial-gradient(var(--surface-0) 50%, var(--surface-1) 100%);\n\n\tborder: var(--border-width) solid var(--border-1);\n\tborder-radius: var(--radius-sm);\n\tcolor: var(--content-0);\n\n\tfilter: drop-shadow(var(--shadow-md));\n\n\tz-index: var(--z-popover);\n\n\t&.primary {\n\t\tbackground-color: var(--surface-0);\n\t}\n\n\t&.secondary {\n\t\tbackground-color: var(--surface-1);\n\t}\n}\n","import React, { createContext, useContext } from \"react\";\n\nimport { Placement, useFloating } from \"@floating-ui/react\";\nimport { createMissingContextError } from \"@ryuzaki13/react-foundation-lib/error\";\n\ninterface PopoverContextValue {\n\topen: boolean;\n\tsetOpen: React.Dispatch<React.SetStateAction<boolean>>;\n\trefs: ReturnType<typeof useFloating>[\"refs\"];\n\tfloatingStyles: React.CSSProperties;\n\tplacement: Placement;\n\tmiddlewareData: ReturnType<typeof useFloating>[\"middlewareData\"];\n\tarrowRef: React.RefObject<HTMLDivElement | null>;\n}\n\nexport const PopoverContext = createContext<PopoverContextValue | null>(null);\n\nexport function usePopoverContext() {\n\tconst context = useContext(PopoverContext);\n\tif (!context) {\n\t\tthrow createMissingContextError({\n\t\t\thookName: \"usePopoverContext\",\n\t\t\tproviderName: \"Popover\"\n\t\t});\n\t}\n\treturn context;\n}\n","import React, { useCallback, useRef } from \"react\";\n\nimport { FloatingPortal } from \"@floating-ui/react\";\nimport { useClickOutside, useEscapeDismiss, useOverlayFocus } from \"@ryuzaki13/react-foundation-lib/dom\";\nimport { cn } from \"@ryuzaki13/react-foundation-lib/utils\";\n\nimport { TooltipArrow } from \"../../floating-arrow\";\n\nimport styles from \"./Popover.module.scss\";\nimport { usePopoverContext } from \"./PopoverContext\";\n\nexport interface PopoverContentProps {\n\tchildren: React.ReactNode | ((ctx: { setClose: () => void }) => React.ReactNode);\n\tonClose?: () => void;\n\tcloseOnOutside?: boolean;\n\tcloseOnEscape?: boolean;\n\tdisableOutsideClick?: boolean;\n\tbackground?: \"primary\" | \"secondary\";\n}\n\n/**\n * Содержимое Popover, отображаемое в портале.\n */\nexport const PopoverContent: React.FC<PopoverContentProps> = ({\n\tchildren,\n\tonClose,\n\tcloseOnOutside = true,\n\tcloseOnEscape = true,\n\tdisableOutsideClick = false,\n\tbackground = \"secondary\"\n}) => {\n\tconst { open, setOpen, refs, floatingStyles, middlewareData, placement, arrowRef } = usePopoverContext();\n\tconst floatingElementRef = useRef<HTMLDivElement | null>(null);\n\tconst setFloating = useCallback(\n\t\t(node: HTMLDivElement | null) => {\n\t\t\tfloatingElementRef.current = node;\n\t\t\trefs.setFloating(node);\n\t\t},\n\t\t[refs]\n\t);\n\n\tconst floatingRef = useOverlayFocus<HTMLDivElement>({\n\t\tactive: open,\n\t\tinitialFocus: \"container\",\n\t\trestoreFocus: true,\n\t\tcontainerRef: floatingElementRef\n\t});\n\n\tconst setClose = useCallback(() => {\n\t\tif (!open) return;\n\t\tsetOpen(false);\n\t\tonClose?.();\n\t}, [setOpen, onClose, open]);\n\n\tuseEscapeDismiss({\n\t\tactive: open,\n\t\tenabled: closeOnEscape,\n\t\tonDismiss: setClose,\n\t\tcontainerRef: floatingRef as React.RefObject<HTMLElement | null>\n\t});\n\n\tconst outsideClose = useCallback(() => {\n\t\tif (!open || disableOutsideClick) return;\n\t\tif (closeOnOutside) setClose();\n\t}, [open, disableOutsideClick, closeOnOutside, setClose]);\n\n\tuseClickOutside([refs.floating as React.RefObject<HTMLElement>, refs.reference as React.RefObject<HTMLElement>], outsideClose);\n\n\tif (!open) return null;\n\n\treturn (\n\t\t<FloatingPortal>\n\t\t\t<div\n\t\t\t\tref={setFloating}\n\t\t\t\tstyle={floatingStyles}\n\t\t\t\tclassName={cn(styles.popover, styles[background])}\n\t\t\t\trole=\"dialog\"\n\t\t\t\taria-modal=\"true\"\n\t\t\t\ttabIndex={-1}>\n\t\t\t\t{typeof children === \"function\" ? children({ setClose }) : children}\n\t\t\t\t<TooltipArrow ref={arrowRef} placement={placement} middlewareData={middlewareData} />\n\t\t\t</div>\n\t\t</FloatingPortal>\n\t);\n};\n","import React, { cloneElement, useCallback } from \"react\";\n\nimport { usePopoverContext } from \"./PopoverContext\";\n\nexport interface PopoverTriggerProps {\n\tpassive?: true;\n\tchildren: React.ReactElement<React.HTMLAttributes<Element> & { ref?: React.Ref<Element> }>;\n}\n\nexport const PopoverTrigger: React.FC<PopoverTriggerProps> = ({ passive, children }) => {\n\tconst { open, setOpen, refs } = usePopoverContext();\n\n\tconst handleClick = useCallback(\n\t\t(e: React.MouseEvent) => {\n\t\t\tif (children.props.onClick) {\n\t\t\t\tchildren.props.onClick(e);\n\t\t\t}\n\t\t\tif (e.defaultPrevented) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\te.preventDefault();\n\t\t\te.stopPropagation();\n\n\t\t\tif (passive) return;\n\n\t\t\tsetOpen((v) => !v);\n\t\t},\n\t\t[children, setOpen, passive]\n\t);\n\n\treturn cloneElement(children as React.JSX.Element, {\n\t\tref: refs.setReference,\n\t\t\"aria-expanded\": open,\n\t\tonClick: handleClick\n\t});\n};\n","/* eslint-disable react-refresh/only-export-components */\nimport React, { useCallback, useRef, useState } from \"react\";\n\nimport { arrow, autoUpdate, flip, offset, Placement, shift, size as floatingSize, useFloating } from \"@floating-ui/react\";\n\nimport { applyPopoverAvailableSize } from \"../lib/applyPopoverAvailableSize\";\n\nimport { PopoverContent } from \"./PopoverContent\";\nimport { PopoverContext } from \"./PopoverContext\";\nimport { PopoverTrigger } from \"./PopoverTrigger\";\n\nconst POPOVER_VIEWPORT_PADDING = 16;\n\nexport interface PopoverProps {\n\tchildren: React.ReactNode;\n\tplacement?: Placement;\n\topen?: boolean;\n\tdefaultOpen?: boolean;\n\tonOpenChange?: (open: boolean) => void;\n}\n\n/**\n * Контролируемый Popover.\n * Используется в связке с Popover.Trigger и Popover.Content.\n */\nconst PopoverRoot: React.FC<PopoverProps> = ({ children, open: controlledOpen, defaultOpen, onOpenChange, placement = \"bottom\" }) => {\n\tconst [uncontrolledOpen, setUncontrolledOpen] = useState(defaultOpen ?? false);\n\n\tconst isControlled = controlledOpen !== undefined;\n\tconst open = isControlled ? controlledOpen : uncontrolledOpen;\n\tconst setOpen = useCallback<React.Dispatch<React.SetStateAction<boolean>>>(\n\t\t(value) => {\n\t\t\tconst next = typeof value === \"function\" ? value(open) : value;\n\t\t\tif (!isControlled) setUncontrolledOpen(next);\n\t\t\tonOpenChange?.(next);\n\t\t},\n\t\t[isControlled, onOpenChange, open]\n\t);\n\n\tconst arrowRef = useRef<HTMLDivElement | null>(null);\n\n\tconst {\n\t\trefs,\n\t\tfloatingStyles,\n\t\tmiddlewareData,\n\t\tplacement: actualPlacement\n\t} = useFloating({\n\t\topen,\n\t\tonOpenChange: setOpen,\n\t\tplacement,\n\t\tmiddleware: [\n\t\t\toffset(8),\n\t\t\tflip({ padding: POPOVER_VIEWPORT_PADDING }),\n\t\t\tshift({ padding: POPOVER_VIEWPORT_PADDING }),\n\t\t\tfloatingSize({\n\t\t\t\tpadding: POPOVER_VIEWPORT_PADDING,\n\t\t\t\tapply({ availableWidth, availableHeight, elements }) {\n\t\t\t\t\tapplyPopoverAvailableSize({ availableWidth, availableHeight, floating: elements.floating });\n\t\t\t\t}\n\t\t\t}),\n\t\t\t// eslint-disable-next-line react-hooks/refs\n\t\t\tarrow({ element: arrowRef.current })\n\t\t],\n\t\twhileElementsMounted: autoUpdate\n\t});\n\n\treturn (\n\t\t<PopoverContext.Provider value={{ open, setOpen, refs, floatingStyles, placement: actualPlacement, middlewareData, arrowRef }}>\n\t\t\t{children}\n\t\t</PopoverContext.Provider>\n\t);\n};\n\n/**\n * Композиционное API:\n * <Popover>\n * <Popover.Trigger />\n * <Popover.Content />\n * </Popover>\n */\nexport const Popover = Object.assign(PopoverRoot, {\n\tTrigger: PopoverTrigger,\n\tContent: PopoverContent\n});\n",".tooltipPanel {\n\tpadding: var(--space-sm);\n\t// background-image: radial-gradient(var(--surface-0) 50%, var(--surface-1) 100%);\n\tbackground-color: var(--surface-1);\n\tborder: var(--border-width) solid var(--border-2);\n\tborder-radius: var(--radius-sm);\n\tcolor: var(--content-0);\n\n\tfilter: drop-shadow(var(--shadow-sm));\n\n\t&.negative {\n\t\t--border-1: var(--content-0);\n\n\t\tbackground-color: var(--content-0);\n\t\tborder-color: var(--border-1);\n\t\tcolor: var(--surface-1);\n\t}\n\n\t&.information {\n\t\t--border-1: var(--status-info-text);\n\n\t\tbackground-color: var(--status-info-text);\n\t\tborder-color: var(--status-info-text);\n\t\tcolor: var(--status-info-on-fill);\n\t}\n\n\t&.error {\n\t\t--border-1: var(--status-error-text);\n\n\t\tbackground-color: var(--status-error-text);\n\t\tborder-color: var(--status-error-text);\n\t\tcolor: var(--status-error-on-fill);\n\t}\n\n\t&.warning {\n\t\t--border-1: var(--status-warning-text);\n\n\t\tbackground-color: var(--status-warning-text);\n\t\tborder-color: var(--status-warning-text);\n\t\tcolor: var(--status-warning-on-fill);\n\t}\n\n\t&.success {\n\t\t--border-1: var(--status-success-text);\n\n\t\tbackground-color: var(--status-success-text);\n\t\tborder-color: var(--status-success-text);\n\t\tcolor: var(--status-success-on-fill);\n\t}\n}\n\n.tooltip {\n\tz-index: var(--z-tooltip);\n\tpointer-events: none;\n\n\ttext-align: initial;\n\tfont-size: var(--font-size-sm);\n\tfont-style: normal;\n\tfont-weight: 500;\n\tfont-variation-settings: \"wght\" 500;\n\tline-height: var(--line-height);\n\n\t@extend .tooltipPanel;\n}\n","/* eslint-disable react-hooks/refs */\nimport React, { useLayoutEffect, useRef, useState } from \"react\";\n\nimport {\n\tarrow,\n\tautoUpdate,\n\tflip,\n\toffset,\n\tPlacement,\n\tshift,\n\tuseDismiss,\n\tuseFloating,\n\tuseHover,\n\tuseInteractions,\n\tuseRole\n} from \"@floating-ui/react\";\nimport { cn } from \"@ryuzaki13/react-foundation-lib/utils\";\nimport { createPortal } from \"react-dom\";\n\nimport { FloatingArrow } from \"../floating-arrow/FloatingArrow\";\n\nimport styles from \"./Popover.module.scss\";\n\ninterface FloatingPopoverProps {\n\tcontent: React.ReactNode;\n\tchildren: React.ReactNode;\n\topenOnHover?: boolean;\n\tplacement?: Placement;\n\topenDelay?: number;\n\tcloseDelay?: number;\n\tmaxWidth?: number;\n\tstate?: \"information\" | \"error\" | \"warning\" | \"success\" | \"negative\";\n\ttooltip?: true;\n\t/**\n\t * Изменяется вместе с CSS-координатой trigger, когда её изменение не отслеживается `autoUpdate`.\n\t * После commit React выполняется повторный расчёт позиции открытой floating-панели.\n\t */\n\tpositionUpdateKey?: unknown;\n}\n\nexport const FloatingPopover: React.FC<FloatingPopoverProps> = ({\n\tcontent,\n\tchildren,\n\topenOnHover = true,\n\tplacement = \"bottom\",\n\topenDelay = 200,\n\tcloseDelay = 100,\n\tmaxWidth,\n\tstate,\n\ttooltip,\n\tpositionUpdateKey\n}) => {\n\tconst [open, setOpen] = useState(false);\n\tconst arrowRef = useRef<HTMLDivElement>(null);\n\n\tconst {\n\t\trefs,\n\t\tfloatingStyles,\n\t\tmiddlewareData,\n\t\tcontext,\n\t\tplacement: computedPlacement,\n\t\tupdate\n\t} = useFloating({\n\t\topen,\n\t\tonOpenChange: setOpen,\n\t\tplacement,\n\t\tmiddleware: [\n\t\t\toffset(8),\n\t\t\tflip({ fallbackAxisSideDirection: \"end\", fallbackPlacements: [\"top\", \"right\", \"bottom\"] }),\n\t\t\tshift({ padding: 8 }),\n\t\t\tarrow({ element: arrowRef, padding: 8 })\n\t\t],\n\t\twhileElementsMounted: autoUpdate\n\t});\n\n\tuseLayoutEffect(() => {\n\t\tif (open) {\n\t\t\tvoid update();\n\t\t}\n\t}, [open, positionUpdateKey, update]);\n\n\tconst hover = useHover(context, {\n\t\tenabled: openOnHover,\n\t\tmove: false,\n\t\tdelay: {\n\t\t\topen: openDelay,\n\t\t\tclose: closeDelay\n\t\t}\n\t});\n\tconst dismiss = useDismiss(context);\n\tconst role = useRole(context);\n\n\tconst { getReferenceProps, getFloatingProps } = useInteractions([hover, dismiss, role]);\n\n\treturn (\n\t\t<>\n\t\t\t<span ref={refs.setReference} {...getReferenceProps()} style={{ lineHeight: 1 }}>\n\t\t\t\t{children}\n\t\t\t</span>\n\n\t\t\t{open &&\n\t\t\t\tcreatePortal(\n\t\t\t\t\t<div\n\t\t\t\t\t\tref={refs.setFloating}\n\t\t\t\t\t\tstyle={{ ...floatingStyles, zIndex: \"var(--z-tooltip)\", maxWidth: maxWidth ? `${maxWidth}em` : undefined }}\n\t\t\t\t\t\t{...getFloatingProps()}\n\t\t\t\t\t\trole=\"tooltip\"\n\t\t\t\t\t\tclassName={cn(styles.tooltipPanel, tooltip && styles.tooltip, state && styles[state])}>\n\t\t\t\t\t\t{content}\n\n\t\t\t\t\t\t<FloatingArrow ref={arrowRef} placement={computedPlacement} middlewareData={middlewareData} />\n\t\t\t\t\t</div>,\n\t\t\t\t\tdocument.body\n\t\t\t\t)}\n\t\t</>\n\t);\n};\n","import React, { useEffect, useRef } from \"react\";\n\nimport { arrow, flip, offset, shift, useFloating } from \"@floating-ui/react\";\n\nimport { FloatingArrow } from \"../floating-arrow/FloatingArrow\";\n\nimport styles from \"./Popover.module.scss\";\n\nexport const FloatingTooltip: React.FC<{\n\tx: number;\n\ty: number;\n\tchildren: React.ReactNode;\n}> = ({ x, y, children }) => {\n\tconst arrowRef = useRef<HTMLDivElement | null>(null);\n\n\tconst {\n\t\trefs,\n\t\tfloatingStyles,\n\t\tmiddlewareData,\n\t\tplacement: computedPlacement\n\t} = useFloating({\n\t\tstrategy: \"absolute\",\n\t\tplacement: \"top\",\n\t\t// eslint-disable-next-line react-hooks/refs\n\t\tmiddleware: [offset(6), flip(), shift({ padding: 16 }), arrow({ element: arrowRef })]\n\t});\n\n\tuseEffect(() => {\n\t\tif (refs.setReference) {\n\t\t\trefs.setReference({\n\t\t\t\tgetBoundingClientRect: () =>\n\t\t\t\t\t({\n\t\t\t\t\t\tx,\n\t\t\t\t\t\ty,\n\t\t\t\t\t\twidth: 0,\n\t\t\t\t\t\theight: 0,\n\t\t\t\t\t\ttop: y,\n\t\t\t\t\t\tleft: x,\n\t\t\t\t\t\tbottom: y,\n\t\t\t\t\t\tright: x,\n\t\t\t\t\t\ttoJSON: () => {}\n\t\t\t\t\t}) as DOMRect\n\t\t\t});\n\t\t}\n\t}, [x, y, refs]);\n\n\treturn (\n\t\t<div ref={refs.setFloating} style={{ ...floatingStyles, position: \"absolute\", pointerEvents: \"none\" }} className={styles.tooltip}>\n\t\t\t{children}\n\n\t\t\t<FloatingArrow ref={arrowRef} placement={computedPlacement} middlewareData={middlewareData} />\n\t\t</div>\n\t);\n};\n"],"mappings":";;;;;;;;;AAWA,SAAgB,EAA0B,EAAE,mBAAgB,oBAAiB,eAA8C;CAE1H,AADA,EAAS,MAAM,YAAY,6BAA6B,GAAG,KAAK,IAAI,GAAG,CAAc,EAAE,GAAG,GAC1F,EAAS,MAAM,YAAY,8BAA8B,GAAG,KAAK,IAAI,GAAG,CAAe,EAAE,GAAG;AAC7F;;;;;GECa,IAAiB,EAA0C,IAAI;AAE5E,SAAgB,IAAoB;CACnC,IAAM,IAAU,EAAW,CAAc;CACzC,IAAI,CAAC,GACJ,MAAM,EAA0B;EAC/B,UAAU;EACV,cAAc;CACf,CAAC;CAEF,OAAO;AACR;;;ACHA,IAAa,KAAiD,EAC7D,aACA,YACA,oBAAiB,IACjB,mBAAgB,IAChB,yBAAsB,IACtB,gBAAa,kBACR;CACL,IAAM,EAAE,SAAM,YAAS,SAAM,mBAAgB,mBAAgB,cAAW,gBAAa,EAAkB,GACjG,IAAqB,EAA8B,IAAI,GACvD,IAAc,GAClB,MAAgC;EAEhC,AADA,EAAmB,UAAU,GAC7B,EAAK,YAAY,CAAI;CACtB,GACA,CAAC,CAAI,CACN,GAEM,IAAc,EAAgC;EACnD,QAAQ;EACR,cAAc;EACd,cAAc;EACd,cAAc;CACf,CAAC,GAEK,IAAW,QAAkB;EAC7B,MACL,EAAQ,EAAK,GACb,IAAU;CACX,GAAG;EAAC;EAAS;EAAS;CAAI,CAAC;CAE3B,EAAiB;EAChB,QAAQ;EACR,SAAS;EACT,WAAW;EACX,cAAc;CACf,CAAC;CAED,IAAM,IAAe,QAAkB;EAClC,CAAC,KAAQ,KACT,KAAgB,EAAS;CAC9B,GAAG;EAAC;EAAM;EAAqB;EAAgB;CAAQ,CAAC;CAMxD,OAJA,EAAgB,CAAC,EAAK,UAA0C,EAAK,SAAyC,GA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/popover/components/Popover.module.scss","../../src/popover/components/PopoverContext.tsx","../../src/popover/components/PopoverContent.tsx","../../src/popover/components/PopoverTrigger.tsx","../../src/popover/components/Popover.tsx","../../src/popover/Popover.module.scss","../../src/popover/FloatingPopover.tsx","../../src/popover/FloatingTooltip.tsx"],"sourcesContent":["type ApplyPopoverAvailableSizeOptions = {\n\treadonly availableWidth: number;\n\treadonly availableHeight: number;\n\treadonly floating: HTMLElement;\n};\n\n/**\n * Передаёт вычисленную Floating UI доступную область самому popover через CSS-переменные.\n * Потребитель может совместить эти границы со своим размером и режимом прокрутки,\n * не дублируя `size()` middleware и правила clipping context.\n */\nexport function applyPopoverAvailableSize({ availableWidth, availableHeight, floating }: ApplyPopoverAvailableSizeOptions) {\n\tfloating.style.setProperty(\"--popover-available-width\", `${Math.max(0, availableWidth)}px`);\n\tfloating.style.setProperty(\"--popover-available-height\", `${Math.max(0, availableHeight)}px`);\n}\n",".popover {\n\tpadding: var(--space-sm);\n\t// background-image: radial-gradient(var(--surface-0) 50%, var(--surface-1) 100%);\n\n\tborder: var(--border-width) solid var(--border-1);\n\tborder-radius: var(--radius-sm);\n\tcolor: var(--content-0);\n\n\tfilter: drop-shadow(var(--shadow-md));\n\n\tz-index: var(--z-popover);\n\n\t&.primary {\n\t\tbackground-color: var(--surface-0);\n\t}\n\n\t&.secondary {\n\t\tbackground-color: var(--surface-1);\n\t}\n}\n","import React, { createContext, useContext } from \"react\";\n\nimport { Placement, useFloating } from \"@floating-ui/react\";\nimport { createMissingContextError } from \"@ryuzaki13/react-foundation-lib/error\";\n\ninterface PopoverContextValue {\n\topen: boolean;\n\tsetOpen: React.Dispatch<React.SetStateAction<boolean>>;\n\trefs: ReturnType<typeof useFloating>[\"refs\"];\n\tfloatingStyles: React.CSSProperties;\n\tplacement: Placement;\n\tmiddlewareData: ReturnType<typeof useFloating>[\"middlewareData\"];\n\tarrowRef: React.RefObject<HTMLDivElement | null>;\n}\n\nexport const PopoverContext = createContext<PopoverContextValue | null>(null);\n\nexport function usePopoverContext() {\n\tconst context = useContext(PopoverContext);\n\tif (!context) {\n\t\tthrow createMissingContextError({\n\t\t\thookName: \"usePopoverContext\",\n\t\t\tproviderName: \"Popover\"\n\t\t});\n\t}\n\treturn context;\n}\n","import React, { useCallback, useRef } from \"react\";\n\nimport { FloatingPortal } from \"@floating-ui/react\";\nimport { useClickOutside, useEscapeDismiss, useOverlayFocus } from \"@ryuzaki13/react-foundation-lib/dom\";\nimport { cn } from \"@ryuzaki13/react-foundation-lib/utils\";\n\nimport { TooltipArrow } from \"../../floating-arrow\";\n\nimport styles from \"./Popover.module.scss\";\nimport { usePopoverContext } from \"./PopoverContext\";\n\nexport interface PopoverContentProps {\n\tchildren: React.ReactNode | ((ctx: { setClose: () => void }) => React.ReactNode);\n\tonClose?: () => void;\n\tcloseOnOutside?: boolean;\n\tcloseOnEscape?: boolean;\n\tdisableOutsideClick?: boolean;\n\tbackground?: \"primary\" | \"secondary\";\n}\n\n/**\n * Содержимое Popover, отображаемое в портале.\n */\nexport const PopoverContent: React.FC<PopoverContentProps> = ({\n\tchildren,\n\tonClose,\n\tcloseOnOutside = true,\n\tcloseOnEscape = true,\n\tdisableOutsideClick = false,\n\tbackground = \"secondary\"\n}) => {\n\tconst { open, setOpen, refs, floatingStyles, middlewareData, placement, arrowRef } = usePopoverContext();\n\tconst floatingElementRef = useRef<HTMLDivElement | null>(null);\n\tconst setFloating = useCallback(\n\t\t(node: HTMLDivElement | null) => {\n\t\t\tfloatingElementRef.current = node;\n\t\t\trefs.setFloating(node);\n\t\t},\n\t\t[refs]\n\t);\n\n\tconst floatingRef = useOverlayFocus<HTMLDivElement>({\n\t\tactive: open,\n\t\tinitialFocus: \"container\",\n\t\trestoreFocus: true,\n\t\tcontainerRef: floatingElementRef\n\t});\n\n\tconst setClose = useCallback(() => {\n\t\tif (!open) return;\n\t\tsetOpen(false);\n\t\tonClose?.();\n\t}, [setOpen, onClose, open]);\n\n\tuseEscapeDismiss({\n\t\tactive: open,\n\t\tenabled: closeOnEscape,\n\t\tonDismiss: setClose,\n\t\tcontainerRef: floatingRef as React.RefObject<HTMLElement | null>\n\t});\n\n\tconst outsideClose = useCallback(() => {\n\t\tif (!open || disableOutsideClick) return;\n\t\tif (closeOnOutside) setClose();\n\t}, [open, disableOutsideClick, closeOnOutside, setClose]);\n\n\tuseClickOutside([refs.floating as React.RefObject<HTMLElement>, refs.reference as React.RefObject<HTMLElement>], outsideClose);\n\n\tif (!open) return null;\n\n\treturn (\n\t\t<FloatingPortal>\n\t\t\t<div\n\t\t\t\tref={setFloating}\n\t\t\t\tstyle={floatingStyles}\n\t\t\t\tclassName={cn(styles.popover, styles[background])}\n\t\t\t\trole=\"dialog\"\n\t\t\t\taria-modal=\"true\"\n\t\t\t\ttabIndex={-1}>\n\t\t\t\t{typeof children === \"function\" ? children({ setClose }) : children}\n\t\t\t\t<TooltipArrow ref={arrowRef} placement={placement} middlewareData={middlewareData} />\n\t\t\t</div>\n\t\t</FloatingPortal>\n\t);\n};\n","import React, { cloneElement, useCallback } from \"react\";\n\nimport { usePopoverContext } from \"./PopoverContext\";\n\nexport interface PopoverTriggerProps {\n\tpassive?: true;\n\tchildren: React.ReactElement<React.HTMLAttributes<Element> & { ref?: React.Ref<Element> }>;\n}\n\nexport const PopoverTrigger: React.FC<PopoverTriggerProps> = ({ passive, children }) => {\n\tconst { open, setOpen, refs } = usePopoverContext();\n\n\tconst handleClick = useCallback(\n\t\t(e: React.MouseEvent) => {\n\t\t\tif (children.props.onClick) {\n\t\t\t\tchildren.props.onClick(e);\n\t\t\t}\n\t\t\tif (e.defaultPrevented) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\te.preventDefault();\n\t\t\te.stopPropagation();\n\n\t\t\tif (passive) return;\n\n\t\t\tsetOpen((v) => !v);\n\t\t},\n\t\t[children, setOpen, passive]\n\t);\n\n\treturn cloneElement(children as React.JSX.Element, {\n\t\tref: refs.setReference,\n\t\t\"aria-expanded\": open,\n\t\tonClick: handleClick\n\t});\n};\n","/* eslint-disable react-refresh/only-export-components */\nimport React, { useCallback, useRef, useState } from \"react\";\n\nimport { arrow, autoUpdate, flip, offset, Placement, shift, size as floatingSize, useFloating } from \"@floating-ui/react\";\n\nimport { applyPopoverAvailableSize } from \"../lib/applyPopoverAvailableSize\";\n\nimport { PopoverContent } from \"./PopoverContent\";\nimport { PopoverContext } from \"./PopoverContext\";\nimport { PopoverTrigger } from \"./PopoverTrigger\";\n\nconst POPOVER_VIEWPORT_PADDING = 16;\n\nexport interface PopoverProps {\n\tchildren: React.ReactNode;\n\tplacement?: Placement;\n\topen?: boolean;\n\tdefaultOpen?: boolean;\n\tonOpenChange?: (open: boolean) => void;\n}\n\n/**\n * Контролируемый Popover.\n * Используется в связке с Popover.Trigger и Popover.Content.\n */\nconst PopoverRoot: React.FC<PopoverProps> = ({ children, open: controlledOpen, defaultOpen, onOpenChange, placement = \"bottom\" }) => {\n\tconst [uncontrolledOpen, setUncontrolledOpen] = useState(defaultOpen ?? false);\n\n\tconst isControlled = controlledOpen !== undefined;\n\tconst open = isControlled ? controlledOpen : uncontrolledOpen;\n\tconst setOpen = useCallback<React.Dispatch<React.SetStateAction<boolean>>>(\n\t\t(value) => {\n\t\t\tconst next = typeof value === \"function\" ? value(open) : value;\n\t\t\tif (!isControlled) setUncontrolledOpen(next);\n\t\t\tonOpenChange?.(next);\n\t\t},\n\t\t[isControlled, onOpenChange, open]\n\t);\n\n\tconst arrowRef = useRef<HTMLDivElement | null>(null);\n\n\tconst {\n\t\trefs,\n\t\tfloatingStyles,\n\t\tmiddlewareData,\n\t\tplacement: actualPlacement\n\t} = useFloating({\n\t\topen,\n\t\tonOpenChange: setOpen,\n\t\tplacement,\n\t\tmiddleware: [\n\t\t\toffset(8),\n\t\t\tflip({ padding: POPOVER_VIEWPORT_PADDING }),\n\t\t\tshift({ padding: POPOVER_VIEWPORT_PADDING }),\n\t\t\tfloatingSize({\n\t\t\t\tpadding: POPOVER_VIEWPORT_PADDING,\n\t\t\t\tapply({ availableWidth, availableHeight, elements }) {\n\t\t\t\t\tapplyPopoverAvailableSize({ availableWidth, availableHeight, floating: elements.floating });\n\t\t\t\t}\n\t\t\t}),\n\t\t\t// eslint-disable-next-line react-hooks/refs\n\t\t\tarrow({ element: arrowRef.current })\n\t\t],\n\t\twhileElementsMounted: autoUpdate\n\t});\n\n\treturn (\n\t\t<PopoverContext.Provider value={{ open, setOpen, refs, floatingStyles, placement: actualPlacement, middlewareData, arrowRef }}>\n\t\t\t{children}\n\t\t</PopoverContext.Provider>\n\t);\n};\n\n/**\n * Композиционное API:\n * <Popover>\n * <Popover.Trigger />\n * <Popover.Content />\n * </Popover>\n */\nexport const Popover = Object.assign(PopoverRoot, {\n\tTrigger: PopoverTrigger,\n\tContent: PopoverContent\n});\n",".tooltipPanel {\n\tpadding: var(--space-sm);\n\t// background-image: radial-gradient(var(--surface-0) 50%, var(--surface-1) 100%);\n\tbackground-color: var(--surface-1);\n\tborder: var(--border-width) solid var(--border-2);\n\tborder-radius: var(--radius-sm);\n\tcolor: var(--content-0);\n\n\tfilter: drop-shadow(var(--shadow-sm));\n\n\t&.negative {\n\t\t--border-1: var(--content-0);\n\n\t\tbackground-color: var(--content-0);\n\t\tborder-color: var(--border-1);\n\t\tcolor: var(--surface-1);\n\t}\n\n\t&.information {\n\t\t--border-1: var(--status-info-text);\n\n\t\tbackground-color: var(--status-info-text);\n\t\tborder-color: var(--status-info-text);\n\t\tcolor: var(--status-info-on-fill);\n\t}\n\n\t&.error {\n\t\t--border-1: var(--status-error-text);\n\n\t\tbackground-color: var(--status-error-text);\n\t\tborder-color: var(--status-error-text);\n\t\tcolor: var(--status-error-on-fill);\n\t}\n\n\t&.warning {\n\t\t--border-1: var(--status-warning-text);\n\n\t\tbackground-color: var(--status-warning-text);\n\t\tborder-color: var(--status-warning-text);\n\t\tcolor: var(--status-warning-on-fill);\n\t}\n\n\t&.success {\n\t\t--border-1: var(--status-success-text);\n\n\t\tbackground-color: var(--status-success-text);\n\t\tborder-color: var(--status-success-text);\n\t\tcolor: var(--status-success-on-fill);\n\t}\n}\n\n.tooltip {\n\tz-index: var(--z-tooltip);\n\tpointer-events: none;\n\n\ttext-align: initial;\n\tfont-size: var(--font-size-sm);\n\tfont-style: normal;\n\tfont-weight: 500;\n\tfont-variation-settings: \"wght\" 500;\n\tline-height: var(--line-height);\n\n\t@extend .tooltipPanel;\n}\n","/* eslint-disable react-hooks/refs */\nimport React, { useLayoutEffect, useRef, useState } from \"react\";\n\nimport {\n\tarrow,\n\tautoUpdate,\n\tflip,\n\toffset,\n\tPlacement,\n\tshift,\n\tuseDismiss,\n\tuseFocus,\n\tuseFloating,\n\tuseHover,\n\tuseInteractions,\n\tuseRole\n} from \"@floating-ui/react\";\nimport { cn } from \"@ryuzaki13/react-foundation-lib/utils\";\nimport { createPortal } from \"react-dom\";\n\nimport { FloatingArrow } from \"../floating-arrow/FloatingArrow\";\n\nimport styles from \"./Popover.module.scss\";\n\ninterface FloatingPopoverProps {\n\tcontent: React.ReactNode;\n\tchildren: React.ReactNode;\n\topenOnHover?: boolean;\n\tplacement?: Placement;\n\topenDelay?: number;\n\tcloseDelay?: number;\n\tmaxWidth?: number;\n\tstate?: \"information\" | \"error\" | \"warning\" | \"success\" | \"negative\";\n\ttooltip?: true;\n\t/**\n\t * Изменяется вместе с CSS-координатой trigger, когда её изменение не отслеживается `autoUpdate`.\n\t * После commit React выполняется повторный расчёт позиции открытой floating-панели.\n\t */\n\tpositionUpdateKey?: unknown;\n}\n\nexport const FloatingPopover: React.FC<FloatingPopoverProps> = ({\n\tcontent,\n\tchildren,\n\topenOnHover = true,\n\tplacement = \"bottom\",\n\topenDelay = 200,\n\tcloseDelay = 100,\n\tmaxWidth,\n\tstate,\n\ttooltip,\n\tpositionUpdateKey\n}) => {\n\tconst [open, setOpen] = useState(false);\n\tconst arrowRef = useRef<HTMLDivElement>(null);\n\n\tconst {\n\t\trefs,\n\t\tfloatingStyles,\n\t\tmiddlewareData,\n\t\tcontext,\n\t\tplacement: computedPlacement,\n\t\tupdate\n\t} = useFloating({\n\t\topen,\n\t\tonOpenChange: setOpen,\n\t\tplacement,\n\t\tmiddleware: [\n\t\t\toffset(8),\n\t\t\tflip({ fallbackAxisSideDirection: \"end\", fallbackPlacements: [\"top\", \"right\", \"bottom\"] }),\n\t\t\tshift({ padding: 8 }),\n\t\t\tarrow({ element: arrowRef, padding: 8 })\n\t\t],\n\t\twhileElementsMounted: autoUpdate\n\t});\n\n\tuseLayoutEffect(() => {\n\t\tif (open) {\n\t\t\tvoid update();\n\t\t}\n\t}, [open, positionUpdateKey, update]);\n\n\tconst hover = useHover(context, {\n\t\tenabled: openOnHover,\n\t\tmove: false,\n\t\tdelay: {\n\t\t\topen: openDelay,\n\t\t\tclose: closeDelay\n\t\t}\n\t});\n\t// Hover-подсказка обязана иметь ту же пассивную точку входа с клавиатуры.\n\t// Связываем focus с тем же флагом, чтобы `openOnHover={false}` не менял\n\t// управляемые сценарии, которые не запрашивали автоматическое открытие.\n\tconst focus = useFocus(context, { enabled: openOnHover });\n\tconst dismiss = useDismiss(context);\n\tconst role = useRole(context);\n\n\tconst { getReferenceProps, getFloatingProps } = useInteractions([hover, focus, dismiss, role]);\n\n\treturn (\n\t\t<>\n\t\t\t<span ref={refs.setReference} {...getReferenceProps()} style={{ lineHeight: 1 }}>\n\t\t\t\t{children}\n\t\t\t</span>\n\n\t\t\t{open &&\n\t\t\t\tcreatePortal(\n\t\t\t\t\t<div\n\t\t\t\t\t\tref={refs.setFloating}\n\t\t\t\t\t\tstyle={{ ...floatingStyles, zIndex: \"var(--z-tooltip)\", maxWidth: maxWidth ? `${maxWidth}em` : undefined }}\n\t\t\t\t\t\t{...getFloatingProps()}\n\t\t\t\t\t\trole=\"tooltip\"\n\t\t\t\t\t\tclassName={cn(styles.tooltipPanel, tooltip && styles.tooltip, state && styles[state])}>\n\t\t\t\t\t\t{content}\n\n\t\t\t\t\t\t<FloatingArrow ref={arrowRef} placement={computedPlacement} middlewareData={middlewareData} />\n\t\t\t\t\t</div>,\n\t\t\t\t\tdocument.body\n\t\t\t\t)}\n\t\t</>\n\t);\n};\n","import React, { useEffect, useRef } from \"react\";\n\nimport { arrow, flip, offset, shift, useFloating } from \"@floating-ui/react\";\n\nimport { FloatingArrow } from \"../floating-arrow/FloatingArrow\";\n\nimport styles from \"./Popover.module.scss\";\n\nexport const FloatingTooltip: React.FC<{\n\tx: number;\n\ty: number;\n\tchildren: React.ReactNode;\n}> = ({ x, y, children }) => {\n\tconst arrowRef = useRef<HTMLDivElement | null>(null);\n\n\tconst {\n\t\trefs,\n\t\tfloatingStyles,\n\t\tmiddlewareData,\n\t\tplacement: computedPlacement\n\t} = useFloating({\n\t\tstrategy: \"absolute\",\n\t\tplacement: \"top\",\n\t\t// eslint-disable-next-line react-hooks/refs\n\t\tmiddleware: [offset(6), flip(), shift({ padding: 16 }), arrow({ element: arrowRef })]\n\t});\n\n\tuseEffect(() => {\n\t\tif (refs.setReference) {\n\t\t\trefs.setReference({\n\t\t\t\tgetBoundingClientRect: () =>\n\t\t\t\t\t({\n\t\t\t\t\t\tx,\n\t\t\t\t\t\ty,\n\t\t\t\t\t\twidth: 0,\n\t\t\t\t\t\theight: 0,\n\t\t\t\t\t\ttop: y,\n\t\t\t\t\t\tleft: x,\n\t\t\t\t\t\tbottom: y,\n\t\t\t\t\t\tright: x,\n\t\t\t\t\t\ttoJSON: () => {}\n\t\t\t\t\t}) as DOMRect\n\t\t\t});\n\t\t}\n\t}, [x, y, refs]);\n\n\treturn (\n\t\t<div ref={refs.setFloating} style={{ ...floatingStyles, position: \"absolute\", pointerEvents: \"none\" }} className={styles.tooltip}>\n\t\t\t{children}\n\n\t\t\t<FloatingArrow ref={arrowRef} placement={computedPlacement} middlewareData={middlewareData} />\n\t\t</div>\n\t);\n};\n"],"mappings":";;;;;;;;;AAWA,SAAgB,EAA0B,EAAE,mBAAgB,oBAAiB,eAA8C;CAE1H,AADA,EAAS,MAAM,YAAY,6BAA6B,G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AoB,UAAU,IAAW,GAAG,EAAS,MAAM,KAAA;EAAU;EACzG,GAAI,EAAiB;EACrB,MAAK;EACL,WAAW,EAAG,EAAO,cAAc,KAAW,EAAO,SAAS,KAAS,EAAO,EAAM;EALrF,UAAA,CAME,GAED,kBAAC,GAAD;GAAe,KAAK;GAAU,WAAW;GAAmC;EAAiB,CAAA,CACzF;CACL,CAAA,GAAA,SAAS,IACV,CACA,EAAA,CAAA;AAEJ,GCjHa,KAIP,EAAE,MAAG,MAAG,kBAAe;CAC5B,IAAM,IAAW,EAA8B,IAAI,GAE7C,EACL,SACA,mBACA,mBACA,WAAW,MACR,EAAY;EACf,UAAU;EACV,WAAW;EAEX,YAAY;GAAC,EAAO,CAAC;GAAG,EAAK;GAAG,EAAM,EAAE,SAAS,GAAG,CAAC;GAAG,EAAM,EAAE,SAAS,EAAS,CAAC;EAAC;CACrF,CAAC;CAqBD,OAnBA,QAAgB;EACf,AAAI,EAAK,gBACR,EAAK,aAAa,EACjB,8BACE;GACA;GACA;GACA,OAAO;GACP,QAAQ;GACR,KAAK;GACL,MAAM;GACN,QAAQ;GACR,OAAO;GACP,cAAc,CAAC;EAChB,GACF,CAAC;CAEH,GAAG;EAAC;EAAG;EAAG;CAAI,CAAC,GAGd,kBAAC,OAAD;EAAK,KAAK,EAAK;EAAa,OAAO;GAAE,GAAG;GAAgB,UAAU;GAAY,eAAe;EAAO;EAAG,WAAW,EAAO;EAAzH,UAAA,CACE,GAED,kBAAC,GAAD;GAAe,KAAK;GAAU,WAAW;GAAmC;EAAiB,CAAA,CACzF;;AAEP"}
@@ -1,4 +1,4 @@
1
- import { a as e, c as t, d as n, i as r, n as i, o as a, p as ee, r as te, s as ne, t as re } from "./base-table-BNtd1xSl.js";
1
+ import { a as e, c as t, d as n, i as r, n as i, o as a, p as ee, r as te, s as ne, t as re } from "./base-table-DswaYoH-.js";
2
2
  import { useEffect as ie, useEffectEvent as ae, useMemo as o, useRef as s } from "react";
3
3
  import { jsx as c } from "react/jsx-runtime";
4
4
  import { formatPipelineDisplayValue as l } from "@ryuzaki13/react-foundation-lib/formatters";
@@ -138,4 +138,4 @@ function m({ title: m, isLoading: h, isFetching: se, data: g, columns: _, select
138
138
  //#endregion
139
139
  export { m as t };
140
140
 
141
- //# sourceMappingURL=table-C3sKpYHL.js.map
141
+ //# sourceMappingURL=table-aozLLSJk.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"table-C3sKpYHL.js","names":[],"sources":["../../src/table/Table.module.scss","../../src/table/Table.tsx"],"sourcesContent":[".selectedIndicatorCell {\n\tbox-shadow: inset 0.1875rem 0 0 var(--content-accent);\n}\n\n.sentinel {\n\theight: 1px;\n}\n","import { useEffect, useEffectEvent, useMemo, useRef } from \"react\";\n\nimport { formatPipelineDisplayValue } from \"@ryuzaki13/react-foundation-lib/formatters\";\nimport { TableFormulaRowData } from \"@ryuzaki13/react-foundation-lib/formulas\";\nimport {\n\ttype FoundationTableRow,\n\tfoundationTableFeatures,\n\ttype TableColumnDef,\n\ttype TableColumnOrderState,\n\ttype TableColumnSizingState,\n\ttype TableColumnVisibilityState,\n\ttype TableSelectionMode,\n\tuseTableRowSelection\n} from \"@ryuzaki13/react-foundation-lib/table\";\nimport { useTable } from \"@tanstack/react-table\";\n\nimport {\n\tBaseTable,\n\tbuildBaseTableMergedCellsLayout,\n\tbuildTableFormattingSnapshot,\n\tFormattedTableCell,\n\tgetOrderedVisibleLeafColumns,\n\tshouldUseTableFormatting,\n\tuseTableColumnOrder,\n\tuseTableColumnPinning,\n\tuseTableColumnSizing,\n\tuseTableColumnVisibility,\n\ttype BaseTableColumnState,\n\ttype BaseTableProps,\n\ttype TableColumnPinningState\n} from \"../base-table\";\n\nimport styles from \"./Table.module.scss\";\n\n/**\n * Возвращает индекс как строковый id, если внешний id не передан.\n */\nfunction defaultGetRowId<TData>(_row: TData, index: number): string {\n\treturn String(index);\n}\n\n/**\n * Пропсы компонента Table.\n *\n * Компонент предназначен для плоских данных и по API осознанно сближен с TreeTable.\n */\nexport interface TableProps<TData extends object> {\n\t/**\n\t * Необязательный заголовок над таблицей.\n\t */\n\ttitle?: string;\n\t/**\n\t * Признак первичной загрузки.\n\t */\n\tisLoading?: boolean;\n\t/**\n\t * Признак фоновой догрузки или обновления данных.\n\t */\n\tisFetching?: boolean;\n\t/**\n\t * Плоский источник строк.\n\t */\n\tdata: readonly TData[] | undefined | null;\n\t/**\n\t * Описание колонок таблицы.\n\t */\n\tcolumns: readonly TableColumnDef<TData>[];\n\t/**\n\t * Режим выбора строк.\n\t */\n\tselectionMode?: TableSelectionMode;\n\t/**\n\t * Внешний список выбранных строк.\n\t *\n\t * Если передан, таблица синхронизирует визуальное выделение с этим набором id.\n\t */\n\tselectedRowIds?: readonly string[];\n\t/**\n\t * Стабильный идентификатор строки.\n\t *\n\t * Если не задан, используется индекс строки.\n\t */\n\tgetRowId?: (row: TData, index: number) => string;\n\t/**\n\t * Дополнительный CSS-класс корневого контейнера.\n\t */\n\tclassName?: string;\n\tminHeight?: `${number}em` | `${number}%`;\n\t/**\n\t * Дополнительный CSS-класс тега `table`.\n\t */\n\ttableClassName?: string;\n\t/**\n\t * Внешнее controlled-состояние видимости колонок.\n\t */\n\tcolumnVisibility?: TableColumnVisibilityState;\n\t/**\n\t * Стартовое uncontrolled-состояние видимости колонок.\n\t */\n\tdefaultColumnVisibility?: TableColumnVisibilityState;\n\t/**\n\t * Внешнее controlled-состояние порядка колонок.\n\t */\n\tcolumnOrder?: readonly string[];\n\t/**\n\t * Стартовое uncontrolled-состояние порядка колонок.\n\t */\n\tdefaultColumnOrder?: readonly string[];\n\t/**\n\t * Внешнее controlled-состояние ширин колонок в px.\n\t */\n\tcolumnSizing?: TableColumnSizingState;\n\t/**\n\t * Стартовое uncontrolled-состояние ширин колонок в px.\n\t */\n\tdefaultColumnSizing?: TableColumnSizingState;\n\t/**\n\t * Внешнее controlled-состояние start-pinning для колонок.\n\t */\n\tcolumnPinning?: TableColumnPinningState;\n\t/**\n\t * Стартовое uncontrolled-состояние start-pinning для колонок.\n\t */\n\tdefaultColumnPinning?: TableColumnPinningState;\n\t/**\n\t * Включает изменение ширины колонок через header-handle.\n\t */\n\tenableColumnResizing?: boolean;\n\t/**\n\t * Включает изменение порядка колонок через drag&drop заголовков.\n\t */\n\tenableColumnReordering?: boolean;\n\t/**\n\t * Минимальная ширина колонки при resize в px.\n\t */\n\tcolumnResizeMinWidth?: number;\n\t/**\n\t * Вызывается после изменения видимости колонок.\n\t */\n\tonColumnVisibilityChange?: (state: TableColumnVisibilityState) => void;\n\t/**\n\t * Вызывается после изменения порядка колонок.\n\t */\n\tonColumnOrderChange?: (state: TableColumnOrderState) => void;\n\t/**\n\t * Вызывается после изменения ширины колонок.\n\t */\n\tonColumnSizingChange?: (state: TableColumnSizingState) => void;\n\t/**\n\t * Вызывается после изменения start-pinning state.\n\t */\n\tonColumnPinningChange?: (state: TableColumnPinningState) => void;\n\t/**\n\t * Вызывается при активации строки кликом или клавиатурой.\n\t */\n\tonRowClick?: (row: TData) => void;\n\t/**\n\t * Вызывается после изменения выбранных строк.\n\t */\n\tonRowSelectionChange?: (rows: TData[]) => void;\n\t/**\n\t * Вызывается при достижении конца таблицы внутри scroll-контейнера.\n\t */\n\tonReachEnd?: () => void;\n\t/**\n\t * Позволяет запретить выбор отдельных строк.\n\t */\n\tgetRowCanSelect?: (row: TData) => boolean;\n\t/**\n\t * Позволяет добавить CSS-класс для конкретной строки.\n\t */\n\tgetRowClassName?: (row: TData) => string | undefined;\n\t/**\n\t * Контекстное меню заголовка колонки. Используется для общих runtime-действий\n\t * вроде server sorting без встраивания доменной логики в shared-таблицу.\n\t */\n\trenderHeaderContextMenu?: BaseTableProps<TData>[\"renderHeaderContextMenu\"];\n\t/**\n\t * Тонкая точка расширения содержимого ячейки поверх стандартного форматирования.\n\t *\n\t * В отличие от `column.cell`, этот слот не отключает общий formatting-runtime:\n\t * `defaultContent` уже содержит отформатированное значение, если оно применимо.\n\t */\n\trenderCellContent?: BaseTableProps<TData>[\"renderCellContent\"];\n}\n\n/**\n * Плоская таблица на базе TanStack Table как React-альтернатива `sap.m.Table`.\n */\nexport function Table<TData extends object>({\n\ttitle,\n\tisLoading,\n\tisFetching,\n\tdata,\n\tcolumns,\n\tselectionMode = \"none\",\n\tselectedRowIds,\n\tgetRowId,\n\tclassName,\n\tminHeight,\n\ttableClassName,\n\tcolumnVisibility,\n\tdefaultColumnVisibility,\n\tcolumnOrder,\n\tdefaultColumnOrder,\n\tcolumnSizing,\n\tdefaultColumnSizing,\n\tcolumnPinning,\n\tdefaultColumnPinning,\n\tenableColumnResizing = false,\n\tenableColumnReordering = false,\n\tcolumnResizeMinWidth,\n\tonColumnVisibilityChange,\n\tonColumnOrderChange,\n\tonColumnSizingChange,\n\tonColumnPinningChange,\n\tonRowClick,\n\tonRowSelectionChange,\n\tonReachEnd,\n\tgetRowCanSelect,\n\tgetRowClassName,\n\trenderHeaderContextMenu,\n\trenderCellContent\n}: TableProps<TData>) {\n\tconst tableData = useMemo(() => data ?? [], [data]);\n\tconst formattingSnapshot = useMemo(() => buildTableFormattingSnapshot(columns), [columns]);\n\tconst resolveRowId = getRowId ?? defaultGetRowId<TData>;\n\tconst rowById = useMemo(() => new Map(tableData.map((row, index) => [resolveRowId(row, index), row])), [resolveRowId, tableData]);\n\tconst availableRowIds = useMemo(() => Array.from(rowById.keys()), [rowById]);\n\tconst scrollableRef = useRef<HTMLDivElement | null>(null);\n\tconst sentinelRef = useRef<HTMLDivElement | null>(null);\n\n\tconst { rowSelection, activateRowSelection } = useTableRowSelection({\n\t\tavailableRowIds,\n\t\trowById,\n\t\tselectionMode,\n\t\tselectedRowIds,\n\t\tonRowSelectionChange\n\t});\n\tconst { columnVisibility: resolvedColumnVisibility, onColumnVisibilityChange: handleColumnVisibilityChange } = useTableColumnVisibility(\n\t\t{\n\t\t\tcolumnVisibility,\n\t\t\tdefaultColumnVisibility,\n\t\t\tonColumnVisibilityChange\n\t\t}\n\t);\n\tconst { columnOrder: resolvedColumnOrder, onColumnOrderChange: handleColumnOrderChange } = useTableColumnOrder({\n\t\tcolumnOrder,\n\t\tdefaultColumnOrder,\n\t\tonColumnOrderChange\n\t});\n\tconst { columnSizing: resolvedColumnSizing, onColumnSizingChange: handleColumnSizingChange } = useTableColumnSizing({\n\t\tcolumnSizing,\n\t\tdefaultColumnSizing,\n\t\tcolumnResizeMinWidth,\n\t\tonColumnSizingChange\n\t});\n\tconst { columnPinning: resolvedColumnPinning, onColumnPinningChange: handleColumnPinningChange } = useTableColumnPinning({\n\t\tcolumnPinning,\n\t\tdefaultColumnPinning,\n\t\tonColumnPinningChange\n\t});\n\tconst baseTableColumnState = useMemo<BaseTableColumnState>(\n\t\t() => ({\n\t\t\tcolumnOrder: resolvedColumnOrder,\n\t\t\tcolumnPinning: resolvedColumnPinning,\n\t\t\tcolumnSizing: resolvedColumnSizing,\n\t\t\tcolumnVisibility: resolvedColumnVisibility\n\t\t}),\n\t\t[resolvedColumnOrder, resolvedColumnPinning, resolvedColumnSizing, resolvedColumnVisibility]\n\t);\n\n\tconst emitReachEnd = useEffectEvent(() => {\n\t\tonReachEnd?.();\n\t});\n\n\tuseEffect(() => {\n\t\tif (!onReachEnd || !scrollableRef.current || !sentinelRef.current || isLoading) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst observer = new IntersectionObserver(\n\t\t\t(entries) => {\n\t\t\t\tconst entry = entries[0];\n\n\t\t\t\tif (entry?.isIntersecting) {\n\t\t\t\t\temitReachEnd();\n\t\t\t\t}\n\t\t\t},\n\t\t\t{\n\t\t\t\troot: scrollableRef.current,\n\t\t\t\tthreshold: 0.1\n\t\t\t}\n\t\t);\n\n\t\tobserver.observe(sentinelRef.current);\n\n\t\treturn () => observer.disconnect();\n\t}, [isLoading, onReachEnd, tableData.length]);\n\n\tconst table = useTable({\n\t\tfeatures: foundationTableFeatures,\n\t\tdata: tableData as TData[],\n\t\tcolumns: columns as TableColumnDef<TData>[],\n\t\tstate: {\n\t\t\tcolumnOrder: resolvedColumnOrder,\n\t\t\tcolumnPinning: resolvedColumnPinning,\n\t\t\tcolumnSizing: resolvedColumnSizing,\n\t\t\tcolumnVisibility: resolvedColumnVisibility,\n\t\t\trowSelection\n\t\t},\n\t\tonColumnOrderChange: handleColumnOrderChange,\n\t\tonColumnPinningChange: handleColumnPinningChange,\n\t\tonColumnSizingChange: handleColumnSizingChange,\n\t\tonColumnVisibilityChange: handleColumnVisibilityChange,\n\t\tgetRowId: (row, index) => resolveRowId(row, index),\n\t\tenableMultiRowSelection: selectionMode === \"multi\",\n\t\tenableRowSelection: (row) => {\n\t\t\tif (selectionMode === \"none\") {\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\treturn getRowCanSelect ? getRowCanSelect(row.original) : true;\n\t\t}\n\t});\n\n\tconst visibleLeafColumns = getOrderedVisibleLeafColumns(table, baseTableColumnState);\n\tconst rowModelRows = table.getRowModel().rows;\n\tconst mergedCellLayout = useMemo(\n\t\t() =>\n\t\t\tbuildBaseTableMergedCellsLayout({\n\t\t\t\trows: rowModelRows,\n\t\t\t\tcolumns: visibleLeafColumns\n\t\t\t}),\n\t\t[rowModelRows, visibleLeafColumns]\n\t);\n\tconst leadingColumnId = visibleLeafColumns[0]?.id;\n\n\t/**\n\t * Активирует строку: обновляет выбор в соответствии с режимом и вызывает внешний callback.\n\t */\n\tconst activateRow = (row: FoundationTableRow<TData>) => {\n\t\tactivateRowSelection(row.id, row.getCanSelect());\n\t\tonRowClick?.(row.original);\n\t};\n\n\treturn (\n\t\t<BaseTable\n\t\t\ttable={table}\n\t\t\tcolumnState={baseTableColumnState}\n\t\t\ttitle={title}\n\t\t\tisLoading={isLoading}\n\t\t\tisFetching={isFetching}\n\t\t\tclassName={className}\n\t\t\tminHeight={minHeight}\n\t\t\ttableClassName={tableClassName}\n\t\t\tselectionMode={selectionMode}\n\t\t\tscrollableRef={scrollableRef}\n\t\t\tonActivateRow={selectionMode !== \"none\" || onRowClick ? activateRow : undefined}\n\t\t\tisRowInteractive={(row) => Boolean(onRowClick || (selectionMode !== \"none\" && row.getCanSelect()))}\n\t\t\tgetRowClassName={(row) => getRowClassName?.(row.original)}\n\t\t\tgetCellClassName={({ row, cell }) =>\n\t\t\t\tcell.column.id === leadingColumnId && row.getIsSelected() ? styles.selectedIndicatorCell : undefined\n\t\t\t}\n\t\t\tgetCellLayout={({ cell }) => mergedCellLayout.get(cell.id)}\n\t\t\trenderHeaderContextMenu={renderHeaderContextMenu}\n\t\t\tenableColumnResizing={enableColumnResizing}\n\t\t\tenableColumnReordering={enableColumnReordering}\n\t\t\tcolumnResizeMinWidth={columnResizeMinWidth}\n\t\t\trenderCellContent={(args) => {\n\t\t\t\tconst displayValue = formatPipelineDisplayValue({\n\t\t\t\t\tfield: formattingSnapshot.runtimeByColumnId[args.cell.column.id],\n\t\t\t\t\trawValue: args.cell.getValue(),\n\t\t\t\t\trowData: args.row.original as TableFormulaRowData,\n\t\t\t\t\trowKind: \"plain\"\n\t\t\t\t});\n\t\t\t\tconst defaultContent = !shouldUseTableFormatting({\n\t\t\t\t\tcolumnId: args.cell.column.id,\n\t\t\t\t\truntimeByColumnId: formattingSnapshot.runtimeByColumnId,\n\t\t\t\t\tcustomCellColumnIds: formattingSnapshot.customCellColumnIds\n\t\t\t\t}) ? (\n\t\t\t\t\targs.defaultContent\n\t\t\t\t) : (\n\t\t\t\t\t<FormattedTableCell displayValue={displayValue} align={args.columnMeta?.align} />\n\t\t\t\t);\n\n\t\t\t\tif (renderCellContent) {\n\t\t\t\t\treturn renderCellContent({\n\t\t\t\t\t\t...args,\n\t\t\t\t\t\tdefaultContent,\n\t\t\t\t\t\tdisplayValue\n\t\t\t\t\t});\n\t\t\t\t}\n\n\t\t\t\treturn defaultContent;\n\t\t\t}}\n\t\t\tafterTableContent={onReachEnd ? <div ref={sentinelRef} className={styles.sentinel} aria-hidden=\"true\" /> : null}\n\t\t/>\n\t);\n}\n"],"mappings":";;;;;;;;;;;;ACqCA,SAAS,GAAuB,GAAa,GAAuB;CACn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AAE,cAAW,GAAiB,IAAI,EAAK,EAAE;EAChC;EACH;EACE;EACF;EACtB,oBAAoB,MAAS;GAC5B,IAAM,IAAe,EAA2B;IAC/C,OAAO,EAAmB,kBAAkB,EAAK,KAAK,OAAO;IAC7D,UAAU,EAAK,KAAK,SAAS;IAC7B,SAAS,EAAK,IAAI;IAClB,SAAS;GACV,CAAC,GACK,IAAkB,EAAyB;IAChD,UAAU,EAAK,KAAK,OAAO;IAC3B,mBAAmB,EAAmB;IACtC,qBAAqB,EAAmB;GACzC,CAAC,IAGA,kBAAC,IAAD;IAAkC;IAAc,OAAO,EAAK,YAAY;GAAQ,CAAA,IAFhF,EAAK;GAaN,OARI,IACI,EAAkB;IACxB,GAAG;IACH;IACA;GACD,CAAC,IAGK;EACR;EACA,mBAAmB,IAAa,kBAAC,OAAD;GAAK,KAAK;GAAa,WAAW,EAAO;GAAU,eAAY;EAAQ,CAAA,IAAI;CAC3G,CAAA;AAEH"}
1
+ {"version":3,"file":"table-aozLLSJk.js","names":[],"sources":["../../src/table/Table.module.scss","../../src/table/Table.tsx"],"sourcesContent":[".selectedIndicatorCell {\n\tbox-shadow: inset 0.1875rem 0 0 var(--content-accent);\n}\n\n.sentinel {\n\theight: 1px;\n}\n","import { useEffect, useEffectEvent, useMemo, useRef } from \"react\";\n\nimport { formatPipelineDisplayValue } from \"@ryuzaki13/react-foundation-lib/formatters\";\nimport { TableFormulaRowData } from \"@ryuzaki13/react-foundation-lib/formulas\";\nimport {\n\ttype FoundationTableRow,\n\tfoundationTableFeatures,\n\ttype TableColumnDef,\n\ttype TableColumnOrderState,\n\ttype TableColumnSizingState,\n\ttype TableColumnVisibilityState,\n\ttype TableSelectionMode,\n\tuseTableRowSelection\n} from \"@ryuzaki13/react-foundation-lib/table\";\nimport { useTable } from \"@tanstack/react-table\";\n\nimport {\n\tBaseTable,\n\tbuildBaseTableMergedCellsLayout,\n\tbuildTableFormattingSnapshot,\n\tFormattedTableCell,\n\tgetOrderedVisibleLeafColumns,\n\tshouldUseTableFormatting,\n\tuseTableColumnOrder,\n\tuseTableColumnPinning,\n\tuseTableColumnSizing,\n\tuseTableColumnVisibility,\n\ttype BaseTableColumnState,\n\ttype BaseTableProps,\n\ttype TableColumnPinningState\n} from \"../base-table\";\n\nimport styles from \"./Table.module.scss\";\n\n/**\n * Возвращает индекс как строковый id, если внешний id не передан.\n */\nfunction defaultGetRowId<TData>(_row: TData, index: number): string {\n\treturn String(index);\n}\n\n/**\n * Пропсы компонента Table.\n *\n * Компонент предназначен для плоских данных и по API осознанно сближен с TreeTable.\n */\nexport interface TableProps<TData extends object> {\n\t/**\n\t * Необязательный заголовок над таблицей.\n\t */\n\ttitle?: string;\n\t/**\n\t * Признак первичной загрузки.\n\t */\n\tisLoading?: boolean;\n\t/**\n\t * Признак фоновой догрузки или обновления данных.\n\t */\n\tisFetching?: boolean;\n\t/**\n\t * Плоский источник строк.\n\t */\n\tdata: readonly TData[] | undefined | null;\n\t/**\n\t * Описание колонок таблицы.\n\t */\n\tcolumns: readonly TableColumnDef<TData>[];\n\t/**\n\t * Режим выбора строк.\n\t */\n\tselectionMode?: TableSelectionMode;\n\t/**\n\t * Внешний список выбранных строк.\n\t *\n\t * Если передан, таблица синхронизирует визуальное выделение с этим набором id.\n\t */\n\tselectedRowIds?: readonly string[];\n\t/**\n\t * Стабильный идентификатор строки.\n\t *\n\t * Если не задан, используется индекс строки.\n\t */\n\tgetRowId?: (row: TData, index: number) => string;\n\t/**\n\t * Дополнительный CSS-класс корневого контейнера.\n\t */\n\tclassName?: string;\n\tminHeight?: `${number}em` | `${number}%`;\n\t/**\n\t * Дополнительный CSS-класс тега `table`.\n\t */\n\ttableClassName?: string;\n\t/**\n\t * Внешнее controlled-состояние видимости колонок.\n\t */\n\tcolumnVisibility?: TableColumnVisibilityState;\n\t/**\n\t * Стартовое uncontrolled-состояние видимости колонок.\n\t */\n\tdefaultColumnVisibility?: TableColumnVisibilityState;\n\t/**\n\t * Внешнее controlled-состояние порядка колонок.\n\t */\n\tcolumnOrder?: readonly string[];\n\t/**\n\t * Стартовое uncontrolled-состояние порядка колонок.\n\t */\n\tdefaultColumnOrder?: readonly string[];\n\t/**\n\t * Внешнее controlled-состояние ширин колонок в px.\n\t */\n\tcolumnSizing?: TableColumnSizingState;\n\t/**\n\t * Стартовое uncontrolled-состояние ширин колонок в px.\n\t */\n\tdefaultColumnSizing?: TableColumnSizingState;\n\t/**\n\t * Внешнее controlled-состояние start-pinning для колонок.\n\t */\n\tcolumnPinning?: TableColumnPinningState;\n\t/**\n\t * Стартовое uncontrolled-состояние start-pinning для колонок.\n\t */\n\tdefaultColumnPinning?: TableColumnPinningState;\n\t/**\n\t * Включает изменение ширины колонок через header-handle.\n\t */\n\tenableColumnResizing?: boolean;\n\t/**\n\t * Включает изменение порядка колонок через drag&drop заголовков.\n\t */\n\tenableColumnReordering?: boolean;\n\t/**\n\t * Минимальная ширина колонки при resize в px.\n\t */\n\tcolumnResizeMinWidth?: number;\n\t/**\n\t * Вызывается после изменения видимости колонок.\n\t */\n\tonColumnVisibilityChange?: (state: TableColumnVisibilityState) => void;\n\t/**\n\t * Вызывается после изменения порядка колонок.\n\t */\n\tonColumnOrderChange?: (state: TableColumnOrderState) => void;\n\t/**\n\t * Вызывается после изменения ширины колонок.\n\t */\n\tonColumnSizingChange?: (state: TableColumnSizingState) => void;\n\t/**\n\t * Вызывается после изменения start-pinning state.\n\t */\n\tonColumnPinningChange?: (state: TableColumnPinningState) => void;\n\t/**\n\t * Вызывается при активации строки кликом или клавиатурой.\n\t */\n\tonRowClick?: (row: TData) => void;\n\t/**\n\t * Вызывается после изменения выбранных строк.\n\t */\n\tonRowSelectionChange?: (rows: TData[]) => void;\n\t/**\n\t * Вызывается при достижении конца таблицы внутри scroll-контейнера.\n\t */\n\tonReachEnd?: () => void;\n\t/**\n\t * Позволяет запретить выбор отдельных строк.\n\t */\n\tgetRowCanSelect?: (row: TData) => boolean;\n\t/**\n\t * Позволяет добавить CSS-класс для конкретной строки.\n\t */\n\tgetRowClassName?: (row: TData) => string | undefined;\n\t/**\n\t * Контекстное меню заголовка колонки. Используется для общих runtime-действий\n\t * вроде server sorting без встраивания доменной логики в shared-таблицу.\n\t */\n\trenderHeaderContextMenu?: BaseTableProps<TData>[\"renderHeaderContextMenu\"];\n\t/**\n\t * Тонкая точка расширения содержимого ячейки поверх стандартного форматирования.\n\t *\n\t * В отличие от `column.cell`, этот слот не отключает общий formatting-runtime:\n\t * `defaultContent` уже содержит отформатированное значение, если оно применимо.\n\t */\n\trenderCellContent?: BaseTableProps<TData>[\"renderCellContent\"];\n}\n\n/**\n * Плоская таблица на базе TanStack Table как React-альтернатива `sap.m.Table`.\n */\nexport function Table<TData extends object>({\n\ttitle,\n\tisLoading,\n\tisFetching,\n\tdata,\n\tcolumns,\n\tselectionMode = \"none\",\n\tselectedRowIds,\n\tgetRowId,\n\tclassName,\n\tminHeight,\n\ttableClassName,\n\tcolumnVisibility,\n\tdefaultColumnVisibility,\n\tcolumnOrder,\n\tdefaultColumnOrder,\n\tcolumnSizing,\n\tdefaultColumnSizing,\n\tcolumnPinning,\n\tdefaultColumnPinning,\n\tenableColumnResizing = false,\n\tenableColumnReordering = false,\n\tcolumnResizeMinWidth,\n\tonColumnVisibilityChange,\n\tonColumnOrderChange,\n\tonColumnSizingChange,\n\tonColumnPinningChange,\n\tonRowClick,\n\tonRowSelectionChange,\n\tonReachEnd,\n\tgetRowCanSelect,\n\tgetRowClassName,\n\trenderHeaderContextMenu,\n\trenderCellContent\n}: TableProps<TData>) {\n\tconst tableData = useMemo(() => data ?? [], [data]);\n\tconst formattingSnapshot = useMemo(() => buildTableFormattingSnapshot(columns), [columns]);\n\tconst resolveRowId = getRowId ?? defaultGetRowId<TData>;\n\tconst rowById = useMemo(() => new Map(tableData.map((row, index) => [resolveRowId(row, index), row])), [resolveRowId, tableData]);\n\tconst availableRowIds = useMemo(() => Array.from(rowById.keys()), [rowById]);\n\tconst scrollableRef = useRef<HTMLDivElement | null>(null);\n\tconst sentinelRef = useRef<HTMLDivElement | null>(null);\n\n\tconst { rowSelection, activateRowSelection } = useTableRowSelection({\n\t\tavailableRowIds,\n\t\trowById,\n\t\tselectionMode,\n\t\tselectedRowIds,\n\t\tonRowSelectionChange\n\t});\n\tconst { columnVisibility: resolvedColumnVisibility, onColumnVisibilityChange: handleColumnVisibilityChange } = useTableColumnVisibility(\n\t\t{\n\t\t\tcolumnVisibility,\n\t\t\tdefaultColumnVisibility,\n\t\t\tonColumnVisibilityChange\n\t\t}\n\t);\n\tconst { columnOrder: resolvedColumnOrder, onColumnOrderChange: handleColumnOrderChange } = useTableColumnOrder({\n\t\tcolumnOrder,\n\t\tdefaultColumnOrder,\n\t\tonColumnOrderChange\n\t});\n\tconst { columnSizing: resolvedColumnSizing, onColumnSizingChange: handleColumnSizingChange } = useTableColumnSizing({\n\t\tcolumnSizing,\n\t\tdefaultColumnSizing,\n\t\tcolumnResizeMinWidth,\n\t\tonColumnSizingChange\n\t});\n\tconst { columnPinning: resolvedColumnPinning, onColumnPinningChange: handleColumnPinningChange } = useTableColumnPinning({\n\t\tcolumnPinning,\n\t\tdefaultColumnPinning,\n\t\tonColumnPinningChange\n\t});\n\tconst baseTableColumnState = useMemo<BaseTableColumnState>(\n\t\t() => ({\n\t\t\tcolumnOrder: resolvedColumnOrder,\n\t\t\tcolumnPinning: resolvedColumnPinning,\n\t\t\tcolumnSizing: resolvedColumnSizing,\n\t\t\tcolumnVisibility: resolvedColumnVisibility\n\t\t}),\n\t\t[resolvedColumnOrder, resolvedColumnPinning, resolvedColumnSizing, resolvedColumnVisibility]\n\t);\n\n\tconst emitReachEnd = useEffectEvent(() => {\n\t\tonReachEnd?.();\n\t});\n\n\tuseEffect(() => {\n\t\tif (!onReachEnd || !scrollableRef.current || !sentinelRef.current || isLoading) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst observer = new IntersectionObserver(\n\t\t\t(entries) => {\n\t\t\t\tconst entry = entries[0];\n\n\t\t\t\tif (entry?.isIntersecting) {\n\t\t\t\t\temitReachEnd();\n\t\t\t\t}\n\t\t\t},\n\t\t\t{\n\t\t\t\troot: scrollableRef.current,\n\t\t\t\tthreshold: 0.1\n\t\t\t}\n\t\t);\n\n\t\tobserver.observe(sentinelRef.current);\n\n\t\treturn () => observer.disconnect();\n\t}, [isLoading, onReachEnd, tableData.length]);\n\n\tconst table = useTable({\n\t\tfeatures: foundationTableFeatures,\n\t\tdata: tableData as TData[],\n\t\tcolumns: columns as TableColumnDef<TData>[],\n\t\tstate: {\n\t\t\tcolumnOrder: resolvedColumnOrder,\n\t\t\tcolumnPinning: resolvedColumnPinning,\n\t\t\tcolumnSizing: resolvedColumnSizing,\n\t\t\tcolumnVisibility: resolvedColumnVisibility,\n\t\t\trowSelection\n\t\t},\n\t\tonColumnOrderChange: handleColumnOrderChange,\n\t\tonColumnPinningChange: handleColumnPinningChange,\n\t\tonColumnSizingChange: handleColumnSizingChange,\n\t\tonColumnVisibilityChange: handleColumnVisibilityChange,\n\t\tgetRowId: (row, index) => resolveRowId(row, index),\n\t\tenableMultiRowSelection: selectionMode === \"multi\",\n\t\tenableRowSelection: (row) => {\n\t\t\tif (selectionMode === \"none\") {\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\treturn getRowCanSelect ? getRowCanSelect(row.original) : true;\n\t\t}\n\t});\n\n\tconst visibleLeafColumns = getOrderedVisibleLeafColumns(table, baseTableColumnState);\n\tconst rowModelRows = table.getRowModel().rows;\n\tconst mergedCellLayout = useMemo(\n\t\t() =>\n\t\t\tbuildBaseTableMergedCellsLayout({\n\t\t\t\trows: rowModelRows,\n\t\t\t\tcolumns: visibleLeafColumns\n\t\t\t}),\n\t\t[rowModelRows, visibleLeafColumns]\n\t);\n\tconst leadingColumnId = visibleLeafColumns[0]?.id;\n\n\t/**\n\t * Активирует строку: обновляет выбор в соответствии с режимом и вызывает внешний callback.\n\t */\n\tconst activateRow = (row: FoundationTableRow<TData>) => {\n\t\tactivateRowSelection(row.id, row.getCanSelect());\n\t\tonRowClick?.(row.original);\n\t};\n\n\treturn (\n\t\t<BaseTable\n\t\t\ttable={table}\n\t\t\tcolumnState={baseTableColumnState}\n\t\t\ttitle={title}\n\t\t\tisLoading={isLoading}\n\t\t\tisFetching={isFetching}\n\t\t\tclassName={className}\n\t\t\tminHeight={minHeight}\n\t\t\ttableClassName={tableClassName}\n\t\t\tselectionMode={selectionMode}\n\t\t\tscrollableRef={scrollableRef}\n\t\t\tonActivateRow={selectionMode !== \"none\" || onRowClick ? activateRow : undefined}\n\t\t\tisRowInteractive={(row) => Boolean(onRowClick || (selectionMode !== \"none\" && row.getCanSelect()))}\n\t\t\tgetRowClassName={(row) => getRowClassName?.(row.original)}\n\t\t\tgetCellClassName={({ row, cell }) =>\n\t\t\t\tcell.column.id === leadingColumnId && row.getIsSelected() ? styles.selectedIndicatorCell : undefined\n\t\t\t}\n\t\t\tgetCellLayout={({ cell }) => mergedCellLayout.get(cell.id)}\n\t\t\trenderHeaderContextMenu={renderHeaderContextMenu}\n\t\t\tenableColumnResizing={enableColumnResizing}\n\t\t\tenableColumnReordering={enableColumnReordering}\n\t\t\tcolumnResizeMinWidth={columnResizeMinWidth}\n\t\t\trenderCellContent={(args) => {\n\t\t\t\tconst displayValue = formatPipelineDisplayValue({\n\t\t\t\t\tfield: formattingSnapshot.runtimeByColumnId[args.cell.column.id],\n\t\t\t\t\trawValue: args.cell.getValue(),\n\t\t\t\t\trowData: args.row.original as TableFormulaRowData,\n\t\t\t\t\trowKind: \"plain\"\n\t\t\t\t});\n\t\t\t\tconst defaultContent = !shouldUseTableFormatting({\n\t\t\t\t\tcolumnId: args.cell.column.id,\n\t\t\t\t\truntimeByColumnId: formattingSnapshot.runtimeByColumnId,\n\t\t\t\t\tcustomCellColumnIds: formattingSnapshot.customCellColumnIds\n\t\t\t\t}) ? (\n\t\t\t\t\targs.defaultContent\n\t\t\t\t) : (\n\t\t\t\t\t<FormattedTableCell displayValue={displayValue} align={args.columnMeta?.align} />\n\t\t\t\t);\n\n\t\t\t\tif (renderCellContent) {\n\t\t\t\t\treturn renderCellContent({\n\t\t\t\t\t\t...args,\n\t\t\t\t\t\tdefaultContent,\n\t\t\t\t\t\tdisplayValue\n\t\t\t\t\t});\n\t\t\t\t}\n\n\t\t\t\treturn defaultContent;\n\t\t\t}}\n\t\t\tafterTableContent={onReachEnd ? <div ref={sentinelRef} className={styles.sentinel} aria-hidden=\"true\" /> : null}\n\t\t/>\n\t);\n}\n"],"mappings":";;;;;;;;;;;;ACqCA,SAAS,GAAuB,GAAa,GAAuB;CACnE,OAAO,OAAO,CAAK;AACpB;AAsJA,SAAgB,EAA4B,EAC3C,UACA,cACA,gBACA,SACA,YACA,mBAAgB,QAChB,oBACA,cACA,eACA,eACA,oBACA,qBACA,4BACA,gBACA,uBACA,iBACA,wBACA,kBACA,yBACA,0BAAuB,IACvB,4BAAyB,IACzB,yBACA,6BACA,wBACA,yBACA,0BACA,eACA,yBACA,eACA,oBACA,oBACA,6BACA,wBACqB;CACrB,IAAM,IAAY,QAAc,KAAQ,CAAC,GAAG,CAAC,CAAI,CAAC,GAC5C,IAAqB,QAAc,EAA6B,CAAO,GAAG,CAAC,CAAO,CAAC,GACnF,IAAe,MAAY,IAC3B,IAAU,QAAc,IAAI,IAAI,EAAU,KAAK,GAAK,MAAU,CAAC,EAAa,GAAK,CAAK,GAAG,CAAG,CAAC,CAAC,GAAG,CAAC,GAAc,CAAS,CAAC,GAC1H,KAAkB,QAAc,MAAM,KAAK,EAAQ,KAAK,CAAC,GAAG,CAAC,CAAO,CAAC,GACrE,IAAgB,EAA8B,IAAI,GAClD,IAAc,EAA8B,IAAI,GAEhD,EAAE,kBAAc,6BAAyB,EAAqB;EACnE;EACA;EACA;EACA;EACA;CACD,CAAC,GACK,EAAE,kBAAkB,GAA0B,0BAA0B,OAAiC,GAC9G;EACC;EACA;EACA;CACD,CACD,GACM,EAAE,aAAa,GAAqB,qBAAqB,OAA4B,EAAoB;EAC9G;EACA;EACA;CACD,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f,eAAe,MAAkB,UAAU,KAjBxB,MAAmC;GAEvD,AADA,GAAqB,EAAI,IAAI,EAAI,aAAa,CAAC,GAC/C,IAAa,EAAI,QAAQ;EAC1B,IAcwE,KAAA;EACtE,mBAAmB,MAAQ,GAAQ,KAAe,MAAkB,UAAU,EAAI,aAAa;EAC/F,kBAAkB,MAAQ,IAAkB,EAAI,QAAQ;EACxD,mBAAmB,EAAE,QAAK,cACzB,EAAK,OAAO,OAAO,MAAmB,EAAI,cAAc,IAAI,EAAO,wBAAwB,KAAA;EAE5F,gBAAgB,EAAE,cAAW,GAAiB,IAAI,EAAK,EAAE;EAChC;EACH;EACE;EACF;EACtB,oBAAoB,MAAS;GAC5B,IAAM,IAAe,EAA2B;IAC/C,OAAO,EAAmB,kBAAkB,EAAK,KAAK,OAAO;IAC7D,UAAU,EAAK,KAAK,SAAS;IAC7B,SAAS,EAAK,IAAI;IAClB,SAAS;GACV,CAAC,GACK,IAAkB,EAAyB;IAChD,UAAU,EAAK,KAAK,OAAO;IAC3B,mBAAmB,EAAmB;IACtC,qBAAqB,EAAmB;GACzC,CAAC,IAGA,kBAAC,IAAD;IAAkC;IAAc,OAAO,EAAK,YAAY;GAAQ,CAAA,IAFhF,EAAK;GAaN,OARI,IACI,EAAkB;IACxB,GAAG;IACH;IACA;GACD,CAAC,IAGK;EACR;EACA,mBAAmB,IAAa,kBAAC,OAAD;GAAK,KAAK;GAAa,WAAW,EAAO;GAAU,eAAY;EAAQ,CAAA,IAAI;CAC3G,CAAA;AAEH"}
@@ -3,6 +3,8 @@ export interface ContextMenuTriggerProps {
3
3
  children: React.ReactElement<React.HTMLAttributes<HTMLElement> & {
4
4
  ref?: React.Ref<HTMLElement>;
5
5
  }>;
6
+ /** Позволяет одному ContextMenu обслуживать множество вложенных целей без отдельного floating-ui runtime на каждую строку или ячейку. */
7
+ resolveTrigger?: (eventTarget: EventTarget | null) => HTMLElement | null;
6
8
  }
7
9
  export declare const ContextMenuTrigger: React.FC<ContextMenuTriggerProps>;
8
10
  //# sourceMappingURL=ContextMenuTrigger.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"ContextMenuTrigger.d.ts","sourceRoot":"","sources":["../../../src/context-menu/components/ContextMenuTrigger.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAuB,MAAM,OAAO,CAAC;AAK5C,MAAM,WAAW,uBAAuB;IACvC,QAAQ,EAAE,KAAK,CAAC,YAAY,CAAC,KAAK,CAAC,cAAc,CAAC,WAAW,CAAC,GAAG;QAAE,GAAG,CAAC,EAAE,KAAK,CAAC,GAAG,CAAC,WAAW,CAAC,CAAA;KAAE,CAAC,CAAC;CACnG;AAED,eAAO,MAAM,kBAAkB,EAAE,KAAK,CAAC,EAAE,CAAC,uBAAuB,CAkBhE,CAAC"}
1
+ {"version":3,"file":"ContextMenuTrigger.d.ts","sourceRoot":"","sources":["../../../src/context-menu/components/ContextMenuTrigger.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAuB,MAAM,OAAO,CAAC;AAK5C,MAAM,WAAW,uBAAuB;IACvC,QAAQ,EAAE,KAAK,CAAC,YAAY,CAAC,KAAK,CAAC,cAAc,CAAC,WAAW,CAAC,GAAG;QAAE,GAAG,CAAC,EAAE,KAAK,CAAC,GAAG,CAAC,WAAW,CAAC,CAAA;KAAE,CAAC,CAAC;IACnG,yIAAyI;IACzI,cAAc,CAAC,EAAE,CAAC,WAAW,EAAE,WAAW,GAAG,IAAI,KAAK,WAAW,GAAG,IAAI,CAAC;CACzE;AAED,eAAO,MAAM,kBAAkB,EAAE,KAAK,CAAC,EAAE,CAAC,uBAAuB,CA4BhE,CAAC"}
@@ -11,8 +11,8 @@ interface MenuContextValue {
11
11
  setFloating: (node: HTMLElement | null) => void;
12
12
  registerTriggerElement: (node: HTMLElement | null) => void;
13
13
  onTriggerClick: (event: React.MouseEvent<HTMLElement>) => void;
14
- onTriggerContextMenu: (event: React.MouseEvent<HTMLElement>) => void;
15
- onTriggerKeyDown: (event: React.KeyboardEvent<HTMLElement>) => void;
14
+ onTriggerContextMenu: (event: React.MouseEvent<HTMLElement>, triggerElement?: HTMLElement) => void;
15
+ onTriggerKeyDown: (event: React.KeyboardEvent<HTMLElement>, triggerElement?: HTMLElement) => void;
16
16
  closeMenu: () => void;
17
17
  }
18
18
  export declare const MenuContext: import("react").Context<MenuContextValue | null>;
@@ -1 +1 @@
1
- {"version":3,"file":"MenuContext.d.ts","sourceRoot":"","sources":["../../../src/context-menu/components/MenuContext.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,cAAc,EAAE,SAAS,EAAE,MAAM,8CAA8C,CAAC;AAE9F,MAAM,MAAM,eAAe,GAAG,OAAO,GAAG,aAAa,CAAC;AAEtD,UAAU,gBAAgB;IACzB,IAAI,EAAE,eAAe,CAAC;IACtB,IAAI,EAAE,OAAO,CAAC;IACd,UAAU,EAAE,cAAc,GAAG,IAAI,CAAC;IAClC,WAAW,EAAE,SAAS,GAAG,IAAI,CAAC;IAC9B,cAAc,EAAE,KAAK,CAAC,aAAa,CAAC;IACpC,WAAW,EAAE,KAAK,CAAC,SAAS,CAAC,WAAW,GAAG,IAAI,CAAC,CAAC;IACjD,UAAU,EAAE,KAAK,CAAC,SAAS,CAAC,WAAW,GAAG,IAAI,CAAC,CAAC;IAChD,WAAW,EAAE,CAAC,IAAI,EAAE,WAAW,GAAG,IAAI,KAAK,IAAI,CAAC;IAChD,sBAAsB,EAAE,CAAC,IAAI,EAAE,WAAW,GAAG,IAAI,KAAK,IAAI,CAAC;IAC3D,cAAc,EAAE,CAAC,KAAK,EAAE,KAAK,CAAC,UAAU,CAAC,WAAW,CAAC,KAAK,IAAI,CAAC;IAC/D,oBAAoB,EAAE,CAAC,KAAK,EAAE,KAAK,CAAC,UAAU,CAAC,WAAW,CAAC,KAAK,IAAI,CAAC;IACrE,gBAAgB,EAAE,CAAC,KAAK,EAAE,KAAK,CAAC,aAAa,CAAC,WAAW,CAAC,KAAK,IAAI,CAAC;IACpE,SAAS,EAAE,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B,cAAc,qBAS7B"}
@@ -1 +1 @@
1
- {"version":3,"file":"MenuRoot.d.ts","sourceRoot":"","sources":["../../../src/context-menu/components/MenuRoot.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAiD,MAAM,OAAO,CAAC;AAEtE,OAAO,EAA4B,SAAS,EAAsB,MAAM,oBAAoB,CAAC;AAU7F,OAAO,EAAe,eAAe,EAAE,MAAM,eAAe,CAAC;AAE7D,UAAU,aAAa;IACtB,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B,IAAI,EAAE,eAAe,CAAC;IACtB,SAAS,CAAC,EAAE,SAAS,CAAC;IACtB,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,YAAY,CAAC,EAAE,CAAC,IAAI,EAAE,OAAO,KAAK,IAAI,CAAC;CACvC;AAED,wBAAgB,QAAQ,CAAC,EACxB,QAAQ,EACR,IAAI,EACJ,SAA6D,EAC7D,IAAI,EAAE,cAAc,EACpB,WAAW,EACX,YAAY,EACZ,EAAE,aAAa,qBAyKf"}
1
+ {"version":3,"file":"MenuRoot.d.ts","sourceRoot":"","sources":["../../../src/context-menu/components/MenuRoot.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAiD,MAAM,OAAO,CAAC;AAEtE,OAAO,EAA4B,SAAS,EAAsB,MAAM,oBAAoB,CAAC;AAU7F,OAAO,EAAe,eAAe,EAAE,MAAM,eAAe,CAAC;AAE7D,UAAU,aAAa;IACtB,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B,IAAI,EAAE,eAAe,CAAC;IACtB,SAAS,CAAC,EAAE,SAAS,CAAC;IACtB,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,YAAY,CAAC,EAAE,CAAC,IAAI,EAAE,OAAO,KAAK,IAAI,CAAC;CACvC;AAED,wBAAgB,QAAQ,CAAC,EACxB,QAAQ,EACR,IAAI,EACJ,SAA6D,EAC7D,IAAI,EAAE,cAAc,EACpB,WAAW,EACX,YAAY,EACZ,EAAE,aAAa,qBAgLf"}
@@ -1,2 +1,2 @@
1
- import { n as e, t } from "../chunks/context-menu-CCAr_R-t.js";
1
+ import { n as e, t } from "../chunks/context-menu-HC7Vteb5.js";
2
2
  export { e as ContextMenu, t as DropdownMenu };
@@ -1,3 +1,3 @@
1
- import { a as e, i as t, n, o as r, r as i, s as a, t as o } from "../chunks/CalendarView-BK-Q6GVc.js";
2
- import { _ as s, a as c, b as l, c as u, d, f, g as p, h as m, i as h, l as g, m as _, n as v, o as y, p as b, r as x, s as S, t as C, u as w, v as T, y as E } from "../chunks/date-input-DXXKeLcq.js";
1
+ import { a as e, i as t, n, o as r, r as i, s as a, t as o } from "../chunks/CalendarView-Bhaov_XE.js";
2
+ import { _ as s, a as c, b as l, c as u, d, f, g as p, h as m, i as h, l as g, m as _, n as v, o as y, p as b, r as x, s as S, t as C, u as w, v as T, y as E } from "../chunks/date-input-DkLfO3Ng.js";
3
3
  export { o as CalendarView, p as DATE_INPUT_SELECTION_MODES, s as DATE_INPUT_SELECTION_MODE_OPTIONS, n as DATE_INPUT_WEEK_END_DAYS, i as DATE_PICKER_LEVELS, x as DEFAULT_DATE_INPUT_FORMAT, h as DEFAULT_DATE_INPUT_PRESET, C as RangeDateInput, v as SingleDateInput, c as areRangeDateValuesEqual, y as areSingleDateValuesEqual, S as formatDateInputValue, u as formatRangeDateValue, g as formatSingleDateValue, t as getDatePickerLevelForSelectionMode, T as isDateInputSelectionMode, e as isDatePickerLevelAvailable, E as normalizeDateInputSelectionModes, w as normalizeRangeDateValue, d as normalizeRangeEndDateValue, f as normalizeSingleDateValue, b as parseRangeDateValue, _ as parseRangeEndDateValue, m as parseSingleDateValue, r as resolveAvailableDatePickerLevel, a as resolveDateInputPeriodRangeState, l as resolveDateInputSelectionModeOptionsByModes };