@ryuzaki13/react-foundation-ui 1.4.2 → 1.4.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (515) hide show
  1. package/dist/advanced-search/index.js +12 -11
  2. package/dist/advanced-search/index.js.map +1 -1
  3. package/dist/badge/index.js +1 -1
  4. package/dist/base-table/index.js +2 -2
  5. package/dist/button/index.js +1 -1
  6. package/dist/chunks/{CalendarView-KCkhCtK-.js → CalendarView-Z_XWk7aI.js} +8 -8
  7. package/dist/chunks/{CalendarView-KCkhCtK-.js.map → CalendarView-Z_XWk7aI.js.map} +1 -1
  8. package/dist/chunks/{ImageViewerRuntime-RN49by8Y.js → ImageViewerRuntime-BMs3BBkV.js} +4 -4
  9. package/dist/chunks/{ImageViewerRuntime-RN49by8Y.js.map → ImageViewerRuntime-BMs3BBkV.js.map} +1 -1
  10. package/dist/chunks/{TextEditorLexicalClient-CVTrglWP.js → TextEditorLexicalClient-CK8j3RA4.js} +16 -18
  11. package/dist/chunks/{TextEditorLexicalClient-CVTrglWP.js.map → TextEditorLexicalClient-CK8j3RA4.js.map} +1 -1
  12. package/dist/chunks/{badge-Cri0-kVK.js → badge-DwIUjH0a.js} +2 -2
  13. package/dist/chunks/{badge-Cri0-kVK.js.map → badge-DwIUjH0a.js.map} +1 -1
  14. package/dist/chunks/{base-table-D5IqsjQD.js → base-table-BFsVwXg3.js} +13 -12
  15. package/dist/chunks/{base-table-D5IqsjQD.js.map → base-table-BFsVwXg3.js.map} +1 -1
  16. package/dist/chunks/{button-CC0Jdx1j.js → button-BU2kRzwu.js} +2 -2
  17. package/dist/chunks/{button-CC0Jdx1j.js.map → button-BU2kRzwu.js.map} +1 -1
  18. package/dist/chunks/check-box-Dd3YFuxd.js.map +1 -1
  19. package/dist/chunks/{context-menu-DQeR3y7M.js → context-menu-C6RO7soI.js} +7 -2
  20. package/dist/chunks/{context-menu-DQeR3y7M.js.map → context-menu-C6RO7soI.js.map} +1 -1
  21. package/dist/chunks/{date-input-DBJisPRz.js → date-input-BzExUQnc.js} +5 -5
  22. package/dist/chunks/{date-input-DBJisPRz.js.map → date-input-BzExUQnc.js.map} +1 -1
  23. package/dist/chunks/{flex-DYZ0IbU6.js → flex-C7njxZ74.js} +10 -7
  24. package/dist/chunks/{flex-DYZ0IbU6.js.map → flex-C7njxZ74.js.map} +1 -1
  25. package/dist/chunks/floating-arrow-BE-z4QkE.js.map +1 -1
  26. package/dist/chunks/{input-BCJfUdK_.js → input-Bp6_Ucgr.js} +15 -15
  27. package/dist/chunks/{input-BCJfUdK_.js.map → input-Bp6_Ucgr.js.map} +1 -1
  28. package/dist/chunks/{input-files-Dcc5K-_1.js → input-files-D1JzSw_Y.js} +2 -2
  29. package/dist/chunks/{input-files-Dcc5K-_1.js.map → input-files-D1JzSw_Y.js.map} +1 -1
  30. package/dist/chunks/{input-search-B7HmrAM7.js → input-search-Bkhcinru.js} +2 -2
  31. package/dist/chunks/{input-search-B7HmrAM7.js.map → input-search-Bkhcinru.js.map} +1 -1
  32. package/dist/chunks/{misc-DIF5h9ba.js → misc-BYxxlJz6.js} +3 -3
  33. package/dist/chunks/{misc-DIF5h9ba.js.map → misc-BYxxlJz6.js.map} +1 -1
  34. package/dist/chunks/{modal-DXHX_sA-.js → modal-paexEF0j.js} +4 -5
  35. package/dist/chunks/{modal-DXHX_sA-.js.map → modal-paexEF0j.js.map} +1 -1
  36. package/dist/chunks/{multi-select-CWx12rgb.js → multi-select-COEkc8Qc.js} +4 -5
  37. package/dist/chunks/multi-select-COEkc8Qc.js.map +1 -0
  38. package/dist/chunks/{picker-BAQ9NeHe.js → picker-e6IsrMUG.js} +3 -3
  39. package/dist/chunks/{picker-BAQ9NeHe.js.map → picker-e6IsrMUG.js.map} +1 -1
  40. package/dist/chunks/{popover-xJJqy1v6.js → popover-CGU3MlsH.js} +14 -14
  41. package/dist/chunks/{popover-xJJqy1v6.js.map → popover-CGU3MlsH.js.map} +1 -1
  42. package/dist/chunks/radio-group-CM9Lg_nc.js.map +1 -1
  43. package/dist/chunks/{select-BPb-eL3O.js → select-BON0S9Dr.js} +115 -115
  44. package/dist/chunks/select-BON0S9Dr.js.map +1 -0
  45. package/dist/chunks/sortable-DcTIAbjD.js.map +1 -1
  46. package/dist/chunks/{table-xMAjqtcY.js → table-Dd5BcC0k.js} +3 -3
  47. package/dist/chunks/{table-xMAjqtcY.js.map → table-Dd5BcC0k.js.map} +1 -1
  48. package/dist/chunks/{table-column-interactions-BGd5Lwy9.js → table-column-interactions-DzEvVuXe.js} +8 -5
  49. package/dist/chunks/{table-column-interactions-BGd5Lwy9.js.map → table-column-interactions-DzEvVuXe.js.map} +1 -1
  50. package/dist/chunks/useODataSelectBase-CKe1AVMI.js.map +1 -1
  51. package/dist/chunks/wheel-picker-FS58cRsQ.js.map +1 -1
  52. package/dist/context-menu/index.js +1 -1
  53. package/dist/date-input/index.js +2 -2
  54. package/dist/date-time-input/index.js +4 -4
  55. package/dist/date-time-input/index.js.map +1 -1
  56. package/dist/detail/index.js.map +1 -1
  57. package/dist/dialog/index.js.map +1 -1
  58. package/dist/disclosure/index.js +1 -1
  59. package/dist/disclosure/index.js.map +1 -1
  60. package/dist/drop-zone/index.js +1 -1
  61. package/dist/drop-zone/index.js.map +1 -1
  62. package/dist/errors/index.js +1 -1
  63. package/dist/errors/index.js.map +1 -1
  64. package/dist/expandable-action-panel/index.js +2 -2
  65. package/dist/expandable-action-panel/index.js.map +1 -1
  66. package/dist/flex/index.js +1 -1
  67. package/dist/fullscreen-portal/index.js +3 -3
  68. package/dist/fullscreen-portal/index.js.map +1 -1
  69. package/dist/image/index.js +5 -5
  70. package/dist/image/index.js.map +1 -1
  71. package/dist/input/index.js +1 -1
  72. package/dist/input-date-time/index.js +1 -1
  73. package/dist/input-date-time/index.js.map +1 -1
  74. package/dist/input-file/index.js +1 -1
  75. package/dist/input-file/index.js.map +1 -1
  76. package/dist/input-files/index.js +1 -1
  77. package/dist/input-image/index.js +1 -1
  78. package/dist/input-image/index.js.map +1 -1
  79. package/dist/input-search/index.js +1 -1
  80. package/dist/layout-picker/index.js +3 -4
  81. package/dist/layout-picker/index.js.map +1 -1
  82. package/dist/layout-picker/ui/LayoutPicker.d.ts.map +1 -1
  83. package/dist/list/index.js +7 -7
  84. package/dist/list/index.js.map +1 -1
  85. package/dist/listbox/index.js.map +1 -1
  86. package/dist/misc/index.js +1 -1
  87. package/dist/modal/index.js +1 -1
  88. package/dist/multi-select/index.js +1 -1
  89. package/dist/multi-select/ui/MultiSelect.d.ts.map +1 -1
  90. package/dist/notifications/index.js +13 -11
  91. package/dist/notifications/index.js.map +1 -1
  92. package/dist/pages/index.js.map +1 -1
  93. package/dist/panel/index.js.map +1 -1
  94. package/dist/picker/index.js +1 -1
  95. package/dist/picker/types.d.ts +1 -1
  96. package/dist/picker/types.d.ts.map +1 -1
  97. package/dist/popover/index.js +1 -1
  98. package/dist/preset-range-date-input/index.js +2 -2
  99. package/dist/preset-range-date-input/index.js.map +1 -1
  100. package/dist/preset-select/index.js +1 -1
  101. package/dist/radio-button/index.js.map +1 -1
  102. package/dist/select/Select.d.ts.map +1 -1
  103. package/dist/select/index.js +1 -1
  104. package/dist/simple-table/index.js +1 -1
  105. package/dist/slider/index.js +27 -24
  106. package/dist/slider/index.js.map +1 -1
  107. package/dist/splitter/index.js.map +1 -1
  108. package/dist/state-select/index.js +12 -10
  109. package/dist/state-select/index.js.map +1 -1
  110. package/dist/styles.css +1 -1
  111. package/dist/switch/index.js +1 -1
  112. package/dist/switch/index.js.map +1 -1
  113. package/dist/table/index.js +1 -1
  114. package/dist/table-column-interactions/index.js +1 -1
  115. package/dist/table-sorting/index.js +1 -1
  116. package/dist/table-sorting/index.js.map +1 -1
  117. package/dist/tabs/index.js +6 -6
  118. package/dist/tabs/index.js.map +1 -1
  119. package/dist/tag-input/index.js +1 -1
  120. package/dist/tag-input/index.js.map +1 -1
  121. package/dist/text/index.js +10 -8
  122. package/dist/text/index.js.map +1 -1
  123. package/dist/text-editor/index.js +2 -2
  124. package/dist/textarea/index.js +1 -1
  125. package/dist/textarea/index.js.map +1 -1
  126. package/dist/toggle/index.js.map +1 -1
  127. package/dist/toolbar/index.js +1 -2
  128. package/dist/toolbar/index.js.map +1 -1
  129. package/dist/tree/index.js.map +1 -1
  130. package/dist/tree-select/TreePickerBase.d.ts.map +1 -1
  131. package/dist/tree-select/index.js +134 -132
  132. package/dist/tree-select/index.js.map +1 -1
  133. package/dist/tree-table/index.js +2 -2
  134. package/dist/tree-table/index.js.map +1 -1
  135. package/package.json +52 -59
  136. package/storybook-static/assets/{Badge-SZ48u9qp.js → Badge-Bh73-APE.js} +11 -11
  137. package/storybook-static/assets/Badge.stories-gNFtCWnR.js +54 -0
  138. package/storybook-static/assets/{Button-CFCpYiPy.js → Button-O9QPAftp.js} +10 -10
  139. package/storybook-static/assets/Button-mjF9HSg0.js +12 -0
  140. package/storybook-static/assets/Button.stories-wkiE0c_a.js +75 -0
  141. package/storybook-static/assets/CalendarView-CqKlnF8k.js +1 -0
  142. package/storybook-static/assets/{DateInput-BfFTwd_P.css → CalendarView-DKvrkS40.css} +1 -1
  143. package/storybook-static/assets/{CheckBox-FoMSruZC.js → CheckBox-CB8fTQF0.js} +11 -11
  144. package/storybook-static/assets/CheckBox-Clpeg9q7.js +2 -0
  145. package/storybook-static/assets/CheckBox.module-BBzuj5He.js +1 -0
  146. package/storybook-static/assets/CheckBox.stories-pfWBxvOy.js +60 -0
  147. package/storybook-static/assets/Color-6AOWCN3U-CVvkiihj.js +1 -0
  148. package/storybook-static/assets/ContextMenu-Sv4wfyS3.js +1 -0
  149. package/storybook-static/assets/{ContextMenu-CU_1kOzV.js → ContextMenu-eGnlhRRu.js} +9 -9
  150. package/storybook-static/assets/ContextMenu.stories-CVw3hOvY.js +90 -0
  151. package/storybook-static/assets/DateInput-D8_Oleoy.js +1 -0
  152. package/storybook-static/assets/{DateInput-BeZ5esVE.js → DateInput-DQDplLib.js} +11 -11
  153. package/storybook-static/assets/DateInput-pmGiwdvw.css +1 -0
  154. package/storybook-static/assets/{DateInput.stories-Bkw2r8CD.js → DateInput.stories-BNpS4CND.js} +2 -2
  155. package/storybook-static/assets/DateRangePresetSelect-Bfx-d5qg.js +3 -0
  156. package/storybook-static/assets/{DateRangePresetSelect-C_mLvEoK.js → DateRangePresetSelect-DCBEf98i.js} +8 -8
  157. package/storybook-static/assets/DateRangePresetSelect.stories-PAV2jgQb.js +11 -0
  158. package/storybook-static/assets/{Detail-WzciiK9S.js → Detail-DvmdQCue.js} +11 -11
  159. package/storybook-static/assets/Detail.stories-CEm00aSN.js +44 -0
  160. package/storybook-static/assets/{Dialog-CwLsVxJY.js → Dialog-3I2Y7jD7.js} +9 -9
  161. package/storybook-static/assets/Dialog.stories-lcadmonM.js +31 -0
  162. package/storybook-static/assets/{Disclosure-BlRuGrk2.js → Disclosure-DUIQ37oh.js} +10 -10
  163. package/storybook-static/assets/Disclosure.stories-BeizaZWP.js +41 -0
  164. package/storybook-static/assets/DocsRenderer-JROSPFPF-DwPk6ai7.js +2 -0
  165. package/storybook-static/assets/{DropZone-Cr3nfCWA.js → DropZone-BGuCU5dq.js} +10 -10
  166. package/storybook-static/assets/DropZone.stories-B4J6OZ3T.js +44 -0
  167. package/storybook-static/assets/ExpandableActionPanel.stories-gCrqbhG6.js +20 -0
  168. package/storybook-static/assets/{Flex-C10912WS.js → Flex-CBwbh1yu.js} +18 -18
  169. package/storybook-static/assets/Flex.stories-cdk6vRZq.js +300 -0
  170. package/storybook-static/assets/FlexContainer-LmZIdhq2.js +1 -0
  171. package/storybook-static/assets/FlexItem-vkDYa5tA.js +3 -0
  172. package/storybook-static/assets/FloatingPopover-D4h-c24R.js +1 -0
  173. package/storybook-static/assets/FloatingPopover-DC84VrV3.css +1 -0
  174. package/storybook-static/assets/FormattedTableCell-CY3E21k8.css +1 -0
  175. package/storybook-static/assets/FormattedTableCell-Dh-kHTOC.js +18 -0
  176. package/storybook-static/assets/Grid-BCzygAqy.js +52 -0
  177. package/storybook-static/assets/{Grid-G88y3oB_.js → Grid-BkKqSMfk.js} +18 -18
  178. package/storybook-static/assets/{Grid.stories-BV7zL-6n.js → Grid.stories-828arrPi.js} +2 -2
  179. package/storybook-static/assets/{Grid-Bb0gH6CX.js → GridContainer-qDguE1HS.js} +2 -53
  180. package/storybook-static/assets/ImageCropper.stories-CrIWrKKR.js +115 -0
  181. package/storybook-static/assets/ImageRenderer-F3AaZx-K.js +2 -0
  182. package/storybook-static/assets/ImageRenderer.stories-l3PnRYxy.js +22 -0
  183. package/storybook-static/assets/ImageView.stories-C6uhkvCN.js +9 -0
  184. package/storybook-static/assets/{ImageViewer.stories-PlFXSB5n.js → ImageViewer.stories-BSPiv5lU.js} +5 -5
  185. package/storybook-static/assets/ImageViewerRuntime-BOpMGgz6.js +51 -0
  186. package/storybook-static/assets/Input-Co--DMHY.js +3 -0
  187. package/storybook-static/assets/{Input-pyUNDVtk.js → Input-D-ZrbHVw.js} +11 -11
  188. package/storybook-static/assets/Input.stories-vqPv6pLx.js +38 -0
  189. package/storybook-static/assets/{InputDateTime-CWk5KBwD.js → InputDateTime-DHBVbRii.js} +11 -11
  190. package/storybook-static/assets/InputDateTime.stories-BAvLMBuk.js +35 -0
  191. package/storybook-static/assets/{InputFile-BLQq7mY9.js → InputFile-B9TVOEZV.js} +10 -10
  192. package/storybook-static/assets/InputFile.stories-CypBLWFh.js +36 -0
  193. package/storybook-static/assets/{InputFiles-B6J4XBdP.js → InputFiles-CxZkOZFK.js} +10 -10
  194. package/storybook-static/assets/InputFiles.stories-BGwCp7OC.js +33 -0
  195. package/storybook-static/assets/InputFilesList-OEX4zGI3.js +1 -0
  196. package/storybook-static/assets/{InputImage--2PSB_E_.js → InputImage-31A6fxSf.js} +10 -10
  197. package/storybook-static/assets/InputImage.stories-CdpOudXI.js +51 -0
  198. package/storybook-static/assets/{LayoutPicker-RZDisgZ_.js → LayoutPicker-Dc55ovYM.js} +13 -13
  199. package/storybook-static/assets/LayoutPicker.stories-DXcn-WXQ.js +449 -0
  200. package/storybook-static/assets/{Listbox-xwfNjBpV.js → Listbox-DF8E6oMR.js} +10 -10
  201. package/storybook-static/assets/Listbox.stories-C98_9wX3.js +47 -0
  202. package/storybook-static/assets/{Modal-HJt_Y-a6.js → Modal-CXvDgktT.js} +12 -12
  203. package/storybook-static/assets/Modal.stories-DAC_QwN7.js +180 -0
  204. package/storybook-static/assets/MultiSelect-B-wX6JPo.js +2 -0
  205. package/storybook-static/assets/{MultiSelect-CvNsFdE4.js → MultiSelect-DN4foQlG.js} +11 -11
  206. package/storybook-static/assets/MultiSelect.stories-CgKNQmma.js +29 -0
  207. package/storybook-static/assets/MultiSelectToken-DDu5n78h.css +1 -0
  208. package/storybook-static/assets/MultiSelectToken-fjW8p4YG.js +1 -0
  209. package/storybook-static/assets/NoData-C7KqaHUh.css +1 -0
  210. package/storybook-static/assets/NoData-W7wK8oTW.js +1 -0
  211. package/storybook-static/assets/{NotificationsHost-DXCf3CQX.js → NotificationsHost-D1UoWmF8.js} +9 -9
  212. package/storybook-static/assets/NotificationsHost.stories-BWUuMmPl.js +25 -0
  213. package/storybook-static/assets/{ODataMultiSelect-CIJNiwGb.js → ODataMultiSelect-DE1V4el8.js} +15 -15
  214. package/storybook-static/assets/ODataMultiSelect.stories-Q1DUIL2W.js +73 -0
  215. package/storybook-static/assets/{ODataSelect-BDga9TUb.js → ODataSelect-CtoT2Wxx.js} +15 -15
  216. package/storybook-static/assets/ODataSelect.stories-DLi7Rwzk.js +73 -0
  217. package/storybook-static/assets/ODataTreeMultiSelect-DEZfgyPK.js +19 -0
  218. package/storybook-static/assets/ODataTreeMultiSelect.stories-H42q78xI.js +30 -0
  219. package/storybook-static/assets/ODataTreeSelect-BeylEiPN.js +17 -0
  220. package/storybook-static/assets/ODataTreeSelect.stories-MOILmtfY.js +24 -0
  221. package/storybook-static/assets/OneStepScroller-BSvYN6QP.js +5 -0
  222. package/storybook-static/assets/OneStepScroller-NRYd-egY.css +1 -0
  223. package/storybook-static/assets/{PeriodSelect-BJbjl62O.js → PeriodSelect-KQFGCxq6.js} +13 -13
  224. package/storybook-static/assets/PeriodSelect.stories-BIYx4_Yy.js +64 -0
  225. package/storybook-static/assets/PickerSelectionToolbar-Cvv8vTZm.js +2 -0
  226. package/storybook-static/assets/PickerTriggerActions-BBZmXagt.js +1 -0
  227. package/storybook-static/assets/{Popover-Dg2T0DoN.js → Popover-7YZIq8Fi.js} +11 -11
  228. package/storybook-static/assets/Popover-D6gSyjaW.js +2 -0
  229. package/storybook-static/assets/Popover-DGX7JNNK.css +1 -0
  230. package/storybook-static/assets/Popover.stories-DM69Ztws.js +69 -0
  231. package/storybook-static/assets/{PresetRangeDateInput-CNmTMNHF.js → PresetRangeDateInput-Ch6GapcJ.js} +8 -8
  232. package/storybook-static/assets/PresetRangeDateInput.stories-Cqd4eb0N.js +15 -0
  233. package/storybook-static/assets/PresetSelect-C8uIYhPJ.js +5 -0
  234. package/storybook-static/assets/{RadioButton-2rfUPkwC.js → RadioButton-BQjiyASl.js} +10 -10
  235. package/storybook-static/assets/RadioButton.stories-Cbho4i83.js +36 -0
  236. package/storybook-static/assets/RadioGroup-DNqu6WaC.js +1 -0
  237. package/storybook-static/assets/{RadioGroup-BduGGVKj.js → RadioGroup-vw4ObVj-.js} +10 -10
  238. package/storybook-static/assets/RadioGroup.stories-B-WQzZW_.js +42 -0
  239. package/storybook-static/assets/Scrollable-DrxMuH2M.js +1 -0
  240. package/storybook-static/assets/{Select-DnZ83aZs.js → Select-BxigZNtu.js} +13 -13
  241. package/storybook-static/assets/Select-X_O4M8Hi.js +12 -0
  242. package/storybook-static/assets/Select.stories-BpTrYJSr.js +46 -0
  243. package/storybook-static/assets/SelectOptionContent-RAmgWCOm.js +1 -0
  244. package/storybook-static/assets/{SerializableSelect-BiFhAxAJ.js → SerializableSelect-CA9wjk2m.js} +12 -12
  245. package/storybook-static/assets/SerializableSelect.stories-DXd4E-3U.js +46 -0
  246. package/storybook-static/assets/{SingleDateTimeInput-Bc-ifbML.js → SingleDateTimeInput-BeFLYUBF.js} +12 -12
  247. package/storybook-static/assets/SingleDateTimeInput.stories-B1aZ754N.js +78 -0
  248. package/storybook-static/assets/Slider-BYrHesOR.js +1 -0
  249. package/storybook-static/assets/{Slider-DfjBSsR3.js → Slider-BdWBkKp4.js} +15 -15
  250. package/storybook-static/assets/Slider.stories-CgmOhVBs.js +77 -0
  251. package/storybook-static/assets/{SliderInput-o9uCcVMP.js → SliderInput-QmF2VQWA.js} +16 -16
  252. package/storybook-static/assets/SliderInput.stories-MjSmhiOM.js +68 -0
  253. package/storybook-static/assets/{Sortable-B6Y9Q9Yn.js → Sortable-D5OTpesH.js} +13 -13
  254. package/storybook-static/assets/Sortable.stories-yz3c5EhY.js +141 -0
  255. package/storybook-static/assets/{Splitter-CfUVnAs7.js → Splitter-DVq6XBul.js} +11 -11
  256. package/storybook-static/assets/Splitter.stories-CopPw1_p.js +22 -0
  257. package/storybook-static/assets/{StateSelect-h0i4M4vO.js → StateSelect-ojwXeKmx.js} +10 -10
  258. package/storybook-static/assets/StateSelect.stories-D46m5HNn.js +47 -0
  259. package/storybook-static/assets/StringToggle.stories-ByYMmlXl.js +6 -0
  260. package/storybook-static/assets/{Switch-CPKaENqL.js → Switch-Dy4Pahkn.js} +10 -10
  261. package/storybook-static/assets/Switch.stories-EiAb5Z-D.js +26 -0
  262. package/storybook-static/assets/{Table-xV66crR1.js → Table-BO6Oa4JV.js} +22 -22
  263. package/storybook-static/assets/Table.stories--TpBKwmP.js +122 -0
  264. package/storybook-static/assets/{Tabs-v9YZeJoc.js → Tabs-7c93qVyH.js} +15 -15
  265. package/storybook-static/assets/Tabs.stories-DXZ0r2ix.js +58 -0
  266. package/storybook-static/assets/TagInput.stories-CoM8rXwa.js +18 -0
  267. package/storybook-static/assets/Text-BPlJUr3R.js +1 -0
  268. package/storybook-static/assets/{Textarea-CRThqX0z.js → Textarea-D3S4MkiX.js} +10 -10
  269. package/storybook-static/assets/Textarea.stories-47k8uHdB.js +27 -0
  270. package/storybook-static/assets/TimePanel-C2iZ9Qr6.js +1 -0
  271. package/storybook-static/assets/TimePanel.stories-JTjIv6z1.js +25 -0
  272. package/storybook-static/assets/{Toggle-CzopviU2.js → Toggle-CHmajZE5.js} +10 -10
  273. package/storybook-static/assets/Toggle-OlKw8qaK.js +1 -0
  274. package/storybook-static/assets/Toggle.stories-k4Z8qQVs.js +30 -0
  275. package/storybook-static/assets/TreeMultiSelect-BC_n1Wb-.js +1 -0
  276. package/storybook-static/assets/TreeMultiSelect-dOg0l7rk.js +19 -0
  277. package/storybook-static/assets/TreeMultiSelect.stories-CAzZRxn5.js +35 -0
  278. package/storybook-static/assets/TreePickerBase-ycYQYQgi.js +22 -0
  279. package/storybook-static/assets/TreeSelect-BrNyI_Qx.js +16 -0
  280. package/storybook-static/assets/TreeSelect-CDecTnag.js +1 -0
  281. package/storybook-static/assets/TreeSelect.stories-BUOw2Rwn.js +18 -0
  282. package/storybook-static/assets/{TreeTable-DbzoCcR5.js → TreeTable-BXw7lFBk.js} +22 -22
  283. package/storybook-static/assets/TreeTable.stories-z40pruPV.js +83 -0
  284. package/storybook-static/assets/WithTooltip-7X4HQR7L-Cakt_JaX.js +9 -0
  285. package/storybook-static/assets/array-BBSjoTRy-CIRmlF93.js +1 -0
  286. package/storybook-static/assets/{async-D27PcxoG.js → async-BLDV04P4.js} +3 -3
  287. package/storybook-static/assets/axe-Bq-2xuso.js +20 -0
  288. package/storybook-static/assets/blocks-BiaKjftm.js +48 -0
  289. package/storybook-static/assets/browserAndReact-DX4H5rjQ.js +105 -0
  290. package/storybook-static/assets/check-fB4gCKB_.js +1 -0
  291. package/storybook-static/assets/chevron-down-B9GH0QvB.js +1 -0
  292. package/storybook-static/assets/chevron-left-DjbyJeHO.js +1 -0
  293. package/storybook-static/assets/chevron-right-D29uf09I.js +1 -0
  294. package/storybook-static/assets/chunk-242VQQM5-BMWWiybC.js +1 -0
  295. package/storybook-static/assets/chunk-DRQKCCAG-CqE-Zrl9.js +1 -0
  296. package/storybook-static/assets/chunk-IMSF75WX-yvVUwIQZ.js +6 -0
  297. package/storybook-static/assets/chunk-KJHJLCBK-D-yQfkOi.js +1 -0
  298. package/storybook-static/assets/chunk-QQBDHPVZ-B98qboss.js +1 -0
  299. package/storybook-static/assets/chunk-W22LQPXL-CGkHFiZ0.js +18 -0
  300. package/storybook-static/assets/circle-alert-Dmd7-WNp.js +1 -0
  301. package/storybook-static/assets/circle-check-VtVMsaJJ.js +1 -0
  302. package/storybook-static/assets/components-CsfQDbHv.js +241 -0
  303. package/storybook-static/assets/contextMenu-CzdfaUsd.js +2 -0
  304. package/storybook-static/assets/date-segments-D3HouZ37.js +1 -0
  305. package/storybook-static/assets/dom-B3G_GtJw.js +1 -0
  306. package/storybook-static/assets/download-CyVhTbv6.js +1 -0
  307. package/storybook-static/assets/error-BZrNlEUO.js +1 -0
  308. package/storybook-static/assets/file-vPGnhPr-.js +1 -0
  309. package/storybook-static/assets/filesAndExcel-DlUnL-Uu.js +122 -0
  310. package/storybook-static/assets/floating-ui.react-DZ8IyUV4.js +1 -0
  311. package/storybook-static/assets/formatter-L2YTDE3Q-x0raBH34.js +1 -0
  312. package/storybook-static/assets/formatters--mhLir82-v41eaI4a.js +1 -0
  313. package/storybook-static/assets/formatters-BTz64vfu.js +291 -0
  314. package/storybook-static/assets/formatters-runtime-DVi3RdYb.js +384 -0
  315. package/storybook-static/assets/foundationLib-CFj4J-Pc.js +82 -0
  316. package/storybook-static/assets/hooks-Ch5aYb7R.js +5 -0
  317. package/storybook-static/assets/iframe-Cr7AcW_R.js +1 -0
  318. package/storybook-static/assets/iframe-DaN-XFub.js +1151 -0
  319. package/storybook-static/assets/info-Cirk1RKZ.js +1 -0
  320. package/storybook-static/assets/{matchers-JIUQ3HVY-BPS-eazD.js → matchers-JIUQ3HVY-DvR2XErZ.js} +3 -3
  321. package/storybook-static/assets/media-BycWpjAl.js +1 -0
  322. package/storybook-static/assets/odata-BtfB5Aje.js +1 -0
  323. package/storybook-static/assets/odata-service-DnPlNGpU-Bpd4Zh9L.js +3 -0
  324. package/storybook-static/assets/odataAndTables-TEZyQ-TZ.js +126 -0
  325. package/storybook-static/assets/{odataFetchFn-BVgXXKgx.js → odataFetchFn-DEKVPDzV.js} +3 -3
  326. package/storybook-static/assets/odataStoryFixtures-CDDaJZKW.js +25 -0
  327. package/storybook-static/assets/{persisted-D8qUQbts.js → persisted-BzLLmgUK.js} +3 -3
  328. package/storybook-static/assets/preload-helper-BHmFeTtP.js +1 -0
  329. package/storybook-static/assets/pureUtilities-Dw249t3R.js +69 -0
  330. package/storybook-static/assets/react-18-CgkwBzTo.js +9 -0
  331. package/storybook-static/assets/react-C21x__mS.js +1 -0
  332. package/storybook-static/assets/react-CvkUhHUq.js +1 -0
  333. package/storybook-static/assets/react-KzpmXJc9.js +9 -0
  334. package/storybook-static/assets/react-dom-2o2phaJG.js +1 -0
  335. package/storybook-static/assets/react-qN2cStNd.js +1 -0
  336. package/storybook-static/assets/refresh-cw-BN3JCsXv.js +1 -0
  337. package/storybook-static/assets/rolldown-runtime-C0FnF6B9.js +1 -0
  338. package/storybook-static/assets/runtimeAndState-CCVgv3ck.js +117 -0
  339. package/storybook-static/assets/settings-2-jtcbbWm5.js +1 -0
  340. package/storybook-static/assets/sortable-dNWaObUX.js +1 -0
  341. package/storybook-static/assets/syntaxhighlighter-T5IQBZDB-hYwVxXYm.js +6 -0
  342. package/storybook-static/assets/theming-mTWhffkp.js +39 -0
  343. package/storybook-static/assets/trash-2-DrVfT0z5.js +1 -0
  344. package/storybook-static/assets/treeStoryFixtures-Ci7STpiz.js +1 -0
  345. package/storybook-static/assets/triangle-alert-B1Q28Bq9.js +1 -0
  346. package/storybook-static/assets/ui.module-DoMIk8Oc.js +1 -0
  347. package/storybook-static/assets/uiClasses-CO3Cdv1E.js +1 -0
  348. package/storybook-static/assets/useFlexClasses-Gn9spXEB.js +1 -0
  349. package/storybook-static/assets/useODataSelectBase-DlbeGYUP.js +1 -0
  350. package/storybook-static/assets/useODataTreeData-CvsoLfiG.js +1 -0
  351. package/storybook-static/assets/usePickerDefaultFilter-DdxyE_i8.js +1 -0
  352. package/storybook-static/assets/usePickerQuery-6rDaPaB0.js +1 -0
  353. package/storybook-static/assets/usePickerTriggerController-BHBjSLtn.js +1 -0
  354. package/storybook-static/assets/utils-DUM89eIj.js +1 -0
  355. package/storybook-static/assets/x-Dh43gJN9.js +1 -0
  356. package/storybook-static/iframe.html +8 -3
  357. package/storybook-static/index.html +6 -0
  358. package/storybook-static/index.json +1 -1
  359. package/storybook-static/project.json +1 -1
  360. package/storybook-static/sb-addons/a11y-3/manager-bundle.js +3 -3
  361. package/storybook-static/sb-addons/chromatic-com-storybook-1/manager-bundle.js +17 -17
  362. package/storybook-static/sb-addons/docs-2/manager-bundle.js +16 -1
  363. package/storybook-static/sb-addons/storybook-core-server-presets-0/common-manager-bundle.js +85 -83
  364. package/storybook-static/sb-addons/vitest-4/manager-bundle.js +1 -1
  365. package/storybook-static/sb-manager/globals-runtime.js +9939 -7695
  366. package/storybook-static/sb-manager/runtime.js +16128 -15326
  367. package/storybook-static/vite-inject-mocker-entry.js +2 -2
  368. package/dist/chunks/multi-select-CWx12rgb.js.map +0 -1
  369. package/dist/chunks/select-BPb-eL3O.js.map +0 -1
  370. package/storybook-static/assets/Badge.stories-CzsgAfG9.js +0 -51
  371. package/storybook-static/assets/Button-MoWVKehO.js +0 -12
  372. package/storybook-static/assets/Button.stories-wwep4c2p.js +0 -75
  373. package/storybook-static/assets/CheckBox-DHvne_6w.js +0 -2
  374. package/storybook-static/assets/CheckBox.module-ezWPE2pa.js +0 -1
  375. package/storybook-static/assets/CheckBox.stories-C14Axs5p.js +0 -60
  376. package/storybook-static/assets/Color-KMSTOMOX-CmMBFN4-.js +0 -1
  377. package/storybook-static/assets/ContextMenu.stories-Dr-tkpqd.js +0 -90
  378. package/storybook-static/assets/DateInput-erobPRG_.js +0 -1
  379. package/storybook-static/assets/DateRangePresetSelect-Cg90Kc_w.js +0 -3
  380. package/storybook-static/assets/DateRangePresetSelect.stories-BVap0joC.js +0 -11
  381. package/storybook-static/assets/Detail.stories-CLdtvJ7q.js +0 -44
  382. package/storybook-static/assets/Dialog.stories-Dx0jZO19.js +0 -31
  383. package/storybook-static/assets/Disclosure.stories-DhUdeDK6.js +0 -41
  384. package/storybook-static/assets/DocsRenderer-JROSPFPF-Dd1n83Uq.js +0 -2
  385. package/storybook-static/assets/DropZone.stories-6yYrwQOe.js +0 -44
  386. package/storybook-static/assets/DropdownMenu-D_2LfViU.js +0 -1
  387. package/storybook-static/assets/ExpandableActionPanel.stories-DVOFSOlm.js +0 -20
  388. package/storybook-static/assets/Flex-V-qg6Ejw.js +0 -3
  389. package/storybook-static/assets/Flex.stories-BZv94LD8.js +0 -300
  390. package/storybook-static/assets/ImageCropper.stories-MLFZyJxZ.js +0 -115
  391. package/storybook-static/assets/ImageRenderer-DHhD7mUz.js +0 -2
  392. package/storybook-static/assets/ImageRenderer.stories-ChcPymk2.js +0 -22
  393. package/storybook-static/assets/ImageView.stories-DszVNgC8.js +0 -9
  394. package/storybook-static/assets/ImageViewerRuntime-D8wFAKx5.js +0 -51
  395. package/storybook-static/assets/Input-BGdz8TmT.js +0 -3
  396. package/storybook-static/assets/Input.stories-Ban0Gnck.js +0 -38
  397. package/storybook-static/assets/InputDateTime.stories-DgKVmf54.js +0 -35
  398. package/storybook-static/assets/InputFile.stories-VnRv_q2r.js +0 -36
  399. package/storybook-static/assets/InputFiles-Dn9afnyd.js +0 -1
  400. package/storybook-static/assets/InputFiles.stories-CLVn5Xfq.js +0 -33
  401. package/storybook-static/assets/InputImage.stories-D__QcSho.js +0 -51
  402. package/storybook-static/assets/LayoutPicker.stories-BCnR-zBu.js +0 -449
  403. package/storybook-static/assets/Listbox.stories-B0HctqVp.js +0 -47
  404. package/storybook-static/assets/Modal.stories-BE-VpK-a.js +0 -180
  405. package/storybook-static/assets/MultiSelect-BoIwmje6.css +0 -1
  406. package/storybook-static/assets/MultiSelect-CaCNRNIe.js +0 -2
  407. package/storybook-static/assets/MultiSelect.stories-CNkbVGsb.js +0 -29
  408. package/storybook-static/assets/NotificationsHost.stories-BgqvZzT3.js +0 -25
  409. package/storybook-static/assets/ODataMultiSelect-CMyI4yYs.js +0 -1
  410. package/storybook-static/assets/ODataMultiSelect.stories-DTGCC6np.js +0 -73
  411. package/storybook-static/assets/ODataSelect-CGplYBh_.js +0 -1
  412. package/storybook-static/assets/ODataSelect.stories-CsxqRAvn.js +0 -73
  413. package/storybook-static/assets/ODataTreeMultiSelect-4ZiAtFZk.js +0 -19
  414. package/storybook-static/assets/ODataTreeMultiSelect.stories-B29Od8BL.js +0 -30
  415. package/storybook-static/assets/ODataTreeSelect-yZy7MBsZ.js +0 -17
  416. package/storybook-static/assets/ODataTreeSelect.stories-H7eaj1Sz.js +0 -24
  417. package/storybook-static/assets/PeriodSelect.stories-6CEzS2_H.js +0 -64
  418. package/storybook-static/assets/Popover.stories-BNgWOHlJ.js +0 -69
  419. package/storybook-static/assets/PresetRangeDateInput.stories-6UPVDF62.js +0 -15
  420. package/storybook-static/assets/RadioButton.stories-DbdFfJqO.js +0 -36
  421. package/storybook-static/assets/RadioGroup-BA21indC.js +0 -1
  422. package/storybook-static/assets/RadioGroup.stories-Ce6x0WUN.js +0 -42
  423. package/storybook-static/assets/Select-DyO25wSA.js +0 -12
  424. package/storybook-static/assets/Select.stories-CQ8f9fY9.js +0 -46
  425. package/storybook-static/assets/SelectOptionContent-fC4HFG5Q.js +0 -1
  426. package/storybook-static/assets/SerializableSelect-ki4BThj7.js +0 -4
  427. package/storybook-static/assets/SerializableSelect.stories-BzXBkWPI.js +0 -43
  428. package/storybook-static/assets/SingleDateTimeInput.stories-CI2yrD-f.js +0 -78
  429. package/storybook-static/assets/Slider.stories-D3O3_tqE.js +0 -77
  430. package/storybook-static/assets/SliderInput.stories-D1puleZB.js +0 -67
  431. package/storybook-static/assets/Sortable.stories-BoaL4W6r.js +0 -141
  432. package/storybook-static/assets/Splitter.stories-DJpFzZVJ.js +0 -22
  433. package/storybook-static/assets/StateSelect.stories-Ch2Gzzmd.js +0 -47
  434. package/storybook-static/assets/StringToggle.stories-B8qIG0M3.js +0 -6
  435. package/storybook-static/assets/Switch.stories-BysIhUHa.js +0 -26
  436. package/storybook-static/assets/Table.stories-CBpgmq7b.js +0 -122
  437. package/storybook-static/assets/Tabs.stories-BPYZuvzR.js +0 -58
  438. package/storybook-static/assets/TagInput.stories-BwOEnVpz.js +0 -18
  439. package/storybook-static/assets/Textarea.stories-BSJGz7JF.js +0 -27
  440. package/storybook-static/assets/TimePanel-ClMfq_py.js +0 -1
  441. package/storybook-static/assets/TimePanel.stories-_FqWdmta.js +0 -25
  442. package/storybook-static/assets/Toggle-BFhzeK2e.js +0 -1
  443. package/storybook-static/assets/Toggle.stories-Dw5UkD_b.js +0 -30
  444. package/storybook-static/assets/TreeMultiSelect-CerqHY2K.js +0 -19
  445. package/storybook-static/assets/TreeMultiSelect-Dw7FI3ic.js +0 -1
  446. package/storybook-static/assets/TreeMultiSelect.stories-BTQKFbeP.js +0 -35
  447. package/storybook-static/assets/TreePickerBase-rJISGJBT.js +0 -22
  448. package/storybook-static/assets/TreeSelect-CQ1vj_c9.js +0 -16
  449. package/storybook-static/assets/TreeSelect-Cp_lX0-B.js +0 -1
  450. package/storybook-static/assets/TreeSelect.stories-D6Q02Phx.js +0 -18
  451. package/storybook-static/assets/TreeTable.stories-YfyhkqH9.js +0 -83
  452. package/storybook-static/assets/WithTooltip-7X4HQR7L-BSQyvCOM.js +0 -9
  453. package/storybook-static/assets/axe-GLfyhAYL.js +0 -20
  454. package/storybook-static/assets/base-table-BNO0lnTL.css +0 -1
  455. package/storybook-static/assets/base-table-Dy3fEhQe.js +0 -18
  456. package/storybook-static/assets/blocks-ixiC6_NZ.js +0 -285
  457. package/storybook-static/assets/button-DZpTIXz2.js +0 -1
  458. package/storybook-static/assets/check-box-DByHwJGx.js +0 -1
  459. package/storybook-static/assets/chunk-242VQQM5-Dtm7LRbQ.js +0 -1
  460. package/storybook-static/assets/chunk-3LY4VQVK-BohfESrT.js +0 -6
  461. package/storybook-static/assets/chunk-LITCR56V-XaMGADKk.js +0 -18
  462. package/storybook-static/assets/contextMenu-BbMrBF3b.js +0 -2
  463. package/storybook-static/assets/date-7kR6zFX5.js +0 -461
  464. package/storybook-static/assets/date-segments-CzU9k5bl.js +0 -1
  465. package/storybook-static/assets/error-BRUjWXbJ.js +0 -1
  466. package/storybook-static/assets/file-CI_sonB1.js +0 -291
  467. package/storybook-static/assets/file-hArYcyES.js +0 -1
  468. package/storybook-static/assets/flex-C--89Z3g.js +0 -1
  469. package/storybook-static/assets/floating-ui.react-DLXcGGFR.js +0 -1
  470. package/storybook-static/assets/formatter-L2YTDE3Q-DgyzUf7M.js +0 -1
  471. package/storybook-static/assets/formatters-BtIOYENB.js +0 -3
  472. package/storybook-static/assets/formulas-DRh9I2eS.js +0 -2
  473. package/storybook-static/assets/grid-DLxeTZJe.js +0 -1
  474. package/storybook-static/assets/hooks-DWeJq8G1.js +0 -5
  475. package/storybook-static/assets/iframe-BJGIOdSH.js +0 -1119
  476. package/storybook-static/assets/input-DXi75xv1.js +0 -1
  477. package/storybook-static/assets/mdx-react-shim-CmoAsjhK.js +0 -1
  478. package/storybook-static/assets/media-DWFaNgLM.js +0 -1
  479. package/storybook-static/assets/misc-BElIqBdV.css +0 -1
  480. package/storybook-static/assets/misc-DNZTbWc6.js +0 -5
  481. package/storybook-static/assets/notifications-DjtgzFqT.js +0 -1
  482. package/storybook-static/assets/number-Xkw1yPJo.js +0 -2
  483. package/storybook-static/assets/odata-C4Liwkjx.js +0 -1
  484. package/storybook-static/assets/odata-service-C2oJ-ZmZ.js +0 -1
  485. package/storybook-static/assets/odataStoryFixtures-eEGvvtmw.js +0 -25
  486. package/storybook-static/assets/picker-DsP4xCcJ.js +0 -2
  487. package/storybook-static/assets/popover-BiQHI7Wi.css +0 -1
  488. package/storybook-static/assets/popover-CuFTypCp.js +0 -2
  489. package/storybook-static/assets/preload-helper-B45gAKPr.js +0 -1
  490. package/storybook-static/assets/preset-select-SPNHA-mp.js +0 -5
  491. package/storybook-static/assets/pwa-B7uYfAPd.js +0 -640
  492. package/storybook-static/assets/queryClient-CA0puYc0.js +0 -567
  493. package/storybook-static/assets/react-18-CaNSmcD-.js +0 -9
  494. package/storybook-static/assets/react-3qMIUlAf.js +0 -9
  495. package/storybook-static/assets/react-dom-BC7xZNHy.js +0 -1
  496. package/storybook-static/assets/select-sUla5-3b.js +0 -1
  497. package/storybook-static/assets/slider--Yp_sa_W.js +0 -2
  498. package/storybook-static/assets/sortable-jALaQqYE.js +0 -1
  499. package/storybook-static/assets/syntaxhighlighter-RTCFPKCB-u_WDwfDn.js +0 -6
  500. package/storybook-static/assets/text-D5xgciF8.js +0 -4
  501. package/storybook-static/assets/theming-oB64gsjY.js +0 -39
  502. package/storybook-static/assets/treeStoryFixtures-Y_nnjz0_.js +0 -1
  503. package/storybook-static/assets/ui-DWDaBPQx.js +0 -1
  504. package/storybook-static/assets/ui.module-wFHXkJzp.js +0 -1
  505. package/storybook-static/assets/uiClasses-CaHp0EWd.js +0 -1
  506. package/storybook-static/assets/useODataSelectBase-DjlPxmxr.js +0 -1
  507. package/storybook-static/assets/useODataTreeData-1W6cbuec.js +0 -1
  508. package/storybook-static/assets/utils-DzbSigQl.js +0 -1
  509. package/storybook-static/assets/valueState-GnkKWBTr.js +0 -277
  510. /package/storybook-static/assets/{DropdownMenu-BgzIzwzM.css → ContextMenu-BgzIzwzM.css} +0 -0
  511. /package/storybook-static/assets/{Grid-K9R_IHaw.css → GridContainer-K9R_IHaw.css} +0 -0
  512. /package/storybook-static/assets/{InputFiles-ByK52qUe.css → InputFilesList-ByK52qUe.css} +0 -0
  513. /package/storybook-static/assets/{slider-DMDFRH6B.css → Slider-DMDFRH6B.css} +0 -0
  514. /package/storybook-static/assets/{Flex-IXK2se1Y.css → useFlexClasses-IXK2se1Y.css} +0 -0
  515. /package/storybook-static/assets/{picker-DzBkX15M.css → usePickerTriggerController-DzBkX15M.css} +0 -0
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":[],"sources":["../../src/detail/Detail.module.scss","../../src/detail/Detail.tsx"],"sourcesContent":[".detailList {\n\tcolumn-gap: var(--space-sm);\n\n\t&.none {\n\t\t--row-gap: 0;\n\t}\n\n\t&.small {\n\t\t--row-gap: var(--space-xs);\n\t}\n\n\t&.normal {\n\t\t--row-gap: var(--space-sm);\n\t}\n\n\t&.large {\n\t\t--row-gap: var(--space-md);\n\t}\n}\n\n.detail {\n\t.dt {\n\t\tfont-weight: 700;\n\t\tfont-variation-settings: \"wght\" 700;\n\t}\n\n\t.dd {\n\t\tfont-weight: 500;\n\t\tfont-variation-settings: \"wght\" 500;\n\t}\n\n\t&.textCenter {\n\t\ttext-align: center;\n\n\t\t.dt,\n\t\t.dd {\n\t\t\tflex: 1;\n\t\t}\n\t}\n\n\t&.inline {\n\t\tdisplay: flex;\n\n\t\t.dt {\n\t\t\ttext-align: right;\n\t\t\tpadding-right: var(--space-sm);\n\t\t}\n\n\t\t.dd {\n\t\t\ttext-align: left;\n\t\t}\n\n\t\t&.start {\n\t\t\talign-items: flex-start;\n\t\t}\n\t\t&.center {\n\t\t\talign-items: center;\n\t\t}\n\t\t&.end {\n\t\t\talign-items: flex-end;\n\t\t}\n\t}\n\n\t&.noWrap {\n\t\t.dt,\n\t\t.dd {\n\t\t\twhite-space: nowrap;\n\t\t\tword-break: normal;\n\t\t}\n\n\t\t.dd {\n\t\t\toverflow: hidden;\n\t\t\ttext-overflow: ellipsis;\n\t\t}\n\t}\n\n\t&:not(:last-child) {\n\t\tmargin-bottom: var(--row-gap);\n\t}\n}\n","import { createContext, CSSProperties, FC, ReactNode, useContext } from \"react\";\n\nimport { cn } from \"@ryuzaki13/react-foundation-lib/utils\";\n\nimport styles from \"./Detail.module.scss\";\n\nexport type DetailType = \"detail\" | \"list\";\n\nexport interface DetailContextType {\n\tsemantic?: DetailType;\n\tinline?: boolean;\n\tcenter?: boolean;\n\tvertical?: \"start\" | \"center\" | \"end\";\n\tnoWrap?: boolean;\n\twithColon?: boolean;\n}\n\nconst DetailContext = createContext<DetailContextType>({});\n\nexport interface DetailItemProps {\n\tlabel: ReactNode;\n\tvalue: ReactNode;\n\twithColon?: boolean;\n\trequired?: boolean;\n}\n\nfunction Item({ label, value, withColon, required }: DetailItemProps) {\n\tconst { semantic, inline, noWrap, center, vertical = \"center\", withColon: withColonParent = true } = useContext(DetailContext);\n\tconst detailClass = cn(styles.detail, center && styles.textCenter, inline && styles.inline, noWrap && styles.noWrap, styles[vertical]);\n\n\tconst labelContent = (\n\t\t<>\n\t\t\t{label}\n\t\t\t{required && <span className=\"statusError\">*</span>}\n\t\t\t{(typeof withColon === \"boolean\" ? withColon : withColonParent) && \":\"}\n\t\t</>\n\t);\n\n\tswitch (semantic) {\n\t\tcase \"detail\":\n\t\t\treturn (\n\t\t\t\t<div className={detailClass}>\n\t\t\t\t\t<dt className={styles.dt}>{labelContent}</dt>\n\t\t\t\t\t<dd className={styles.dd}>{value}</dd>\n\t\t\t\t</div>\n\t\t\t);\n\n\t\tcase \"list\":\n\t\t\treturn (\n\t\t\t\t<li className={detailClass}>\n\t\t\t\t\t<div className={styles.dt}>{labelContent}</div>\n\t\t\t\t\t<div className={styles.dd}>{value}</div>\n\t\t\t\t</li>\n\t\t\t);\n\n\t\tdefault:\n\t\t\treturn (\n\t\t\t\t<div className={detailClass}>\n\t\t\t\t\t<div className={styles.dt}>{labelContent}</div>\n\t\t\t\t\t<div className={styles.dd}>{value}</div>\n\t\t\t\t</div>\n\t\t\t);\n\t}\n}\n\nexport interface DetailProps {\n\tcolumnCount?: number;\n\trowGap?: \"none\" | \"small\" | \"normal\" | \"large\";\n\tchildren: ReactNode;\n\tclassName?: string;\n\n\tsemantic?: DetailType;\n\tinline?: boolean;\n\tcenter?: boolean;\n\tvertical?: \"start\" | \"center\" | \"end\";\n\tnoWrap?: boolean;\n\twithColon?: boolean;\n}\n\nexport interface DetailComponent extends FC<DetailProps> {\n\tItem: FC<DetailItemProps>;\n}\n\n/**\n * Компонент для вывода пар «заголовок-значение» в одну или несколько колонок. Подходит для карточек сущностей, сводок и страниц просмотра.\n */\nexport const Detail: DetailComponent = ({ children, columnCount = 1, rowGap = \"none\", semantic = \"list\", className, ...itemProps }) => {\n\tconst classes = cn(styles.detailList, styles[rowGap], className);\n\tconst style = { columnCount: Math.min(5, Math.max(1, columnCount)) } as CSSProperties;\n\tconst content =\n\t\tsemantic === \"detail\" ? (\n\t\t\t<dl className={classes} style={style}>\n\t\t\t\t{children}\n\t\t\t</dl>\n\t\t) : (\n\t\t\t<ul className={classes} style={style}>\n\t\t\t\t{children}\n\t\t\t</ul>\n\t\t);\n\n\treturn <DetailContext.Provider value={{ ...itemProps, semantic }}>{content}</DetailContext.Provider>;\n};\n\nDetail.Item = Item;\n"],"mappings":";;;;;;;;;;;;;;;;;;GCiBM,IAAgB,EAAiC,CAAC,CAAC;AASzD,SAAS,EAAK,EAAE,UAAO,UAAO,cAAW,eAA6B;CACrE,IAAM,EAAE,aAAU,WAAQ,WAAQ,WAAQ,cAAW,UAAU,WAAW,IAAkB,OAAS,EAAW,CAAa,GACvH,IAAc,EAAG,EAAO,QAAQ,KAAU,EAAO,YAAY,KAAU,EAAO,QAAQ,KAAU,EAAO,QAAQ,EAAO,EAAS,GAE/H,IACL,kBAAA,GAAA,EAAA,UAAA;EACE;EACA,KAAY,kBAAC,QAAD;GAAM,WAAU;aAAc;EAAO,CAAA;GAChD,OAAO,KAAc,YAAY,IAAY,MAAoB;CAClE,EAAA,CAAA;CAGH,QAAQ,GAAR;EACC,KAAK,UACJ,OACC,kBAAC,OAAD;GAAK,WAAW;aAAhB,CACC,kBAAC,MAAD;IAAI,WAAW,EAAO;cAAK;GAAiB,CAAA,GAC5C,kBAAC,MAAD;IAAI,WAAW,EAAO;cAAK;GAAU,CAAA,CACjC;;EAGP,KAAK,QACJ,OACC,kBAAC,MAAD;GAAI,WAAW;aAAf,CACC,kBAAC,OAAD;IAAK,WAAW,EAAO;cAAK;GAAkB,CAAA,GAC9C,kBAAC,OAAD;IAAK,WAAW,EAAO;cAAK;GAAW,CAAA,CACpC;;EAGN,SACC,OACC,kBAAC,OAAD;GAAK,WAAW;aAAhB,CACC,kBAAC,OAAD;IAAK,WAAW,EAAO;cAAK;GAAkB,CAAA,GAC9C,kBAAC,OAAD;IAAK,WAAW,EAAO;cAAK;GAAW,CAAA,CACnC;;CAER;AACD;AAuBA,IAAa,KAA2B,EAAE,aAAU,iBAAc,GAAG,YAAS,QAAQ,cAAW,QAAQ,cAAW,GAAG,QAAgB;CACtI,IAAM,IAAU,EAAG,EAAO,YAAY,EAAO,IAAS,CAAS,GAEzD,IAEJ,EADD,MAAa,WACX,OAIA,MAJD;EAAI,WAAW;EAAgB,SAHjB,aAAa,KAAK,IAAI,GAAG,KAAK,IAAI,GAAG,CAAW,CAAC,EAGhC;EAC7B;CACE,CAIA;CAGN,OAAO,kBAAC,EAAc,UAAf;EAAwB,OAAO;GAAE,GAAG;GAAW;EAAS;YAAI;CAAgC,CAAA;AACpG;AAEA,EAAO,OAAO"}
1
+ {"version":3,"file":"index.js","names":[],"sources":["../../src/detail/Detail.module.scss","../../src/detail/Detail.tsx"],"sourcesContent":[".detailList {\n\tcolumn-gap: var(--space-sm);\n\n\t&.none {\n\t\t--row-gap: 0;\n\t}\n\n\t&.small {\n\t\t--row-gap: var(--space-xs);\n\t}\n\n\t&.normal {\n\t\t--row-gap: var(--space-sm);\n\t}\n\n\t&.large {\n\t\t--row-gap: var(--space-md);\n\t}\n}\n\n.detail {\n\t.dt {\n\t\tfont-weight: 700;\n\t\tfont-variation-settings: \"wght\" 700;\n\t}\n\n\t.dd {\n\t\tfont-weight: 500;\n\t\tfont-variation-settings: \"wght\" 500;\n\t}\n\n\t&.textCenter {\n\t\ttext-align: center;\n\n\t\t.dt,\n\t\t.dd {\n\t\t\tflex: 1;\n\t\t}\n\t}\n\n\t&.inline {\n\t\tdisplay: flex;\n\n\t\t.dt {\n\t\t\ttext-align: right;\n\t\t\tpadding-right: var(--space-sm);\n\t\t}\n\n\t\t.dd {\n\t\t\ttext-align: left;\n\t\t}\n\n\t\t&.start {\n\t\t\talign-items: flex-start;\n\t\t}\n\t\t&.center {\n\t\t\talign-items: center;\n\t\t}\n\t\t&.end {\n\t\t\talign-items: flex-end;\n\t\t}\n\t}\n\n\t&.noWrap {\n\t\t.dt,\n\t\t.dd {\n\t\t\twhite-space: nowrap;\n\t\t\tword-break: normal;\n\t\t}\n\n\t\t.dd {\n\t\t\toverflow: hidden;\n\t\t\ttext-overflow: ellipsis;\n\t\t}\n\t}\n\n\t&:not(:last-child) {\n\t\tmargin-bottom: var(--row-gap);\n\t}\n}\n","import { createContext, CSSProperties, FC, ReactNode, useContext } from \"react\";\n\nimport { cn } from \"@ryuzaki13/react-foundation-lib/utils\";\n\nimport styles from \"./Detail.module.scss\";\n\nexport type DetailType = \"detail\" | \"list\";\n\nexport interface DetailContextType {\n\tsemantic?: DetailType;\n\tinline?: boolean;\n\tcenter?: boolean;\n\tvertical?: \"start\" | \"center\" | \"end\";\n\tnoWrap?: boolean;\n\twithColon?: boolean;\n}\n\nconst DetailContext = createContext<DetailContextType>({});\n\nexport interface DetailItemProps {\n\tlabel: ReactNode;\n\tvalue: ReactNode;\n\twithColon?: boolean;\n\trequired?: boolean;\n}\n\nfunction Item({ label, value, withColon, required }: DetailItemProps) {\n\tconst { semantic, inline, noWrap, center, vertical = \"center\", withColon: withColonParent = true } = useContext(DetailContext);\n\tconst detailClass = cn(styles.detail, center && styles.textCenter, inline && styles.inline, noWrap && styles.noWrap, styles[vertical]);\n\n\tconst labelContent = (\n\t\t<>\n\t\t\t{label}\n\t\t\t{required && <span className=\"statusError\">*</span>}\n\t\t\t{(typeof withColon === \"boolean\" ? withColon : withColonParent) && \":\"}\n\t\t</>\n\t);\n\n\tswitch (semantic) {\n\t\tcase \"detail\":\n\t\t\treturn (\n\t\t\t\t<div className={detailClass}>\n\t\t\t\t\t<dt className={styles.dt}>{labelContent}</dt>\n\t\t\t\t\t<dd className={styles.dd}>{value}</dd>\n\t\t\t\t</div>\n\t\t\t);\n\n\t\tcase \"list\":\n\t\t\treturn (\n\t\t\t\t<li className={detailClass}>\n\t\t\t\t\t<div className={styles.dt}>{labelContent}</div>\n\t\t\t\t\t<div className={styles.dd}>{value}</div>\n\t\t\t\t</li>\n\t\t\t);\n\n\t\tdefault:\n\t\t\treturn (\n\t\t\t\t<div className={detailClass}>\n\t\t\t\t\t<div className={styles.dt}>{labelContent}</div>\n\t\t\t\t\t<div className={styles.dd}>{value}</div>\n\t\t\t\t</div>\n\t\t\t);\n\t}\n}\n\nexport interface DetailProps {\n\tcolumnCount?: number;\n\trowGap?: \"none\" | \"small\" | \"normal\" | \"large\";\n\tchildren: ReactNode;\n\tclassName?: string;\n\n\tsemantic?: DetailType;\n\tinline?: boolean;\n\tcenter?: boolean;\n\tvertical?: \"start\" | \"center\" | \"end\";\n\tnoWrap?: boolean;\n\twithColon?: boolean;\n}\n\nexport interface DetailComponent extends FC<DetailProps> {\n\tItem: FC<DetailItemProps>;\n}\n\n/**\n * Компонент для вывода пар «заголовок-значение» в одну или несколько колонок. Подходит для карточек сущностей, сводок и страниц просмотра.\n */\nexport const Detail: DetailComponent = ({ children, columnCount = 1, rowGap = \"none\", semantic = \"list\", className, ...itemProps }) => {\n\tconst classes = cn(styles.detailList, styles[rowGap], className);\n\tconst style = { columnCount: Math.min(5, Math.max(1, columnCount)) } as CSSProperties;\n\tconst content =\n\t\tsemantic === \"detail\" ? (\n\t\t\t<dl className={classes} style={style}>\n\t\t\t\t{children}\n\t\t\t</dl>\n\t\t) : (\n\t\t\t<ul className={classes} style={style}>\n\t\t\t\t{children}\n\t\t\t</ul>\n\t\t);\n\n\treturn <DetailContext.Provider value={{ ...itemProps, semantic }}>{content}</DetailContext.Provider>;\n};\n\nDetail.Item = Item;\n"],"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A,MAJD;EAAI,WAAW;EAAgB,SAHjB,aAAa,KAAK,IAAI,GAAG,KAAK,IAAI,GAAG,CAAW,CAAC,EAGhC;EAC7B;CACE,CAIA;CAGN,OAAO,kBAAC,EAAc,UAAf;EAAwB,OAAO;GAAE,GAAG;GAAW;EAAS;EAAI,UAAA;CAAgC,CAAA;AACpG;AAEA,EAAO,OAAO"}
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":[],"sources":["../../src/dialog/Dialog.tsx"],"sourcesContent":["import React, { PropsWithChildren, useId } from \"react\";\n\nimport { getOrCreatePortalRoot, useEscapeDismiss, useOverlayFocus } from \"@ryuzaki13/react-foundation-lib/dom\";\nimport { createPortal } from \"react-dom\";\n\ninterface DialogProps extends PropsWithChildren {\n\ttitle: React.ReactNode;\n\tdescription: string;\n\topen: boolean;\n\tonClose: () => void;\n\tminWidth?: string | number;\n}\n\n/**\n * Модальное диалоговое окно для важных подтверждений и коротких пользовательских сценариев.\n */\nexport function Dialog({ title, description, open, onClose, minWidth, children }: DialogProps) {\n\tconst titleId = useId();\n\tconst descriptionId = useId();\n\tconst panelRef = useOverlayFocus<HTMLDivElement>({\n\t\tactive: open,\n\t\ttrapFocus: true,\n\t\trestoreFocus: true,\n\t\tinitialFocus: \"auto\"\n\t});\n\n\tuseEscapeDismiss({\n\t\tactive: open,\n\t\tonDismiss: onClose,\n\t\tcontainerRef: panelRef\n\t});\n\n\tif (!open) {\n\t\treturn null;\n\t}\n\n\tif (typeof document === \"undefined\") {\n\t\treturn null;\n\t}\n\n\tconst portalTarget = getOrCreatePortalRoot(\"dialog-root\");\n\n\tif (!portalTarget) {\n\t\treturn null;\n\t}\n\n\treturn createPortal(\n\t\t<div\n\t\t\tclassName=\"fixed inset0 flexCenter surfaceBackdrop\"\n\t\t\tstyle={{ zIndex: \"var(--z-dialog)\" }}\n\t\t\tonMouseDown={(event) => event.target === event.currentTarget && onClose()}>\n\t\t\t<div\n\t\t\t\tref={panelRef}\n\t\t\t\trole=\"dialog\"\n\t\t\t\taria-modal=\"true\"\n\t\t\t\taria-labelledby={title ? titleId : undefined}\n\t\t\t\taria-describedby={description ? descriptionId : undefined}\n\t\t\t\ttabIndex={-1}\n\t\t\t\tclassName=\"surface0 shadowMd paddingLg radiusSm\"\n\t\t\t\tstyle={{ minWidth }}>\n\t\t\t\t{title && (\n\t\t\t\t\t<h2 id={titleId} className=\"margin0\">\n\t\t\t\t\t\t{title}\n\t\t\t\t\t</h2>\n\t\t\t\t)}\n\t\t\t\t{description && <p id={descriptionId}>{description}</p>}\n\t\t\t\t{children}\n\t\t\t</div>\n\t\t</div>,\n\t\tportalTarget\n\t);\n}\n"],"mappings":";;;;;AAgBA,SAAgB,EAAO,EAAE,UAAO,gBAAa,SAAM,YAAS,aAAU,eAAyB;CAC9F,IAAM,IAAU,EAAM,GAChB,IAAgB,EAAM,GACtB,IAAW,EAAgC;EAChD,QAAQ;EACR,WAAW;EACX,cAAc;EACd,cAAc;CACf,CAAC;CAYD,IAVA,EAAiB;EAChB,QAAQ;EACR,WAAW;EACX,cAAc;CACf,CAAC,GAEG,CAAC,KAID,OAAO,WAAa,KACvB,OAAO;CAGR,IAAM,IAAe,EAAsB,aAAa;CAMxD,OAJK,IAIE,EACN,kBAAC,OAAD;EACC,WAAU;EACV,OAAO,EAAE,QAAQ,kBAAkB;EACnC,cAAc,MAAU,EAAM,WAAW,EAAM,iBAAiB,EAAQ;YACxE,kBAAC,OAAD;GACC,KAAK;GACL,MAAK;GACL,cAAW;GACX,mBAAiB,IAAQ,IAAU,KAAA;GACnC,oBAAkB,IAAc,IAAgB,KAAA;GAChD,UAAU;GACV,WAAU;GACV,OAAO,EAAE,YAAS;aARnB;IASE,KACA,kBAAC,MAAD;KAAI,IAAI;KAAS,WAAU;eACzB;IACE,CAAA;IAEJ,KAAe,kBAAC,KAAD;KAAG,IAAI;eAAgB;IAAe,CAAA;IACrD;GACG;;CACD,CAAA,GACL,CACD,IA3BQ;AA4BT"}
1
+ {"version":3,"file":"index.js","names":[],"sources":["../../src/dialog/Dialog.tsx"],"sourcesContent":["import React, { PropsWithChildren, useId } from \"react\";\n\nimport { getOrCreatePortalRoot, useEscapeDismiss, useOverlayFocus } from \"@ryuzaki13/react-foundation-lib/dom\";\nimport { createPortal } from \"react-dom\";\n\ninterface DialogProps extends PropsWithChildren {\n\ttitle: React.ReactNode;\n\tdescription: string;\n\topen: boolean;\n\tonClose: () => void;\n\tminWidth?: string | number;\n}\n\n/**\n * Модальное диалоговое окно для важных подтверждений и коротких пользовательских сценариев.\n */\nexport function Dialog({ title, description, open, onClose, minWidth, children }: DialogProps) {\n\tconst titleId = useId();\n\tconst descriptionId = useId();\n\tconst panelRef = useOverlayFocus<HTMLDivElement>({\n\t\tactive: open,\n\t\ttrapFocus: true,\n\t\trestoreFocus: true,\n\t\tinitialFocus: \"auto\"\n\t});\n\n\tuseEscapeDismiss({\n\t\tactive: open,\n\t\tonDismiss: onClose,\n\t\tcontainerRef: panelRef\n\t});\n\n\tif (!open) {\n\t\treturn null;\n\t}\n\n\tif (typeof document === \"undefined\") {\n\t\treturn null;\n\t}\n\n\tconst portalTarget = getOrCreatePortalRoot(\"dialog-root\");\n\n\tif (!portalTarget) {\n\t\treturn null;\n\t}\n\n\treturn createPortal(\n\t\t<div\n\t\t\tclassName=\"fixed inset0 flexCenter surfaceBackdrop\"\n\t\t\tstyle={{ zIndex: \"var(--z-dialog)\" }}\n\t\t\tonMouseDown={(event) => event.target === event.currentTarget && onClose()}>\n\t\t\t<div\n\t\t\t\tref={panelRef}\n\t\t\t\trole=\"dialog\"\n\t\t\t\taria-modal=\"true\"\n\t\t\t\taria-labelledby={title ? titleId : undefined}\n\t\t\t\taria-describedby={description ? descriptionId : undefined}\n\t\t\t\ttabIndex={-1}\n\t\t\t\tclassName=\"surface0 shadowMd paddingLg radiusSm\"\n\t\t\t\tstyle={{ minWidth }}>\n\t\t\t\t{title && (\n\t\t\t\t\t<h2 id={titleId} className=\"margin0\">\n\t\t\t\t\t\t{title}\n\t\t\t\t\t</h2>\n\t\t\t\t)}\n\t\t\t\t{description && <p id={descriptionId}>{description}</p>}\n\t\t\t\t{children}\n\t\t\t</div>\n\t\t</div>,\n\t\tportalTarget\n\t);\n}\n"],"mappings":";;;;;AAgBA,SAAgB,EAAO,EAAE,UAAO,gBAAa,SAAM,YAAS,aAAU,eAAyB;CAC9F,IAAM,IAAU,EAAM,GAChB,IAAgB,EAAM,GACtB,IAAW,EAAgC;EAChD,QAAQ;EACR,WAAW;EACX,cAAc;EACd,cAAc;CACf,CAAC;CAYD,IAVA,EAAiB;EAChB,QAAQ;EACR,WAAW;EACX,cAAc;CACf,CAAC,GAEG,CAAC,KAID,OAAO,WAAa,KACvB,OAAO;CAGR,IAAM,IAAe,EAAsB,aAAa;CAMxD,OAJK,IAIE,EACN,kBAAC,OAAD;EACC,WAAU;EACV,OAAO,EAAE,QAAQ,kBAAkB;EACnC,cAAc,MAAU,EAAM,WAAW,EAAM,iBAAiB,EAAQ;EACxE,UAAA,kBAAC,OAAD;GACC,KAAK;GACL,MAAK;GACL,cAAW;GACX,mBAAiB,IAAQ,IAAU,KAAA;GACnC,oBAAkB,IAAc,IAAgB,KAAA;GAChD,UAAU;GACV,WAAU;GACV,OAAO,EAAE,YAAS;GARnB,UAAA;IASE,KACA,kBAAC,MAAD;KAAI,IAAI;KAAS,WAAU;KACzB,UAAA;IACE,CAAA;IAEJ,KAAe,kBAAC,KAAD;KAAG,IAAI;KAAgB,UAAA;IAAe,CAAA;IACrD;GACG;;CACD,CAAA,GACL,CACD,IA3BQ;AA4BT"}
@@ -1,5 +1,5 @@
1
1
  import { t as e } from "../chunks/ui.module-BisoTevy.js";
2
- import { t } from "../chunks/flex-DYZ0IbU6.js";
2
+ import { t } from "../chunks/flex-C7njxZ74.js";
3
3
  import { useId as n, useState as r } from "react";
4
4
  import { cn as i } from "@ryuzaki13/react-foundation-lib/utils";
5
5
  import { ChevronDownIcon as a, ChevronUpIcon as o } from "lucide-react";
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":[],"sources":["../../src/disclosure/Disclosure.module.scss","../../src/disclosure/Disclosure.tsx","../../src/disclosure/DisclosureGroup.tsx"],"sourcesContent":[".disclosure {\n\t--ui-panel-background: var(--surface-2);\n\n\tbox-shadow: none;\n}\n\n.disclosureHeader {\n\tdisplay: flex;\n\talign-items: center;\n}\n\n.disclosureButton {\n\t// flex: 1 1 auto;\n\tmin-width: 0;\n\tdisplay: flex;\n\talign-items: center;\n\tjustify-content: flex-start;\n\n\t&:hover {\n\t\tcolor: var(--content-accent);\n\t}\n}\n\n.disclosureActions {\n\t// flex: 0 0 auto;\n\tdisplay: flex;\n\talign-items: center;\n\tpadding-inline-end: var(--space-sm);\n}\n\n.disclosureGroup {\n\t> .disclosure {\n\t\tborder-radius: 0;\n\n\t\t&:not(:first-child) {\n\t\t\tborder-top: none;\n\t\t}\n\n\t\t&:first-child {\n\t\t\tborder-top-left-radius: var(--radius-sm);\n\t\t\tborder-top-right-radius: var(--radius-sm);\n\t\t}\n\n\t\t&:last-child {\n\t\t\tborder-bottom-left-radius: var(--radius-sm);\n\t\t\tborder-bottom-right-radius: var(--radius-sm);\n\t\t}\n\t}\n}\n","import React, { PropsWithChildren, useId, useState } from \"react\";\n\nimport { cn } from \"@ryuzaki13/react-foundation-lib/utils\";\nimport { ChevronDownIcon, ChevronUpIcon } from \"lucide-react\";\n\nimport { FlexSpacer } from \"../flex\";\nimport uiStyles from \"../ui.module.scss\";\n\nimport styles from \"./Disclosure.module.scss\";\n\nexport interface DisclosureProps extends PropsWithChildren {\n\tlabel: React.ReactNode;\n\tdefaultOpen?: boolean;\n\t/** Независимые действия в правой части заголовка, расположенные вне кнопки раскрытия. */\n\theaderActions?: React.ReactNode;\n}\n\n/**\n * Раскрывающийся блок с заголовком и скрываемым содержимым. Используется для FAQ, настроек и компактного размещения второстепенной информации.\n */\nexport function Disclosure({ label, defaultOpen, headerActions, children }: DisclosureProps) {\n\tconst [open, setOpen] = useState(defaultOpen === true);\n\tconst panelId = useId();\n\tconst buttonId = useId();\n\n\treturn (\n\t\t<div className={cn(uiStyles.uiElement, uiStyles.uiPanel, styles.disclosure)}>\n\t\t\t<div className={styles.disclosureHeader}>\n\t\t\t\t<button\n\t\t\t\t\tid={buttonId}\n\t\t\t\t\ttype=\"button\"\n\t\t\t\t\taria-expanded={open}\n\t\t\t\t\taria-controls={panelId}\n\t\t\t\t\tclassName={cn(styles.disclosureButton, \"fontBold radiusSm paddingSm gapSm\")}\n\t\t\t\t\tdata-ui=\"disclosure-toggle\"\n\t\t\t\t\tdata-action={open ? \"collapse-disclosure\" : \"expand-disclosure\"}\n\t\t\t\t\tonClick={() => setOpen((prevOpen) => !prevOpen)}>\n\t\t\t\t\t{open ? <ChevronUpIcon /> : <ChevronDownIcon />}\n\t\t\t\t\t{label}\n\t\t\t\t</button>\n\t\t\t\t{headerActions ? (\n\t\t\t\t\t<>\n\t\t\t\t\t\t<FlexSpacer />\n\t\t\t\t\t\t{headerActions}\n\t\t\t\t\t</>\n\t\t\t\t) : null}\n\t\t\t</div>\n\n\t\t\t{open && (\n\t\t\t\t<div id={panelId} role=\"region\" aria-labelledby={buttonId}>\n\t\t\t\t\t<div className={\"paddingMd\"}>{children}</div>\n\t\t\t\t</div>\n\t\t\t)}\n\t\t</div>\n\t);\n}\n","import React from \"react\";\n\nimport { cn } from \"@ryuzaki13/react-foundation-lib/utils\";\n\nimport { Disclosure, DisclosureProps } from \"./Disclosure\";\nimport styles from \"./Disclosure.module.scss\";\n\ninterface DisclosureGroupProps {\n\tchildren?:\n\t\t| (React.ReactElement<DisclosureProps, typeof Disclosure> | null | undefined | false)\n\t\t| (React.ReactElement<DisclosureProps, typeof Disclosure> | null | undefined | false)[];\n\tclassName?: string;\n}\n\n/**\n * Групповой контейнер для нескольких `Disclosure`. Помогает выстраивать последовательный список раскрывающихся секций.\n */\nexport function DisclosureGroup({ className, children }: DisclosureGroupProps) {\n\treturn <div className={cn(styles.disclosureGroup, className)}>{children}</div>;\n}\n"],"mappings":";;;;;;;;;;;;;;;ACoBA,SAAgB,EAAW,EAAE,UAAO,gBAAa,kBAAe,eAA6B;CAC5F,IAAM,CAAC,GAAM,KAAW,EAAS,MAAgB,EAAI,GAC/C,IAAU,EAAM,GAChB,IAAW,EAAM;CAEvB,OACC,kBAAC,OAAD;EAAK,WAAW,EAAG,EAAS,WAAW,EAAS,SAAS,EAAO,UAAU;YAA1E,CACC,kBAAC,OAAD;GAAK,WAAW,EAAO;aAAvB,CACC,kBAAC,UAAD;IACC,IAAI;IACJ,MAAK;IACL,iBAAe;IACf,iBAAe;IACf,WAAW,EAAG,EAAO,kBAAkB,mCAAmC;IAC1E,WAAQ;IACR,eAAa,IAAO,wBAAwB;IAC5C,eAAe,GAAS,MAAa,CAAC,CAAQ;cAR/C,CASS,EAAP,IAAQ,IAAoB,GAArB,CAAgB,CAAsB,GAC7C,CACM;OACP,IACA,kBAAA,GAAA,EAAA,UAAA,CACC,kBAAC,GAAD,CAAa,CAAA,GACZ,CACA,EAAA,CAAA,IACC,IACA;MAEJ,KACA,kBAAC,OAAD;GAAK,IAAI;GAAS,MAAK;GAAS,mBAAiB;aAChD,kBAAC,OAAD;IAAK,WAAW;IAAc;GAAc,CAAA;EACxC,CAAA,CAEF;;AAEP;;;ACtCA,SAAgB,EAAgB,EAAE,cAAW,eAAkC;CAC9E,OAAO,kBAAC,OAAD;EAAK,WAAW,EAAG,EAAO,iBAAiB,CAAS;EAAI;CAAc,CAAA;AAC9E"}
1
+ {"version":3,"file":"index.js","names":[],"sources":["../../src/disclosure/Disclosure.module.scss","../../src/disclosure/Disclosure.tsx","../../src/disclosure/DisclosureGroup.tsx"],"sourcesContent":[".disclosure {\n\t--ui-panel-background: var(--surface-2);\n\n\tbox-shadow: none;\n}\n\n.disclosureHeader {\n\tdisplay: flex;\n\talign-items: center;\n}\n\n.disclosureButton {\n\t// flex: 1 1 auto;\n\tmin-width: 0;\n\tdisplay: flex;\n\talign-items: center;\n\tjustify-content: flex-start;\n\n\t&:hover {\n\t\tcolor: var(--content-accent);\n\t}\n}\n\n.disclosureActions {\n\t// flex: 0 0 auto;\n\tdisplay: flex;\n\talign-items: center;\n\tpadding-inline-end: var(--space-sm);\n}\n\n.disclosureGroup {\n\t> .disclosure {\n\t\tborder-radius: 0;\n\n\t\t&:not(:first-child) {\n\t\t\tborder-top: none;\n\t\t}\n\n\t\t&:first-child {\n\t\t\tborder-top-left-radius: var(--radius-sm);\n\t\t\tborder-top-right-radius: var(--radius-sm);\n\t\t}\n\n\t\t&:last-child {\n\t\t\tborder-bottom-left-radius: var(--radius-sm);\n\t\t\tborder-bottom-right-radius: var(--radius-sm);\n\t\t}\n\t}\n}\n","import React, { PropsWithChildren, useId, useState } from \"react\";\n\nimport { cn } from \"@ryuzaki13/react-foundation-lib/utils\";\nimport { ChevronDownIcon, ChevronUpIcon } from \"lucide-react\";\n\nimport { FlexSpacer } from \"../flex\";\nimport uiStyles from \"../ui.module.scss\";\n\nimport styles from \"./Disclosure.module.scss\";\n\nexport interface DisclosureProps extends PropsWithChildren {\n\tlabel: React.ReactNode;\n\tdefaultOpen?: boolean;\n\t/** Независимые действия в правой части заголовка, расположенные вне кнопки раскрытия. */\n\theaderActions?: React.ReactNode;\n}\n\n/**\n * Раскрывающийся блок с заголовком и скрываемым содержимым. Используется для FAQ, настроек и компактного размещения второстепенной информации.\n */\nexport function Disclosure({ label, defaultOpen, headerActions, children }: DisclosureProps) {\n\tconst [open, setOpen] = useState(defaultOpen === true);\n\tconst panelId = useId();\n\tconst buttonId = useId();\n\n\treturn (\n\t\t<div className={cn(uiStyles.uiElement, uiStyles.uiPanel, styles.disclosure)}>\n\t\t\t<div className={styles.disclosureHeader}>\n\t\t\t\t<button\n\t\t\t\t\tid={buttonId}\n\t\t\t\t\ttype=\"button\"\n\t\t\t\t\taria-expanded={open}\n\t\t\t\t\taria-controls={panelId}\n\t\t\t\t\tclassName={cn(styles.disclosureButton, \"fontBold radiusSm paddingSm gapSm\")}\n\t\t\t\t\tdata-ui=\"disclosure-toggle\"\n\t\t\t\t\tdata-action={open ? \"collapse-disclosure\" : \"expand-disclosure\"}\n\t\t\t\t\tonClick={() => setOpen((prevOpen) => !prevOpen)}>\n\t\t\t\t\t{open ? <ChevronUpIcon /> : <ChevronDownIcon />}\n\t\t\t\t\t{label}\n\t\t\t\t</button>\n\t\t\t\t{headerActions ? (\n\t\t\t\t\t<>\n\t\t\t\t\t\t<FlexSpacer />\n\t\t\t\t\t\t{headerActions}\n\t\t\t\t\t</>\n\t\t\t\t) : null}\n\t\t\t</div>\n\n\t\t\t{open && (\n\t\t\t\t<div id={panelId} role=\"region\" aria-labelledby={buttonId}>\n\t\t\t\t\t<div className={\"paddingMd\"}>{children}</div>\n\t\t\t\t</div>\n\t\t\t)}\n\t\t</div>\n\t);\n}\n","import React from \"react\";\n\nimport { cn } from \"@ryuzaki13/react-foundation-lib/utils\";\n\nimport { Disclosure, DisclosureProps } from \"./Disclosure\";\nimport styles from \"./Disclosure.module.scss\";\n\ninterface DisclosureGroupProps {\n\tchildren?:\n\t\t| (React.ReactElement<DisclosureProps, typeof Disclosure> | null | undefined | false)\n\t\t| (React.ReactElement<DisclosureProps, typeof Disclosure> | null | undefined | false)[];\n\tclassName?: string;\n}\n\n/**\n * Групповой контейнер для нескольких `Disclosure`. Помогает выстраивать последовательный список раскрывающихся секций.\n */\nexport function DisclosureGroup({ className, children }: DisclosureGroupProps) {\n\treturn <div className={cn(styles.disclosureGroup, className)}>{children}</div>;\n}\n"],"mappings":";;;;;;;;;;;;;;;ACoBA,SAAgB,EAAW,EAAE,UAAO,gBAAa,kBAAe,eAA6B;CAC5F,IAAM,CAAC,GAAM,KAAW,EAAS,MAAgB,EAAI,GAC/C,IAAU,EAAM,GAChB,IAAW,EAAM;CAEvB,OACC,kBAAC,OAAD;EAAK,WAAW,EAAG,EAAS,WAAW,EAAS,SAAS,EAAO,UAAU;EAA1E,UAAA,CACC,kBAAC,OAAD;GAAK,WAAW,EAAO;GAAvB,UAAA,CACC,kBAAC,UAAD;IACC,IAAI;IACJ,MAAK;IACL,iBAAe;IACf,iBAAe;IACf,WAAW,EAAG,EAAO,kBAAkB,mCAAmC;IAC1E,WAAQ;IACR,eAAa,IAAO,wBAAwB;IAC5C,eAAe,GAAS,MAAa,CAAC,CAAQ;IAR/C,UAAA,CASS,EAAP,IAAQ,IAAoB,GAArB,CAAgB,CAAsB,GAC7C,CACM;GACP,CAAA,GAAA,IACA,kBAAA,GAAA,EAAA,UAAA,CACC,kBAAC,GAAD,CAAa,CAAA,GACZ,CACA,EAAA,CAAA,IACC,IACA;EAEJ,CAAA,GAAA,KACA,kBAAC,OAAD;GAAK,IAAI;GAAS,MAAK;GAAS,mBAAiB;GAChD,UAAA,kBAAC,OAAD;IAAK,WAAW;IAAc;GAAc,CAAA;EACxC,CAAA,CAEF;;AAEP;;;ACtCA,SAAgB,EAAgB,EAAE,cAAW,eAAkC;CAC9E,OAAO,kBAAC,OAAD;EAAK,WAAW,EAAG,EAAO,iBAAiB,CAAS;EAAI;CAAc,CAAA;AAC9E"}
@@ -1,4 +1,4 @@
1
- import { n as e } from "../chunks/input-files-Dcc5K-_1.js";
1
+ import { n as e } from "../chunks/input-files-D1JzSw_Y.js";
2
2
  import { useCallback as t, useMemo as n, useRef as r, useState as i } from "react";
3
3
  import { cn as a, handleKeyboardActivation as o } from "@ryuzaki13/react-foundation-lib/utils";
4
4
  import { UploadIcon as s } from "lucide-react";
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":[],"sources":["../../src/drop-zone/DropZone.module.scss","../../src/drop-zone/DropZone.tsx"],"sourcesContent":[".zone {\n\tdisplay: flex;\n\tflex-direction: column;\n\talign-items: center;\n\tjustify-content: center;\n\tgap: var(--space-sm);\n\n\tmin-height: 8em;\n\tpadding: var(--space-lg);\n\n\tborder: var(--border-width) dashed var(--border-0);\n\tborder-radius: var(--radius-sm);\n\tbackground-color: var(--surface-0);\n\n\tcolor: var(--content-2);\n\tcursor: pointer;\n\n\ttransition-property: border-color, background-color;\n\ttransition-duration: var(--transition-fast);\n\n\t&.dragOver {\n\t\tborder-color: var(--content-accent);\n\t\tbackground-color: var(--surface-1);\n\t}\n\n\t&.disabled {\n\t\tcursor: default;\n\t\tpointer-events: none;\n\t\tbackground-color: var(--surface-2);\n\t\tborder-color: var(--overlay-backdrop);\n\n\t\t.icon,\n\t\t.hint {\n\t\t\topacity: 0.25;\n\t\t}\n\t}\n}\n\n.icon {\n\twidth: 2em;\n\theight: 2em;\n\tcolor: var(--content-2);\n}\n\n.hint {\n\ttext-align: center;\n}\n","import { ChangeEvent, ReactNode, useCallback, useMemo, useRef, useState } from \"react\";\n\nimport {\n\tassertValidAccept,\n\tassertValidAllowedMime,\n\treadFile,\n\tReadFileError,\n\tReadFileResult,\n\tReadMode\n} from \"@ryuzaki13/react-foundation-lib/file\";\nimport { cn, handleKeyboardActivation } from \"@ryuzaki13/react-foundation-lib/utils\";\nimport { UploadIcon } from \"lucide-react\";\n\nimport { InputFilesList } from \"../input-files\";\n\nimport styles from \"./DropZone.module.scss\";\n\n/**\n * Пропсы компонента DropZone.\n *\n * Компонент представляет собой визуальную зону для выбора файлов.\n * Поддерживает перетаскивание и выбор по клику, а результаты передаются в onDrop.\n */\nexport interface DropZoneProps {\n\tvalue: ReadFileResult[];\n\t/** Вызывается с массивом результатов readFile после сброса файлов */\n\tonChange: (results: ReadFileResult[]) => void;\n\t/** Callback ошибки чтения одного из файлов */\n\tonChangeError?: (error: ReadFileError) => void;\n\n\t/** HTML-атрибут accept для нативного input[type=\"file\"] (например `[\".pdf\", \".docx\"]`) */\n\taccept?: readonly string[];\n\t/** Список допустимых MIME-типов — передаётся в readFile (например `[\"application/pdf\", \"image/png\"]`) */\n\tallowedMime?: readonly string[];\n\t/** Максимальный размер одного файла в байтах */\n\tmaxBytes?: number;\n\t/** Режим чтения: \"data-url\" (по умолчанию) или \"array-buffer\" */\n\treadMode?: ReadMode;\n\t/** Разрешить сброс нескольких файлов (по умолчанию true) */\n\tmultiple?: boolean;\n\n\t/** Блокировка компонента */\n\tdisabled?: boolean;\n\t/** CSS-класс обёртки */\n\tclassName?: string;\n\t/**\n\t * Кастомный контент внутри зоны.\n\t * По умолчанию отображается иконка загрузки и текст \"Перетащите файлы сюда\".\n\t */\n\tchildren?: ReactNode;\n}\n\n/**\n * DropZone — зона для перетаскивания файлов и выбора по клику.\n *\n * При наведении файла зона подсвечивается (пунктирная рамка меняет цвет).\n * При сбросе файлов каждый читается через readFile, успешные результаты\n * передаются в onDrop, ошибки — в onDropError.\n *\n * Поддерживает кастомный контент через children.\n * Если children не указан — отображается иконка загрузки и подсказка.\n */\nexport function DropZone({\n\tvalue,\n\tonChange,\n\tonChangeError,\n\taccept,\n\tallowedMime,\n\tmaxBytes,\n\treadMode,\n\tmultiple = true,\n\tdisabled,\n\tclassName,\n\tchildren\n}: DropZoneProps) {\n\tassertValidAllowedMime(allowedMime);\n\tassertValidAccept(accept);\n\n\t/** Счётчик вложенности drag-событий для корректной обработки dragLeave */\n\tconst dragCounter = useRef(0);\n\t/** Скрытый input для выбора файлов по клику */\n\tconst inputRef = useRef<HTMLInputElement>(null);\n\t/** Состояние: файл перетаскивается над зоной */\n\tconst [isDragOver, setIsDragOver] = useState(false);\n\n\t/**\n\t * Формируем HTML-атрибут accept из accept или allowedMime.\n\t */\n\tconst acceptAttr = useMemo(() => {\n\t\tif (accept && accept.length > 0) {\n\t\t\treturn accept.join(\",\");\n\t\t}\n\t\tif (allowedMime && allowedMime.length > 0) {\n\t\t\treturn allowedMime.join(\",\");\n\t\t}\n\t\treturn \"*\";\n\t}, [allowedMime, accept]);\n\n\tconst readDroppedFile = useCallback(\n\t\t(file: File) => {\n\t\t\tif (readMode === \"array-buffer\") {\n\t\t\t\treturn readFile(file, { allowedMime, maxBytes, mode: \"array-buffer\" });\n\t\t\t}\n\n\t\t\treturn readFile(file, { allowedMime, maxBytes });\n\t\t},\n\t\t[allowedMime, maxBytes, readMode]\n\t);\n\n\tconst processFiles = useCallback(\n\t\tasync (files: File[]) => {\n\t\t\tif (disabled || files.length === 0) return;\n\n\t\t\tconst filesToProcess = multiple ? files : files.slice(0, 1);\n\t\t\tconst results: ReadFileResult[] = [];\n\n\t\t\tfor (const file of filesToProcess) {\n\t\t\t\ttry {\n\t\t\t\t\tconst result = await readDroppedFile(file);\n\t\t\t\t\tresults.push(result);\n\t\t\t\t} catch (err) {\n\t\t\t\t\tif (err instanceof ReadFileError && onChangeError) {\n\t\t\t\t\t\tonChangeError(err);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (results.length > 0) {\n\t\t\t\tonChange(results);\n\t\t\t}\n\t\t},\n\t\t[disabled, multiple, onChange, onChangeError, readDroppedFile]\n\t);\n\n\tconst openFileDialog = useCallback(() => {\n\t\tif (disabled) return;\n\n\t\tinputRef.current?.click();\n\t}, [disabled]);\n\n\t/**\n\t * Обработка dragEnter — увеличиваем счётчик и включаем подсветку.\n\t * Счётчик нужен потому что dragEnter/dragLeave срабатывают\n\t * на каждом дочернем элементе внутри зоны.\n\t */\n\tconst handleDragEnter = useCallback(\n\t\t(e: React.DragEvent) => {\n\t\t\te.preventDefault();\n\t\t\te.stopPropagation();\n\t\t\tif (disabled) return;\n\n\t\t\tdragCounter.current += 1;\n\t\t\tif (dragCounter.current === 1) {\n\t\t\t\tsetIsDragOver(true);\n\t\t\t}\n\t\t},\n\t\t[disabled]\n\t);\n\n\t/**\n\t * Обработка dragOver — предотвращаем дефолтное поведение браузера\n\t * (иначе drop-событие не сработает).\n\t */\n\tconst handleDragOver = useCallback(\n\t\t(e: React.DragEvent) => {\n\t\t\te.preventDefault();\n\t\t\te.stopPropagation();\n\t\t\tif (disabled) return;\n\n\t\t\te.dataTransfer.dropEffect = \"copy\";\n\t\t},\n\t\t[disabled]\n\t);\n\n\t/**\n\t * Обработка dragLeave — уменьшаем счётчик, выключаем подсветку при 0.\n\t */\n\tconst handleDragLeave = useCallback(\n\t\t(e: React.DragEvent) => {\n\t\t\te.preventDefault();\n\t\t\te.stopPropagation();\n\t\t\tif (disabled) return;\n\n\t\t\tdragCounter.current -= 1;\n\t\t\tif (dragCounter.current === 0) {\n\t\t\t\tsetIsDragOver(false);\n\t\t\t}\n\t\t},\n\t\t[disabled]\n\t);\n\n\t/**\n\t * Обработка drop — читаем сброшенные файлы через общую логику.\n\t */\n\tconst handleDrop = useCallback(\n\t\tasync (e: React.DragEvent) => {\n\t\t\te.preventDefault();\n\t\t\te.stopPropagation();\n\n\t\t\t// Сбрасываем состояние drag\n\t\t\tdragCounter.current = 0;\n\t\t\tsetIsDragOver(false);\n\n\t\t\tif (disabled) return;\n\n\t\t\tconst droppedFiles = Array.from(e.dataTransfer.files);\n\t\t\tawait processFiles(droppedFiles);\n\t\t},\n\t\t[disabled, processFiles]\n\t);\n\n\tconst handleInputChange = useCallback(\n\t\tasync (e: ChangeEvent<HTMLInputElement>) => {\n\t\t\tconst selectedFiles = Array.from(e.target.files ?? []);\n\t\t\tawait processFiles(selectedFiles);\n\n\t\t\t// Сбрасываем значение, чтобы повторный выбор того же файла тоже вызывал change.\n\t\t\te.target.value = \"\";\n\t\t},\n\t\t[processFiles]\n\t);\n\n\tconst handleKeyDown = useCallback(\n\t\t(e: React.KeyboardEvent<HTMLDivElement>) => {\n\t\t\thandleKeyboardActivation(e, openFileDialog, { disabled });\n\t\t},\n\t\t[disabled, openFileDialog]\n\t);\n\n\treturn (\n\t\t<div>\n\t\t\t<input\n\t\t\t\tref={inputRef}\n\t\t\t\ttype=\"file\"\n\t\t\t\thidden\n\t\t\t\tdisabled={disabled}\n\t\t\t\tmultiple={multiple}\n\t\t\t\taccept={acceptAttr}\n\t\t\t\tonChange={handleInputChange}\n\t\t\t/>\n\t\t\t<div\n\t\t\t\tclassName={cn(styles.zone, isDragOver && styles.dragOver, disabled && styles.disabled, className)}\n\t\t\t\tonClick={openFileDialog}\n\t\t\t\tonKeyDown={handleKeyDown}\n\t\t\t\tonDragEnter={handleDragEnter}\n\t\t\t\tonDragOver={handleDragOver}\n\t\t\t\tonDragLeave={handleDragLeave}\n\t\t\t\tonDrop={handleDrop}\n\t\t\t\trole=\"button\"\n\t\t\t\ttabIndex={disabled ? -1 : 0}\n\t\t\t\taria-disabled={disabled}>\n\t\t\t\t{children ?? (\n\t\t\t\t\t<>\n\t\t\t\t\t\t{/* Иконка загрузки по умолчанию */}\n\t\t\t\t\t\t<UploadIcon className={styles.icon} />\n\t\t\t\t\t\t{/* Текст подсказки */}\n\t\t\t\t\t\t<span className={styles.hint}>\n\t\t\t\t\t\t\t{multiple ? \"Перетащите файлы сюда или нажмите для выбора\" : \"Перетащите файл сюда или нажмите для выбора\"}\n\t\t\t\t\t\t</span>\n\t\t\t\t\t</>\n\t\t\t\t)}\n\t\t\t</div>\n\n\t\t\t{/* Список выбранных файлов */}\n\t\t\t<InputFilesList files={value} onChange={onChange} />\n\t\t</div>\n\t);\n}\n"],"mappings":";;;;;;;;;;;;;;;AC8DA,SAAgB,EAAS,EACxB,UACA,aACA,kBACA,WACA,gBACA,aACA,aACA,cAAW,IACX,aACA,cACA,eACiB;CAEjB,AADA,EAAuB,CAAW,GAClC,EAAkB,CAAM;CAGxB,IAAM,IAAc,EAAO,CAAC,GAEtB,IAAW,EAAyB,IAAI,GAExC,CAAC,GAAY,KAAiB,EAAS,EAAK,GAK5C,IAAa,QACd,KAAU,EAAO,SAAS,IACtB,EAAO,KAAK,GAAG,IAEnB,KAAe,EAAY,SAAS,IAChC,EAAY,KAAK,GAAG,IAErB,KACL,CAAC,GAAa,CAAM,CAAC,GAElB,IAAkB,GACtB,MACI,MAAa,iBACT,EAAS,GAAM;EAAE;EAAa;EAAU,MAAM;CAAe,CAAC,IAG/D,EAAS,GAAM;EAAE;EAAa;CAAS,CAAC,GAEhD;EAAC;EAAa;EAAU;CAAQ,CACjC,GAEM,IAAe,EACpB,OAAO,MAAkB;EACxB,IAAI,KAAY,EAAM,WAAW,GAAG;EAEpC,IAAM,IAAiB,IAAW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,CAAY,CACd,GAEM,IAAgB,GACpB,MAA2C;EAC3C,EAAyB,GAAG,GAAgB,EAAE,YAAS,CAAC;CACzD,GACA,CAAC,GAAU,CAAc,CAC1B;CAEA,OACC,kBAAC,OAAD,EAAA,UAAA;EACC,kBAAC,SAAD;GACC,KAAK;GACL,MAAK;GACL,QAAA;GACU;GACA;GACV,QAAQ;GACR,UAAU;EACV,CAAA;EACD,kBAAC,OAAD;GACC,WAAW,EAAG,EAAO,MAAM,KAAc,EAAO,UAAU,KAAY,EAAO,UAAU,CAAS;GAChG,SAAS;GACT,WAAW;GACX,aAAa;GACb,YAAY;GACZ,aAAa;GACb,QAAQ;GACR,MAAK;GACL,UAAU,IAAW,KAAK;GAC1B,iBAAe;aACd,KACA,kBAAA,GAAA,EAAA,UAAA,CAEC,kBAAC,GAAD,EAAY,WAAW,EAAO,KAAO,CAAA,GAErC,kBAAC,QAAD;IAAM,WAAW,EAAO;cACtB,IAAW,iDAAiD;GACxD,CAAA,CACL,EAAA,CAAA;EAEC,CAAA;EAGL,kBAAC,GAAD;GAAgB,OAAO;GAAiB;EAAW,CAAA;CAC/C,EAAA,CAAA;AAEP"}
1
+ {"version":3,"file":"index.js","names":[],"sources":["../../src/drop-zone/DropZone.module.scss","../../src/drop-zone/DropZone.tsx"],"sourcesContent":[".zone {\n\tdisplay: flex;\n\tflex-direction: column;\n\talign-items: center;\n\tjustify-content: center;\n\tgap: var(--space-sm);\n\n\tmin-height: 8em;\n\tpadding: var(--space-lg);\n\n\tborder: var(--border-width) dashed var(--border-0);\n\tborder-radius: var(--radius-sm);\n\tbackground-color: var(--surface-0);\n\n\tcolor: var(--content-2);\n\tcursor: pointer;\n\n\ttransition-property: border-color, background-color;\n\ttransition-duration: var(--transition-fast);\n\n\t&.dragOver {\n\t\tborder-color: var(--content-accent);\n\t\tbackground-color: var(--surface-1);\n\t}\n\n\t&.disabled {\n\t\tcursor: default;\n\t\tpointer-events: none;\n\t\tbackground-color: var(--surface-2);\n\t\tborder-color: var(--overlay-backdrop);\n\n\t\t.icon,\n\t\t.hint {\n\t\t\topacity: 0.25;\n\t\t}\n\t}\n}\n\n.icon {\n\twidth: 2em;\n\theight: 2em;\n\tcolor: var(--content-2);\n}\n\n.hint {\n\ttext-align: center;\n}\n","import { ChangeEvent, ReactNode, useCallback, useMemo, useRef, useState } from \"react\";\n\nimport {\n\tassertValidAccept,\n\tassertValidAllowedMime,\n\treadFile,\n\tReadFileError,\n\tReadFileResult,\n\tReadMode\n} from \"@ryuzaki13/react-foundation-lib/file\";\nimport { cn, handleKeyboardActivation } from \"@ryuzaki13/react-foundation-lib/utils\";\nimport { UploadIcon } from \"lucide-react\";\n\nimport { InputFilesList } from \"../input-files\";\n\nimport styles from \"./DropZone.module.scss\";\n\n/**\n * Пропсы компонента DropZone.\n *\n * Компонент представляет собой визуальную зону для выбора файлов.\n * Поддерживает перетаскивание и выбор по клику, а результаты передаются в onDrop.\n */\nexport interface DropZoneProps {\n\tvalue: ReadFileResult[];\n\t/** Вызывается с массивом результатов readFile после сброса файлов */\n\tonChange: (results: ReadFileResult[]) => void;\n\t/** Callback ошибки чтения одного из файлов */\n\tonChangeError?: (error: ReadFileError) => void;\n\n\t/** HTML-атрибут accept для нативного input[type=\"file\"] (например `[\".pdf\", \".docx\"]`) */\n\taccept?: readonly string[];\n\t/** Список допустимых MIME-типов — передаётся в readFile (например `[\"application/pdf\", \"image/png\"]`) */\n\tallowedMime?: readonly string[];\n\t/** Максимальный размер одного файла в байтах */\n\tmaxBytes?: number;\n\t/** Режим чтения: \"data-url\" (по умолчанию) или \"array-buffer\" */\n\treadMode?: ReadMode;\n\t/** Разрешить сброс нескольких файлов (по умолчанию true) */\n\tmultiple?: boolean;\n\n\t/** Блокировка компонента */\n\tdisabled?: boolean;\n\t/** CSS-класс обёртки */\n\tclassName?: string;\n\t/**\n\t * Кастомный контент внутри зоны.\n\t * По умолчанию отображается иконка загрузки и текст \"Перетащите файлы сюда\".\n\t */\n\tchildren?: ReactNode;\n}\n\n/**\n * DropZone — зона для перетаскивания файлов и выбора по клику.\n *\n * При наведении файла зона подсвечивается (пунктирная рамка меняет цвет).\n * При сбросе файлов каждый читается через readFile, успешные результаты\n * передаются в onDrop, ошибки — в onDropError.\n *\n * Поддерживает кастомный контент через children.\n * Если children не указан — отображается иконка загрузки и подсказка.\n */\nexport function DropZone({\n\tvalue,\n\tonChange,\n\tonChangeError,\n\taccept,\n\tallowedMime,\n\tmaxBytes,\n\treadMode,\n\tmultiple = true,\n\tdisabled,\n\tclassName,\n\tchildren\n}: DropZoneProps) {\n\tassertValidAllowedMime(allowedMime);\n\tassertValidAccept(accept);\n\n\t/** Счётчик вложенности drag-событий для корректной обработки dragLeave */\n\tconst dragCounter = useRef(0);\n\t/** Скрытый input для выбора файлов по клику */\n\tconst inputRef = useRef<HTMLInputElement>(null);\n\t/** Состояние: файл перетаскивается над зоной */\n\tconst [isDragOver, setIsDragOver] = useState(false);\n\n\t/**\n\t * Формируем HTML-атрибут accept из accept или allowedMime.\n\t */\n\tconst acceptAttr = useMemo(() => {\n\t\tif (accept && accept.length > 0) {\n\t\t\treturn accept.join(\",\");\n\t\t}\n\t\tif (allowedMime && allowedMime.length > 0) {\n\t\t\treturn allowedMime.join(\",\");\n\t\t}\n\t\treturn \"*\";\n\t}, [allowedMime, accept]);\n\n\tconst readDroppedFile = useCallback(\n\t\t(file: File) => {\n\t\t\tif (readMode === \"array-buffer\") {\n\t\t\t\treturn readFile(file, { allowedMime, maxBytes, mode: \"array-buffer\" });\n\t\t\t}\n\n\t\t\treturn readFile(file, { allowedMime, maxBytes });\n\t\t},\n\t\t[allowedMime, maxBytes, readMode]\n\t);\n\n\tconst processFiles = useCallback(\n\t\tasync (files: File[]) => {\n\t\t\tif (disabled || files.length === 0) return;\n\n\t\t\tconst filesToProcess = multiple ? files : files.slice(0, 1);\n\t\t\tconst results: ReadFileResult[] = [];\n\n\t\t\tfor (const file of filesToProcess) {\n\t\t\t\ttry {\n\t\t\t\t\tconst result = await readDroppedFile(file);\n\t\t\t\t\tresults.push(result);\n\t\t\t\t} catch (err) {\n\t\t\t\t\tif (err instanceof ReadFileError && onChangeError) {\n\t\t\t\t\t\tonChangeError(err);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (results.length > 0) {\n\t\t\t\tonChange(results);\n\t\t\t}\n\t\t},\n\t\t[disabled, multiple, onChange, onChangeError, readDroppedFile]\n\t);\n\n\tconst openFileDialog = useCallback(() => {\n\t\tif (disabled) return;\n\n\t\tinputRef.current?.click();\n\t}, [disabled]);\n\n\t/**\n\t * Обработка dragEnter — увеличиваем счётчик и включаем подсветку.\n\t * Счётчик нужен потому что dragEnter/dragLeave срабатывают\n\t * на каждом дочернем элементе внутри зоны.\n\t */\n\tconst handleDragEnter = useCallback(\n\t\t(e: React.DragEvent) => {\n\t\t\te.preventDefault();\n\t\t\te.stopPropagation();\n\t\t\tif (disabled) return;\n\n\t\t\tdragCounter.current += 1;\n\t\t\tif (dragCounter.current === 1) {\n\t\t\t\tsetIsDragOver(true);\n\t\t\t}\n\t\t},\n\t\t[disabled]\n\t);\n\n\t/**\n\t * Обработка dragOver — предотвращаем дефолтное поведение браузера\n\t * (иначе drop-событие не сработает).\n\t */\n\tconst handleDragOver = useCallback(\n\t\t(e: React.DragEvent) => {\n\t\t\te.preventDefault();\n\t\t\te.stopPropagation();\n\t\t\tif (disabled) return;\n\n\t\t\te.dataTransfer.dropEffect = \"copy\";\n\t\t},\n\t\t[disabled]\n\t);\n\n\t/**\n\t * Обработка dragLeave — уменьшаем счётчик, выключаем подсветку при 0.\n\t */\n\tconst handleDragLeave = useCallback(\n\t\t(e: React.DragEvent) => {\n\t\t\te.preventDefault();\n\t\t\te.stopPropagation();\n\t\t\tif (disabled) return;\n\n\t\t\tdragCounter.current -= 1;\n\t\t\tif (dragCounter.current === 0) {\n\t\t\t\tsetIsDragOver(false);\n\t\t\t}\n\t\t},\n\t\t[disabled]\n\t);\n\n\t/**\n\t * Обработка drop — читаем сброшенные файлы через общую логику.\n\t */\n\tconst handleDrop = useCallback(\n\t\tasync (e: React.DragEvent) => {\n\t\t\te.preventDefault();\n\t\t\te.stopPropagation();\n\n\t\t\t// Сбрасываем состояние drag\n\t\t\tdragCounter.current = 0;\n\t\t\tsetIsDragOver(false);\n\n\t\t\tif (disabled) return;\n\n\t\t\tconst droppedFiles = Array.from(e.dataTransfer.files);\n\t\t\tawait processFiles(droppedFiles);\n\t\t},\n\t\t[disabled, processFiles]\n\t);\n\n\tconst handleInputChange = useCallback(\n\t\tasync (e: ChangeEvent<HTMLInputElement>) => {\n\t\t\tconst selectedFiles = Array.from(e.target.files ?? []);\n\t\t\tawait processFiles(selectedFiles);\n\n\t\t\t// Сбрасываем значение, чтобы повторный выбор того же файла тоже вызывал change.\n\t\t\te.target.value = \"\";\n\t\t},\n\t\t[processFiles]\n\t);\n\n\tconst handleKeyDown = useCallback(\n\t\t(e: React.KeyboardEvent<HTMLDivElement>) => {\n\t\t\thandleKeyboardActivation(e, openFileDialog, { disabled });\n\t\t},\n\t\t[disabled, openFileDialog]\n\t);\n\n\treturn (\n\t\t<div>\n\t\t\t<input\n\t\t\t\tref={inputRef}\n\t\t\t\ttype=\"file\"\n\t\t\t\thidden\n\t\t\t\tdisabled={disabled}\n\t\t\t\tmultiple={multiple}\n\t\t\t\taccept={acceptAttr}\n\t\t\t\tonChange={handleInputChange}\n\t\t\t/>\n\t\t\t<div\n\t\t\t\tclassName={cn(styles.zone, isDragOver && styles.dragOver, disabled && styles.disabled, className)}\n\t\t\t\tonClick={openFileDialog}\n\t\t\t\tonKeyDown={handleKeyDown}\n\t\t\t\tonDragEnter={handleDragEnter}\n\t\t\t\tonDragOver={handleDragOver}\n\t\t\t\tonDragLeave={handleDragLeave}\n\t\t\t\tonDrop={handleDrop}\n\t\t\t\trole=\"button\"\n\t\t\t\ttabIndex={disabled ? -1 : 0}\n\t\t\t\taria-disabled={disabled}>\n\t\t\t\t{children ?? (\n\t\t\t\t\t<>\n\t\t\t\t\t\t{/* Иконка загрузки по умолчанию */}\n\t\t\t\t\t\t<UploadIcon className={styles.icon} />\n\t\t\t\t\t\t{/* Текст подсказки */}\n\t\t\t\t\t\t<span className={styles.hint}>\n\t\t\t\t\t\t\t{multiple ? \"Перетащите файлы сюда или нажмите для выбора\" : \"Перетащите файл сюда или нажмите для выбора\"}\n\t\t\t\t\t\t</span>\n\t\t\t\t\t</>\n\t\t\t\t)}\n\t\t\t</div>\n\n\t\t\t{/* Список выбранных файлов */}\n\t\t\t<InputFilesList files={value} onChange={onChange} />\n\t\t</div>\n\t);\n}\n"],"mappings":";;;;;;;;;;;;;;;AC8DA,SAAgB,EAAS,EACxB,UACA,aACA,kBACA,WACA,gBACA,aACA,aACA,cAAW,IACX,aACA,cACA,eACiB;CAEjB,AADA,EAAuB,CAAW,GAClC,EAAkB,CAAM;CAGxB,IAAM,IAAc,EAAO,CAAC,GAEtB,IAAW,EAAyB,IAAI,GAExC,CAAC,GAAY,KAAiB,EAAS,EAAK,GAK5C,IAAa,QACd,KAAU,EAAO,SAAS,IACtB,EAAO,KAAK,GAAG,IAEnB,KAAe,EAAY,SAAS,IAChC,EAAY,KAAK,GAAG,IAErB,KACL,CAAC,GAAa,CAAM,CAAC,GAElB,IAAkB,GACtB,MACI,MAAa,iBACT,EAAS,GAAM;EAAE;EAAa;EAAU,MAAM;CAAe,CAAC,IAG/D,EAAS,GAAM;EAAE;EAAa;CAAS,CAAC,GAEhD;EAAC;EAAa;EAAU;CAAQ,CACjC,GAEM,IAAe,EACpB,OAAO,MAAkB;EACxB,IAAI,KAAY,EAAM,WAAW,GAAG;EAEpC,IAAM,IAAiB,IAAW,IAAQ,EAAM,MAAM,GAAG,CAAC,GACpD,IAA4B,CAAC;EAEnC,KAAK,IAAM,KAAQ,GAClB,IAAI;GACH,IAAM,IAAS,MAAM,EAAgB,CAAI;GACzC,EAAQ,KAAK,CAAM;EACpB,SAAS,GAAK;GACb,AAAI,aAAe,KAAiB,KACnC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L,QAAA;GACU;GACA;GACV,QAAQ;GACR,UAAU;EACV,CAAA;EACD,kBAAC,OAAD;GACC,WAAW,EAAG,EAAO,MAAM,KAAc,EAAO,UAAU,KAAY,EAAO,UAAU,CAAS;GAChG,SAAS;GACT,WAAW;GACX,aAAa;GACb,YAAY;GACZ,aAAa;GACb,QAAQ;GACR,MAAK;GACL,UAAU,IAAW,KAAK;GAC1B,iBAAe;GACd,UAAA,KACA,kBAAA,GAAA,EAAA,UAAA,CAEC,kBAAC,GAAD,EAAY,WAAW,EAAO,KAAO,CAAA,GAErC,kBAAC,QAAD;IAAM,WAAW,EAAO;IACtB,UAAA,IAAW,iDAAiD;GACxD,CAAA,CACL,EAAA,CAAA;EAEC,CAAA;EAGL,kBAAC,GAAD;GAAgB,OAAO;GAAiB;EAAW,CAAA;CAC/C,EAAA,CAAA;AAEP"}
@@ -1,5 +1,5 @@
1
1
  import { Text as e } from "../text/index.js";
2
- import { r as t } from "../chunks/flex-DYZ0IbU6.js";
2
+ import { r as t } from "../chunks/flex-C7njxZ74.js";
3
3
  import { Component as n, useEffect as r, useState as i } from "react";
4
4
  import { useQueryClient as a } from "@tanstack/react-query";
5
5
  import { logError as o } from "@ryuzaki13/react-foundation-lib/utils";
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":[],"sources":["../../src/errors/PageError.tsx","../../src/errors/BadRequestPage.tsx","../../src/errors/BoomExplosion.tsx","../../src/errors/constants.ts","../../src/errors/ForbiddenPage.tsx","../../src/errors/NotFoundPage.tsx","../../src/errors/ErrorDisplay.tsx","../../src/errors/ErrorBoundary.tsx","../../src/errors/ErrorExplosion.tsx","../../src/errors/SimpleErrorDisplay.tsx","../../src/errors/UnauthorizedPage.tsx","../../src/errors/ViewNotChanged.tsx"],"sourcesContent":["import React from \"react\";\n\nimport { Flex } from \"../flex\";\n\ninterface PageErrorProps {\n\tcode: string | number;\n\ttitle: string;\n\tdescription: string;\n}\n\nexport const PageError: React.FC<PageErrorProps> = ({ code, title, description }) => {\n\treturn (\n\t\t<Flex.Predefined variant=\"columnCenter\" className=\"paddingXl\">\n\t\t\t<div aria-hidden=\"true\" className=\"content2 fontBolded\" style={{ fontSize: \"5em\" }}>\n\t\t\t\t{code}\n\t\t\t</div>\n\t\t\t<h2>{title}</h2>\n\t\t\t<p>{description}</p>\n\t\t\t{/* <Link to=\"/\">Вернуться на главную</Link> */}\n\t\t</Flex.Predefined>\n\t);\n};\n","import { PageError } from \"./PageError\";\n\nexport const BadRequestPage: React.FC = () => {\n\treturn (\n\t\t<PageError\n\t\t\tcode={400}\n\t\t\ttitle=\"Некорректный запрос\"\n\t\t\tdescription=\"Похоже, что запрос был сформирован неверно. Попробуйте обновить страницу или вернуться на главную.\"\n\t\t/>\n\t);\n};\n","import { useState } from \"react\";\n\nexport function BoomExplosion() {\n\tconst [transform] = useState(() => {\n\t\tconst scale = 0.7 + Math.random() * 0.3;\n\t\tconst rotate = Math.random() * 45 - 15;\n\t\treturn `scale(${scale}) rotateZ(${rotate}deg)`;\n\t});\n\n\treturn (\n\t\t<svg\n\t\t\tviewBox=\"0 0 300 300\"\n\t\t\twidth=\"300\"\n\t\t\theight=\"300\"\n\t\t\tstyle={{\n\t\t\t\tposition: \"absolute\",\n\t\t\t\ttop: \"50%\",\n\t\t\t\tleft: \"50%\",\n\t\t\t\ttransform: `translate(-50%, -50%) ${transform}`,\n\t\t\t\tzIndex: 0,\n\t\t\t\topacity: 0.5\n\t\t\t}}>\n\t\t\t<polygon\n\t\t\t\tpoints=\"\n150,10 170,60 230,40 200,100 270,110 210,150 270,190 200,200 230,260 170,240 150,290 130,240\n70,260 100,200 30,190 90,150 30,110 100,100 70,40 130,60\"\n\t\t\t\tfill=\"var(--status-error-on-fill)\"\n\t\t\t\tstroke=\"var(--status-error-fill)\"\n\t\t\t\tstrokeWidth=\"5\"\n\t\t\t\tstrokeLinejoin=\"round\"\n\t\t\t/>\n\t\t</svg>\n\t);\n}\n","export const ERROR_BOOM_MESSAGES = [\"Упс!\", \"Ой!\", \"Эх!\", \"Ай-ай-ай!\", \"Бах!\", \"Бум!\", \"Ого!\", \"Облом!\", \"Ёлки-палки!\", \"Хлоп!\"];\n","import { PageError } from \"./PageError\";\n\nexport const ForbiddenPage: React.FC = () => {\n\treturn <PageError code={403} title=\"Доступ запрещён\" description=\"У вас нет прав для просмотра этой страницы.\" />;\n};\n","import { PageError } from \"./PageError\";\n\nexport const NotFoundPage: React.FC = () => {\n\treturn <PageError code={404} title=\"Страница не найдена\" description=\"Извините, запрашиваемая страница не существует\" />;\n};\n","import { useEffect, useState } from \"react\";\n\nimport { captureRuntimeErrorReport } from \"@ryuzaki13/react-foundation-lib/error-report\";\nimport { logError } from \"@ryuzaki13/react-foundation-lib/utils\";\nimport { useQueryClient } from \"@tanstack/react-query\";\n\nimport { BadRequestPage } from \"./BadRequestPage\";\nimport { BoomExplosion } from \"./BoomExplosion\";\nimport { ERROR_BOOM_MESSAGES } from \"./constants\";\nimport { ForbiddenPage } from \"./ForbiddenPage\";\nimport { NotFoundPage } from \"./NotFoundPage\";\n\nfunction getHttpStatusCode(error: Error): number | undefined {\n\tif (!(\"status\" in error) || typeof error.status !== \"number\") return undefined;\n\treturn error.status;\n}\n\nexport const ErrorDisplay: React.FC<{ error: Error; componentStack?: string; draftId?: string | null }> = ({\n\terror,\n\tcomponentStack,\n\tdraftId\n}) => {\n\tconst [randomValue] = useState(() => Math.random());\n\tconst queryClient = useQueryClient();\n\n\tuseEffect(() => {\n\t\tif (draftId !== undefined) return;\n\n\t\tvoid captureRuntimeErrorReport(\n\t\t\terror,\n\t\t\t{\n\t\t\t\tcategory: \"react\",\n\t\t\t\tcomponentStack\n\t\t\t},\n\t\t\tqueryClient\n\t\t);\n\t}, [componentStack, draftId, error, queryClient]);\n\n\tconst httpStatusCode = getHttpStatusCode(error);\n\n\tif (httpStatusCode) {\n\t\tswitch (httpStatusCode) {\n\t\t\tcase 400:\n\t\t\t\treturn <BadRequestPage />;\n\t\t\tcase 403:\n\t\t\t\treturn <ForbiddenPage />;\n\t\t\tcase 404:\n\t\t\t\treturn <NotFoundPage />;\n\t\t}\n\t}\n\n\tlogError(error.stack);\n\n\treturn (\n\t\t<section className=\"w100 h100 flexColumn justifyContentCenter paddingMd\">\n\t\t\t<div aria-hidden=\"true\" className=\"textCenter relative fontBolded statusError\" style={{ fontSize: \"4em\", marginBlock: \"2em\" }}>\n\t\t\t\t<BoomExplosion />\n\t\t\t\t<div\n\t\t\t\t\tstyle={{\n\t\t\t\t\t\tzIndex: 1,\n\t\t\t\t\t\tposition: \"relative\",\n\t\t\t\t\t\ttextShadow: \"1px -1px 1px var(--status-warning-border-focus), -1px 1px 1px var(--status-info-border-focus)\"\n\t\t\t\t\t}}>\n\t\t\t\t\t{ERROR_BOOM_MESSAGES[Math.floor(randomValue * ERROR_BOOM_MESSAGES.length)]}\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t\t<div className=\"textCenter\">\n\t\t\t\t<h2 className=\"statusError\">Критическая ошибка</h2>\n\t\t\t\t<p className=\"statusError fontSizeLg\">\n\t\t\t\t\t<code>{error.message}</code>\n\t\t\t\t</p>\n\t\t\t\t<p>Попробуйте перезагрузить страницу или вернуться позже.</p>\n\t\t\t</div>\n\t\t</section>\n\t);\n};\n","import React, { Component } from \"react\";\n\nimport { captureRuntimeErrorReport } from \"@ryuzaki13/react-foundation-lib/error-report\";\n\nimport { ErrorDisplay } from \"./ErrorDisplay\";\n\ninterface ErrorBoundaryProps {\n\tchildren: React.ReactNode;\n\tcustomComponent?: React.ComponentType<{ error: Error }>;\n}\n\ntype ErrorBoundaryState = {\n\terror: Error | null;\n\tcomponentStack?: string;\n\tdraftId?: string | null;\n};\n\nexport class ErrorBoundary extends Component<ErrorBoundaryProps, ErrorBoundaryState> {\n\tconstructor(props: ErrorBoundaryProps) {\n\t\tsuper(props);\n\t\tthis.state = { error: null };\n\t}\n\n\tstatic getDerivedStateFromError(error: Error) {\n\t\treturn { error };\n\t}\n\n\tcomponentDidUpdate(prevProps: ErrorBoundaryProps) {\n\t\t// Сбрасываем ошибку при изменении children\n\t\tif (this.state.error && prevProps.children !== this.props.children) {\n\t\t\tthis.setState({ error: null, componentStack: undefined, draftId: undefined });\n\t\t}\n\t}\n\n\tcomponentDidCatch(error: Error, errorInfo: React.ErrorInfo) {\n\t\tthis.setState({ componentStack: errorInfo.componentStack ?? undefined, draftId: null });\n\n\t\tcaptureRuntimeErrorReport(error, {\n\t\t\tcategory: \"react\",\n\t\t\tcomponentStack: errorInfo.componentStack ?? undefined\n\t\t}).then((draft) => {\n\t\t\tif (draft && this.state.error === error) {\n\t\t\t\tthis.setState({ draftId: draft.reportId });\n\t\t\t}\n\t\t});\n\t}\n\n\trender() {\n\t\tif (this.state.error) {\n\t\t\tconst CustomComponent = this.props.customComponent;\n\t\t\treturn CustomComponent ? (\n\t\t\t\t<CustomComponent error={this.state.error} />\n\t\t\t) : (\n\t\t\t\t<ErrorDisplay error={this.state.error} componentStack={this.state.componentStack} draftId={this.state.draftId} />\n\t\t\t);\n\t\t}\n\n\t\treturn this.props.children;\n\t}\n}\n","import React, { useState } from \"react\";\n\nimport { BoomExplosion } from \"./BoomExplosion\";\nimport { ERROR_BOOM_MESSAGES } from \"./constants\";\n\ninterface ErrorExplosionProps {\n\theader?: string;\n\tdescription?: string;\n}\n\nexport const ErrorExplosion: React.FC<ErrorExplosionProps> = ({ header, description }) => {\n\tconst [randomValue] = useState(() => Math.random());\n\n\treturn (\n\t\t<div className=\"container marginBlockLg\">\n\t\t\t<div aria-hidden=\"true\" className={\"textCenter relative fontBolded statusWarning marginBlockMd\"} style={{ fontSize: \"6em\" }}>\n\t\t\t\t<BoomExplosion />\n\t\t\t\t<div\n\t\t\t\t\tstyle={{\n\t\t\t\t\t\tzIndex: 1,\n\t\t\t\t\t\tposition: \"relative\",\n\t\t\t\t\t\ttextShadow: \"1px 0 1px var(--status-error-fill), -1px 0 1px var(--status-info-fill)\"\n\t\t\t\t\t}}>\n\t\t\t\t\t{ERROR_BOOM_MESSAGES[Math.floor(randomValue * ERROR_BOOM_MESSAGES.length)]}\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t\t<div className=\"flexColumn alignItemsCenter textCenter marginBlockMd\">\n\t\t\t\t{header && <h2 className=\"statusWarning\">{header}</h2>}\n\t\t\t\t{description && <p>{description}</p>}\n\t\t\t</div>\n\t\t</div>\n\t);\n};\n","import { logError } from \"@ryuzaki13/react-foundation-lib/utils\";\n\nimport { Text } from \"../text\";\n\nexport function SimpleErrorDisplay({ error }: { error: Error }) {\n\tlogError(error.stack);\n\n\treturn (\n\t\t<Text color=\"error\">\n\t\t\t<code>{error.message}</code>\n\t\t</Text>\n\t);\n}\n","import { PageError } from \"./PageError\";\n\nexport const UnauthorizedPage: React.FC = () => {\n\treturn (\n\t\t<PageError\n\t\t\tcode={401}\n\t\t\ttitle=\"Необходима авторизация\"\n\t\t\tdescription=\"Для доступа к этой странице нужно войти в систему. Пожалуйста, авторизуйтесь и попробуйте снова.\"\n\t\t/>\n\t);\n};\n","import React from \"react\";\n\nimport { Flex } from \"../flex\";\n\nexport const ViewNotChanged: React.FC = () => {\n\treturn (\n\t\t<Flex.Predefined variant=\"columnCenter\" className=\"paddingXl\">\n\t\t\t<h2 className=\"content2\">Выберите ракурс</h2>\n\t\t</Flex.Predefined>\n\t);\n};\n"],"mappings":";;;;;;;;AAUA,IAAa,KAAuC,EAAE,SAAM,UAAO,qBAEjE,kBAAC,EAAK,YAAN;CAAiB,SAAQ;CAAe,WAAU;WAAlD;EACC,kBAAC,OAAD;GAAK,eAAY;GAAO,WAAU;GAAsB,OAAO,EAAE,UAAU,MAAM;aAC/E;EACG,CAAA;EACL,kBAAC,MAAD,EAAA,UAAK,EAAU,CAAA;EACf,kBAAC,KAAD,EAAA,UAAI,EAAe,CAAA;CAEH;ICjBN,UAEX,kBAAC,GAAD;CACC,MAAM;CACN,OAAM;CACN,aAAY;AACZ,CAAA;;;ACNH,SAAgB,IAAgB;CAC/B,IAAM,CAAC,KAAa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KAAK,MAAM,MAAQ,CAAA,IAE3C,kBAAC,GAAD;IAAc,OAAO,KAAK,MAAM;IAAO,gBAAgB,KAAK,MAAM;IAAgB,SAAS,KAAK,MAAM;GAAU,CAAA;EAElH;EAEA,OAAO,KAAK,MAAM;CACnB;AACD,GCjDa,KAAiD,EAAE,WAAQ,qBAAkB;CACzF,IAAM,CAAC,KAAe,QAAe,KAAK,OAAO,CAAC;CAElD,OACC,kBAAC,OAAD;EAAK,WAAU;YAAf,CACC,kBAAC,OAAD;GAAK,eAAY;GAAO,WAAW;GAA8D,OAAO,EAAE,UAAU,MAAM;aAA1H,CACC,kBAAC,GAAD,CAAgB,CAAA,GAChB,kBAAC,OAAD;IACC,OAAO;KACN,QAAQ;KACR,UAAU;KACV,YAAY;IACb;cACC,EAAoB,KAAK,MAAM,IAAc,EAAoB,MAAM;GACpE,CAAA,CACD;MACL,kBAAC,OAAD;GAAK,WAAU;aAAf,CACE,KAAU,kBAAC,MAAD;IAAI,WAAU;cAAiB;GAAW,CAAA,GACpD,KAAe,kBAAC,KAAD,EAAA,UAAI,EAAe,CAAA,CAC/B;IACD;;AAEP;;;AC5BA,SAAgB,EAAmB,EAAE,YAA2B;CAG/D,OAFA,EAAS,EAAM,KAAK,GAGnB,kBAAC,GAAD;EAAM,OAAM;YACX,kBAAC,QAAD,EAAA,UAAO,EAAM,QAAc,CAAA;CACtB,CAAA;AAER;;;ACVA,IAAa,UAEX,kBAAC,GAAD;CACC,MAAM;CACN,OAAM;CACN,aAAY;AACZ,CAAA,GCJU,UAEX,kBAAC,EAAK,YAAN;CAAiB,SAAQ;CAAe,WAAU;WACjD,kBAAC,MAAD;EAAI,WAAU;YAAW;CAAmB,CAAA;AAC5B,CAAA"}
1
+ {"version":3,"file":"index.js","names":[],"sources":["../../src/errors/PageError.tsx","../../src/errors/BadRequestPage.tsx","../../src/errors/BoomExplosion.tsx","../../src/errors/constants.ts","../../src/errors/ForbiddenPage.tsx","../../src/errors/NotFoundPage.tsx","../../src/errors/ErrorDisplay.tsx","../../src/errors/ErrorBoundary.tsx","../../src/errors/ErrorExplosion.tsx","../../src/errors/SimpleErrorDisplay.tsx","../../src/errors/UnauthorizedPage.tsx","../../src/errors/ViewNotChanged.tsx"],"sourcesContent":["import React from \"react\";\n\nimport { Flex } from \"../flex\";\n\ninterface PageErrorProps {\n\tcode: string | number;\n\ttitle: string;\n\tdescription: string;\n}\n\nexport const PageError: React.FC<PageErrorProps> = ({ code, title, description }) => {\n\treturn (\n\t\t<Flex.Predefined variant=\"columnCenter\" className=\"paddingXl\">\n\t\t\t<div aria-hidden=\"true\" className=\"content2 fontBolded\" style={{ fontSize: \"5em\" }}>\n\t\t\t\t{code}\n\t\t\t</div>\n\t\t\t<h2>{title}</h2>\n\t\t\t<p>{description}</p>\n\t\t\t{/* <Link to=\"/\">Вернуться на главную</Link> */}\n\t\t</Flex.Predefined>\n\t);\n};\n","import { PageError } from \"./PageError\";\n\nexport const BadRequestPage: React.FC = () => {\n\treturn (\n\t\t<PageError\n\t\t\tcode={400}\n\t\t\ttitle=\"Некорректный запрос\"\n\t\t\tdescription=\"Похоже, что запрос был сформирован неверно. Попробуйте обновить страницу или вернуться на главную.\"\n\t\t/>\n\t);\n};\n","import { useState } from \"react\";\n\nexport function BoomExplosion() {\n\tconst [transform] = useState(() => {\n\t\tconst scale = 0.7 + Math.random() * 0.3;\n\t\tconst rotate = Math.random() * 45 - 15;\n\t\treturn `scale(${scale}) rotateZ(${rotate}deg)`;\n\t});\n\n\treturn (\n\t\t<svg\n\t\t\tviewBox=\"0 0 300 300\"\n\t\t\twidth=\"300\"\n\t\t\theight=\"300\"\n\t\t\tstyle={{\n\t\t\t\tposition: \"absolute\",\n\t\t\t\ttop: \"50%\",\n\t\t\t\tleft: \"50%\",\n\t\t\t\ttransform: `translate(-50%, -50%) ${transform}`,\n\t\t\t\tzIndex: 0,\n\t\t\t\topacity: 0.5\n\t\t\t}}>\n\t\t\t<polygon\n\t\t\t\tpoints=\"\n150,10 170,60 230,40 200,100 270,110 210,150 270,190 200,200 230,260 170,240 150,290 130,240\n70,260 100,200 30,190 90,150 30,110 100,100 70,40 130,60\"\n\t\t\t\tfill=\"var(--status-error-on-fill)\"\n\t\t\t\tstroke=\"var(--status-error-fill)\"\n\t\t\t\tstrokeWidth=\"5\"\n\t\t\t\tstrokeLinejoin=\"round\"\n\t\t\t/>\n\t\t</svg>\n\t);\n}\n","export const ERROR_BOOM_MESSAGES = [\"Упс!\", \"Ой!\", \"Эх!\", \"Ай-ай-ай!\", \"Бах!\", \"Бум!\", \"Ого!\", \"Облом!\", \"Ёлки-палки!\", \"Хлоп!\"];\n","import { PageError } from \"./PageError\";\n\nexport const ForbiddenPage: React.FC = () => {\n\treturn <PageError code={403} title=\"Доступ запрещён\" description=\"У вас нет прав для просмотра этой страницы.\" />;\n};\n","import { PageError } from \"./PageError\";\n\nexport const NotFoundPage: React.FC = () => {\n\treturn <PageError code={404} title=\"Страница не найдена\" description=\"Извините, запрашиваемая страница не существует\" />;\n};\n","import { useEffect, useState } from \"react\";\n\nimport { captureRuntimeErrorReport } from \"@ryuzaki13/react-foundation-lib/error-report\";\nimport { logError } from \"@ryuzaki13/react-foundation-lib/utils\";\nimport { useQueryClient } from \"@tanstack/react-query\";\n\nimport { BadRequestPage } from \"./BadRequestPage\";\nimport { BoomExplosion } from \"./BoomExplosion\";\nimport { ERROR_BOOM_MESSAGES } from \"./constants\";\nimport { ForbiddenPage } from \"./ForbiddenPage\";\nimport { NotFoundPage } from \"./NotFoundPage\";\n\nfunction getHttpStatusCode(error: Error): number | undefined {\n\tif (!(\"status\" in error) || typeof error.status !== \"number\") return undefined;\n\treturn error.status;\n}\n\nexport const ErrorDisplay: React.FC<{ error: Error; componentStack?: string; draftId?: string | null }> = ({\n\terror,\n\tcomponentStack,\n\tdraftId\n}) => {\n\tconst [randomValue] = useState(() => Math.random());\n\tconst queryClient = useQueryClient();\n\n\tuseEffect(() => {\n\t\tif (draftId !== undefined) return;\n\n\t\tvoid captureRuntimeErrorReport(\n\t\t\terror,\n\t\t\t{\n\t\t\t\tcategory: \"react\",\n\t\t\t\tcomponentStack\n\t\t\t},\n\t\t\tqueryClient\n\t\t);\n\t}, [componentStack, draftId, error, queryClient]);\n\n\tconst httpStatusCode = getHttpStatusCode(error);\n\n\tif (httpStatusCode) {\n\t\tswitch (httpStatusCode) {\n\t\t\tcase 400:\n\t\t\t\treturn <BadRequestPage />;\n\t\t\tcase 403:\n\t\t\t\treturn <ForbiddenPage />;\n\t\t\tcase 404:\n\t\t\t\treturn <NotFoundPage />;\n\t\t}\n\t}\n\n\tlogError(error.stack);\n\n\treturn (\n\t\t<section className=\"w100 h100 flexColumn justifyContentCenter paddingMd\">\n\t\t\t<div aria-hidden=\"true\" className=\"textCenter relative fontBolded statusError\" style={{ fontSize: \"4em\", marginBlock: \"2em\" }}>\n\t\t\t\t<BoomExplosion />\n\t\t\t\t<div\n\t\t\t\t\tstyle={{\n\t\t\t\t\t\tzIndex: 1,\n\t\t\t\t\t\tposition: \"relative\",\n\t\t\t\t\t\ttextShadow: \"1px -1px 1px var(--status-warning-border-focus), -1px 1px 1px var(--status-info-border-focus)\"\n\t\t\t\t\t}}>\n\t\t\t\t\t{ERROR_BOOM_MESSAGES[Math.floor(randomValue * ERROR_BOOM_MESSAGES.length)]}\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t\t<div className=\"textCenter\">\n\t\t\t\t<h2 className=\"statusError\">Критическая ошибка</h2>\n\t\t\t\t<p className=\"statusError fontSizeLg\">\n\t\t\t\t\t<code>{error.message}</code>\n\t\t\t\t</p>\n\t\t\t\t<p>Попробуйте перезагрузить страницу или вернуться позже.</p>\n\t\t\t</div>\n\t\t</section>\n\t);\n};\n","import React, { Component } from \"react\";\n\nimport { captureRuntimeErrorReport } from \"@ryuzaki13/react-foundation-lib/error-report\";\n\nimport { ErrorDisplay } from \"./ErrorDisplay\";\n\ninterface ErrorBoundaryProps {\n\tchildren: React.ReactNode;\n\tcustomComponent?: React.ComponentType<{ error: Error }>;\n}\n\ntype ErrorBoundaryState = {\n\terror: Error | null;\n\tcomponentStack?: string;\n\tdraftId?: string | null;\n};\n\nexport class ErrorBoundary extends Component<ErrorBoundaryProps, ErrorBoundaryState> {\n\tconstructor(props: ErrorBoundaryProps) {\n\t\tsuper(props);\n\t\tthis.state = { error: null };\n\t}\n\n\tstatic getDerivedStateFromError(error: Error) {\n\t\treturn { error };\n\t}\n\n\tcomponentDidUpdate(prevProps: ErrorBoundaryProps) {\n\t\t// Сбрасываем ошибку при изменении children\n\t\tif (this.state.error && prevProps.children !== this.props.children) {\n\t\t\tthis.setState({ error: null, componentStack: undefined, draftId: undefined });\n\t\t}\n\t}\n\n\tcomponentDidCatch(error: Error, errorInfo: React.ErrorInfo) {\n\t\tthis.setState({ componentStack: errorInfo.componentStack ?? undefined, draftId: null });\n\n\t\tcaptureRuntimeErrorReport(error, {\n\t\t\tcategory: \"react\",\n\t\t\tcomponentStack: errorInfo.componentStack ?? undefined\n\t\t}).then((draft) => {\n\t\t\tif (draft && this.state.error === error) {\n\t\t\t\tthis.setState({ draftId: draft.reportId });\n\t\t\t}\n\t\t});\n\t}\n\n\trender() {\n\t\tif (this.state.error) {\n\t\t\tconst CustomComponent = this.props.customComponent;\n\t\t\treturn CustomComponent ? (\n\t\t\t\t<CustomComponent error={this.state.error} />\n\t\t\t) : (\n\t\t\t\t<ErrorDisplay error={this.state.error} componentStack={this.state.componentStack} draftId={this.state.draftId} />\n\t\t\t);\n\t\t}\n\n\t\treturn this.props.children;\n\t}\n}\n","import React, { useState } from \"react\";\n\nimport { BoomExplosion } from \"./BoomExplosion\";\nimport { ERROR_BOOM_MESSAGES } from \"./constants\";\n\ninterface ErrorExplosionProps {\n\theader?: string;\n\tdescription?: string;\n}\n\nexport const ErrorExplosion: React.FC<ErrorExplosionProps> = ({ header, description }) => {\n\tconst [randomValue] = useState(() => Math.random());\n\n\treturn (\n\t\t<div className=\"container marginBlockLg\">\n\t\t\t<div aria-hidden=\"true\" className={\"textCenter relative fontBolded statusWarning marginBlockMd\"} style={{ fontSize: \"6em\" }}>\n\t\t\t\t<BoomExplosion />\n\t\t\t\t<div\n\t\t\t\t\tstyle={{\n\t\t\t\t\t\tzIndex: 1,\n\t\t\t\t\t\tposition: \"relative\",\n\t\t\t\t\t\ttextShadow: \"1px 0 1px var(--status-error-fill), -1px 0 1px var(--status-info-fill)\"\n\t\t\t\t\t}}>\n\t\t\t\t\t{ERROR_BOOM_MESSAGES[Math.floor(randomValue * ERROR_BOOM_MESSAGES.length)]}\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t\t<div className=\"flexColumn alignItemsCenter textCenter marginBlockMd\">\n\t\t\t\t{header && <h2 className=\"statusWarning\">{header}</h2>}\n\t\t\t\t{description && <p>{description}</p>}\n\t\t\t</div>\n\t\t</div>\n\t);\n};\n","import { logError } from \"@ryuzaki13/react-foundation-lib/utils\";\n\nimport { Text } from \"../text\";\n\nexport function SimpleErrorDisplay({ error }: { error: Error }) {\n\tlogError(error.stack);\n\n\treturn (\n\t\t<Text color=\"error\">\n\t\t\t<code>{error.message}</code>\n\t\t</Text>\n\t);\n}\n","import { PageError } from \"./PageError\";\n\nexport const UnauthorizedPage: React.FC = () => {\n\treturn (\n\t\t<PageError\n\t\t\tcode={401}\n\t\t\ttitle=\"Необходима авторизация\"\n\t\t\tdescription=\"Для доступа к этой странице нужно войти в систему. Пожалуйста, авторизуйтесь и попробуйте снова.\"\n\t\t/>\n\t);\n};\n","import React from \"react\";\n\nimport { Flex } from \"../flex\";\n\nexport const ViewNotChanged: React.FC = () => {\n\treturn (\n\t\t<Flex.Predefined variant=\"columnCenter\" className=\"paddingXl\">\n\t\t\t<h2 className=\"content2\">Выберите ракурс</h2>\n\t\t</Flex.Predefined>\n\t);\n};\n"],"mappings":";;;;;;;;AAUA,IAAa,KAAuC,EAAE,SAAM,UAAO,qBAEjE,kBAAC,EAAK,YAAN;CAAiB,SAAQ;CAAe,WAAU;CAAlD,UAAA;EACC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AA,kBAAC,QAAD,EAAA,UAAO,EAAM,QAAc,CAAA;CACtB,CAAA;AAER;;;ACVA,IAAa,UAEX,kBAAC,GAAD;CACC,MAAM;CACN,OAAM;CACN,aAAY;AACZ,CAAA,GCJU,UAEX,kBAAC,EAAK,YAAN;CAAiB,SAAQ;CAAe,WAAU;CACjD,UAAA,kBAAC,MAAD;EAAI,WAAU;EAAW,UAAA;CAAmB,CAAA;AAC5B,CAAA"}
@@ -1,5 +1,5 @@
1
- import { n as e } from "../chunks/button-CC0Jdx1j.js";
2
- import { l as t } from "../chunks/misc-DIF5h9ba.js";
1
+ import { n as e } from "../chunks/button-BU2kRzwu.js";
2
+ import { l as t } from "../chunks/misc-BYxxlJz6.js";
3
3
  import { useCallback as n, useId as r, useState as i } from "react";
4
4
  import { cn as a } from "@ryuzaki13/react-foundation-lib/utils";
5
5
  import { ChevronsLeftIcon as o, ChevronsRightIcon as s } from "lucide-react";
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":[],"sources":["../../src/expandable-action-panel/ExpandableActionPanel.module.scss","../../src/expandable-action-panel/ExpandableActionPanel.tsx","../../src/expandable-action-panel/LabeledExpandableActionPanel.tsx"],"sourcesContent":[".expandableActionPanel {\n\tdisplay: flex;\n\talign-items: center;\n\tjustify-content: flex-end;\n\tgap: var(--space-sm);\n\tmin-width: var(--control-height);\n\tmax-width: 100%;\n\toverflow: hidden;\n}\n\n.content {\n\tmin-width: 0;\n\tmax-width: 100%;\n\tflex: 1 1 auto;\n\toverflow: hidden;\n}\n\n.contentScroller {\n\twidth: 100%;\n\tmin-width: 0;\n}\n\n.labeledPanel {\n\tdisplay: flex;\n\talign-items: center;\n\tgap: var(--space-sm);\n\twidth: 100%;\n\tmin-width: 0;\n}\n\n.label {\n\tcolor: var(--content-0);\n}\n\n.labeledActionPanel {\n\tflex: 0 1 auto;\n}\n","import React, { PropsWithChildren, useCallback, useId, useState } from \"react\";\n\nimport { cn } from \"@ryuzaki13/react-foundation-lib/utils\";\nimport { ChevronsLeftIcon, ChevronsRightIcon } from \"lucide-react\";\n\nimport { Button } from \"../button\";\nimport { OneStepScroller } from \"../misc\";\n\nimport styles from \"./ExpandableActionPanel.module.scss\";\n\nexport interface ExpandableActionPanelProps extends PropsWithChildren {\n\tclassName?: string;\n\tcontentClassName?: string;\n\ttoggleClassName?: string;\n\topen?: boolean;\n\tdefaultOpen?: boolean;\n\tdisabled?: boolean;\n\tonOpenChange?: (open: boolean) => void;\n\texpandLabel?: string;\n\tcollapseLabel?: string;\n\tpanelLabel?: string;\n\titemSelector?: string;\n\tscrollPadding?: number;\n\tsmoothScroll?: boolean;\n}\n\n/**\n * Горизонтальная раскрывающаяся панель действий.\n * Не знает о внешнем layout и может использоваться рядом с любым содержимым.\n */\nexport function ExpandableActionPanel({\n\tchildren,\n\tclassName,\n\tcontentClassName,\n\ttoggleClassName,\n\topen: controlledOpen,\n\tdefaultOpen = false,\n\tdisabled,\n\tonOpenChange,\n\texpandLabel = \"Раскрыть панель действий влево\",\n\tcollapseLabel = \"Свернуть панель действий\",\n\tpanelLabel = \"Действия панели\",\n\titemSelector,\n\tscrollPadding,\n\tsmoothScroll\n}: ExpandableActionPanelProps) {\n\tconst [uncontrolledOpen, setUncontrolledOpen] = useState(defaultOpen);\n\tconst panelId = useId();\n\tconst isControlled = controlledOpen !== undefined;\n\tconst open = isControlled ? controlledOpen : uncontrolledOpen;\n\n\tconst setOpen = useCallback<React.Dispatch<React.SetStateAction<boolean>>>(\n\t\t(value) => {\n\t\t\tconst nextOpen = typeof value === \"function\" ? value(open) : value;\n\n\t\t\tif (!isControlled) {\n\t\t\t\tsetUncontrolledOpen(nextOpen);\n\t\t\t}\n\n\t\t\tonOpenChange?.(nextOpen);\n\t\t},\n\t\t[isControlled, onOpenChange, open]\n\t);\n\n\tconst handleToggle = () => setOpen((prevOpen) => !prevOpen);\n\tconst ToggleIcon = open ? ChevronsRightIcon : ChevronsLeftIcon;\n\n\treturn (\n\t\t<div className={cn(styles.expandableActionPanel, className)} data-ui=\"expandable-action-panel\" data-open={open ? \"\" : undefined}>\n\t\t\t<Button\n\t\t\t\tclassName={toggleClassName}\n\t\t\t\ticon={<ToggleIcon />}\n\t\t\t\ttitle={open ? collapseLabel : expandLabel}\n\t\t\t\tdisabled={disabled}\n\t\t\t\tvariant=\"neutralOutline\"\n\t\t\t\taria-expanded={open}\n\t\t\t\taria-controls={panelId}\n\t\t\t\tdata-ui=\"expandable-action-panel-toggle\"\n\t\t\t\tdata-action={open ? \"collapse-action-panel\" : \"expand-action-panel\"}\n\t\t\t\tonClick={handleToggle}\n\t\t\t/>\n\n\t\t\t{open && (\n\t\t\t\t<div id={panelId} role=\"group\" aria-label={panelLabel} className={cn(styles.content, contentClassName)}>\n\t\t\t\t\t<OneStepScroller\n\t\t\t\t\t\tclassName={styles.contentScroller}\n\t\t\t\t\t\titemSelector={itemSelector}\n\t\t\t\t\t\tscrollPadding={scrollPadding}\n\t\t\t\t\t\tsmooth={smoothScroll}>\n\t\t\t\t\t\t{children}\n\t\t\t\t\t</OneStepScroller>\n\t\t\t\t</div>\n\t\t\t)}\n\t\t</div>\n\t);\n}\n","import React from \"react\";\n\nimport { cn } from \"@ryuzaki13/react-foundation-lib/utils\";\n\nimport { ExpandableActionPanel, ExpandableActionPanelProps } from \"./ExpandableActionPanel\";\nimport styles from \"./ExpandableActionPanel.module.scss\";\n\nexport interface LabeledExpandableActionPanelProps extends Omit<ExpandableActionPanelProps, \"className\"> {\n\tlabel: React.ReactNode;\n\tclassName?: string;\n\tlabelClassName?: string;\n\tlabelStyle?: React.CSSProperties;\n\tlabelMinWidth?: React.CSSProperties[\"minWidth\"];\n\tpanelClassName?: string;\n}\n\n/**\n * Раскрывающаяся панель действий с левым текстом, который сжимается через `flexEllipsis`.\n */\nexport function LabeledExpandableActionPanel({\n\tlabel,\n\tclassName,\n\tlabelClassName,\n\tlabelStyle,\n\tlabelMinWidth = \"12em\",\n\tpanelClassName,\n\topen,\n\tdefaultOpen,\n\t...panelProps\n}: LabeledExpandableActionPanelProps) {\n\tconst resolvedLabelStyle: React.CSSProperties = {\n\t\t...labelStyle,\n\t\tminWidth: labelMinWidth\n\t};\n\tconst title = typeof label === \"string\" ? label : undefined;\n\n\treturn (\n\t\t<div className={cn(styles.labeledPanel, className)} data-ui=\"labeled-expandable-action-panel\">\n\t\t\t<div className={cn(\"flexEllipsis\", styles.label, labelClassName)} style={resolvedLabelStyle} title={title}>\n\t\t\t\t{label}\n\t\t\t</div>\n\t\t\t<ExpandableActionPanel\n\t\t\t\t{...panelProps}\n\t\t\t\topen={open}\n\t\t\t\tdefaultOpen={defaultOpen}\n\t\t\t\tclassName={cn(styles.labeledActionPanel, panelClassName)}\n\t\t\t/>\n\t\t</div>\n\t);\n}\n"],"mappings":";;;;;;;;;;;;;;;;AC8BA,SAAgB,EAAsB,EACrC,aACA,cACA,qBACA,oBACA,MAAM,GACN,iBAAc,IACd,aACA,iBACA,iBAAc,kCACd,mBAAgB,4BAChB,gBAAa,mBACb,iBACA,kBACA,mBAC8B;CAC9B,IAAM,CAAC,GAAkB,KAAuB,EAAS,CAAW,GAC9D,IAAU,EAAM,GAChB,IAAe,MAAmB,KAAA,GAClC,IAAO,IAAe,IAAiB,GAEvC,IAAU,GACd,MAAU;EACV,IAAM,IAAW,OAAO,KAAU,aAAa,EAAM,CAAI,IAAI;EAM7D,AAJK,KACJ,EAAoB,CAAQ,GAG7B,IAAe,CAAQ;CACxB,GACA;EAAC;EAAc;EAAc;CAAI,CAClC,GAEM,UAAqB,GAAS,MAAa,CAAC,CAAQ,GACpD,IAAa,IAAO,IAAoB;CAE9C,OACC,kBAAC,OAAD;EAAK,WAAW,EAAG,EAAO,uBAAuB,CAAS;EAAG,WAAQ;EAA0B,aAAW,IAAO,KAAK,KAAA;YAAtH,CACC,kBAAC,GAAD;GACC,WAAW;GACX,MAAM,kBAAC,GAAD,CAAa,CAAA;GACnB,OAAO,IAAO,IAAgB;GACpB;GACV,SAAQ;GACR,iBAAe;GACf,iBAAe;GACf,WAAQ;GACR,eAAa,IAAO,0BAA0B;GAC9C,SAAS;EACT,CAAA,GAEA,KACA,kBAAC,OAAD;GAAK,IAAI;GAAS,MAAK;GAAQ,cAAY;GAAY,WAAW,EAAG,EAAO,SAAS,CAAgB;aACpG,kBAAC,GAAD;IACC,WAAW,EAAO;IACJ;IACC;IACf,QAAQ;IACP;GACe,CAAA;EACb,CAAA,CAEF;;AAEP;;;AC5EA,SAAgB,EAA6B,EAC5C,UACA,cACA,mBACA,eACA,mBAAgB,QAChB,mBACA,SACA,gBACA,GAAG,KACkC;CACrC,IAAM,IAA0C;EAC/C,GAAG;EACH,UAAU;CACX,GACM,IAAQ,OAAO,KAAU,WAAW,IAAQ,KAAA;CAElD,OACC,kBAAC,OAAD;EAAK,WAAW,EAAG,EAAO,cAAc,CAAS;EAAG,WAAQ;YAA5D,CACC,kBAAC,OAAD;GAAK,WAAW,EAAG,gBAAgB,EAAO,OAAO,CAAc;GAAG,OAAO;GAA2B;aAClG;EACG,CAAA,GACL,kBAAC,GAAD;GACC,GAAI;GACE;GACO;GACb,WAAW,EAAG,EAAO,oBAAoB,CAAc;EACvD,CAAA,CACG;;AAEP"}
1
+ {"version":3,"file":"index.js","names":[],"sources":["../../src/expandable-action-panel/ExpandableActionPanel.module.scss","../../src/expandable-action-panel/ExpandableActionPanel.tsx","../../src/expandable-action-panel/LabeledExpandableActionPanel.tsx"],"sourcesContent":[".expandableActionPanel {\n\tdisplay: flex;\n\talign-items: center;\n\tjustify-content: flex-end;\n\tgap: var(--space-sm);\n\tmin-width: var(--control-height);\n\tmax-width: 100%;\n\toverflow: hidden;\n}\n\n.content {\n\tmin-width: 0;\n\tmax-width: 100%;\n\tflex: 1 1 auto;\n\toverflow: hidden;\n}\n\n.contentScroller {\n\twidth: 100%;\n\tmin-width: 0;\n}\n\n.labeledPanel {\n\tdisplay: flex;\n\talign-items: center;\n\tgap: var(--space-sm);\n\twidth: 100%;\n\tmin-width: 0;\n}\n\n.label {\n\tcolor: var(--content-0);\n}\n\n.labeledActionPanel {\n\tflex: 0 1 auto;\n}\n","import React, { PropsWithChildren, useCallback, useId, useState } from \"react\";\n\nimport { cn } from \"@ryuzaki13/react-foundation-lib/utils\";\nimport { ChevronsLeftIcon, ChevronsRightIcon } from \"lucide-react\";\n\nimport { Button } from \"../button\";\nimport { OneStepScroller } from \"../misc\";\n\nimport styles from \"./ExpandableActionPanel.module.scss\";\n\nexport interface ExpandableActionPanelProps extends PropsWithChildren {\n\tclassName?: string;\n\tcontentClassName?: string;\n\ttoggleClassName?: string;\n\topen?: boolean;\n\tdefaultOpen?: boolean;\n\tdisabled?: boolean;\n\tonOpenChange?: (open: boolean) => void;\n\texpandLabel?: string;\n\tcollapseLabel?: string;\n\tpanelLabel?: string;\n\titemSelector?: string;\n\tscrollPadding?: number;\n\tsmoothScroll?: boolean;\n}\n\n/**\n * Горизонтальная раскрывающаяся панель действий.\n * Не знает о внешнем layout и может использоваться рядом с любым содержимым.\n */\nexport function ExpandableActionPanel({\n\tchildren,\n\tclassName,\n\tcontentClassName,\n\ttoggleClassName,\n\topen: controlledOpen,\n\tdefaultOpen = false,\n\tdisabled,\n\tonOpenChange,\n\texpandLabel = \"Раскрыть панель действий влево\",\n\tcollapseLabel = \"Свернуть панель действий\",\n\tpanelLabel = \"Действия панели\",\n\titemSelector,\n\tscrollPadding,\n\tsmoothScroll\n}: ExpandableActionPanelProps) {\n\tconst [uncontrolledOpen, setUncontrolledOpen] = useState(defaultOpen);\n\tconst panelId = useId();\n\tconst isControlled = controlledOpen !== undefined;\n\tconst open = isControlled ? controlledOpen : uncontrolledOpen;\n\n\tconst setOpen = useCallback<React.Dispatch<React.SetStateAction<boolean>>>(\n\t\t(value) => {\n\t\t\tconst nextOpen = typeof value === \"function\" ? value(open) : value;\n\n\t\t\tif (!isControlled) {\n\t\t\t\tsetUncontrolledOpen(nextOpen);\n\t\t\t}\n\n\t\t\tonOpenChange?.(nextOpen);\n\t\t},\n\t\t[isControlled, onOpenChange, open]\n\t);\n\n\tconst handleToggle = () => setOpen((prevOpen) => !prevOpen);\n\tconst ToggleIcon = open ? ChevronsRightIcon : ChevronsLeftIcon;\n\n\treturn (\n\t\t<div className={cn(styles.expandableActionPanel, className)} data-ui=\"expandable-action-panel\" data-open={open ? \"\" : undefined}>\n\t\t\t<Button\n\t\t\t\tclassName={toggleClassName}\n\t\t\t\ticon={<ToggleIcon />}\n\t\t\t\ttitle={open ? collapseLabel : expandLabel}\n\t\t\t\tdisabled={disabled}\n\t\t\t\tvariant=\"neutralOutline\"\n\t\t\t\taria-expanded={open}\n\t\t\t\taria-controls={panelId}\n\t\t\t\tdata-ui=\"expandable-action-panel-toggle\"\n\t\t\t\tdata-action={open ? \"collapse-action-panel\" : \"expand-action-panel\"}\n\t\t\t\tonClick={handleToggle}\n\t\t\t/>\n\n\t\t\t{open && (\n\t\t\t\t<div id={panelId} role=\"group\" aria-label={panelLabel} className={cn(styles.content, contentClassName)}>\n\t\t\t\t\t<OneStepScroller\n\t\t\t\t\t\tclassName={styles.contentScroller}\n\t\t\t\t\t\titemSelector={itemSelector}\n\t\t\t\t\t\tscrollPadding={scrollPadding}\n\t\t\t\t\t\tsmooth={smoothScroll}>\n\t\t\t\t\t\t{children}\n\t\t\t\t\t</OneStepScroller>\n\t\t\t\t</div>\n\t\t\t)}\n\t\t</div>\n\t);\n}\n","import React from \"react\";\n\nimport { cn } from \"@ryuzaki13/react-foundation-lib/utils\";\n\nimport { ExpandableActionPanel, ExpandableActionPanelProps } from \"./ExpandableActionPanel\";\nimport styles from \"./ExpandableActionPanel.module.scss\";\n\nexport interface LabeledExpandableActionPanelProps extends Omit<ExpandableActionPanelProps, \"className\"> {\n\tlabel: React.ReactNode;\n\tclassName?: string;\n\tlabelClassName?: string;\n\tlabelStyle?: React.CSSProperties;\n\tlabelMinWidth?: React.CSSProperties[\"minWidth\"];\n\tpanelClassName?: string;\n}\n\n/**\n * Раскрывающаяся панель действий с левым текстом, который сжимается через `flexEllipsis`.\n */\nexport function LabeledExpandableActionPanel({\n\tlabel,\n\tclassName,\n\tlabelClassName,\n\tlabelStyle,\n\tlabelMinWidth = \"12em\",\n\tpanelClassName,\n\topen,\n\tdefaultOpen,\n\t...panelProps\n}: LabeledExpandableActionPanelProps) {\n\tconst resolvedLabelStyle: React.CSSProperties = {\n\t\t...labelStyle,\n\t\tminWidth: labelMinWidth\n\t};\n\tconst title = typeof label === \"string\" ? label : undefined;\n\n\treturn (\n\t\t<div className={cn(styles.labeledPanel, className)} data-ui=\"labeled-expandable-action-panel\">\n\t\t\t<div className={cn(\"flexEllipsis\", styles.label, labelClassName)} style={resolvedLabelStyle} title={title}>\n\t\t\t\t{label}\n\t\t\t</div>\n\t\t\t<ExpandableActionPanel\n\t\t\t\t{...panelProps}\n\t\t\t\topen={open}\n\t\t\t\tdefaultOpen={defaultOpen}\n\t\t\t\tclassName={cn(styles.labeledActionPanel, panelClassName)}\n\t\t\t/>\n\t\t</div>\n\t);\n}\n"],"mappings":";;;;;;;;;;;;;;;;AC8BA,SAAgB,EAAsB,EACrC,aACA,cACA,qBACA,oBACA,MAAM,GACN,iBAAc,IACd,aACA,iBACA,iBAAc,kCACd,mBAAgB,4BAChB,gBAAa,mBACb,iBACA,kBACA,mBAC8B;CAC9B,IAAM,CAAC,GAAkB,KAAuB,EAAS,CAAW,GAC9D,IAAU,EAAM,GAChB,IAAe,MAAmB,KAAA,GAClC,IAAO,IAAe,IAAiB,GAEvC,IAAU,GACd,MAAU;EACV,IAAM,IAAW,OAAO,KAAU,aAAa,EAAM,CAAI,IAAI;EAM7D,AAJK,KACJ,EAAoB,CAAQ,GAG7B,IAAe,CAAQ;CACxB,GACA;EAAC;EAAc;EAAc;CAAI,CAClC,GAEM,UAAqB,GAAS,MAAa,CAAC,CAAQ,GACpD,IAAa,IAAO,IAAoB;CAE9C,OACC,kBAAC,OAAD;EAAK,WAAW,EAAG,EAAO,uBAAuB,CAAS;EAAG,WAAQ;EAA0B,aAAW,IAAO,KAAK,KAAA;EAAtH,UAAA,CACC,kBAAC,GAAD;GACC,WAAW;GACX,MAAM,kBAAC,GAAD,CAAa,CAAA;GACnB,OAAO,IAAO,IAAgB;GACpB;GACV,SAAQ;GACR,iBAAe;GACf,iBAAe;GACf,WAAQ;GACR,eAAa,IAAO,0BAA0B;GAC9C,SAAS;EACT,CAAA,GAEA,KACA,kBAAC,OAAD;GAAK,IAAI;GAAS,MAAK;GAAQ,cAAY;GAAY,WAAW,EAAG,EAAO,SAAS,CAAgB;GACpG,UAAA,kBAAC,GAAD;IACC,WAAW,EAAO;IACJ;IACC;IACf,QAAQ;IACP;GACe,CAAA;EACb,CAAA,CAEF;;AAEP;;;AC5EA,SAAgB,EAA6B,EAC5C,UACA,cACA,mBACA,eACA,mBAAgB,QAChB,mBACA,SACA,gBACA,GAAG,KACkC;CACrC,IAAM,IAA0C;EAC/C,GAAG;EACH,UAAU;CACX,GACM,IAAQ,OAAO,KAAU,WAAW,IAAQ,KAAA;CAElD,OACC,kBAAC,OAAD;EAAK,WAAW,EAAG,EAAO,cAAc,CAAS;EAAG,WAAQ;EAA5D,UAAA,CACC,kBAAC,OAAD;GAAK,WAAW,EAAG,gBAAgB,EAAO,OAAO,CAAc;GAAG,OAAO;GAA2B;GAClG,UAAA;EACG,CAAA,GACL,kBAAC,GAAD;GACC,GAAI;GACE;GACO;GACb,WAAW,EAAG,EAAO,oBAAoB,CAAc;EACvD,CAAA,CACG;;AAEP"}
@@ -1,2 +1,2 @@
1
- import { a as e, i as t, n, o as r, r as i, t as a } from "../chunks/flex-DYZ0IbU6.js";
1
+ import { a as e, i as t, n, o as r, r as i, t as a } from "../chunks/flex-C7njxZ74.js";
2
2
  export { i as Flex, n as FlexCenter, r as FlexContainer, e as FlexItem, a as FlexSpacer, t as PredefinedFlex };
@@ -15,7 +15,7 @@ function d({ open: d, title: f, description: p, onOpenChange: m, children: h })
15
15
  let { refs: g, context: _ } = o({
16
16
  open: d,
17
17
  onOpenChange: m
18
- }), { getFloatingProps: v } = s([a(_, { outsidePress: !1 }), c(_, { role: "dialog" })]), y = e((e) => {
18
+ }), v = a(_, { outsidePress: !1 }), y = c(_, { role: "dialog" }), { getFloatingProps: b } = s([v, y]), x = e((e) => {
19
19
  g.setFloating(e);
20
20
  }, [g]);
21
21
  return d ? /* @__PURE__ */ t(i, { children: /* @__PURE__ */ t(r, {
@@ -26,8 +26,8 @@ function d({ open: d, title: f, description: p, onOpenChange: m, children: h })
26
26
  modal: !1,
27
27
  returnFocus: !0,
28
28
  children: /* @__PURE__ */ t("section", {
29
- ref: y,
30
- ...v({
29
+ ref: x,
30
+ ...b({
31
31
  className: l.panel,
32
32
  "aria-label": u(f, p)
33
33
  }),
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":[],"sources":["../../src/fullscreen-portal/FullscreenPortal.module.scss","../../src/fullscreen-portal/FullscreenPortal.tsx"],"sourcesContent":[".overlay {\n\tposition: fixed;\n\tinset: 0;\n\tz-index: var(--z-fullscreen-portal);\n\tbackground: var(--overlay-glass);\n}\n\n.panel {\n\tposition: fixed;\n\tinset: var(--space-lg);\n\tdisplay: flex;\n\tflex-direction: column;\n\tmin-width: 0;\n\tmin-height: 0;\n\tpadding: var(--space-md);\n\tborder: var(--border);\n\tborder-radius: var(--radius-md);\n\tbackground: var(--surface-1);\n\tbox-shadow: var(--shadow-lg);\n\toverflow: hidden;\n\n\t&:focus-visible {\n\t\toutline: var(--focus);\n\t\toutline-offset: var(--focus-offset);\n\t}\n}\n","import { useCallback, type ReactNode } from \"react\";\n\nimport {\n\tFloatingFocusManager,\n\tFloatingOverlay,\n\tFloatingPortal,\n\tuseDismiss,\n\tuseFloating,\n\tuseInteractions,\n\tuseRole\n} from \"@floating-ui/react\";\n\nimport styles from \"./FullscreenPortal.module.scss\";\n\n/** Props полноэкранного портала для поверхностных UI-блоков. */\nexport type FullscreenPortalProps = {\n\t/** Признак открытого fullscreen-режима. */\n\topen: boolean;\n\t/** Заголовок содержимого, используемый для доступного имени dialog. */\n\ttitle: string;\n\t/** Описание fullscreen-режима для доступного имени dialog. */\n\tdescription: string;\n\t/** Callback изменения состояния fullscreen-режима. */\n\tonOpenChange: (open: boolean) => void;\n\t/** Содержимое, которое нужно отрендерить в полноэкранном слое. */\n\tchildren: ReactNode;\n};\n\n/** Формирует доступное имя dialog из заголовка и описания fullscreen-режима. */\nfunction resolveFullscreenAriaLabel(title: string, description: string): string {\n\tconst trimmedTitle = title.trim();\n\treturn trimmedTitle ? `${trimmedTitle}. ${description}` : description;\n}\n\n/** Универсальный fullscreen-портал на базе Floating UI. */\nexport function FullscreenPortal({ open, title, description, onOpenChange, children }: FullscreenPortalProps) {\n\tconst { refs, context } = useFloating({ open, onOpenChange });\n\tconst dismiss = useDismiss(context, { outsidePress: false });\n\tconst role = useRole(context, { role: \"dialog\" });\n\tconst { getFloatingProps } = useInteractions([dismiss, role]);\n\t/** Передает DOM-узел полноэкранной панели в Floating UI context. */\n\tconst setFloating = useCallback(\n\t\t(node: HTMLElement | null) => {\n\t\t\trefs.setFloating(node);\n\t\t},\n\t\t[refs]\n\t);\n\n\tif (!open) return null;\n\n\treturn (\n\t\t<FloatingPortal>\n\t\t\t<FloatingOverlay lockScroll className={styles.overlay}>\n\t\t\t\t<FloatingFocusManager context={context} modal={false} returnFocus>\n\t\t\t\t\t<section\n\t\t\t\t\t\tref={setFloating}\n\t\t\t\t\t\t{...getFloatingProps({\n\t\t\t\t\t\t\tclassName: styles.panel,\n\t\t\t\t\t\t\t\"aria-label\": resolveFullscreenAriaLabel(title, description)\n\t\t\t\t\t\t})}>\n\t\t\t\t\t\t{children}\n\t\t\t\t\t</section>\n\t\t\t\t</FloatingFocusManager>\n\t\t\t</FloatingOverlay>\n\t\t</FloatingPortal>\n\t);\n}\n"],"mappings":";;;;;;;;;AC6BA,SAAS,EAA2B,GAAe,GAA6B;CAC/E,IAAM,IAAe,EAAM,KAAK;CAChC,OAAO,IAAe,GAAG,EAAa,IAAI,MAAgB;AAC3D;AAGA,SAAgB,EAAiB,EAAE,SAAM,UAAO,gBAAa,iBAAc,eAAmC;CAC7G,IAAM,EAAE,SAAM,eAAY,EAAY;EAAE;EAAM;CAAa,CAAC,GAGtD,EAAE,wBAAqB,EAAgB,CAF7B,EAAW,GAAS,EAAE,cAAc,GAAM,CAEZ,GADjC,EAAQ,GAAS,EAAE,MAAM,SAAS,CACQ,CAAI,CAAC,GAEtD,IAAc,GAClB,MAA6B;EAC7B,EAAK,YAAY,CAAI;CACtB,GACA,CAAC,CAAI,CACN;CAIA,OAFK,IAGJ,kBAAC,GAAD,EAAA,UACC,kBAAC,GAAD;EAAiB,YAAA;EAAW,WAAW,EAAO;YAC7C,kBAAC,GAAD;GAA+B;GAAS,OAAO;GAAO,aAAA;aACrD,kBAAC,WAAD;IACC,KAAK;IACL,GAAI,EAAiB;KACpB,WAAW,EAAO;KAClB,cAAc,EAA2B,GAAO,CAAW;IAC5D,CAAC;IACA;GACO,CAAA;EACY,CAAA;CACN,CAAA,EACF,CAAA,IAhBC;AAkBnB"}
1
+ {"version":3,"file":"index.js","names":[],"sources":["../../src/fullscreen-portal/FullscreenPortal.module.scss","../../src/fullscreen-portal/FullscreenPortal.tsx"],"sourcesContent":[".overlay {\n\tposition: fixed;\n\tinset: 0;\n\tz-index: var(--z-fullscreen-portal);\n\tbackground: var(--overlay-glass);\n}\n\n.panel {\n\tposition: fixed;\n\tinset: var(--space-lg);\n\tdisplay: flex;\n\tflex-direction: column;\n\tmin-width: 0;\n\tmin-height: 0;\n\tpadding: var(--space-md);\n\tborder: var(--border);\n\tborder-radius: var(--radius-md);\n\tbackground: var(--surface-1);\n\tbox-shadow: var(--shadow-lg);\n\toverflow: hidden;\n\n\t&:focus-visible {\n\t\toutline: var(--focus);\n\t\toutline-offset: var(--focus-offset);\n\t}\n}\n","import { useCallback, type ReactNode } from \"react\";\n\nimport {\n\tFloatingFocusManager,\n\tFloatingOverlay,\n\tFloatingPortal,\n\tuseDismiss,\n\tuseFloating,\n\tuseInteractions,\n\tuseRole\n} from \"@floating-ui/react\";\n\nimport styles from \"./FullscreenPortal.module.scss\";\n\n/** Props полноэкранного портала для поверхностных UI-блоков. */\nexport type FullscreenPortalProps = {\n\t/** Признак открытого fullscreen-режима. */\n\topen: boolean;\n\t/** Заголовок содержимого, используемый для доступного имени dialog. */\n\ttitle: string;\n\t/** Описание fullscreen-режима для доступного имени dialog. */\n\tdescription: string;\n\t/** Callback изменения состояния fullscreen-режима. */\n\tonOpenChange: (open: boolean) => void;\n\t/** Содержимое, которое нужно отрендерить в полноэкранном слое. */\n\tchildren: ReactNode;\n};\n\n/** Формирует доступное имя dialog из заголовка и описания fullscreen-режима. */\nfunction resolveFullscreenAriaLabel(title: string, description: string): string {\n\tconst trimmedTitle = title.trim();\n\treturn trimmedTitle ? `${trimmedTitle}. ${description}` : description;\n}\n\n/** Универсальный fullscreen-портал на базе Floating UI. */\nexport function FullscreenPortal({ open, title, description, onOpenChange, children }: FullscreenPortalProps) {\n\tconst { refs, context } = useFloating({ open, onOpenChange });\n\tconst dismiss = useDismiss(context, { outsidePress: false });\n\tconst role = useRole(context, { role: \"dialog\" });\n\tconst { getFloatingProps } = useInteractions([dismiss, role]);\n\t/** Передает DOM-узел полноэкранной панели в Floating UI context. */\n\tconst setFloating = useCallback(\n\t\t(node: HTMLElement | null) => {\n\t\t\trefs.setFloating(node);\n\t\t},\n\t\t[refs]\n\t);\n\n\tif (!open) return null;\n\n\treturn (\n\t\t<FloatingPortal>\n\t\t\t<FloatingOverlay lockScroll className={styles.overlay}>\n\t\t\t\t<FloatingFocusManager context={context} modal={false} returnFocus>\n\t\t\t\t\t<section\n\t\t\t\t\t\tref={setFloating}\n\t\t\t\t\t\t{...getFloatingProps({\n\t\t\t\t\t\t\tclassName: styles.panel,\n\t\t\t\t\t\t\t\"aria-label\": resolveFullscreenAriaLabel(title, description)\n\t\t\t\t\t\t})}>\n\t\t\t\t\t\t{children}\n\t\t\t\t\t</section>\n\t\t\t\t</FloatingFocusManager>\n\t\t\t</FloatingOverlay>\n\t\t</FloatingPortal>\n\t);\n}\n"],"mappings":";;;;;;;;;AC6BA,SAAS,EAA2B,GAAe,GAA6B;CAC/E,IAAM,IAAe,EAAM,KAAK;CAChC,OAAO,IAAe,GAAG,EAAa,IAAI,MAAgB;AAC3D;AAGA,SAAgB,EAAiB,EAAE,SAAM,UAAO,gBAAa,iBAAc,eAAmC;CAC7G,IAAM,EAAE,SAAM,eAAY,EAAY;EAAE;EAAM;CAAa,CAAC,GACtD,IAAU,EAAW,GAAS,EAAE,cAAc,GAAM,CAAC,GACrD,IAAO,EAAQ,GAAS,EAAE,MAAM,SAAS,CAAC,GAC1C,EAAE,wBAAqB,EAAgB,CAAC,GAAS,CAAI,CAAC,GAEtD,IAAc,GAClB,MAA6B;EAC7B,EAAK,YAAY,CAAI;CACtB,GACA,CAAC,CAAI,CACN;CAIA,OAFK,IAGJ,kBAAC,GAAD,EAAA,UACC,kBAAC,GAAD;EAAiB,YAAA;EAAW,WAAW,EAAO;EAC7C,UAAA,kBAAC,GAAD;GAA+B;GAAS,OAAO;GAAO,aAAA;GACrD,UAAA,kBAAC,WAAD;IACC,KAAK;IACL,GAAI,EAAiB;KACpB,WAAW,EAAO;KAClB,cAAc,EAA2B,GAAO,CAAW;IAC5D,CAAC;IACA;GACO,CAAA;EACY,CAAA;CACN,CAAA,EACF,CAAA,IAhBC;AAkBnB"}
@@ -1,8 +1,8 @@
1
- import { n as e } from "../chunks/button-CC0Jdx1j.js";
1
+ import { n as e } from "../chunks/button-BU2kRzwu.js";
2
2
  import { r as t } from "../chunks/grid-dI94AAbi.js";
3
- import { o as n } from "../chunks/input-BCJfUdK_.js";
4
- import { i as r, n as i, r as a } from "../chunks/modal-DXHX_sA-.js";
5
- import { t as o } from "../chunks/input-files-Dcc5K-_1.js";
3
+ import { o as n } from "../chunks/input-Bp6_Ucgr.js";
4
+ import { i as r, n as i, r as a } from "../chunks/modal-paexEF0j.js";
5
+ import { t as o } from "../chunks/input-files-D1JzSw_Y.js";
6
6
  import { Suspense as s, lazy as c, useCallback as l, useEffect as u, useMemo as d, useRef as f, useState as p } from "react";
7
7
  import { Fragment as m, jsx as h, jsxs as g } from "react/jsx-runtime";
8
8
  import _ from "react-easy-crop";
@@ -500,7 +500,7 @@ function M({ image: e, alt: t, sizes: n, aspectRatio: r, ...i }) {
500
500
  }
501
501
  //#endregion
502
502
  //#region src/image/ui/ImageViewer.tsx
503
- var N = c(() => import("../chunks/ImageViewerRuntime-RN49by8Y.js"));
503
+ var N = c(() => import("../chunks/ImageViewerRuntime-BMs3BBkV.js"));
504
504
  function P(e) {
505
505
  let [t, n] = p(!1), r = l(() => n(!0), []);
506
506
  return typeof document < "u" && (e.open || t) ? /* @__PURE__ */ h(s, {
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":[],"sources":["../../src/image/lib/buildImageSrcSet.ts","../../src/image/lib/buildImageSources.ts","../../src/image/ui/ImageCropper.tsx","../../src/image/ui/ImagePlaceholder.tsx","../../src/image/ui/ImageRenderer.tsx","../../src/image/lib/getImageSelectionKey.ts","../../src/image/model/useImageSelectionState.ts","../../src/image/lib/getImageCropPreviewStyle.ts","../../src/image/ui/ImageSelectionFields.tsx","../../src/image/ui/ImageSelectionModal.tsx","../../src/image/ui/ImageSelectionPanel.tsx","../../src/image/ui/ImageView.tsx","../../src/image/ui/ImageViewer.tsx"],"sourcesContent":["import { type ImageCandidate } from \"../model/imageTypes\";\n\n/** Собирает валидный srcset из уже разрешённых вызывающим кодом URL вариантов. */\nexport function buildImageSrcSet(candidates: readonly ImageCandidate[]): string {\n\treturn candidates\n\t\t.map((candidate) => (\"width\" in candidate ? `${candidate.src} ${candidate.width}w` : `${candidate.src} ${candidate.density}x`))\n\t\t.join(\", \");\n}\n","import { type ImageSource, type ResponsiveImageSource } from \"../model/imageTypes\";\n\nimport { buildImageSrcSet } from \"./buildImageSrcSet\";\n\n/** Преобразует декларативные наборы кандидатов в готовые source-дескрипторы. */\nexport function buildImageSources(sources: readonly ResponsiveImageSource[] | undefined, defaultSizes?: string): ImageSource[] {\n\treturn (sources ?? [])\n\t\t.map((source) => ({\n\t\t\tsrcSet: buildImageSrcSet(source.candidates),\n\t\t\ttype: source.type,\n\t\t\tsizes: source.sizes ?? defaultSizes\n\t\t}))\n\t\t.filter((source) => source.srcSet.length > 0);\n}\n","import { useCallback, useState } from \"react\";\n\nimport Cropper from \"react-easy-crop\";\n\nimport { type ImageCropArea, type ImageCropperProps, type ImageCropPoint } from \"../model/imageCropTypes\";\n\nconst DEFAULT_CROP: ImageCropPoint = { x: 0, y: 0 };\n\n/**\n * Управляемая или автономная область обрезки изображения.\n * Числовой aspect задаётся вызывающим кодом и не связан с назначением изображения.\n */\nexport function ImageCropper({\n\timage,\n\taspect = 16 / 9,\n\twidth = \"100%\",\n\tclassName,\n\tstyle,\n\tcrop,\n\tdefaultCrop = DEFAULT_CROP,\n\tzoom,\n\tdefaultZoom = 1,\n\tminZoom = 1,\n\tmaxZoom = 3,\n\tzoomSpeed = 0.1,\n\tobjectFit = \"contain\",\n\tdisabled = false,\n\tonCropChange,\n\tonZoomChange,\n\tonCropComplete\n}: ImageCropperProps) {\n\tconst [uncontrolledCrop, setUncontrolledCrop] = useState(defaultCrop);\n\tconst [uncontrolledZoom, setUncontrolledZoom] = useState(defaultZoom);\n\tconst resolvedCrop = crop ?? uncontrolledCrop;\n\tconst resolvedZoom = zoom ?? uncontrolledZoom;\n\n\tconst handleCropChange = useCallback(\n\t\t(nextCrop: ImageCropPoint) => {\n\t\t\tif (disabled) return;\n\n\t\t\tif (crop === undefined) {\n\t\t\t\tsetUncontrolledCrop(nextCrop);\n\t\t\t}\n\n\t\t\tonCropChange?.(nextCrop);\n\t\t},\n\t\t[crop, disabled, onCropChange]\n\t);\n\n\tconst handleZoomChange = useCallback(\n\t\t(nextZoom: number) => {\n\t\t\tif (disabled) return;\n\n\t\t\tif (zoom === undefined) {\n\t\t\t\tsetUncontrolledZoom(nextZoom);\n\t\t\t}\n\n\t\t\tonZoomChange?.(nextZoom);\n\t\t},\n\t\t[disabled, onZoomChange, zoom]\n\t);\n\n\tconst handleCropComplete = useCallback(\n\t\t(croppedAreaPercentages: ImageCropArea, croppedAreaPixels: ImageCropArea) => {\n\t\t\tif (disabled) return;\n\n\t\t\tonCropComplete?.(croppedAreaPixels, croppedAreaPercentages);\n\t\t},\n\t\t[disabled, onCropComplete]\n\t);\n\n\treturn (\n\t\t<div\n\t\t\tclassName={className}\n\t\t\tstyle={{ position: \"relative\", width, aspectRatio: aspect, pointerEvents: disabled ? \"none\" : undefined, ...style }}>\n\t\t\t<Cropper\n\t\t\t\timage={image}\n\t\t\t\tcrop={resolvedCrop}\n\t\t\t\tzoom={resolvedZoom}\n\t\t\t\taspect={aspect}\n\t\t\t\tminZoom={minZoom}\n\t\t\t\tmaxZoom={maxZoom}\n\t\t\t\tzoomSpeed={zoomSpeed}\n\t\t\t\tobjectFit={objectFit}\n\t\t\t\tonCropChange={handleCropChange}\n\t\t\t\tonZoomChange={handleZoomChange}\n\t\t\t\tonCropComplete={handleCropComplete}\n\t\t\t\tcropperProps={{ \"aria-disabled\": disabled || undefined }}\n\t\t\t/>\n\t\t</div>\n\t);\n}\n","export interface ImagePlaceholderProps {\n\twidth?: number | string;\n\theight?: number | string;\n\taspectRatio?: string | \"unset\";\n\tclassName?: string;\n}\n\nexport function ImagePlaceholder({ width = \"100%\", height = \"100%\", aspectRatio = \"16 / 9\", className }: ImagePlaceholderProps) {\n\treturn (\n\t\t<div style={{ width, height, aspectRatio }} className={className}>\n\t\t\t<svg\n\t\t\t\twidth={width}\n\t\t\t\theight={height}\n\t\t\t\tviewBox=\"0 0 200 200\"\n\t\t\t\txmlns=\"http://www.w3.org/2000/svg\"\n\t\t\t\trole=\"img\"\n\t\t\t\tfill=\"none\"\n\t\t\t\trx=\"10\"\n\t\t\t\try=\"10\"\n\t\t\t\tstyle={{ display: \"block\" }}\n\t\t\t\taria-label=\"Изображение недоступно\">\n\t\t\t\t{/* <rect width=\"200\" height=\"200\" fill=\"var(--surface-2)\" rx=\"10\" ry=\"10\" /> */}\n\t\t\t\t<g fill=\"var(--surface-0)\">\n\t\t\t\t\t<rect x=\"40\" y=\"50\" width=\"120\" height=\"100\" rx=\"10\" />\n\n\t\t\t\t\t<circle cx=\"60\" cy=\"70\" r=\"8\" fill=\"var(--surface-2)\" />\n\n\t\t\t\t\t<path d=\"M50 130 L75 100 L100 130 Z\" fill=\"var(--surface-2)\" />\n\t\t\t\t\t<path d=\"M90 130 L120 90 L150 130 Z\" fill=\"var(--surface-2)\" />\n\n\t\t\t\t\t<line x1=\"160\" y1=\"40\" x2=\"40\" y2=\"160\" stroke=\"var(--surface-0)\" strokeWidth=\"15\" strokeLinecap=\"round\" />\n\t\t\t\t\t<line x1=\"160\" y1=\"40\" x2=\"40\" y2=\"160\" stroke=\"var(--surface-2)\" strokeWidth=\"5\" strokeLinecap=\"round\" />\n\t\t\t\t</g>\n\t\t\t</svg>\n\t\t</div>\n\t);\n}\n","import { type CSSProperties, type ImgHTMLAttributes, type ReactNode, useEffect, useRef, useState } from \"react\";\n\nimport { type ImageLayout, type ImageSource } from \"../model/imageTypes\";\n\nimport { ImagePlaceholder } from \"./ImagePlaceholder\";\n\nexport interface ImageRendererProps extends Omit<ImgHTMLAttributes<HTMLImageElement>, \"src\" | \"width\" | \"height\"> {\n\tsrc: string;\n\tsources?: readonly ImageSource[];\n\tlayout?: ImageLayout;\n\talt?: string;\n\trole?: string;\n\tariaLabel?: string;\n\tcaption?: string;\n\tfallback?: ReactNode;\n\tuseFigure?: boolean;\n\taspectRatio?: string | \"unset\";\n\twidth?: CSSProperties[\"width\"];\n\theight?: CSSProperties[\"height\"];\n\tintrinsicWidth?: number;\n\tintrinsicHeight?: number;\n\twrapperStyle?: CSSProperties;\n}\n\n/**\n * Базовый рендер изображения: lazy-появление, placeholder, обработка ошибки и figure/caption.\n * Компонент не знает, как устроено хранилище и какие форматы/размеры доступны.\n */\nexport function ImageRenderer({\n\tsrc,\n\tsources,\n\talt,\n\trole,\n\tariaLabel,\n\tcaption,\n\tfallback,\n\tuseFigure = false,\n\tlayout = \"cover\",\n\twidth = \"100%\",\n\theight = \"100%\",\n\taspectRatio,\n\tintrinsicWidth,\n\tintrinsicHeight,\n\tonLoad,\n\tonError,\n\tstyle,\n\twrapperStyle,\n\t...imgProps\n}: ImageRendererProps) {\n\tconst wrapperRef = useRef<HTMLDivElement | null>(null);\n\tconst [containerWidth, setContainerWidth] = useState(0);\n\tconst [isVisible, setIsVisible] = useState(false);\n\tconst [hasLoaded, setHasLoaded] = useState(false);\n\tconst [hasError, setHasError] = useState(false);\n\n\tuseEffect(() => {\n\t\tif (typeof IntersectionObserver === \"undefined\") {\n\t\t\t// Отложенный fallback сохраняет одинаковый первый render на сервере и в браузере без IntersectionObserver.\n\t\t\tconst timeoutId = window.setTimeout(() => setIsVisible(true), 0);\n\n\t\t\treturn () => window.clearTimeout(timeoutId);\n\t\t}\n\n\t\tconst observer = new IntersectionObserver(\n\t\t\t([entry]) => {\n\t\t\t\tif (entry.isIntersecting) {\n\t\t\t\t\tconst parentWidth = Math.round(entry.boundingClientRect.width);\n\n\t\t\t\t\tsetContainerWidth(parentWidth);\n\t\t\t\t\tsetIsVisible(true);\n\t\t\t\t\tobserver.disconnect();\n\t\t\t\t}\n\t\t\t},\n\t\t\t{ rootMargin: \"100px\", threshold: 0.01 }\n\t\t);\n\n\t\tif (wrapperRef.current) {\n\t\t\tobserver.observe(wrapperRef.current);\n\t\t}\n\n\t\treturn () => observer.disconnect();\n\t}, []);\n\n\tconst isIntrinsic = layout === \"intrinsic\";\n\tconst resolvedHeight = isIntrinsic ? \"auto\" : height;\n\tconst intrinsicAspectRatio = intrinsicWidth && intrinsicHeight ? `${intrinsicWidth} / ${intrinsicHeight}` : undefined;\n\tconst resolvedAspectRatio = isIntrinsic ? (intrinsicAspectRatio ?? aspectRatio ?? \"auto\") : (aspectRatio ?? \"16 / 9\");\n\tconst placeholderHeight = isIntrinsic && resolvedAspectRatio !== \"auto\" && resolvedAspectRatio !== \"unset\" ? \"100%\" : resolvedHeight;\n\tconst sizesAttr = containerWidth ? `${containerWidth}px` : \"100vw\";\n\tconst defaultFallback = <ImagePlaceholder width={width} height={placeholderHeight} aspectRatio={resolvedAspectRatio} />;\n\tconst loadedImageStyle: CSSProperties = isIntrinsic\n\t\t? {\n\t\t\t\t...style,\n\t\t\t\tdisplay: \"block\",\n\t\t\t\twidth: \"100%\",\n\t\t\t\theight: \"auto\",\n\t\t\t\tobjectFit: undefined\n\t\t\t}\n\t\t: {\n\t\t\t\tdisplay: \"block\",\n\t\t\t\twidth: \"100%\",\n\t\t\t\theight: \"100%\",\n\t\t\t\tobjectFit: layout,\n\t\t\t\t...style\n\t\t\t};\n\n\tconst content = (\n\t\t<>\n\t\t\t{!hasLoaded && !hasError && (fallback || defaultFallback)}\n\t\t\t{isVisible && !hasError && (\n\t\t\t\t<picture>\n\t\t\t\t\t{sources?.map((source) => (\n\t\t\t\t\t\t<source\n\t\t\t\t\t\t\tkey={`${source.type ?? \"source\"}-${source.srcSet}`}\n\t\t\t\t\t\t\tsrcSet={source.srcSet}\n\t\t\t\t\t\t\ttype={source.type}\n\t\t\t\t\t\t\tsizes={source.sizes ?? sizesAttr}\n\t\t\t\t\t\t/>\n\t\t\t\t\t))}\n\t\t\t\t\t<img\n\t\t\t\t\t\tsrc={src}\n\t\t\t\t\t\talt={alt}\n\t\t\t\t\t\trole={role}\n\t\t\t\t\t\taria-label={ariaLabel}\n\t\t\t\t\t\tonLoad={(event) => {\n\t\t\t\t\t\t\tsetHasLoaded(true);\n\t\t\t\t\t\t\tonLoad?.(event);\n\t\t\t\t\t\t}}\n\t\t\t\t\t\tonError={(event) => {\n\t\t\t\t\t\t\tsetHasError(true);\n\t\t\t\t\t\t\tonError?.(event);\n\t\t\t\t\t\t}}\n\t\t\t\t\t\tstyle={!hasLoaded ? { display: \"none\" } : loadedImageStyle}\n\t\t\t\t\t\taria-busy={!hasLoaded}\n\t\t\t\t\t\twidth={intrinsicWidth}\n\t\t\t\t\t\theight={intrinsicHeight}\n\t\t\t\t\t\t{...imgProps}\n\t\t\t\t\t/>\n\t\t\t\t</picture>\n\t\t\t)}\n\t\t\t{hasError && defaultFallback}\n\t\t</>\n\t);\n\n\tconst wrapped = (\n\t\t<div ref={wrapperRef} style={{ width, height: resolvedHeight, aspectRatio: resolvedAspectRatio, ...wrapperStyle }}>\n\t\t\t{content}\n\t\t</div>\n\t);\n\n\treturn useFigure ? (\n\t\t<figure className=\"relative\">\n\t\t\t{wrapped}\n\t\t\t{caption && (\n\t\t\t\t<figcaption\n\t\t\t\t\tstyle={{ bottom: 2, right: 2, maxWidth: \"calc(100% - 4px)\" }}\n\t\t\t\t\tclassName=\"absolute paddingInlineMd textRight radiusSm fontSizeSm\">\n\t\t\t\t\t{caption}\n\t\t\t\t</figcaption>\n\t\t\t)}\n\t\t</figure>\n\t) : (\n\t\twrapped\n\t);\n}\n","import { type SelectedImageData } from \"../model/imageSelectionTypes\";\n\n/** Возвращает устойчивый ключ файла внутри текущего набора выбранных изображений. */\nexport function getImageSelectionKey(image: SelectedImageData, index: number): string {\n\treturn `${image.file.meta.name}-${image.file.meta.size}-${image.file.meta.lastModified}-${index}`;\n}\n","import { useCallback, useMemo, useState } from \"react\";\n\nimport { getImageSelectionKey } from \"../lib/getImageSelectionKey\";\n\nimport { type ImageCropArea, type ImageCropPoint } from \"./imageCropTypes\";\nimport {\n\ttype ImageCropperState,\n\ttype ImageSelectionPanelProps,\n\ttype ImageSelectionState,\n\ttype SelectedImageData,\n\ttype SelectedImageFile\n} from \"./imageSelectionTypes\";\n\nconst INITIAL_CROPPER_STATE: ImageCropperState = { crop: { x: 0, y: 0 }, zoom: 1 };\n\n/**\n * Управляет набором изображений в conventional controlled/uncontrolled-режиме.\n * В controlled-режиме каждое изменение сразу передаётся через onChange, а источник истины остаётся у вызывающего кода.\n */\nexport function useImageSelectionState({\n\tvalue,\n\tdefaultValue,\n\tdisabled,\n\tonChange,\n\tonApply\n}: Pick<ImageSelectionPanelProps, \"value\" | \"defaultValue\" | \"disabled\" | \"onChange\" | \"onApply\">): ImageSelectionState {\n\tconst [uncontrolledValue, setUncontrolledValue] = useState<SelectedImageData[]>(defaultValue ?? []);\n\tconst [requestedActiveIndex, setActiveIndex] = useState(0);\n\tconst [cropperStateByImage, setCropperStateByImage] = useState<Record<string, ImageCropperState>>({});\n\tconst resolvedValue = value ?? uncontrolledValue;\n\n\tconst updateValue = useCallback(\n\t\t(updater: (currentValue: SelectedImageData[]) => SelectedImageData[]) => {\n\t\t\tconst nextValue = updater(resolvedValue);\n\n\t\t\tif (value === undefined) {\n\t\t\t\tsetUncontrolledValue(nextValue);\n\t\t\t}\n\n\t\t\tonChange?.(nextValue);\n\t\t},\n\t\t[onChange, resolvedValue, value]\n\t);\n\n\tconst files = useMemo(() => resolvedValue.map((image) => image.file), [resolvedValue]);\n\tconst activeIndex = resolvedValue.length === 0 ? 0 : Math.min(requestedActiveIndex, resolvedValue.length - 1);\n\tconst activeImage = resolvedValue[activeIndex];\n\tconst activeImageKey = activeImage ? getImageSelectionKey(activeImage, activeIndex) : undefined;\n\tconst activeCropperState = activeImageKey ? (cropperStateByImage[activeImageKey] ?? INITIAL_CROPPER_STATE) : INITIAL_CROPPER_STATE;\n\tconst hasSelected = resolvedValue.length > 0;\n\tconst canApply = !disabled && hasSelected && resolvedValue.every((image) => image.alt.trim() && image.crop);\n\n\tconst setFiles = useCallback(\n\t\t(nextFiles: SelectedImageFile[]) => {\n\t\t\tupdateValue((currentValue) =>\n\t\t\t\tnextFiles.map((file) => {\n\t\t\t\t\t// Сохраняем описание и crop для файлов, которые остались в выборе.\n\t\t\t\t\tconst existingImage = currentValue.find((image) => image.file.file === file.file);\n\n\t\t\t\t\treturn existingImage ? { ...existingImage, file } : { file, alt: \"\" };\n\t\t\t\t})\n\t\t\t);\n\t\t},\n\t\t[updateValue]\n\t);\n\n\tconst setActiveAlt = useCallback(\n\t\t(alt: string) => {\n\t\t\tupdateValue((currentValue) => currentValue.map((image, index) => (index === activeIndex ? { ...image, alt } : image)));\n\t\t},\n\t\t[activeIndex, updateValue]\n\t);\n\n\tconst setActiveCrop = useCallback(\n\t\t(crop: ImageCropArea) => {\n\t\t\tupdateValue((currentValue) => currentValue.map((image, index) => (index === activeIndex ? { ...image, crop } : image)));\n\t\t},\n\t\t[activeIndex, updateValue]\n\t);\n\n\tconst setActiveCropperCrop = useCallback(\n\t\t(crop: ImageCropPoint) => {\n\t\t\tif (!activeImageKey) return;\n\n\t\t\tsetCropperStateByImage((currentState) => ({\n\t\t\t\t...currentState,\n\t\t\t\t[activeImageKey]: {\n\t\t\t\t\tcrop,\n\t\t\t\t\tzoom: currentState[activeImageKey]?.zoom ?? 1\n\t\t\t\t}\n\t\t\t}));\n\t\t},\n\t\t[activeImageKey]\n\t);\n\n\tconst setActiveCropperZoom = useCallback(\n\t\t(zoom: number) => {\n\t\t\tif (!activeImageKey) return;\n\n\t\t\tsetCropperStateByImage((currentState) => ({\n\t\t\t\t...currentState,\n\t\t\t\t[activeImageKey]: {\n\t\t\t\t\tcrop: currentState[activeImageKey]?.crop ?? { x: 0, y: 0 },\n\t\t\t\t\tzoom\n\t\t\t\t}\n\t\t\t}));\n\t\t},\n\t\t[activeImageKey]\n\t);\n\n\tconst apply = useCallback(() => {\n\t\tonApply?.(resolvedValue);\n\t}, [onApply, resolvedValue]);\n\n\treturn {\n\t\tvalue: resolvedValue,\n\t\tfiles,\n\t\tactiveIndex,\n\t\tactiveImage,\n\t\tactiveCropperState,\n\t\thasSelected,\n\t\tcanApply,\n\t\tapply,\n\t\tsetFiles,\n\t\tsetActiveIndex,\n\t\tsetActiveAlt,\n\t\tsetActiveCrop,\n\t\tsetActiveCropperCrop,\n\t\tsetActiveCropperZoom\n\t};\n}\n","import { type CSSProperties } from \"react\";\n\nimport { type SelectedImageData } from \"../model/imageSelectionTypes\";\n\nexport type ImageNaturalSize = {\n\twidth: number;\n\theight: number;\n};\n\n/** Масштабирует preview так, чтобы контейнер показывал только выбранную область crop. */\nexport function getImageCropPreviewStyle(image: SelectedImageData, size: ImageNaturalSize | undefined, aspect: number): CSSProperties {\n\tif (!image.crop || !size) {\n\t\treturn {\n\t\t\twidth: \"100%\",\n\t\t\taspectRatio: aspect,\n\t\t\tobjectFit: \"cover\",\n\t\t\tdisplay: \"block\"\n\t\t};\n\t}\n\n\tconst crop = image.crop;\n\n\treturn {\n\t\tposition: \"absolute\",\n\t\tleft: `${-(crop.x / crop.width) * 100}%`,\n\t\ttop: `${-(crop.y / crop.height) * 100}%`,\n\t\twidth: `${(size.width / crop.width) * 100}%`,\n\t\theight: `${(size.height / crop.height) * 100}%`,\n\t\tmaxWidth: \"none\"\n\t};\n}\n","import { useState } from \"react\";\n\nimport { GridContainer } from \"../../grid\";\nimport { InputText } from \"../../input\";\nimport { InputFiles } from \"../../input-files\";\nimport { getImageCropPreviewStyle, type ImageNaturalSize } from \"../lib/getImageCropPreviewStyle\";\nimport { getImageSelectionKey } from \"../lib/getImageSelectionKey\";\nimport { type ImageSelectionPanelProps, type ImageSelectionState } from \"../model/imageSelectionTypes\";\n\nimport { ImageCropper } from \"./ImageCropper\";\n\nconst DEFAULT_ALLOWED_IMAGE_MIME = [\"image/jpeg\", \"image/png\", \"image/webp\", \"image/avif\"] as const;\n\ninterface ImageSelectionFieldsProps extends Pick<\n\tImageSelectionPanelProps,\n\t\"aspect\" | \"disabled\" | \"allowedMime\" | \"maxBytes\" | \"minimumCropWidth\" | \"onReadError\"\n> {\n\tstate: ImageSelectionState;\n}\n\n/** Поля выбора файлов, crop и альтернативного текста для активного изображения. */\nexport function ImageSelectionFields({\n\taspect = 16 / 9,\n\tdisabled,\n\tallowedMime = DEFAULT_ALLOWED_IMAGE_MIME,\n\tmaxBytes,\n\tminimumCropWidth,\n\tonReadError,\n\tstate\n}: ImageSelectionFieldsProps) {\n\tconst area = state.activeImage?.crop;\n\tconst [imageSizes, setImageSizes] = useState<Record<string, ImageNaturalSize>>({});\n\n\treturn (\n\t\t<GridContainer gap=\"md\">\n\t\t\t<InputFiles\n\t\t\t\tlabel=\"Файл изображения\"\n\t\t\t\tallowedMime={allowedMime}\n\t\t\t\tvalue={state.files}\n\t\t\t\tonChange={state.setFiles}\n\t\t\t\tmaxBytes={maxBytes}\n\t\t\t\tdisabled={disabled}\n\t\t\t\tonReadError={onReadError}\n\t\t\t/>\n\n\t\t\t{state.hasSelected && state.activeImage && (\n\t\t\t\t<div>\n\t\t\t\t\t<GridContainer templateColumns=\"repeat(auto-fill, minmax(10em, 1fr))\" gap=\"xs\">\n\t\t\t\t\t\t{state.value.map((image, index) => {\n\t\t\t\t\t\t\tconst imageKey = getImageSelectionKey(image, index);\n\n\t\t\t\t\t\t\treturn (\n\t\t\t\t\t\t\t\t<button\n\t\t\t\t\t\t\t\t\tkey={imageKey}\n\t\t\t\t\t\t\t\t\ttype=\"button\"\n\t\t\t\t\t\t\t\t\tdisabled={disabled}\n\t\t\t\t\t\t\t\t\tonClick={() => state.setActiveIndex(index)}\n\t\t\t\t\t\t\t\t\tstyle={{\n\t\t\t\t\t\t\t\t\t\tpadding: 0,\n\t\t\t\t\t\t\t\t\t\tborder: index === state.activeIndex ? \"2px solid var(--border-accent)\" : \"2px solid transparent\",\n\t\t\t\t\t\t\t\t\t\tbackground: \"transparent\",\n\t\t\t\t\t\t\t\t\t\tcursor: disabled ? \"default\" : \"pointer\"\n\t\t\t\t\t\t\t\t\t}}>\n\t\t\t\t\t\t\t\t\t<span\n\t\t\t\t\t\t\t\t\t\tstyle={{\n\t\t\t\t\t\t\t\t\t\t\tposition: \"relative\",\n\t\t\t\t\t\t\t\t\t\t\tdisplay: \"block\",\n\t\t\t\t\t\t\t\t\t\t\twidth: \"100%\",\n\t\t\t\t\t\t\t\t\t\t\taspectRatio: aspect,\n\t\t\t\t\t\t\t\t\t\t\toverflow: \"hidden\"\n\t\t\t\t\t\t\t\t\t\t}}>\n\t\t\t\t\t\t\t\t\t\t<img\n\t\t\t\t\t\t\t\t\t\t\tsrc={image.file.dataUrl}\n\t\t\t\t\t\t\t\t\t\t\talt={image.alt || `Предпросмотр изображения ${index + 1}`}\n\t\t\t\t\t\t\t\t\t\t\tstyle={getImageCropPreviewStyle(image, imageSizes[imageKey], aspect)}\n\t\t\t\t\t\t\t\t\t\t\tonLoad={(event) => {\n\t\t\t\t\t\t\t\t\t\t\t\tconst target = event.currentTarget;\n\n\t\t\t\t\t\t\t\t\t\t\t\tsetImageSizes((currentSizes) => ({\n\t\t\t\t\t\t\t\t\t\t\t\t\t...currentSizes,\n\t\t\t\t\t\t\t\t\t\t\t\t\t[imageKey]: {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\twidth: target.naturalWidth,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\theight: target.naturalHeight\n\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t}));\n\t\t\t\t\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t\t\t</button>\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t})}\n\t\t\t\t\t</GridContainer>\n\n\t\t\t\t\t<div>\n\t\t\t\t\t\tВыберите область изображения{\" \"}\n\t\t\t\t\t\t{area && (\n\t\t\t\t\t\t\t<code className={minimumCropWidth && area.width < minimumCropWidth ? \"statusError\" : \"statusSuccess\"}>\n\t\t\t\t\t\t\t\t{area.width}x{area.height}\n\t\t\t\t\t\t\t\t{minimumCropWidth && area.width < minimumCropWidth ? \" — недостаточная ширина\" : \"\"}\n\t\t\t\t\t\t\t</code>\n\t\t\t\t\t\t)}\n\t\t\t\t\t</div>\n\n\t\t\t\t\t<ImageCropper\n\t\t\t\t\t\tkey={getImageSelectionKey(state.activeImage, state.activeIndex)}\n\t\t\t\t\t\timage={state.activeImage.file.dataUrl}\n\t\t\t\t\t\tcrop={state.activeCropperState.crop}\n\t\t\t\t\t\tzoom={state.activeCropperState.zoom}\n\t\t\t\t\t\taspect={aspect}\n\t\t\t\t\t\tdisabled={disabled}\n\t\t\t\t\t\tonCropChange={state.setActiveCropperCrop}\n\t\t\t\t\t\tonZoomChange={state.setActiveCropperZoom}\n\t\t\t\t\t\tonCropComplete={state.setActiveCrop}\n\t\t\t\t\t/>\n\t\t\t\t</div>\n\t\t\t)}\n\n\t\t\t<InputText\n\t\t\t\trequired\n\t\t\t\tdisabled={!state.hasSelected || disabled}\n\t\t\t\tlabel=\"Краткое описание изображения\"\n\t\t\t\tplaceholder=\"\"\n\t\t\t\tvalue={state.activeImage?.alt ?? \"\"}\n\t\t\t\tonChange={state.setActiveAlt}\n\t\t\t/>\n\t\t</GridContainer>\n\t);\n}\n","import { Button } from \"../../button\";\nimport { Modal, ModalContent, ModalFooter } from \"../../modal\";\nimport { type ImageSelectionModalProps } from \"../model/imageSelectionTypes\";\nimport { useImageSelectionState } from \"../model/useImageSelectionState\";\n\nimport { ImageSelectionFields } from \"./ImageSelectionFields\";\n\n/** Модальная форма выбора изображений с необязательным этапом подтверждения. */\nexport function ImageSelectionModal({\n\tdisabled,\n\tisOpen = true,\n\tonClose = () => {},\n\ttitle = \"Загрузка нового изображения\",\n\t...props\n}: ImageSelectionModalProps) {\n\tconst state = useImageSelectionState({ ...props, disabled });\n\n\tif (!props.onApply) {\n\t\treturn (\n\t\t\t<Modal isOpen={isOpen} onClose={onClose} title={title} size=\"xl\">\n\t\t\t\t<ModalContent scrollable>\n\t\t\t\t\t<ImageSelectionFields {...props} disabled={disabled} state={state} />\n\t\t\t\t</ModalContent>\n\t\t\t</Modal>\n\t\t);\n\t}\n\n\treturn (\n\t\t<Modal isOpen={isOpen} onClose={onClose} title={title} size=\"xl\">\n\t\t\t<ModalContent scrollable>\n\t\t\t\t<ImageSelectionFields {...props} disabled={disabled} state={state} />\n\t\t\t</ModalContent>\n\t\t\t<ModalFooter>\n\t\t\t\t<Button disabled={!state.canApply} tone=\"success\" onClick={state.apply}>\n\t\t\t\t\tПрименить\n\t\t\t\t</Button>\n\t\t\t</ModalFooter>\n\t\t</Modal>\n\t);\n}\n","import { Button } from \"../../button\";\nimport { type ImageSelectionActionsData, type ImageSelectionPanelProps } from \"../model/imageSelectionTypes\";\nimport { useImageSelectionState } from \"../model/useImageSelectionState\";\n\nimport { ImageSelectionFields } from \"./ImageSelectionFields\";\n\n/** Встраиваемая форма выбора и обрезки одного или нескольких изображений. */\nexport function ImageSelectionPanel({ disabled, renderActions, ...props }: ImageSelectionPanelProps) {\n\tconst state = useImageSelectionState({ ...props, disabled });\n\tconst actionsData: ImageSelectionActionsData = {\n\t\tvalue: state.value,\n\t\tactiveIndex: state.activeIndex,\n\t\thasSelected: state.hasSelected,\n\t\tcanApply: state.canApply,\n\t\tapply: state.apply\n\t};\n\n\treturn (\n\t\t<>\n\t\t\t<ImageSelectionFields {...props} disabled={disabled} state={state} />\n\t\t\t{renderActions\n\t\t\t\t? renderActions(actionsData)\n\t\t\t\t: props.onApply && (\n\t\t\t\t\t\t<div>\n\t\t\t\t\t\t\t<Button disabled={!state.canApply} tone=\"success\" onClick={state.apply}>\n\t\t\t\t\t\t\t\tПрименить\n\t\t\t\t\t\t\t</Button>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t)}\n\t\t</>\n\t);\n}\n","import { type ImgHTMLAttributes } from \"react\";\n\nimport { buildImageSources } from \"../lib/buildImageSources\";\nimport { buildImageSrcSet } from \"../lib/buildImageSrcSet\";\nimport { type ResponsiveImageData } from \"../model/imageTypes\";\n\nimport { ImageRenderer, type ImageRendererProps } from \"./ImageRenderer\";\n\nexport interface ImageViewProps\n\textends\n\t\tOmit<ImageRendererProps, \"src\" | \"sources\" | \"alt\" | \"intrinsicWidth\" | \"intrinsicHeight\" | \"srcSet\" | \"sizes\">,\n\t\tPick<ImgHTMLAttributes<HTMLImageElement>, \"sizes\"> {\n\timage: ResponsiveImageData;\n\talt?: string;\n}\n\n/**\n * Собирает picture/srcset из готовых URL и делегирует отображение ImageRenderer.\n * Компонент не формирует имена файлов и не знает о форматах или размерах хранилища.\n */\nexport function ImageView({ image, alt, sizes, aspectRatio, ...props }: ImageViewProps) {\n\tconst sources = buildImageSources(image.sources, sizes);\n\tconst srcSet = image.candidates ? buildImageSrcSet(image.candidates) : undefined;\n\tconst resolvedAspectRatio =\n\t\taspectRatio ?? (image.intrinsicWidth && image.intrinsicHeight ? `${image.intrinsicWidth} / ${image.intrinsicHeight}` : undefined);\n\n\treturn (\n\t\t<ImageRenderer\n\t\t\t{...props}\n\t\t\tsrc={image.src}\n\t\t\tsrcSet={srcSet || undefined}\n\t\t\tsources={sources}\n\t\t\tsizes={sizes}\n\t\t\talt={alt ?? image.alt}\n\t\t\tintrinsicWidth={image.intrinsicWidth}\n\t\t\tintrinsicHeight={image.intrinsicHeight}\n\t\t\taspectRatio={resolvedAspectRatio}\n\t\t/>\n\t);\n}\n","import { lazy, Suspense, useCallback, useState } from \"react\";\n\nimport { type ImageViewerProps } from \"../model/imageViewerTypes\";\n\nimport \"yet-another-react-lightbox/plugins/captions.css\";\nimport \"yet-another-react-lightbox/plugins/counter.css\";\nimport \"yet-another-react-lightbox/plugins/thumbnails.css\";\nimport \"yet-another-react-lightbox/styles.css\";\n\nconst LazyImageViewerRuntime = lazy(() => import(\"./ImageViewerRuntime\"));\n\n/**\n * Управляемый полноэкранный viewer с ленивой границей vendor runtime.\n * YARL и его плагины загружаются только при первом открытии, а после mount runtime остаётся в React-дереве,\n * чтобы закрытие успело завершить анимацию, снять inert и вернуть focus исходному trigger.\n */\nexport function ImageViewer(props: ImageViewerProps) {\n\tconst [runtimeMounted, setRuntimeMounted] = useState(false);\n\tconst handleRuntimeMounted = useCallback(() => setRuntimeMounted(true), []);\n\tconst canRenderRuntime = typeof document !== \"undefined\" && (props.open || runtimeMounted);\n\n\tif (!canRenderRuntime) return null;\n\n\treturn (\n\t\t<Suspense fallback={null}>\n\t\t\t<LazyImageViewerRuntime {...props} onRuntimeMounted={handleRuntimeM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K;EAAU,SAAS,EAAM;YAAO;CAEhE,CAAA,EACJ,CAAA,CAEP,EAAA,CAAA;AAEJ;;;ACXA,SAAgB,EAAU,EAAE,UAAO,QAAK,UAAO,gBAAa,GAAG,KAAyB;CACvF,IAAM,IAAU,EAAkB,EAAM,SAAS,CAAK,GAChD,IAAS,EAAM,aAAa,EAAiB,EAAM,UAAU,IAAI,KAAA,GACjE,IACL,MAAgB,EAAM,kBAAkB,EAAM,kBAAkB,GAAG,EAAM,eAAe,KAAK,EAAM,oBAAoB,KAAA;CAExH,OACC,kBAAC,GAAD;EACC,GAAI;EACJ,KAAK,EAAM;EACX,QAAQ,KAAU,KAAA;EACT;EACF;EACP,KAAK,KAAO,EAAM;EAClB,gBAAgB,EAAM;EACtB,iBAAiB,EAAM;EACvB,aAAa;CACb,CAAA;AAEH;;;AC9BA,IAAM,IAAyB,QAAW,OAAO,2CAAuB;AAOxE,SAAgB,EAAY,GAAyB;CACpD,IAAM,CAAC,GAAgB,KAAqB,EAAS,EAAK,GACpD,IAAuB,QAAkB,EAAkB,EAAI,GAAG,CAAC,CAAC;CAK1E,OAJyB,OAAO,WAAa,QAAgB,EAAM,QAAQ,KAK1E,kBAAC,GAAD;EAAU,UAAU;YACnB,kBAAC,GAAD;GAAwB,GAAI;GAAO,kBAAkB;EAAuB,CAAA;CACnE,CAAA,IALmB;AAO/B"}
1
+ {"version":3,"file":"index.js","names":[],"sources":["../../src/image/lib/buildImageSrcSet.ts","../../src/image/lib/buildImageSources.ts","../../src/image/ui/ImageCropper.tsx","../../src/image/ui/ImagePlaceholder.tsx","../../src/image/ui/ImageRenderer.tsx","../../src/image/lib/getImageSelectionKey.ts","../../src/image/model/useImageSelectionState.ts","../../src/image/lib/getImageCropPreviewStyle.ts","../../src/image/ui/ImageSelectionFields.tsx","../../src/image/ui/ImageSelectionModal.tsx","../../src/image/ui/ImageSelectionPanel.tsx","../../src/image/ui/ImageView.tsx","../../src/image/ui/ImageViewer.tsx"],"sourcesContent":["import { type ImageCandidate } from \"../model/imageTypes\";\n\n/** Собирает валидный srcset из уже разрешённых вызывающим кодом URL вариантов. */\nexport function buildImageSrcSet(candidates: readonly ImageCandidate[]): string {\n\treturn candidates\n\t\t.map((candidate) => (\"width\" in candidate ? `${candidate.src} ${candidate.width}w` : `${candidate.src} ${candidate.density}x`))\n\t\t.join(\", \");\n}\n","import { type ImageSource, type ResponsiveImageSource } from \"../model/imageTypes\";\n\nimport { buildImageSrcSet } from \"./buildImageSrcSet\";\n\n/** Преобразует декларативные наборы кандидатов в готовые source-дескрипторы. */\nexport function buildImageSources(sources: readonly ResponsiveImageSource[] | undefined, defaultSizes?: string): ImageSource[] {\n\treturn (sources ?? [])\n\t\t.map((source) => ({\n\t\t\tsrcSet: buildImageSrcSet(source.candidates),\n\t\t\ttype: source.type,\n\t\t\tsizes: source.sizes ?? defaultSizes\n\t\t}))\n\t\t.filter((source) => source.srcSet.length > 0);\n}\n","import { useCallback, useState } from \"react\";\n\nimport Cropper from \"react-easy-crop\";\n\nimport { type ImageCropArea, type ImageCropperProps, type ImageCropPoint } from \"../model/imageCropTypes\";\n\nconst DEFAULT_CROP: ImageCropPoint = { x: 0, y: 0 };\n\n/**\n * Управляемая или автономная область обрезки изображения.\n * Числовой aspect задаётся вызывающим кодом и не связан с назначением изображения.\n */\nexport function ImageCropper({\n\timage,\n\taspect = 16 / 9,\n\twidth = \"100%\",\n\tclassName,\n\tstyle,\n\tcrop,\n\tdefaultCrop = DEFAULT_CROP,\n\tzoom,\n\tdefaultZoom = 1,\n\tminZoom = 1,\n\tmaxZoom = 3,\n\tzoomSpeed = 0.1,\n\tobjectFit = \"contain\",\n\tdisabled = false,\n\tonCropChange,\n\tonZoomChange,\n\tonCropComplete\n}: ImageCropperProps) {\n\tconst [uncontrolledCrop, setUncontrolledCrop] = useState(defaultCrop);\n\tconst [uncontrolledZoom, setUncontrolledZoom] = useState(defaultZoom);\n\tconst resolvedCrop = crop ?? uncontrolledCrop;\n\tconst resolvedZoom = zoom ?? uncontrolledZoom;\n\n\tconst handleCropChange = useCallback(\n\t\t(nextCrop: ImageCropPoint) => {\n\t\t\tif (disabled) return;\n\n\t\t\tif (crop === undefined) {\n\t\t\t\tsetUncontrolledCrop(nextCrop);\n\t\t\t}\n\n\t\t\tonCropChange?.(nextCrop);\n\t\t},\n\t\t[crop, disabled, onCropChange]\n\t);\n\n\tconst handleZoomChange = useCallback(\n\t\t(nextZoom: number) => {\n\t\t\tif (disabled) return;\n\n\t\t\tif (zoom === undefined) {\n\t\t\t\tsetUncontrolledZoom(nextZoom);\n\t\t\t}\n\n\t\t\tonZoomChange?.(nextZoom);\n\t\t},\n\t\t[disabled, onZoomChange, zoom]\n\t);\n\n\tconst handleCropComplete = useCallback(\n\t\t(croppedAreaPercentages: ImageCropArea, croppedAreaPixels: ImageCropArea) => {\n\t\t\tif (disabled) return;\n\n\t\t\tonCropComplete?.(croppedAreaPixels, croppedAreaPercentages);\n\t\t},\n\t\t[disabled, onCropComplete]\n\t);\n\n\treturn (\n\t\t<div\n\t\t\tclassName={className}\n\t\t\tstyle={{ position: \"relative\", width, aspectRatio: aspect, pointerEvents: disabled ? \"none\" : undefined, ...style }}>\n\t\t\t<Cropper\n\t\t\t\timage={image}\n\t\t\t\tcrop={resolvedCrop}\n\t\t\t\tzoom={resolvedZoom}\n\t\t\t\taspect={aspect}\n\t\t\t\tminZoom={minZoom}\n\t\t\t\tmaxZoom={maxZoom}\n\t\t\t\tzoomSpeed={zoomSpeed}\n\t\t\t\tobjectFit={objectFit}\n\t\t\t\tonCropChange={handleCropChange}\n\t\t\t\tonZoomChange={handleZoomChange}\n\t\t\t\tonCropComplete={handleCropComplete}\n\t\t\t\tcropperProps={{ \"aria-disabled\": disabled || undefined }}\n\t\t\t/>\n\t\t</div>\n\t);\n}\n","export interface ImagePlaceholderProps {\n\twidth?: number | string;\n\theight?: number | string;\n\taspectRatio?: string | \"unset\";\n\tclassName?: string;\n}\n\nexport function ImagePlaceholder({ width = \"100%\", height = \"100%\", aspectRatio = \"16 / 9\", className }: ImagePlaceholderProps) {\n\treturn (\n\t\t<div style={{ width, height, aspectRatio }} className={className}>\n\t\t\t<svg\n\t\t\t\twidth={width}\n\t\t\t\theight={height}\n\t\t\t\tviewBox=\"0 0 200 200\"\n\t\t\t\txmlns=\"http://www.w3.org/2000/svg\"\n\t\t\t\trole=\"img\"\n\t\t\t\tfill=\"none\"\n\t\t\t\trx=\"10\"\n\t\t\t\try=\"10\"\n\t\t\t\tstyle={{ display: \"block\" }}\n\t\t\t\taria-label=\"Изображение недоступно\">\n\t\t\t\t{/* <rect width=\"200\" height=\"200\" fill=\"var(--surface-2)\" rx=\"10\" ry=\"10\" /> */}\n\t\t\t\t<g fill=\"var(--surface-0)\">\n\t\t\t\t\t<rect x=\"40\" y=\"50\" width=\"120\" height=\"100\" rx=\"10\" />\n\n\t\t\t\t\t<circle cx=\"60\" cy=\"70\" r=\"8\" fill=\"var(--surface-2)\" />\n\n\t\t\t\t\t<path d=\"M50 130 L75 100 L100 130 Z\" fill=\"var(--surface-2)\" />\n\t\t\t\t\t<path d=\"M90 130 L120 90 L150 130 Z\" fill=\"var(--surface-2)\" />\n\n\t\t\t\t\t<line x1=\"160\" y1=\"40\" x2=\"40\" y2=\"160\" stroke=\"var(--surface-0)\" strokeWidth=\"15\" strokeLinecap=\"round\" />\n\t\t\t\t\t<line x1=\"160\" y1=\"40\" x2=\"40\" y2=\"160\" stroke=\"var(--surface-2)\" strokeWidth=\"5\" strokeLinecap=\"round\" />\n\t\t\t\t</g>\n\t\t\t</svg>\n\t\t</div>\n\t);\n}\n","import { type CSSProperties, type ImgHTMLAttributes, type ReactNode, useEffect, useRef, useState } from \"react\";\n\nimport { type ImageLayout, type ImageSource } from \"../model/imageTypes\";\n\nimport { ImagePlaceholder } from \"./ImagePlaceholder\";\n\nexport interface ImageRendererProps extends Omit<ImgHTMLAttributes<HTMLImageElement>, \"src\" | \"width\" | \"height\"> {\n\tsrc: string;\n\tsources?: readonly ImageSource[];\n\tlayout?: ImageLayout;\n\talt?: string;\n\trole?: string;\n\tariaLabel?: string;\n\tcaption?: string;\n\tfallback?: ReactNode;\n\tuseFigure?: boolean;\n\taspectRatio?: string | \"unset\";\n\twidth?: CSSProperties[\"width\"];\n\theight?: CSSProperties[\"height\"];\n\tintrinsicWidth?: number;\n\tintrinsicHeight?: number;\n\twrapperStyle?: CSSProperties;\n}\n\n/**\n * Базовый рендер изображения: lazy-появление, placeholder, обработка ошибки и figure/caption.\n * Компонент не знает, как устроено хранилище и какие форматы/размеры доступны.\n */\nexport function ImageRenderer({\n\tsrc,\n\tsources,\n\talt,\n\trole,\n\tariaLabel,\n\tcaption,\n\tfallback,\n\tuseFigure = false,\n\tlayout = \"cover\",\n\twidth = \"100%\",\n\theight = \"100%\",\n\taspectRatio,\n\tintrinsicWidth,\n\tintrinsicHeight,\n\tonLoad,\n\tonError,\n\tstyle,\n\twrapperStyle,\n\t...imgProps\n}: ImageRendererProps) {\n\tconst wrapperRef = useRef<HTMLDivElement | null>(null);\n\tconst [containerWidth, setContainerWidth] = useState(0);\n\tconst [isVisible, setIsVisible] = useState(false);\n\tconst [hasLoaded, setHasLoaded] = useState(false);\n\tconst [hasError, setHasError] = useState(false);\n\n\tuseEffect(() => {\n\t\tif (typeof IntersectionObserver === \"undefined\") {\n\t\t\t// Отложенный fallback сохраняет одинаковый первый render на сервере и в браузере без IntersectionObserver.\n\t\t\tconst timeoutId = window.setTimeout(() => setIsVisible(true), 0);\n\n\t\t\treturn () => window.clearTimeout(timeoutId);\n\t\t}\n\n\t\tconst observer = new IntersectionObserver(\n\t\t\t([entry]) => {\n\t\t\t\tif (entry.isIntersecting) {\n\t\t\t\t\tconst parentWidth = Math.round(entry.boundingClientRect.width);\n\n\t\t\t\t\tsetContainerWidth(parentWidth);\n\t\t\t\t\tsetIsVisible(true);\n\t\t\t\t\tobserver.disconnect();\n\t\t\t\t}\n\t\t\t},\n\t\t\t{ rootMargin: \"100px\", threshold: 0.01 }\n\t\t);\n\n\t\tif (wrapperRef.current) {\n\t\t\tobserver.observe(wrapperRef.current);\n\t\t}\n\n\t\treturn () => observer.disconnect();\n\t}, []);\n\n\tconst isIntrinsic = layout === \"intrinsic\";\n\tconst resolvedHeight = isIntrinsic ? \"auto\" : height;\n\tconst intrinsicAspectRatio = intrinsicWidth && intrinsicHeight ? `${intrinsicWidth} / ${intrinsicHeight}` : undefined;\n\tconst resolvedAspectRatio = isIntrinsic ? (intrinsicAspectRatio ?? aspectRatio ?? \"auto\") : (aspectRatio ?? \"16 / 9\");\n\tconst placeholderHeight = isIntrinsic && resolvedAspectRatio !== \"auto\" && resolvedAspectRatio !== \"unset\" ? \"100%\" : resolvedHeight;\n\tconst sizesAttr = containerWidth ? `${containerWidth}px` : \"100vw\";\n\tconst defaultFallback = <ImagePlaceholder width={width} height={placeholderHeight} aspectRatio={resolvedAspectRatio} />;\n\tconst loadedImageStyle: CSSProperties = isIntrinsic\n\t\t? {\n\t\t\t\t...style,\n\t\t\t\tdisplay: \"block\",\n\t\t\t\twidth: \"100%\",\n\t\t\t\theight: \"auto\",\n\t\t\t\tobjectFit: undefined\n\t\t\t}\n\t\t: {\n\t\t\t\tdisplay: \"block\",\n\t\t\t\twidth: \"100%\",\n\t\t\t\theight: \"100%\",\n\t\t\t\tobjectFit: layout,\n\t\t\t\t...style\n\t\t\t};\n\n\tconst content = (\n\t\t<>\n\t\t\t{!hasLoaded && !hasError && (fallback || defaultFallback)}\n\t\t\t{isVisible && !hasError && (\n\t\t\t\t<picture>\n\t\t\t\t\t{sources?.map((source) => (\n\t\t\t\t\t\t<source\n\t\t\t\t\t\t\tkey={`${source.type ?? \"source\"}-${source.srcSet}`}\n\t\t\t\t\t\t\tsrcSet={source.srcSet}\n\t\t\t\t\t\t\ttype={source.type}\n\t\t\t\t\t\t\tsizes={source.sizes ?? sizesAttr}\n\t\t\t\t\t\t/>\n\t\t\t\t\t))}\n\t\t\t\t\t<img\n\t\t\t\t\t\tsrc={src}\n\t\t\t\t\t\talt={alt}\n\t\t\t\t\t\trole={role}\n\t\t\t\t\t\taria-label={ariaLabel}\n\t\t\t\t\t\tonLoad={(event) => {\n\t\t\t\t\t\t\tsetHasLoaded(true);\n\t\t\t\t\t\t\tonLoad?.(event);\n\t\t\t\t\t\t}}\n\t\t\t\t\t\tonError={(event) => {\n\t\t\t\t\t\t\tsetHasError(true);\n\t\t\t\t\t\t\tonError?.(event);\n\t\t\t\t\t\t}}\n\t\t\t\t\t\tstyle={!hasLoaded ? { display: \"none\" } : loadedImageStyle}\n\t\t\t\t\t\taria-busy={!hasLoaded}\n\t\t\t\t\t\twidth={intrinsicWidth}\n\t\t\t\t\t\theight={intrinsicHeight}\n\t\t\t\t\t\t{...imgProps}\n\t\t\t\t\t/>\n\t\t\t\t</picture>\n\t\t\t)}\n\t\t\t{hasError && defaultFallback}\n\t\t</>\n\t);\n\n\tconst wrapped = (\n\t\t<div ref={wrapperRef} style={{ width, height: resolvedHeight, aspectRatio: resolvedAspectRatio, ...wrapperStyle }}>\n\t\t\t{content}\n\t\t</div>\n\t);\n\n\treturn useFigure ? (\n\t\t<figure className=\"relative\">\n\t\t\t{wrapped}\n\t\t\t{caption && (\n\t\t\t\t<figcaption\n\t\t\t\t\tstyle={{ bottom: 2, right: 2, maxWidth: \"calc(100% - 4px)\" }}\n\t\t\t\t\tclassName=\"absolute paddingInlineMd textRight radiusSm fontSizeSm\">\n\t\t\t\t\t{caption}\n\t\t\t\t</figcaption>\n\t\t\t)}\n\t\t</figure>\n\t) : (\n\t\twrapped\n\t);\n}\n","import { type SelectedImageData } from \"../model/imageSelectionTypes\";\n\n/** Возвращает устойчивый ключ файла внутри текущего набора выбранных изображений. */\nexport function getImageSelectionKey(image: SelectedImageData, index: number): string {\n\treturn `${image.file.meta.name}-${image.file.meta.size}-${image.file.meta.lastModified}-${index}`;\n}\n","import { useCallback, useMemo, useState } from \"react\";\n\nimport { getImageSelectionKey } from \"../lib/getImageSelectionKey\";\n\nimport { type ImageCropArea, type ImageCropPoint } from \"./imageCropTypes\";\nimport {\n\ttype ImageCropperState,\n\ttype ImageSelectionPanelProps,\n\ttype ImageSelectionState,\n\ttype SelectedImageData,\n\ttype SelectedImageFile\n} from \"./imageSelectionTypes\";\n\nconst INITIAL_CROPPER_STATE: ImageCropperState = { crop: { x: 0, y: 0 }, zoom: 1 };\n\n/**\n * Управляет набором изображений в conventional controlled/uncontrolled-режиме.\n * В controlled-режиме каждое изменение сразу передаётся через onChange, а источник истины остаётся у вызывающего кода.\n */\nexport function useImageSelectionState({\n\tvalue,\n\tdefaultValue,\n\tdisabled,\n\tonChange,\n\tonApply\n}: Pick<ImageSelectionPanelProps, \"value\" | \"defaultValue\" | \"disabled\" | \"onChange\" | \"onApply\">): ImageSelectionState {\n\tconst [uncontrolledValue, setUncontrolledValue] = useState<SelectedImageData[]>(defaultValue ?? []);\n\tconst [requestedActiveIndex, setActiveIndex] = useState(0);\n\tconst [cropperStateByImage, setCropperStateByImage] = useState<Record<string, ImageCropperState>>({});\n\tconst resolvedValue = value ?? uncontrolledValue;\n\n\tconst updateValue = useCallback(\n\t\t(updater: (currentValue: SelectedImageData[]) => SelectedImageData[]) => {\n\t\t\tconst nextValue = updater(resolvedValue);\n\n\t\t\tif (value === undefined) {\n\t\t\t\tsetUncontrolledValue(nextValue);\n\t\t\t}\n\n\t\t\tonChange?.(nextValue);\n\t\t},\n\t\t[onChange, resolvedValue, value]\n\t);\n\n\tconst files = useMemo(() => resolvedValue.map((image) => image.file), [resolvedValue]);\n\tconst activeIndex = resolvedValue.length === 0 ? 0 : Math.min(requestedActiveIndex, resolvedValue.length - 1);\n\tconst activeImage = resolvedValue[activeIndex];\n\tconst activeImageKey = activeImage ? getImageSelectionKey(activeImage, activeIndex) : undefined;\n\tconst activeCropperState = activeImageKey ? (cropperStateByImage[activeImageKey] ?? INITIAL_CROPPER_STATE) : INITIAL_CROPPER_STATE;\n\tconst hasSelected = resolvedValue.length > 0;\n\tconst canApply = !disabled && hasSelected && resolvedValue.every((image) => image.alt.trim() && image.crop);\n\n\tconst setFiles = useCallback(\n\t\t(nextFiles: SelectedImageFile[]) => {\n\t\t\tupdateValue((currentValue) =>\n\t\t\t\tnextFiles.map((file) => {\n\t\t\t\t\t// Сохраняем описание и crop для файлов, которые остались в выборе.\n\t\t\t\t\tconst existingImage = currentValue.find((image) => image.file.file === file.file);\n\n\t\t\t\t\treturn existingImage ? { ...existingImage, file } : { file, alt: \"\" };\n\t\t\t\t})\n\t\t\t);\n\t\t},\n\t\t[updateValue]\n\t);\n\n\tconst setActiveAlt = useCallback(\n\t\t(alt: string) => {\n\t\t\tupdateValue((currentValue) => currentValue.map((image, index) => (index === activeIndex ? { ...image, alt } : image)));\n\t\t},\n\t\t[activeIndex, updateValue]\n\t);\n\n\tconst setActiveCrop = useCallback(\n\t\t(crop: ImageCropArea) => {\n\t\t\tupdateValue((currentValue) => currentValue.map((image, index) => (index === activeIndex ? { ...image, crop } : image)));\n\t\t},\n\t\t[activeIndex, updateValue]\n\t);\n\n\tconst setActiveCropperCrop = useCallback(\n\t\t(crop: ImageCropPoint) => {\n\t\t\tif (!activeImageKey) return;\n\n\t\t\tsetCropperStateByImage((currentState) => ({\n\t\t\t\t...currentState,\n\t\t\t\t[activeImageKey]: {\n\t\t\t\t\tcrop,\n\t\t\t\t\tzoom: currentState[activeImageKey]?.zoom ?? 1\n\t\t\t\t}\n\t\t\t}));\n\t\t},\n\t\t[activeImageKey]\n\t);\n\n\tconst setActiveCropperZoom = useCallback(\n\t\t(zoom: number) => {\n\t\t\tif (!activeImageKey) return;\n\n\t\t\tsetCropperStateByImage((currentState) => ({\n\t\t\t\t...currentState,\n\t\t\t\t[activeImageKey]: {\n\t\t\t\t\tcrop: currentState[activeImageKey]?.crop ?? { x: 0, y: 0 },\n\t\t\t\t\tzoom\n\t\t\t\t}\n\t\t\t}));\n\t\t},\n\t\t[activeImageKey]\n\t);\n\n\tconst apply = useCallback(() => {\n\t\tonApply?.(resolvedValue);\n\t}, [onApply, resolvedValue]);\n\n\treturn {\n\t\tvalue: resolvedValue,\n\t\tfiles,\n\t\tactiveIndex,\n\t\tactiveImage,\n\t\tactiveCropperState,\n\t\thasSelected,\n\t\tcanApply,\n\t\tapply,\n\t\tsetFiles,\n\t\tsetActiveIndex,\n\t\tsetActiveAlt,\n\t\tsetActiveCrop,\n\t\tsetActiveCropperCrop,\n\t\tsetActiveCropperZoom\n\t};\n}\n","import { type CSSProperties } from \"react\";\n\nimport { type SelectedImageData } from \"../model/imageSelectionTypes\";\n\nexport type ImageNaturalSize = {\n\twidth: number;\n\theight: number;\n};\n\n/** Масштабирует preview так, чтобы контейнер показывал только выбранную область crop. */\nexport function getImageCropPreviewStyle(image: SelectedImageData, size: ImageNaturalSize | undefined, aspect: number): CSSProperties {\n\tif (!image.crop || !size) {\n\t\treturn {\n\t\t\twidth: \"100%\",\n\t\t\taspectRatio: aspect,\n\t\t\tobjectFit: \"cover\",\n\t\t\tdisplay: \"block\"\n\t\t};\n\t}\n\n\tconst crop = image.crop;\n\n\treturn {\n\t\tposition: \"absolute\",\n\t\tleft: `${-(crop.x / crop.width) * 100}%`,\n\t\ttop: `${-(crop.y / crop.height) * 100}%`,\n\t\twidth: `${(size.width / crop.width) * 100}%`,\n\t\theight: `${(size.height / crop.height) * 100}%`,\n\t\tmaxWidth: \"none\"\n\t};\n}\n","import { useState } from \"react\";\n\nimport { GridContainer } from \"../../grid\";\nimport { InputText } from \"../../input\";\nimport { InputFiles } from \"../../input-files\";\nimport { getImageCropPreviewStyle, type ImageNaturalSize } from \"../lib/getImageCropPreviewStyle\";\nimport { getImageSelectionKey } from \"../lib/getImageSelectionKey\";\nimport { type ImageSelectionPanelProps, type ImageSelectionState } from \"../model/imageSelectionTypes\";\n\nimport { ImageCropper } from \"./ImageCropper\";\n\nconst DEFAULT_ALLOWED_IMAGE_MIME = [\"image/jpeg\", \"image/png\", \"image/webp\", \"image/avif\"] as const;\n\ninterface ImageSelectionFieldsProps extends Pick<\n\tImageSelectionPanelProps,\n\t\"aspect\" | \"disabled\" | \"allowedMime\" | \"maxBytes\" | \"minimumCropWidth\" | \"onReadError\"\n> {\n\tstate: ImageSelectionState;\n}\n\n/** Поля выбора файлов, crop и альтернативного текста для активного изображения. */\nexport function ImageSelectionFields({\n\taspect = 16 / 9,\n\tdisabled,\n\tallowedMime = DEFAULT_ALLOWED_IMAGE_MIME,\n\tmaxBytes,\n\tminimumCropWidth,\n\tonReadError,\n\tstate\n}: ImageSelectionFieldsProps) {\n\tconst area = state.activeImage?.crop;\n\tconst [imageSizes, setImageSizes] = useState<Record<string, ImageNaturalSize>>({});\n\n\treturn (\n\t\t<GridContainer gap=\"md\">\n\t\t\t<InputFiles\n\t\t\t\tlabel=\"Файл изображения\"\n\t\t\t\tallowedMime={allowedMime}\n\t\t\t\tvalue={state.files}\n\t\t\t\tonChange={state.setFiles}\n\t\t\t\tmaxBytes={maxBytes}\n\t\t\t\tdisabled={disabled}\n\t\t\t\tonReadError={onReadError}\n\t\t\t/>\n\n\t\t\t{state.hasSelected && state.activeImage && (\n\t\t\t\t<div>\n\t\t\t\t\t<GridContainer templateColumns=\"repeat(auto-fill, minmax(10em, 1fr))\" gap=\"xs\">\n\t\t\t\t\t\t{state.value.map((image, index) => {\n\t\t\t\t\t\t\tconst imageKey = getImageSelectionKey(image, index);\n\n\t\t\t\t\t\t\treturn (\n\t\t\t\t\t\t\t\t<button\n\t\t\t\t\t\t\t\t\tkey={imageKey}\n\t\t\t\t\t\t\t\t\ttype=\"button\"\n\t\t\t\t\t\t\t\t\tdisabled={disabled}\n\t\t\t\t\t\t\t\t\tonClick={() => state.setActiveIndex(index)}\n\t\t\t\t\t\t\t\t\tstyle={{\n\t\t\t\t\t\t\t\t\t\tpadding: 0,\n\t\t\t\t\t\t\t\t\t\tborder: index === state.activeIndex ? \"2px solid var(--border-accent)\" : \"2px solid transparent\",\n\t\t\t\t\t\t\t\t\t\tbackground: \"transparent\",\n\t\t\t\t\t\t\t\t\t\tcursor: disabled ? \"default\" : \"pointer\"\n\t\t\t\t\t\t\t\t\t}}>\n\t\t\t\t\t\t\t\t\t<span\n\t\t\t\t\t\t\t\t\t\tstyle={{\n\t\t\t\t\t\t\t\t\t\t\tposition: \"relative\",\n\t\t\t\t\t\t\t\t\t\t\tdisplay: \"block\",\n\t\t\t\t\t\t\t\t\t\t\twidth: \"100%\",\n\t\t\t\t\t\t\t\t\t\t\taspectRatio: aspect,\n\t\t\t\t\t\t\t\t\t\t\toverflow: \"hidden\"\n\t\t\t\t\t\t\t\t\t\t}}>\n\t\t\t\t\t\t\t\t\t\t<img\n\t\t\t\t\t\t\t\t\t\t\tsrc={image.file.dataUrl}\n\t\t\t\t\t\t\t\t\t\t\talt={image.alt || `Предпросмотр изображения ${index + 1}`}\n\t\t\t\t\t\t\t\t\t\t\tstyle={getImageCropPreviewStyle(image, imageSizes[imageKey], aspect)}\n\t\t\t\t\t\t\t\t\t\t\tonLoad={(event) => {\n\t\t\t\t\t\t\t\t\t\t\t\tconst target = event.currentTarget;\n\n\t\t\t\t\t\t\t\t\t\t\t\tsetImageSizes((currentSizes) => ({\n\t\t\t\t\t\t\t\t\t\t\t\t\t...currentSizes,\n\t\t\t\t\t\t\t\t\t\t\t\t\t[imageKey]: {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\twidth: target.naturalWidth,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\theight: target.naturalHeight\n\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t}));\n\t\t\t\t\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t\t\t</button>\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t})}\n\t\t\t\t\t</GridContainer>\n\n\t\t\t\t\t<div>\n\t\t\t\t\t\tВыберите область изображения{\" \"}\n\t\t\t\t\t\t{area && (\n\t\t\t\t\t\t\t<code className={minimumCropWidth && area.width < minimumCropWidth ? \"statusError\" : \"statusSuccess\"}>\n\t\t\t\t\t\t\t\t{area.width}x{area.height}\n\t\t\t\t\t\t\t\t{minimumCropWidth && area.width < minimumCropWidth ? \" — недостаточная ширина\" : \"\"}\n\t\t\t\t\t\t\t</code>\n\t\t\t\t\t\t)}\n\t\t\t\t\t</div>\n\n\t\t\t\t\t<ImageCropper\n\t\t\t\t\t\tkey={getImageSelectionKey(state.activeImage, state.activeIndex)}\n\t\t\t\t\t\timage={state.activeImage.file.dataUrl}\n\t\t\t\t\t\tcrop={state.activeCropperState.crop}\n\t\t\t\t\t\tzoom={state.activeCropperState.zoom}\n\t\t\t\t\t\taspect={aspect}\n\t\t\t\t\t\tdisabled={disabled}\n\t\t\t\t\t\tonCropChange={state.setActiveCropperCrop}\n\t\t\t\t\t\tonZoomChange={state.setActiveCropperZoom}\n\t\t\t\t\t\tonCropComplete={state.setActiveCrop}\n\t\t\t\t\t/>\n\t\t\t\t</div>\n\t\t\t)}\n\n\t\t\t<InputText\n\t\t\t\trequired\n\t\t\t\tdisabled={!state.hasSelected || disabled}\n\t\t\t\tlabel=\"Краткое описание изображения\"\n\t\t\t\tplaceholder=\"\"\n\t\t\t\tvalue={state.activeImage?.alt ?? \"\"}\n\t\t\t\tonChange={state.setActiveAlt}\n\t\t\t/>\n\t\t</GridContainer>\n\t);\n}\n","import { Button } from \"../../button\";\nimport { Modal, ModalContent, ModalFooter } from \"../../modal\";\nimport { type ImageSelectionModalProps } from \"../model/imageSelectionTypes\";\nimport { useImageSelectionState } from \"../model/useImageSelectionState\";\n\nimport { ImageSelectionFields } from \"./ImageSelectionFields\";\n\n/** Модальная форма выбора изображений с необязательным этапом подтверждения. */\nexport function ImageSelectionModal({\n\tdisabled,\n\tisOpen = true,\n\tonClose = () => {},\n\ttitle = \"Загрузка нового изображения\",\n\t...props\n}: ImageSelectionModalProps) {\n\tconst state = useImageSelectionState({ ...props, disabled });\n\n\tif (!props.onApply) {\n\t\treturn (\n\t\t\t<Modal isOpen={isOpen} onClose={onClose} title={title} size=\"xl\">\n\t\t\t\t<ModalContent scrollable>\n\t\t\t\t\t<ImageSelectionFields {...props} disabled={disabled} state={state} />\n\t\t\t\t</ModalContent>\n\t\t\t</Modal>\n\t\t);\n\t}\n\n\treturn (\n\t\t<Modal isOpen={isOpen} onClose={onClose} title={title} size=\"xl\">\n\t\t\t<ModalContent scrollable>\n\t\t\t\t<ImageSelectionFields {...props} disabled={disabled} state={state} />\n\t\t\t</ModalContent>\n\t\t\t<ModalFooter>\n\t\t\t\t<Button disabled={!state.canApply} tone=\"success\" onClick={state.apply}>\n\t\t\t\t\tПрименить\n\t\t\t\t</Button>\n\t\t\t</ModalFooter>\n\t\t</Modal>\n\t);\n}\n","import { Button } from \"../../button\";\nimport { type ImageSelectionActionsData, type ImageSelectionPanelProps } from \"../model/imageSelectionTypes\";\nimport { useImageSelectionState } from \"../model/useImageSelectionState\";\n\nimport { ImageSelectionFields } from \"./ImageSelectionFields\";\n\n/** Встраиваемая форма выбора и обрезки одного или нескольких изображений. */\nexport function ImageSelectionPanel({ disabled, renderActions, ...props }: ImageSelectionPanelProps) {\n\tconst state = useImageSelectionState({ ...props, disabled });\n\tconst actionsData: ImageSelectionActionsData = {\n\t\tvalue: state.value,\n\t\tactiveIndex: state.activeIndex,\n\t\thasSelected: state.hasSelected,\n\t\tcanApply: state.canApply,\n\t\tapply: state.apply\n\t};\n\n\treturn (\n\t\t<>\n\t\t\t<ImageSelectionFields {...props} disabled={disabled} state={state} />\n\t\t\t{renderActions\n\t\t\t\t? renderActions(actionsData)\n\t\t\t\t: props.onApply && (\n\t\t\t\t\t\t<div>\n\t\t\t\t\t\t\t<Button disabled={!state.canApply} tone=\"success\" onClick={state.apply}>\n\t\t\t\t\t\t\t\tПрименить\n\t\t\t\t\t\t\t</Button>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t)}\n\t\t</>\n\t);\n}\n","import { type ImgHTMLAttributes } from \"react\";\n\nimport { buildImageSources } from \"../lib/buildImageSources\";\nimport { buildImageSrcSet } from \"../lib/buildImageSrcSet\";\nimport { type ResponsiveImageData } from \"../model/imageTypes\";\n\nimport { ImageRenderer, type ImageRendererProps } from \"./ImageRenderer\";\n\nexport interface ImageViewProps\n\textends\n\t\tOmit<ImageRendererProps, \"src\" | \"sources\" | \"alt\" | \"intrinsicWidth\" | \"intrinsicHeight\" | \"srcSet\" | \"sizes\">,\n\t\tPick<ImgHTMLAttributes<HTMLImageElement>, \"sizes\"> {\n\timage: ResponsiveImageData;\n\talt?: string;\n}\n\n/**\n * Собирает picture/srcset из готовых URL и делегирует отображение ImageRenderer.\n * Компонент не формирует имена файлов и не знает о форматах или размерах хранилища.\n */\nexport function ImageView({ image, alt, sizes, aspectRatio, ...props }: ImageViewProps) {\n\tconst sources = buildImageSources(image.sources, sizes);\n\tconst srcSet = image.candidates ? buildImageSrcSet(image.candidates) : undefined;\n\tconst resolvedAspectRatio =\n\t\taspectRatio ?? (image.intrinsicWidth && image.intrinsicHeight ? `${image.intrinsicWidth} / ${image.intrinsicHeight}` : undefined);\n\n\treturn (\n\t\t<ImageRenderer\n\t\t\t{...props}\n\t\t\tsrc={image.src}\n\t\t\tsrcSet={srcSet || undefined}\n\t\t\tsources={sources}\n\t\t\tsizes={sizes}\n\t\t\talt={alt ?? image.alt}\n\t\t\tintrinsicWidth={image.intrinsicWidth}\n\t\t\tintrinsicHeight={image.intrinsicHeight}\n\t\t\taspectRatio={resolvedAspectRatio}\n\t\t/>\n\t);\n}\n","import { lazy, Suspense, useCallback, useState } from \"react\";\n\nimport { type ImageViewerProps } from \"../model/imageViewerTypes\";\n\nimport \"yet-another-react-lightbox/plugins/captions.css\";\nimport \"yet-another-react-lightbox/plugins/counter.css\";\nimport \"yet-another-react-lightbox/plugins/thumbnails.css\";\nimport \"yet-another-react-lightbox/styles.css\";\n\nconst LazyImageViewerRuntime = lazy(() => import(\"./ImageViewerRuntime\"));\n\n/**\n * Управляемый полноэкранный viewer с ленивой границей vendor runtime.\n * YARL и его плагины загружаются только при первом открытии, а после mount runtime остаётся в React-дереве,\n * чтобы закрытие успело завершить анимацию, снять inert и вернуть focus исходному trigger.\n */\nexport function ImageViewer(props: ImageViewerProps) {\n\tconst [runtimeMounted, setRuntimeMounted] = useState(false);\n\tconst handleRuntimeMounted = useCallback(() => setRuntimeMounted(true), []);\n\tconst canRenderRuntime = typeof document !== \"undefined\" && (props.open || runtimeMounted);\n\n\tif (!canRenderRuntime) return null;\n\n\treturn (\n\t\t<Suspense fallback={null}>\n\t\t\t<LazyImageViewerRuntime {...props} onRuntimeMounted={handleRuntimeMounted} />\n\t\t</Suspense>\n\t);\n}\n"],"mappings":";;;;;;;;;AAGA,SAAgB,EAAiB,GAA+C;CAC/E,OAAO,EACL,KAAK,MAAe,WAAW,IAAY,GAAG,EAAU,IAAI,GAAG,EAAU,MAAM,KAAK,GAAG,EAAU,IAAI,GAAG,EAAU,QAAQ,EAAG,CAAC,CAC9H,KAAK,IAAI;AACZ;;;ACFA,SAAgB,EAAkB,GAAuD,GAAsC;CAC9H,QAAQ,KAAW,CAAC,EAAA,CAClB,KAAK,OAAY;EACjB,QAAQ,EAAiB,EAAO,UAAU;EAC1C,MAAM,EAAO;EACb,OAAO,EAAO,SAAS;CACxB,EAAE,CAAC,CACF,QAAQ,MAAW,EAAO,OAAO,SAAS,CAAC;AAC9C;;;ACPA,IAAM,IAA+B;CAAE,GAAG;CAAG,GAAG;AAAE;AAMlD,SAAgB,EAAa,EAC5B,UACA,YAAS,KAAK,GACd,WAAQ,QACR,cACA,UACA,SACA,iBAAc,GACd,SACA,iBAAc,GACd,aAAU,GACV,aAAU,GACV,eAAY,IACZ,eAAY,WACZ,cAAW,IACX,iBACA,iBACA,qBACqB;CACrB,IAAM,CAAC,GAAkB,KAAuB,EAAS,CAAW,GAC9D,CAAC,GAAkB,KAAuB,EAAS,CAAW,GAC9D,IAAe,KAAQ,GACvB,IAAe,KAAQ,GAEvB,IAAmB,GACvB,MAA6B;EACzB,MAEA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D;EAAU,UAAU;EACnB,UAAA,kBAAC,GAAD;GAAwB,GAAI;GAAO,kBAAkB;EAAuB,CAAA;CACnE,CAAA,IALmB;AAO/B"}
@@ -1,2 +1,2 @@
1
- import { a as e, c as t, i as n, l as r, n as i, o as a, r as o, s, t as c } from "../chunks/input-BCJfUdK_.js";
1
+ import { a as e, c as t, i as n, l as r, n as i, o as a, r as o, s, t as c } from "../chunks/input-Bp6_Ucgr.js";
2
2
  export { i as Input, o as InputClearButton, n as InputControl, c as InputErrorComponent, e as InputNumber, a as InputText, s as InputUI, t as InputUILoading, r as useInputFieldIds };
@@ -1,5 +1,5 @@
1
1
  import { t as e } from "../chunks/ui.module-BisoTevy.js";
2
- import { i as t, l as n, r, s as i } from "../chunks/input-BCJfUdK_.js";
2
+ import { i as t, l as n, r, s as i } from "../chunks/input-Bp6_Ucgr.js";
3
3
  import { useCallback as a, useMemo as o, useRef as s, useState as c } from "react";
4
4
  import { cn as l } from "@ryuzaki13/react-foundation-lib/utils";
5
5
  import { jsx as u } from "react/jsx-runtime";