@ryuzaki13/react-foundation-ui 1.5.0 → 1.5.2

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 (333) hide show
  1. package/dist/advanced-search/index.js +4 -4
  2. package/dist/base-table/index.js +1 -1
  3. package/dist/chunks/CalendarView-Cfih7hjD.js +439 -0
  4. package/dist/chunks/{CalendarView-DtacoN_c.js.map → CalendarView-Cfih7hjD.js.map} +1 -1
  5. package/dist/chunks/CheckBox.module-C5SjPwSj.js.map +1 -1
  6. package/dist/chunks/{TextEditorLexicalClient-DVML-Nhd.js → TextEditorLexicalClient-BSafrkLJ.js} +241 -275
  7. package/dist/chunks/TextEditorLexicalClient-BSafrkLJ.js.map +1 -0
  8. package/dist/chunks/{base-table-BPcdSitC.js → base-table-X7aSSjXa.js} +2 -2
  9. package/dist/chunks/{base-table-BPcdSitC.js.map → base-table-X7aSSjXa.js.map} +1 -1
  10. package/dist/chunks/{context-menu-BY4pYGwB.js → context-menu-tcD3kVAc.js} +58 -62
  11. package/dist/chunks/context-menu-tcD3kVAc.js.map +1 -0
  12. package/dist/chunks/date-input-Bsl9dxxY.js +341 -0
  13. package/dist/chunks/date-input-Bsl9dxxY.js.map +1 -0
  14. package/dist/chunks/{input-BWCaVC06.js → input-CAw1Loze.js} +54 -47
  15. package/dist/chunks/input-CAw1Loze.js.map +1 -0
  16. package/dist/chunks/{input-files-62qH2TMj.js → input-files-CLtQ7p8j.js} +2 -2
  17. package/dist/chunks/{input-files-62qH2TMj.js.map → input-files-CLtQ7p8j.js.map} +1 -1
  18. package/dist/chunks/{input-search-CdPI1cb6.js → input-search-F6MPrUGF.js} +2 -2
  19. package/dist/chunks/{input-search-CdPI1cb6.js.map → input-search-F6MPrUGF.js.map} +1 -1
  20. package/dist/chunks/modal-DPIXoMkB.js.map +1 -1
  21. package/dist/chunks/{multi-select-01xmD1nZ.js → multi-select-CZPB8H6v.js} +61 -60
  22. package/dist/chunks/multi-select-CZPB8H6v.js.map +1 -0
  23. package/dist/chunks/{picker-Mdb73_uW.js → picker-TYLwgl1c.js} +82 -92
  24. package/dist/chunks/{picker-Mdb73_uW.js.map → picker-TYLwgl1c.js.map} +1 -1
  25. package/dist/chunks/{select-DRf4_a1Z.js → select-BwbljzU9.js} +35 -34
  26. package/dist/chunks/select-BwbljzU9.js.map +1 -0
  27. package/dist/chunks/{table-DSg9gi_l.js → table-DihiNNJt.js} +2 -2
  28. package/dist/chunks/{table-DSg9gi_l.js.map → table-DihiNNJt.js.map} +1 -1
  29. package/dist/chunks/types-CxXyru6U.js.map +1 -1
  30. package/dist/chunks/{useODataSelectBase-DI_wwKgw.js → useODataSelectBase-Bfljwe39.js} +16 -24
  31. package/dist/chunks/{useODataSelectBase-DI_wwKgw.js.map → useODataSelectBase-Bfljwe39.js.map} +1 -1
  32. package/dist/context-menu/components/MenuRoot.d.ts.map +1 -1
  33. package/dist/context-menu/index.js +1 -1
  34. package/dist/date-input/index.js +2 -2
  35. package/dist/date-input/lib/dateInputValue.d.ts +2 -6
  36. package/dist/date-input/lib/dateInputValue.d.ts.map +1 -1
  37. package/dist/date-input/lib/types.d.ts +0 -4
  38. package/dist/date-input/lib/types.d.ts.map +1 -1
  39. package/dist/date-input/model/useDateInput.d.ts +2 -2
  40. package/dist/date-input/model/useDateInput.d.ts.map +1 -1
  41. package/dist/date-input/ui/CalendarView.d.ts.map +1 -1
  42. package/dist/date-input/ui/DateInput.d.ts +0 -4
  43. package/dist/date-input/ui/DateInput.d.ts.map +1 -1
  44. package/dist/date-time-input/index.js +229 -234
  45. package/dist/date-time-input/index.js.map +1 -1
  46. package/dist/date-time-input/model/useDateTimeSegments.d.ts.map +1 -1
  47. package/dist/date-time-input/ui/SingleDateTimeInput.d.ts.map +1 -1
  48. package/dist/disclosure/index.js.map +1 -1
  49. package/dist/drop-zone/index.js +1 -1
  50. package/dist/image/index.js +2 -2
  51. package/dist/input/Input.d.ts.map +1 -1
  52. package/dist/input/index.js +1 -1
  53. package/dist/input-date-time/index.js +1 -1
  54. package/dist/input-file/index.js +1 -1
  55. package/dist/input-files/index.js +1 -1
  56. package/dist/input-image/index.js +1 -1
  57. package/dist/input-search/index.js +1 -1
  58. package/dist/layout-picker/index.js +1 -1
  59. package/dist/list/List.d.ts.map +1 -1
  60. package/dist/list/index.js +74 -45
  61. package/dist/list/index.js.map +1 -1
  62. package/dist/list/useListVirtualizer.d.ts +13 -0
  63. package/dist/list/useListVirtualizer.d.ts.map +1 -0
  64. package/dist/multi-select/index.js +1 -1
  65. package/dist/multi-select/ui/MultiSelect.d.ts.map +1 -1
  66. package/dist/picker/index.js +1 -1
  67. package/dist/picker/model/usePickerQuery.d.ts +6 -2
  68. package/dist/picker/model/usePickerQuery.d.ts.map +1 -1
  69. package/dist/picker/model/usePickerSelectionLifecycle.d.ts.map +1 -1
  70. package/dist/preset-range-date-input/index.js +1 -1
  71. package/dist/preset-select/index.js +1 -1
  72. package/dist/select/Select.d.ts.map +1 -1
  73. package/dist/select/index.js +1 -1
  74. package/dist/simple-table/index.js +1 -1
  75. package/dist/slider/SliderInput.d.ts.map +1 -1
  76. package/dist/slider/index.js +333 -290
  77. package/dist/slider/index.js.map +1 -1
  78. package/dist/state-select/index.js +1 -1
  79. package/dist/styles.css +1 -1
  80. package/dist/table/index.js +1 -1
  81. package/dist/table-sorting/index.js +1 -1
  82. package/dist/tabs/index.js.map +1 -1
  83. package/dist/tag-input/TagInput.d.ts.map +1 -1
  84. package/dist/tag-input/index.js +1 -1
  85. package/dist/tag-input/index.js.map +1 -1
  86. package/dist/text-editor/EmailDialog.d.ts +1 -2
  87. package/dist/text-editor/EmailDialog.d.ts.map +1 -1
  88. package/dist/text-editor/LinkDialog.d.ts +1 -2
  89. package/dist/text-editor/LinkDialog.d.ts.map +1 -1
  90. package/dist/text-editor/PhoneDialog.d.ts +1 -2
  91. package/dist/text-editor/PhoneDialog.d.ts.map +1 -1
  92. package/dist/text-editor/SemanticDialog.d.ts +1 -2
  93. package/dist/text-editor/SemanticDialog.d.ts.map +1 -1
  94. package/dist/text-editor/TextEditorDialogs.d.ts +2 -1
  95. package/dist/text-editor/TextEditorDialogs.d.ts.map +1 -1
  96. package/dist/text-editor/TimeDialog.d.ts +1 -2
  97. package/dist/text-editor/TimeDialog.d.ts.map +1 -1
  98. package/dist/text-editor/index.js +1 -1
  99. package/dist/text-editor/nodes/AccessibleLinkNode.d.ts.map +1 -1
  100. package/dist/text-editor/nodes/SemanticTagNode.d.ts.map +1 -1
  101. package/dist/text-editor/toolbar/types.d.ts.map +1 -1
  102. package/dist/textarea/index.js +1 -1
  103. package/dist/tree-select/TreePickerBase.d.ts.map +1 -1
  104. package/dist/tree-select/index.js +244 -249
  105. package/dist/tree-select/index.js.map +1 -1
  106. package/dist/tree-table/index.js +1 -1
  107. package/package.json +1 -1
  108. package/storybook-static/assets/{Badge-CblO4qSx.js → Badge-DdvnnE8F.js} +1 -1
  109. package/storybook-static/assets/{Badge.stories-CtRrqjAo.js → Badge.stories-BUKUom98.js} +1 -1
  110. package/storybook-static/assets/{Button-Bzc9jBAF.js → Button-CghMveZ5.js} +1 -1
  111. package/storybook-static/assets/{Button-BVt4jmN4.js → Button-Co_JCRHU.js} +1 -1
  112. package/storybook-static/assets/{Button.stories-tqfxm0ox.js → Button.stories-CGj8XyOO.js} +1 -1
  113. package/storybook-static/assets/{CalendarView-MkrPd5D-.js → CalendarView-CaphwAt-.js} +1 -1
  114. package/storybook-static/assets/{CheckBox-0BK2dgdD.js → CheckBox-BQcaUjLx.js} +1 -1
  115. package/storybook-static/assets/{CheckBox-CWipX4CI.js → CheckBox-DAffOBou.js} +1 -1
  116. package/storybook-static/assets/CheckBox-Dw4nDCv8.css +1 -0
  117. package/storybook-static/assets/{CheckBox.stories-B5yWzlQa.js → CheckBox.stories-D_pMeQfu.js} +1 -1
  118. package/storybook-static/assets/{Color-6AOWCN3U-WdTzF_2p.js → Color-6AOWCN3U--6e3-dEn.js} +1 -1
  119. package/storybook-static/assets/{ContextMenu-kbSWsoCE.js → ContextMenu-CCuLOUEi.js} +1 -1
  120. package/storybook-static/assets/ContextMenu-CCwVy2bU.js +1 -0
  121. package/storybook-static/assets/{ContextMenu.stories-CQcrX3sj.js → ContextMenu.stories-DvArgxXF.js} +1 -1
  122. package/storybook-static/assets/{DateInput-CyNIW9Md.js → DateInput-2WtbeZR7.js} +1 -1
  123. package/storybook-static/assets/DateInput-DNJ3WoMQ.js +1 -0
  124. package/storybook-static/assets/{DateInput.stories-DyB3PjTl.js → DateInput.stories-v5ti6IEo.js} +1 -1
  125. package/storybook-static/assets/{DateRangePresetSelect-CBZ0OAmn.js → DateRangePresetSelect-CPxgZfAB.js} +1 -1
  126. package/storybook-static/assets/{DateRangePresetSelect-BwibZk_q.js → DateRangePresetSelect-q30Gumdf.js} +1 -1
  127. package/storybook-static/assets/{DateRangePresetSelect.stories-kmmKl-3j.js → DateRangePresetSelect.stories-DdOS7cEa.js} +1 -1
  128. package/storybook-static/assets/{Detail-pHBZ5bkR.js → Detail-DIuLwIa1.js} +1 -1
  129. package/storybook-static/assets/{Detail.stories-Bs5YNmLn.js → Detail.stories-D3P1LkKH.js} +1 -1
  130. package/storybook-static/assets/{Dialog-DbFhCtF1.js → Dialog-zOHAVMnY.js} +1 -1
  131. package/storybook-static/assets/{Dialog-DBTU-LRR.js → Dialog-zxssjiyA.js} +1 -1
  132. package/storybook-static/assets/{Dialog.stories-_WQW8YNs.js → Dialog.stories-CPdleZZG.js} +1 -1
  133. package/storybook-static/assets/{Disclosure-vOJWmhLt.js → Disclosure-X-fwyTOO.js} +1 -1
  134. package/storybook-static/assets/{Disclosure.stories-wyulIOoJ.js → Disclosure.stories-DhBj8XEl.js} +1 -1
  135. package/storybook-static/assets/{DisclosureGroup-DjObX5Qs.css → DisclosureGroup-CNoH2D1R.css} +1 -1
  136. package/storybook-static/assets/{DisclosureGroup-BUDxwl5C.js → DisclosureGroup-COBTA8iF.js} +1 -1
  137. package/storybook-static/assets/{DocsRenderer-JROSPFPF-B7vhvrpB.js → DocsRenderer-JROSPFPF-DBKu16F9.js} +1 -1
  138. package/storybook-static/assets/{DropZone-BvRT0gUm.js → DropZone-BxSCEj48.js} +1 -1
  139. package/storybook-static/assets/{DropZone-B7Q1qQqP.js → DropZone-C8pMmwdl.js} +1 -1
  140. package/storybook-static/assets/{DropZone.stories-WmoR3uPj.js → DropZone.stories-BCAhhItK.js} +1 -1
  141. package/storybook-static/assets/{DropdownMenu-BW35W6_U.js → DropdownMenu-Bi3Tiwls.js} +1 -1
  142. package/storybook-static/assets/{ExpandableActionPanel-C9G9PsZx.js → ExpandableActionPanel-CBwWx_Nv.js} +1 -1
  143. package/storybook-static/assets/{ExpandableActionPanel.stories-Dllpmeu_.js → ExpandableActionPanel.stories-BkYsUqoo.js} +1 -1
  144. package/storybook-static/assets/{Flex-Cydb-4MR.js → Flex-CO947dLM.js} +1 -1
  145. package/storybook-static/assets/{Flex.stories-Dczj9g4W.js → Flex.stories-DMUThbwO.js} +1 -1
  146. package/storybook-static/assets/{FloatingPopover-C-W77AcJ.js → FloatingPopover-BlMi_zjk.js} +1 -1
  147. package/storybook-static/assets/{FormattedTableCell-fePg_bmP.js → FormattedTableCell-DDNLMP5K.js} +1 -1
  148. package/storybook-static/assets/{Grid-Dal3v5dj.js → Grid-39TY8m4Z.js} +1 -1
  149. package/storybook-static/assets/{Grid.stories-Byb4mMpE.js → Grid.stories-DYvrXiSG.js} +1 -1
  150. package/storybook-static/assets/{ImageCropper.stories-B9OD2pur.js → ImageCropper.stories-B9ltINOC.js} +1 -1
  151. package/storybook-static/assets/{ImageRenderer-BcUjptiu.js → ImageRenderer-DA--Akcn.js} +1 -1
  152. package/storybook-static/assets/{ImageRenderer.stories-BuO2nhom.js → ImageRenderer.stories-BVdd0zeh.js} +1 -1
  153. package/storybook-static/assets/{ImageView.stories-mSkR535R.js → ImageView.stories-DIQCaBWQ.js} +1 -1
  154. package/storybook-static/assets/{ImageViewer.stories-DVdR3-_j.js → ImageViewer.stories-CyYc6RrG.js} +2 -2
  155. package/storybook-static/assets/{ImageViewerRuntime-DiR_HwIE.js → ImageViewerRuntime-eZU4pDw8.js} +1 -1
  156. package/storybook-static/assets/{Input-DZQKV4DP.js → Input-DvVsbr8K.js} +1 -1
  157. package/storybook-static/assets/{Input-BdCavSu1.js → Input-VmS-QVKm.js} +1 -1
  158. package/storybook-static/assets/{Input.stories-Cu66SvKb.js → Input.stories-mATd9a0c.js} +1 -1
  159. package/storybook-static/assets/{InputDateTime-Day94W-O.js → InputDateTime-BSnv1V99.js} +1 -1
  160. package/storybook-static/assets/{InputDateTime.stories-990MuicZ.js → InputDateTime.stories-BHseZWJW.js} +1 -1
  161. package/storybook-static/assets/{InputFile-CJll5mC-.js → InputFile-Du6kJw8h.js} +1 -1
  162. package/storybook-static/assets/{InputFile-Cp8x84ZG.js → InputFile-YpStVIKr.js} +1 -1
  163. package/storybook-static/assets/{InputFile.stories-fNNwbNfa.js → InputFile.stories-B9bGCSU3.js} +1 -1
  164. package/storybook-static/assets/{InputFiles-OusF5Lfq.js → InputFiles-BNhs2jEI.js} +1 -1
  165. package/storybook-static/assets/{InputFiles-CBvR3Szf.js → InputFiles-PUk0s7uQ.js} +1 -1
  166. package/storybook-static/assets/{InputFiles.stories-DcpEbOOo.js → InputFiles.stories-CxVfsYaA.js} +1 -1
  167. package/storybook-static/assets/{InputFilesList-zuNP1QIB.js → InputFilesList-_rwKzQPQ.js} +1 -1
  168. package/storybook-static/assets/{InputImage-CjMAL3uq.js → InputImage-Trwkv0rb.js} +1 -1
  169. package/storybook-static/assets/{InputImage-Dl2bJNZk.js → InputImage-XAl4ina5.js} +1 -1
  170. package/storybook-static/assets/{InputImage.stories-BzxEndIe.js → InputImage.stories-Dddz-oRL.js} +1 -1
  171. package/storybook-static/assets/{InteractiveComponents.stories-CXF1nGLl.js → InteractiveComponents.stories-BZZTxt_C.js} +1 -1
  172. package/storybook-static/assets/{LayoutPicker-DzAN3gGO.js → LayoutPicker-BzGJmYT0.js} +1 -1
  173. package/storybook-static/assets/{LayoutPicker-BahcFBzK.js → LayoutPicker-z5o3xDMb.js} +1 -1
  174. package/storybook-static/assets/{LayoutPicker.stories-ByamaGlv.js → LayoutPicker.stories-Du2gCRWE.js} +1 -1
  175. package/storybook-static/assets/{Listbox-C5hwzE4s.js → Listbox-C4QRr_MP.js} +1 -1
  176. package/storybook-static/assets/{Listbox-CHsNGsDc.js → Listbox-DuZWJ8ZZ.js} +1 -1
  177. package/storybook-static/assets/{Listbox.stories-CvXZeESb.js → Listbox.stories-Y-8RgXM_.js} +1 -1
  178. package/storybook-static/assets/{Modal-Dib11Lzy.js → Modal-D9Zfvpww.js} +1 -1
  179. package/storybook-static/assets/{Modal.stories-DYMy-kLP.js → Modal.stories-BnFP5Zrr.js} +1 -1
  180. package/storybook-static/assets/{ModalManagerProvider-BL_cTIW7.css → ModalManagerProvider-C5bd7SFD.css} +1 -1
  181. package/storybook-static/assets/{ModalManagerProvider-natWXnSM.js → ModalManagerProvider-Duey-HBY.js} +1 -1
  182. package/storybook-static/assets/{MultiSelect-DlCZ7dhH.js → MultiSelect-BeQ2iAxN.js} +1 -1
  183. package/storybook-static/assets/{MultiSelect-Cl9MkPZw.js → MultiSelect-BhMW5jH5.js} +1 -1
  184. package/storybook-static/assets/{MultiSelect.stories-202TRBKq.js → MultiSelect.stories-Cayi9A_V.js} +1 -1
  185. package/storybook-static/assets/{NoData-DcHZdLTJ.js → NoData-CeHT8LTg.js} +1 -1
  186. package/storybook-static/assets/{NotificationsHost-DzqEi2vc.js → NotificationsHost-_4XSnTo2.js} +1 -1
  187. package/storybook-static/assets/{NotificationsHost.stories-CvoQfIjj.js → NotificationsHost.stories-C-2ucbpq.js} +1 -1
  188. package/storybook-static/assets/{ODataMultiSelect-CHQguikm.js → ODataMultiSelect-DILkVUzB.js} +1 -1
  189. package/storybook-static/assets/{ODataMultiSelect.stories-BZbWK4CP.js → ODataMultiSelect.stories-odWzDl6l.js} +1 -1
  190. package/storybook-static/assets/{ODataSelect-C1YGDpg_.js → ODataSelect-BUAhfvPU.js} +1 -1
  191. package/storybook-static/assets/{ODataSelect.stories-D4tQXs2c.js → ODataSelect.stories-PpNPmCz2.js} +1 -1
  192. package/storybook-static/assets/{ODataTreeMultiSelect-BjR7zhyJ.js → ODataTreeMultiSelect-BH7nIL9w.js} +1 -1
  193. package/storybook-static/assets/{ODataTreeMultiSelect.stories-Drg8mLhi.js → ODataTreeMultiSelect.stories-C4zOROB1.js} +1 -1
  194. package/storybook-static/assets/{ODataTreeSelect-D_fcT3Aw.js → ODataTreeSelect-CkJq3807.js} +1 -1
  195. package/storybook-static/assets/{ODataTreeSelect.stories-BWFdmmvf.js → ODataTreeSelect.stories-BcbRGbmJ.js} +1 -1
  196. package/storybook-static/assets/{OneStepScroller-DWCRXFHq.js → OneStepScroller-BGIjsObI.js} +1 -1
  197. package/storybook-static/assets/{PeriodSelect-DtfTzrNK.js → PeriodSelect-BcG6A50F.js} +1 -1
  198. package/storybook-static/assets/{PeriodSelect-C7QQKxZ4.js → PeriodSelect-DvAMLr40.js} +1 -1
  199. package/storybook-static/assets/{PeriodSelect.stories-CF65LIHm.js → PeriodSelect.stories-DmvK-wEi.js} +1 -1
  200. package/storybook-static/assets/{PickerSelectionToolbar-D9atWyWj.js → PickerSelectionToolbar-Cas1QrbP.js} +1 -1
  201. package/storybook-static/assets/{PickerTriggerActions-C7WeaOKN.js → PickerTriggerActions-DUcQfADH.js} +1 -1
  202. package/storybook-static/assets/{Popover-CUJF-IMC.js → Popover-Dl9KlVW0.js} +1 -1
  203. package/storybook-static/assets/{Popover-DQJIeny_.js → Popover-mm3LuMCX.js} +1 -1
  204. package/storybook-static/assets/{Popover.stories-BON0z3PX.js → Popover.stories-BqlULHhR.js} +1 -1
  205. package/storybook-static/assets/{PresetRangeDateInput-D3_uzWzQ.js → PresetRangeDateInput-84a4mW00.js} +1 -1
  206. package/storybook-static/assets/{PresetRangeDateInput-DpA1KOCo.js → PresetRangeDateInput-Dp-RORYt.js} +1 -1
  207. package/storybook-static/assets/{PresetRangeDateInput.stories-CDDJDiei.js → PresetRangeDateInput.stories-Bw3dSWVM.js} +1 -1
  208. package/storybook-static/assets/{PresetSelect-DlV2eC-b.js → PresetSelect-DbMc37dQ.js} +1 -1
  209. package/storybook-static/assets/{RadioButton-BLyqp88m.js → RadioButton-Ceuq5i6x.js} +1 -1
  210. package/storybook-static/assets/{RadioButton-wkLEwRaH.js → RadioButton-DhaK8UUD.js} +1 -1
  211. package/storybook-static/assets/{RadioButton.stories-DS9RYBEJ.js → RadioButton.stories-S98_hDUl.js} +1 -1
  212. package/storybook-static/assets/{RadioGroup-CsWIje1J.js → RadioGroup-BqSOcKQI.js} +1 -1
  213. package/storybook-static/assets/{RadioGroup-DERcyzA0.js → RadioGroup-Di55rXi_.js} +1 -1
  214. package/storybook-static/assets/{RadioGroup.stories-DkgUPavS.js → RadioGroup.stories-7RFD3uHM.js} +1 -1
  215. package/storybook-static/assets/{Scrollable-DvJ3T3Ik.js → Scrollable-B0p5mrx8.js} +1 -1
  216. package/storybook-static/assets/Select-BS9Its_r.js +12 -0
  217. package/storybook-static/assets/{Select-DmEm2boi.js → Select-CIqhX4mK.js} +1 -1
  218. package/storybook-static/assets/{Select.stories-BEPJovVd.js → Select.stories-DNhv8-zb.js} +1 -1
  219. package/storybook-static/assets/{SelectOptionContent-B5E2W8PZ.js → SelectOptionContent-DXq8ymaG.js} +1 -1
  220. package/storybook-static/assets/{SerializableSelect-wgzDfqEi.js → SerializableSelect-Wq154MOD.js} +1 -1
  221. package/storybook-static/assets/{SerializableSelect.stories-V8IqyO9Y.js → SerializableSelect.stories-5sc1J9RV.js} +1 -1
  222. package/storybook-static/assets/{SingleDateTimeInput-B7v0t9f5.js → SingleDateTimeInput-Bkv6gIle.js} +1 -1
  223. package/storybook-static/assets/SingleDateTimeInput-D7sbOu36.js +1 -0
  224. package/storybook-static/assets/{SingleDateTimeInput.stories-FOoEMoyF.js → SingleDateTimeInput.stories-DWWk1ufW.js} +1 -1
  225. package/storybook-static/assets/{Slider-24H5ASxG.js → Slider-BGsWuJAm.js} +1 -1
  226. package/storybook-static/assets/{Slider-3HQKHpoi.js → Slider-BxM1AhD9.js} +1 -1
  227. package/storybook-static/assets/{Slider.stories-DeeP8cmV.js → Slider.stories-VJI4Rnlr.js} +1 -1
  228. package/storybook-static/assets/{SliderInput-CFbx-GW7.js → SliderInput-CzLa4eqn.js} +1 -1
  229. package/storybook-static/assets/SliderInput-D4y-O8R2.js +2 -0
  230. package/storybook-static/assets/{SliderInput.stories-Djli653m.js → SliderInput.stories-g0Kwo7dl.js} +1 -1
  231. package/storybook-static/assets/{Sortable-CMo2PMKX.js → Sortable-CgA1YBUW.js} +1 -1
  232. package/storybook-static/assets/{Sortable.stories-BFsQvwMx.js → Sortable.stories-x3gePcSZ.js} +1 -1
  233. package/storybook-static/assets/{Splitter-dwOhGuIg.js → Splitter-BgFyt-RI.js} +1 -1
  234. package/storybook-static/assets/{Splitter.stories-DZ3nAxpo.js → Splitter.stories-CkN8ukyN.js} +1 -1
  235. package/storybook-static/assets/{StateSelect-j3gi4kbM.js → StateSelect-Ce4t44r8.js} +1 -1
  236. package/storybook-static/assets/{StateSelect-IigEzRom.js → StateSelect-DSuIDlz9.js} +1 -1
  237. package/storybook-static/assets/{StateSelect.stories-Bj-2m2hS.js → StateSelect.stories-BPomWgn7.js} +1 -1
  238. package/storybook-static/assets/{StringToggle.stories-ClSl76ts.js → StringToggle.stories-CnMi5EAT.js} +1 -1
  239. package/storybook-static/assets/{Switch-C9OAPzUM.js → Switch-DDCJrhcQ.js} +1 -1
  240. package/storybook-static/assets/{Switch-BDbBZjMA.js → Switch-OWLmHmHZ.js} +1 -1
  241. package/storybook-static/assets/{Switch.stories-CQ3ueThx.js → Switch.stories-BDu-Afks.js} +1 -1
  242. package/storybook-static/assets/{Table-BbGcLQ81.js → Table-DZg-HjgT.js} +1 -1
  243. package/storybook-static/assets/{Table.stories-DvaHP59R.js → Table.stories-C1tWXfqI.js} +1 -1
  244. package/storybook-static/assets/{Tabs-CNEYvzUv.js → Tabs-DRfMQ8Jx.js} +1 -1
  245. package/storybook-static/assets/{Tabs.stories-BpyQokl8.js → Tabs.stories-Dgdc1lZD.js} +1 -1
  246. package/storybook-static/assets/TabsBox-B5ugO318.css +1 -0
  247. package/storybook-static/assets/{TabsBox-ClZCbgKB.js → TabsBox-DljUVTsd.js} +1 -1
  248. package/storybook-static/assets/{TagInput-DorsSF_V.js → TagInput-BCS6WLcW.js} +1 -1
  249. package/storybook-static/assets/{TagInput.stories-ChgRz4Co.js → TagInput.stories-Dy5AVzAj.js} +1 -1
  250. package/storybook-static/assets/{Text-DUqtop-c.js → Text-C4TWqy0Q.js} +1 -1
  251. package/storybook-static/assets/{Textarea-ZfZJmHsp.js → Textarea-5Gx2U0_d.js} +1 -1
  252. package/storybook-static/assets/{Textarea-yZWv6QdW.js → Textarea-BZrJEPN7.js} +1 -1
  253. package/storybook-static/assets/{Textarea.stories-B5Q7syxH.js → Textarea.stories-BvdLNmb_.js} +1 -1
  254. package/storybook-static/assets/{TimePanel-C39f__j8.js → TimePanel-D3QC0eS8.js} +1 -1
  255. package/storybook-static/assets/{TimePanel.stories-DtjILTPk.js → TimePanel.stories-BZOB234n.js} +1 -1
  256. package/storybook-static/assets/{Toggle-CdpPJI_O.js → Toggle-BpzUjB13.js} +1 -1
  257. package/storybook-static/assets/{Toggle-BndjhQFY.js → Toggle-DarFnpF4.js} +1 -1
  258. package/storybook-static/assets/{Toggle.stories-BD_C0YTw.js → Toggle.stories-DyPUelGH.js} +1 -1
  259. package/storybook-static/assets/{TreeMultiSelect--M1WiE_f.js → TreeMultiSelect-DNjTWvVq.js} +1 -1
  260. package/storybook-static/assets/{TreeMultiSelect-BPz5kISi.js → TreeMultiSelect-DqpIhAuh.js} +1 -1
  261. package/storybook-static/assets/{TreeMultiSelect.stories-BgkDJur9.js → TreeMultiSelect.stories-Uc9jwEfE.js} +1 -1
  262. package/storybook-static/assets/TreePickerBase-BRKipsrA.js +22 -0
  263. package/storybook-static/assets/{TreeSelect-B0RWsDT4.js → TreeSelect-Bp1Zik9B.js} +1 -1
  264. package/storybook-static/assets/{TreeSelect-BrQGgG40.js → TreeSelect-CrLx5V7M.js} +1 -1
  265. package/storybook-static/assets/{TreeSelect.stories-DkgdJ5XX.js → TreeSelect.stories-RlHKzmuz.js} +1 -1
  266. package/storybook-static/assets/{TreeTable-HQr8pb9r.js → TreeTable-DhQ6u1Pe.js} +1 -1
  267. package/storybook-static/assets/{TreeTable.stories-C4hcph6x.js → TreeTable.stories-CAs-UAM0.js} +1 -1
  268. package/storybook-static/assets/{async-lzSWdC34.js → async-B2DliTcn.js} +1 -1
  269. package/storybook-static/assets/{blocks-D8l_hmHU.js → blocks-CGuhQMXa.js} +3 -3
  270. package/storybook-static/assets/{browserAndReact-BwvRFhzI.js → browserAndReact-C-OypV8y.js} +1 -1
  271. package/storybook-static/assets/{check-DpX8PMs_.js → check-Bw0XnpCV.js} +1 -1
  272. package/storybook-static/assets/{chevron-down-DE8FRR-h.js → chevron-down-CfrX73tO.js} +1 -1
  273. package/storybook-static/assets/{chevron-left-Cy3TEG_Y.js → chevron-left-DpeXiQaY.js} +1 -1
  274. package/storybook-static/assets/{chevron-right-CZ4-4s1X.js → chevron-right-BFJM6q51.js} +1 -1
  275. package/storybook-static/assets/{chunk-W22LQPXL-Ci-XApFb.js → chunk-W22LQPXL-Bt3_v9HM.js} +1 -1
  276. package/storybook-static/assets/{circle-alert-CWbgc3Jn.js → circle-alert-y52RJRUz.js} +1 -1
  277. package/storybook-static/assets/{circle-check-DODquDnH.js → circle-check-D-VabHaY.js} +1 -1
  278. package/storybook-static/assets/{components-BdUOCBP9.js → components-I69uHPsH.js} +3 -3
  279. package/storybook-static/assets/{contextMenu-XvvXJEpW.js → contextMenu-DfPU9cBt.js} +1 -1
  280. package/storybook-static/assets/defaultRenderers-Bkg6olnb.js +1 -0
  281. package/storybook-static/assets/{download-BEGaHxQc.js → download-CtH__7oe.js} +1 -1
  282. package/storybook-static/assets/{filesAndExcel-C9FnZv9P.js → filesAndExcel-BkVmFKKv.js} +1 -1
  283. package/storybook-static/assets/{floating-ui.react-GziJy4gA.js → floating-ui.react-CxI0EsOT.js} +1 -1
  284. package/storybook-static/assets/{formatters-CVj-3Vn0-C5-BLq9O.js → formatters-CVj-3Vn0-BFaHJqZL.js} +1 -1
  285. package/storybook-static/assets/{formatters-vWial7jf.js → formatters-D37vYORi.js} +1 -1
  286. package/storybook-static/assets/{formatters-runtime-DO0szrYr.js → formatters-runtime-D3X8TbPs.js} +1 -1
  287. package/storybook-static/assets/{foundationLib-CIqc9fhG.js → foundationLib-DozGtKQB.js} +1 -1
  288. package/storybook-static/assets/{hooks-DfgvMSqN.js → hooks-Df19Nsi2.js} +1 -1
  289. package/storybook-static/assets/{iframe-BHhbrImE.js → iframe-BQrLcg06.js} +3 -3
  290. package/storybook-static/assets/iframe-lJqBcWzL.js +1 -0
  291. package/storybook-static/assets/{info-DSZ4aUvi.js → info-BeGxRQvx.js} +1 -1
  292. package/storybook-static/assets/{odata-DmijE2H9.js → odata-BDmwSB0b.js} +1 -1
  293. package/storybook-static/assets/odata-service-B5w4YBao-BW9QLSrS.js +3 -0
  294. package/storybook-static/assets/{odataAndTables-m2AMS6oI.js → odataAndTables-CdiAn8YJ.js} +1 -1
  295. package/storybook-static/assets/{odataFetchFn-CwpkgKoz.js → odataFetchFn-B4sQvu6J.js} +1 -1
  296. package/storybook-static/assets/{odataStoryFixtures-CBtJYQsv.js → odataStoryFixtures-DJ_pv2Rq.js} +1 -1
  297. package/storybook-static/assets/{persisted-DpSU25AR.js → persisted-Cryvs_Te.js} +1 -1
  298. package/storybook-static/assets/{pureUtilities-BG4ZSO63.js → pureUtilities-YEJFcbIT.js} +1 -1
  299. package/storybook-static/assets/{react-Bz35HWpn.js → react-D5HGS0WP.js} +1 -1
  300. package/storybook-static/assets/{refresh-cw-ltgf4cUB.js → refresh-cw-BtYtkXmi.js} +1 -1
  301. package/storybook-static/assets/{runtimeAndState-C_GrWjr8.js → runtimeAndState-Bc0p1zM-.js} +1 -1
  302. package/storybook-static/assets/{settings-2-qpVYfZn_.js → settings-2-BTaug5uU.js} +1 -1
  303. package/storybook-static/assets/{sortable-CrCQ3H1V.js → sortable-CV5Mg3jp.js} +1 -1
  304. package/storybook-static/assets/{syntaxhighlighter-T5IQBZDB-eOr9ght-.js → syntaxhighlighter-T5IQBZDB-CyWSuE24.js} +1 -1
  305. package/storybook-static/assets/{trash-2-lfhUDclN.js → trash-2-Bcxa3Ezm.js} +1 -1
  306. package/storybook-static/assets/{triangle-alert-D9YGTafY.js → triangle-alert-Cy0xZ6CK.js} +1 -1
  307. package/storybook-static/assets/{useODataSelectBase-BVgxJPNn.js → useODataSelectBase-rnvEwUEf.js} +1 -1
  308. package/storybook-static/assets/{useODataTreeData-CdLHOBnD.js → useODataTreeData-DFL7fNez.js} +1 -1
  309. package/storybook-static/assets/{usePickerQuery-B6U-oOS6.js → usePickerQuery-BpbIXzlf.js} +1 -1
  310. package/storybook-static/assets/{usePickerTriggerController-C-VxrzSe.js → usePickerTriggerController-CLjquchr.js} +1 -1
  311. package/storybook-static/assets/{x-CNM39xuu.js → x-CTu2RxD8.js} +1 -1
  312. package/storybook-static/iframe.html +2 -2
  313. package/storybook-static/project.json +1 -1
  314. package/dist/chunks/CalendarView-DtacoN_c.js +0 -439
  315. package/dist/chunks/TextEditorLexicalClient-DVML-Nhd.js.map +0 -1
  316. package/dist/chunks/context-menu-BY4pYGwB.js.map +0 -1
  317. package/dist/chunks/date-input-DKkJO_-h.js +0 -340
  318. package/dist/chunks/date-input-DKkJO_-h.js.map +0 -1
  319. package/dist/chunks/input-BWCaVC06.js.map +0 -1
  320. package/dist/chunks/multi-select-01xmD1nZ.js.map +0 -1
  321. package/dist/chunks/select-DRf4_a1Z.js.map +0 -1
  322. package/storybook-static/assets/CheckBox-8XczNrjq.css +0 -1
  323. package/storybook-static/assets/ContextMenu-BjWu5DHB.js +0 -1
  324. package/storybook-static/assets/DateInput-BUgBb3aH.js +0 -1
  325. package/storybook-static/assets/Select-g0c0XGQY.js +0 -12
  326. package/storybook-static/assets/SingleDateTimeInput-CN7PyOsb.js +0 -1
  327. package/storybook-static/assets/SliderInput-bqFr-Lyp.js +0 -2
  328. package/storybook-static/assets/TabsBox-Co1vxD90.css +0 -1
  329. package/storybook-static/assets/TreePickerBase-Dup03AiC.js +0 -22
  330. package/storybook-static/assets/defaultRenderers-lMEgLPIU.js +0 -1
  331. package/storybook-static/assets/iframe-oIP1aL7X.js +0 -1
  332. package/storybook-static/assets/odata-service-B5w4YBao-BcP2cvfZ.js +0 -3
  333. /package/storybook-static/assets/{CheckBox.module-DPvJxTHD.js → CheckBox.module-CM_GPl_E.js} +0 -0
@@ -1,5 +1,5 @@
1
1
  import { t as e } from "./ui.module-BfaIVBba.js";
2
- import { useEffect as t, useEffectEvent as n, useId as r, useState as i } from "react";
2
+ import { useId as t, useLayoutEffect as n, useRef as r, useState as i } from "react";
3
3
  import { cn as a } from "@ryuzaki13/react-foundation-lib/utils";
4
4
  import { XIcon as o } from "lucide-react";
5
5
  import { jsx as s, jsxs as c } from "react/jsx-runtime";
@@ -16,8 +16,8 @@ var u = {
16
16
  };
17
17
  //#endregion
18
18
  //#region src/input/lib/useInputFieldIds.ts
19
- function d({ id: e, hasLabel: t, hasDescription: n, hasError: i }) {
20
- let a = r(), o = e ?? a, s = t ? `${o}-label` : void 0, c = n ? `${o}-description` : void 0, l = i ? `${o}-error` : void 0;
19
+ function d({ id: e, hasLabel: n, hasDescription: r, hasError: i }) {
20
+ let a = t(), o = e ?? a, s = n ? `${o}-label` : void 0, c = r ? `${o}-description` : void 0, l = i ? `${o}-error` : void 0;
21
21
  return {
22
22
  controlId: o,
23
23
  labelId: s,
@@ -167,55 +167,62 @@ function y({ label: t, description: n, disabled: r, className: o, onClear: c, er
167
167
  })
168
168
  });
169
169
  }
170
- function b({ label: r, description: o, disabled: c, className: f, onClear: p, error: g, onClearError: y, onChange: b, value: x, size: S, endAdornment: C, endAdornmentClassName: w, endAdornmentWidth: T, ...E }) {
171
- let D = E, { controlId: O, labelId: k, descriptionId: A, errorId: j, describedBy: M } = d({
172
- id: E.id,
173
- hasLabel: r != null,
174
- hasDescription: !!o,
175
- hasError: !!g
176
- }), [N, P] = i(() => String(x)), F = n((e) => {
177
- P(e);
178
- });
179
- t(() => {
180
- F(x !== void 0 && typeof x == "number" && !isNaN(x) ? String(x) : "");
181
- }, [x]);
182
- let I = p ? () => {
183
- P(""), p();
184
- } : void 0, L = (e) => {
185
- let t = e.target.value;
186
- P(t), b(l(t)), g && y && y();
187
- }, R = v({
188
- endAdornment: C,
189
- onClear: I,
190
- disabled: c
191
- }), z = _(C != null, !!I, T);
170
+ function b({ label: t, description: i, disabled: o, className: c, onClear: f, error: p, onClearError: g, onChange: y, value: b, size: x, endAdornment: S, endAdornmentClassName: C, endAdornmentWidth: w, ...T }) {
171
+ let E = T, { controlId: D, labelId: O, descriptionId: k, errorId: A, describedBy: j } = d({
172
+ id: T.id,
173
+ hasLabel: t != null,
174
+ hasDescription: !!i,
175
+ hasError: !!p
176
+ }), M = r(null), N = r(null), P = b !== void 0 && typeof b == "number" && !isNaN(b) ? String(b) : "";
177
+ n(() => {
178
+ let e = N.current;
179
+ if (e && Object.is(e.value, b)) {
180
+ M.current && M.current.value !== e.raw && (M.current.value = e.raw);
181
+ return;
182
+ }
183
+ N.current = null, M.current && M.current.value !== P && (M.current.value = P);
184
+ }, [P, b]);
185
+ let F = f ? () => {
186
+ f();
187
+ } : void 0, I = (e) => {
188
+ let t = e.target.value, n = l(t);
189
+ N.current = {
190
+ value: n,
191
+ raw: t
192
+ }, y(n), p && g && g();
193
+ }, L = v({
194
+ endAdornment: S,
195
+ onClear: F,
196
+ disabled: o
197
+ }), R = _(S != null, !!F, w);
192
198
  return /* @__PURE__ */ s(m, {
193
- label: r,
194
- description: o,
195
- disabled: c,
196
- required: E.required,
197
- className: f,
198
- size: S,
199
- error: g,
200
- controlId: O,
201
- labelId: k,
202
- descriptionId: A,
203
- errorId: j,
199
+ label: t,
200
+ description: i,
201
+ disabled: o,
202
+ required: T.required,
203
+ className: c,
204
+ size: x,
205
+ error: p,
206
+ controlId: D,
207
+ labelId: O,
208
+ descriptionId: k,
209
+ errorId: A,
204
210
  children: /* @__PURE__ */ s(h, {
205
- endAdornment: R,
206
- endAdornmentClassName: w,
207
- endAdornmentWidth: z,
211
+ endAdornment: L,
212
+ endAdornmentClassName: C,
213
+ endAdornmentWidth: R,
208
214
  children: ({ controlClassName: t }) => /* @__PURE__ */ s("input", {
209
- ...D,
210
- id: O,
215
+ ...E,
216
+ ref: M,
217
+ id: D,
211
218
  type: "number",
212
219
  inputMode: "decimal",
213
- disabled: c,
214
- value: N,
215
- "aria-labelledby": k,
216
- "aria-describedby": M,
220
+ disabled: o,
221
+ defaultValue: P,
222
+ "aria-labelledby": O,
223
+ "aria-describedby": j,
217
224
  className: a(e.uiInputControl, u.input, u.inputNumber, t),
218
- onChange: L
225
+ onChange: I
219
226
  })
220
227
  })
221
228
  });
@@ -232,4 +239,4 @@ function S({ text: t }) {
232
239
  //#endregion
233
240
  export { b as a, p as c, h as i, d as l, x as n, y as o, g as r, m as s, S as t, u };
234
241
 
235
- //# sourceMappingURL=input-BWCaVC06.js.map
242
+ //# sourceMappingURL=input-CAw1Loze.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"input-CAw1Loze.js","names":[],"sources":["../../src/input/Input.module.scss","../../src/input/lib/useInputFieldIds.ts","../../src/input/Input.tsx","../../src/input/InputErrorComponent.tsx"],"sourcesContent":["@use \"@/styles/mixins\" as *;\n\n.controlLayout {\n\tposition: relative;\n\twidth: 100%;\n}\n\n.input {\n\theight: var(--control-height);\n\twidth: 100%;\n\tpadding: var(--space-xs) var(--space-sm);\n\tfont-size: var(--font-size-md);\n\n\t--ui-color: var(--content-0);\n\t--ui-color-hover: var(--content-0);\n\t--ui-color-active: var(--content-0);\n\n\t--button-size: cacl(var(--control-height) - var(--border-width) * 2);\n}\n\n.inputNumber {\n\tappearance: textfield;\n\t-moz-appearance: textfield;\n\n\t&::-webkit-inner-spin-button,\n\t&::-webkit-outer-spin-button {\n\t\t-webkit-appearance: none;\n\t\tmargin: 0;\n\t}\n}\n\n.controlWithEndAdornment {\n\tpadding-right: calc(var(--input-end-adornment-width, var(--control-height)) + var(--space-sm));\n}\n\n.controlEndAdornment {\n\tposition: absolute;\n\theight: 100%;\n\ttop: 0;\n\tright: calc(var(--border-width) * 2);\n\tdisplay: flex;\n\talign-items: center;\n\tjustify-content: flex-end;\n\tmax-width: calc(100% - var(--space-md));\n}\n\n.endAdornmentGroup {\n\tdisplay: flex;\n\talign-items: center;\n\tgap: var(--space-xs);\n}\n\n.clearButton {\n\twidth: var(--button-size);\n\theight: var(--button-size);\n\tdisplay: flex;\n\talign-items: center;\n\tjustify-content: center;\n\tborder: none;\n\tborder-radius: var(--radius-sm);\n\n\tbackground: transparent;\n\tcolor: var(--content-2);\n\n\ttransition:\n\t\tcolor var(--transition-fast) ease,\n\t\tbackground-color var(--transition-fast) ease;\n\n\t&:hover {\n\t\tcolor: var(--content-accent);\n\t}\n\n\t&:focus-visible {\n\t\t@include focusVisible;\n\t}\n\n\t&:disabled {\n\t\tpointer-events: none;\n\t\topacity: var(--disabled-opacity);\n\t}\n}\n\n.error {\n\tposition: absolute;\n\tz-index: 11;\n\tbottom: calc(var(--space-xs) * -1);\n\tleft: 0;\n\tright: 0;\n\ttransform: translateY(100%);\n\t// font-size: var(--font-size-sm);\n\tcolor: var(--status-error-on-fill);\n\tbackground: var(--status-error-fill);\n\tborder-radius: var(--radius-sm);\n\tpadding: var(--space-xs) var(--space-sm);\n\tbox-shadow: var(--shadow-sm);\n\topacity: 0.9;\n}\n","import { useId } from \"react\";\n\nexport interface UseInputFieldIdsOptions {\n\tid?: string;\n\thasLabel?: boolean;\n\thasDescription?: boolean;\n\thasError?: boolean;\n}\n\nexport interface InputFieldIds {\n\tcontrolId: string;\n\tlabelId?: string;\n\tdescriptionId?: string;\n\terrorId?: string;\n\tdescribedBy?: string;\n}\n\nexport function useInputFieldIds({ id: externalId, hasLabel, hasDescription, hasError }: UseInputFieldIdsOptions): InputFieldIds {\n\tconst autoId = useId();\n\tconst controlId = externalId ?? autoId;\n\tconst labelId = hasLabel ? `${controlId}-label` : undefined;\n\tconst descriptionId = hasDescription ? `${controlId}-description` : undefined;\n\tconst errorId = hasError ? `${controlId}-error` : undefined;\n\tconst describedBy = [descriptionId, errorId].filter(Boolean).join(\" \") || undefined;\n\n\treturn {\n\t\tcontrolId,\n\t\tlabelId,\n\t\tdescriptionId,\n\t\terrorId,\n\t\tdescribedBy\n\t};\n}\n","import React, { CSSProperties, InputHTMLAttributes, ReactNode, useLayoutEffect, useRef, useState } from \"react\";\n\nimport { toFiniteNumber } from \"@ryuzaki13/react-foundation-lib/formatters\";\nimport { cn } from \"@ryuzaki13/react-foundation-lib/utils\";\nimport { XIcon } from \"lucide-react\";\n\nimport { UiBaseProps, UiSize } from \"../types\";\nimport uiStyles from \"../ui.module.scss\";\n\nimport styles from \"./Input.module.scss\";\nimport { useInputFieldIds } from \"./lib/useInputFieldIds\";\n\nexport interface InputUIProps extends Omit<UiBaseProps<never>, \"value\" | \"onChange\"> {\n\tclassName?: string;\n\terror?: string;\n\tcontrolId?: string;\n\tlabelId?: string;\n\tdescriptionId?: string;\n\terrorId?: string;\n\trequired?: boolean;\n\tchildren: React.ReactNode;\n}\n\nexport interface InputControlRenderProps {\n\tcontrolClassName?: string;\n}\n\nexport interface InputControlProps {\n\tclassName?: string;\n\tendAdornment?: ReactNode;\n\tendAdornmentClassName?: string;\n\tendAdornmentWidth?: string;\n\tchildren: (props: InputControlRenderProps) => ReactNode;\n}\n\nexport interface InputClearButtonProps {\n\tonClick?: () => void;\n\tdisabled?: boolean;\n\tclassName?: string;\n\tariaLabel?: string;\n}\n\nfunction InputLabel({ label, controlId, labelId }: { label: React.ReactNode; controlId?: string; labelId?: string }) {\n\treturn (\n\t\t<label id={labelId} htmlFor={controlId} className={uiStyles.uiLabel}>\n\t\t\t{label}\n\t\t</label>\n\t);\n}\n\nexport function InputUILoading({\n\tlabel,\n\tdescription,\n\tsize,\n\tdisabled,\n\tclassName\n}: Pick<InputUIProps, \"label\" | \"description\" | \"size\" | \"disabled\" | \"className\">) {\n\tconst { controlId, labelId, descriptionId } = useInputFieldIds({\n\t\thasLabel: label !== undefined && label !== null,\n\t\thasDescription: !!description\n\t});\n\n\treturn (\n\t\t<div\n\t\t\tclassName={cn(uiStyles.uiElement, uiStyles.uiSizable, size && uiStyles[size as UiSize], uiStyles.disabled, className)}\n\t\t\taria-disabled={disabled || undefined}>\n\t\t\t{label && <InputLabel label={label} controlId={controlId} labelId={labelId} />}\n\t\t\t{description && (\n\t\t\t\t<p id={descriptionId} className={uiStyles.uiDescription}>\n\t\t\t\t\t{description}\n\t\t\t\t</p>\n\t\t\t)}\n\t\t\t<div className={cn(uiStyles.uiInputControlFake, \"skeletonLine\")} />\n\t\t</div>\n\t);\n}\n\n/**\n * Низкоуровневая оболочка поля ввода с общими элементами оформления.\n */\nexport function InputUI({\n\tlabel,\n\tdescription,\n\tdisabled,\n\tclassName,\n\terror,\n\tsize,\n\tcontrolId,\n\tlabelId,\n\tdescriptionId,\n\terrorId,\n\trequired,\n\tchildren\n}: InputUIProps) {\n\treturn (\n\t\t<div\n\t\t\tclassName={cn(\n\t\t\t\tuiStyles.uiElement,\n\t\t\t\tuiStyles.uiSizable,\n\t\t\t\tsize && uiStyles[size as UiSize],\n\t\t\t\tdisabled && uiStyles.disabled,\n\t\t\t\trequired && uiStyles.required,\n\t\t\t\tclassName\n\t\t\t)}\n\t\t\taria-disabled={disabled || undefined}>\n\t\t\t{label && <InputLabel label={label} controlId={controlId} labelId={labelId} />}\n\t\t\t{description && (\n\t\t\t\t<p id={descriptionId} className={uiStyles.uiDescription}>\n\t\t\t\t\t{description}\n\t\t\t\t</p>\n\t\t\t)}\n\t\t\t<div className={styles.controlLayout}>\n\t\t\t\t{children}\n\n\t\t\t\t{error && (\n\t\t\t\t\t<p id={errorId} className={styles.error} role=\"alert\">\n\t\t\t\t\t\t{error}\n\t\t\t\t\t</p>\n\t\t\t\t)}\n\t\t\t</div>\n\t\t</div>\n\t);\n}\n\nexport function InputControl({ className, endAdornment, endAdornmentClassName, endAdornmentWidth, children }: InputControlProps) {\n\tconst hasEndAdornment = endAdornment !== undefined && endAdornment !== null;\n\tconst style =\n\t\thasEndAdornment && endAdornmentWidth ? ({ \"--input-end-adornment-width\": endAdornmentWidth } as CSSProperties) : undefined;\n\n\treturn (\n\t\t<div className={cn(styles.controlLayout, className)} style={style}>\n\t\t\t{children({ controlClassName: hasEndAdornment ? styles.controlWithEndAdornment : undefined })}\n\t\t\t{hasEndAdornment && <div className={cn(styles.controlEndAdornment, endAdornmentClassName)}>{endAdornment}</div>}\n\t\t</div>\n\t);\n}\n\nexport function InputClearButton({ onClick, disabled, className, ariaLabel = \"Очистить значение\" }: InputClearButtonProps) {\n\treturn (\n\t\t<button\n\t\t\ttype=\"button\"\n\t\t\tdisabled={disabled || !onClick}\n\t\t\tclassName={cn(styles.clearButton, className)}\n\t\t\tonClick={onClick}\n\t\t\taria-label={ariaLabel}>\n\t\t\t<XIcon />\n\t\t</button>\n\t);\n}\n\nfunction resolveEndAdornmentWidth(hasAdornment: boolean, hasClearAction: boolean, explicitWidth?: string) {\n\tif (explicitWidth) {\n\t\treturn explicitWidth;\n\t}\n\n\tif (hasAdornment && hasClearAction) {\n\t\treturn \"calc((var(--control-height) * 2) + var(--space-xs))\";\n\t}\n\n\tif (hasAdornment || hasClearAction) {\n\t\treturn \"var(--control-height)\";\n\t}\n\n\treturn undefined;\n}\n\nfunction createEndAdornment({ endAdornment, onClear, disabled }: { endAdornment?: ReactNode; onClear?: () => void; disabled?: boolean }) {\n\tif ((endAdornment === undefined || endAdornment === null) && !onClear) {\n\t\treturn undefined;\n\t}\n\n\treturn (\n\t\t<div className={styles.endAdornmentGroup}>\n\t\t\t{endAdornment}\n\t\t\t{onClear && <InputClearButton onClick={onClear} disabled={disabled} />}\n\t\t</div>\n\t);\n}\n\nexport interface BaseInputProps<T extends number | string | undefined, V = T>\n\textends Omit<InputHTMLAttributes<HTMLInputElement>, \"size\" | \"value\" | \"type\" | \"defaultValue\" | \"onChange\">, UiBaseProps<T, V> {\n\tonClear?: () => void;\n\terror?: string;\n\tonClearError?: () => void;\n\tdefaultValue?: T;\n\tendAdornment?: ReactNode;\n\tendAdornmentClassName?: string;\n\tendAdornmentWidth?: string;\n}\n\nexport interface InputTextProps extends BaseInputProps<string> {\n\ttype?: \"email\" | \"password\" | \"search\" | \"tel\" | \"text\" | \"url\";\n\n\t/**\n\t * Регулярное выражение для валидации всего введённого значения.\n\t * При несоответствии поле подсвечивается как невалидное, но текст не удаляется.\n\t * Пример: `/^\\d*$/`\n\t */\n\tallowedPattern?: RegExp;\n}\n\n/**\n * Базовое текстовое поле ввода для строковых значений.\n */\nexport function InputText({\n\tlabel,\n\tdescription,\n\tdisabled,\n\tclassName,\n\tonClear,\n\terror,\n\tonClearError,\n\tonChange,\n\tvalue,\n\tsize,\n\tallowedPattern,\n\tendAdornment,\n\tendAdornmentClassName,\n\tendAdornmentWidth,\n\ttype = \"text\",\n\t...props\n}: InputTextProps) {\n\tconst [internalInvalid, setInternalInvalid] = useState(false);\n\n\tconst handleInput = (e: React.ChangeEvent<HTMLInputElement>) => {\n\t\tconst newValue = e.target.value;\n\n\t\tif (allowedPattern !== undefined) {\n\t\t\tsetInternalInvalid(newValue !== \"\" && !allowedPattern.test(newValue));\n\t\t}\n\n\t\tonChange(newValue);\n\t\tif (error && onClearError) onClearError();\n\t};\n\n\tconst hasValue = Boolean(value && value.length > 0);\n\tconst visibleError = hasValue ? error : undefined;\n\tconst { controlId, labelId, descriptionId, errorId, describedBy } = useInputFieldIds({\n\t\tid: props.id,\n\t\thasLabel: label !== undefined && label !== null,\n\t\thasDescription: !!description,\n\t\thasError: !!visibleError\n\t});\n\tconst isInvalid = hasValue && (!!error || internalInvalid);\n\tconst resolvedEndAdornment = createEndAdornment({ endAdornment, onClear, disabled: disabled || !hasValue });\n\tconst hasCustomAdornment = endAdornment !== undefined && endAdornment !== null;\n\tconst resolvedEndAdornmentWidth = resolveEndAdornmentWidth(hasCustomAdornment, !!onClear, endAdornmentWidth);\n\n\treturn (\n\t\t<InputUI\n\t\t\tlabel={label}\n\t\t\tdescription={description}\n\t\t\tdisabled={disabled}\n\t\t\trequired={props.required}\n\t\t\tclassName={className}\n\t\t\tsize={size}\n\t\t\terror={visibleError}\n\t\t\tcontrolId={controlId}\n\t\t\tlabelId={labelId}\n\t\t\tdescriptionId={descriptionId}\n\t\t\terrorId={errorId}>\n\t\t\t<InputControl\n\t\t\t\tendAdornment={resolvedEndAdornment}\n\t\t\t\tendAdornmentClassName={endAdornmentClassName}\n\t\t\t\tendAdornmentWidth={resolvedEndAdornmentWidth}>\n\t\t\t\t{({ controlClassName }) => (\n\t\t\t\t\t<input\n\t\t\t\t\t\t{...props}\n\t\t\t\t\t\tid={controlId}\n\t\t\t\t\t\ttype={type}\n\t\t\t\t\t\tdisabled={disabled}\n\t\t\t\t\t\tvalue={value}\n\t\t\t\t\t\taria-invalid={isInvalid || undefined}\n\t\t\t\t\t\taria-labelledby={labelId}\n\t\t\t\t\t\taria-describedby={describedBy}\n\t\t\t\t\t\tdata-invalid={isInvalid ? \"\" : undefined}\n\t\t\t\t\t\tclassName={cn(uiStyles.uiInputControl, styles.input, controlClassName)}\n\t\t\t\t\t\tonChange={handleInput}\n\t\t\t\t\t/>\n\t\t\t\t)}\n\t\t\t</InputControl>\n\t\t</InputUI>\n\t);\n}\n\n/**\n * Числовое поле ввода с нормализацией значения и защитой от промежуточного невалидного ввода.\n */\nexport function InputNumber({\n\tlabel,\n\tdescription,\n\tdisabled,\n\tclassName,\n\tonClear,\n\terror,\n\tonClearError,\n\tonChange,\n\tvalue,\n\tsize,\n\tendAdornment,\n\tendAdornmentClassName,\n\tendAdornmentWidth,\n\t...props\n}: BaseInputProps<number | undefined>) {\n\tconst inputProps = props as InputHTMLAttributes<HTMLInputElement>;\n\tconst { controlId, labelId, descriptionId, errorId, describedBy } = useInputFieldIds({\n\t\tid: props.id,\n\t\thasLabel: label !== undefined && label !== null,\n\t\thasDescription: !!description,\n\t\thasError: !!error\n\t});\n\n\tconst inputRef = useRef<HTMLInputElement | null>(null);\n\tconst numberDraftRef = useRef<{ readonly value: number | undefined; readonly raw: string } | null>(null);\n\tconst externalRawValue = value !== undefined && typeof value === \"number\" && !isNaN(value) ? String(value) : \"\";\n\n\t/**\n\t * Числовой input хранит промежуточную строку в DOM, а controlled number остаётся\n\t * источником истины. Layout-effect синхронизирует именно внешнюю DOM-систему,\n\t * поэтому не создаёт каскадного React render и не ломает ввод неполных чисел.\n\t */\n\tuseLayoutEffect(() => {\n\t\tconst numberDraft = numberDraftRef.current;\n\t\tif (numberDraft && Object.is(numberDraft.value, value)) {\n\t\t\tif (inputRef.current && inputRef.current.value !== numberDraft.raw) {\n\t\t\t\tinputRef.current.value = numberDraft.raw;\n\t\t\t}\n\t\t\treturn;\n\t\t}\n\n\t\tnumberDraftRef.current = null;\n\t\tif (inputRef.current && inputRef.current.value !== externalRawValue) {\n\t\t\tinputRef.current.value = externalRawValue;\n\t\t}\n\t}, [externalRawValue, value]);\n\n\tconst handleClear = onClear\n\t\t? () => {\n\t\t\t\tonClear();\n\t\t\t}\n\t\t: undefined;\n\n\tconst handleInput = (e: React.ChangeEvent<HTMLInputElement>) => {\n\t\tconst raw = e.target.value;\n\n\t\tconst parsed = toFiniteNumber(raw); // ?? value ?? 0;\n\t\tnumberDraftRef.current = { value: parsed, raw };\n\n\t\tonChange(parsed);\n\t\tif (error && onClearError) onClearError();\n\t};\n\n\tconst resolvedEndAdornment = createEndAdornment({ endAdornment, onClear: handleClear, disabled });\n\tconst hasCustomAdornment = endAdornment !== undefined && endAdornment !== null;\n\tconst resolvedEndAdornmentWidth = resolveEndAdornmentWidth(hasCustomAdornment, !!handleClear, endAdornmentWidth);\n\n\treturn (\n\t\t<InputUI\n\t\t\tlabel={label}\n\t\t\tdescription={description}\n\t\t\tdisabled={disabled}\n\t\t\trequired={props.required}\n\t\t\tclassName={className}\n\t\t\tsize={size}\n\t\t\terror={error}\n\t\t\tcontrolId={controlId}\n\t\t\tlabelId={labelId}\n\t\t\tdescriptionId={descriptionId}\n\t\t\terrorId={errorId}>\n\t\t\t<InputControl\n\t\t\t\tendAdornment={resolvedEndAdornment}\n\t\t\t\tendAdornmentClassName={endAdornmentClassName}\n\t\t\t\tendAdornmentWidth={resolvedEndAdornmentWidth}>\n\t\t\t\t{({ controlClassName }) => (\n\t\t\t\t\t<input\n\t\t\t\t\t\t{...inputProps}\n\t\t\t\t\t\tref={inputRef}\n\t\t\t\t\t\tid={controlId}\n\t\t\t\t\t\ttype=\"number\"\n\t\t\t\t\t\tinputMode=\"decimal\"\n\t\t\t\t\t\tdisabled={disabled}\n\t\t\t\t\t\tdefaultValue={externalRawValue}\n\t\t\t\t\t\taria-labelledby={labelId}\n\t\t\t\t\t\taria-describedby={describedBy}\n\t\t\t\t\t\tclassName={cn(uiStyles.uiInputControl, styles.input, styles.inputNumber, controlClassName)}\n\t\t\t\t\t\tonChange={handleInput}\n\t\t\t\t\t/>\n\t\t\t\t)}\n\t\t\t</InputControl>\n\t\t</InputUI>\n\t);\n}\n\n/**\n * Совместимый алиас для `InputText`.\n */\nexport const Input = InputText;\n","import styles from \"../ui.module.scss\";\n\ninterface InputErrorComponentProps {\n\ttext: string;\n}\n\nexport function InputErrorComponent({ text }: InputErrorComponentProps) {\n\treturn <div className={styles.uiErrorElement}>{text}</div>;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;ACiBA,SAAgB,EAAiB,EAAE,IAAI,GAAY,aAAU,mBAAgB,eAAoD;CAChI,IAAM,IAAS,EAAM,GACf,IAAY,KAAc,GAC1B,IAAU,IAAW,GAAG,EAAU,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WAAW,EAAG,EAAS,gBAAgB,EAAO,OAAO,EAAO,aAAa,CAAgB;IACzF,UAAU;GACV,CAAA;EAEW,CAAA;CACN,CAAA;AAEX;AAKA,IAAa,IAAQ;;;ACtYrB,SAAgB,EAAoB,EAAE,WAAkC;CACvE,OAAO,kBAAC,OAAD;EAAK,WAAW,EAAO;EAAiB,UAAA;CAAU,CAAA;AAC1D"}
@@ -1,5 +1,5 @@
1
1
  import { t as e } from "./ui.module-BfaIVBba.js";
2
- import { i as t, l as n, s as r } from "./input-BWCaVC06.js";
2
+ import { i as t, l as n, s as r } from "./input-CAw1Loze.js";
3
3
  import { useCallback as i, useRef as a } from "react";
4
4
  import { cn as o, handleKeyboardActivation as s } from "@ryuzaki13/react-foundation-lib/utils";
5
5
  import { XIcon as c } from "lucide-react";
@@ -138,4 +138,4 @@ function _(c) {
138
138
  //#endregion
139
139
  export { g as n, _ as t };
140
140
 
141
- //# sourceMappingURL=input-files-62qH2TMj.js.map
141
+ //# sourceMappingURL=input-files-CLtQ7p8j.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"input-files-62qH2TMj.js","names":[],"sources":["../../src/input-files/InputFiles.module.scss","../../src/input-files/InputFilesList.tsx","../../src/input-files/InputFiles.tsx"],"sourcesContent":["/* Контрол, имитирующий внешний вид InputText */\n.control {\n\theight: var(--control-height);\n\twidth: 100%;\n\tpadding: 0 var(--space-sm);\n\tfont-size: var(--font-size-md);\n\tcursor: pointer;\n\n\tdisplay: flex;\n\talign-items: center;\n}\n\n/* Скрытый нативный input[type=\"file\"] */\n.hiddenInput {\n\tposition: absolute;\n\twidth: 0;\n\theight: 0;\n\topacity: 0;\n\toverflow: hidden;\n\tpointer-events: none;\n}\n\n/* Список выбранных файлов */\n.fileList {\n\tdisplay: flex;\n\tflex-direction: column;\n\tgap: var(--space-xs);\n\tmargin-top: var(--space-xs);\n}\n\n/* Элемент списка — строка с именем файла и кнопкой удаления */\n.fileItem {\n\tdisplay: flex;\n\talign-items: center;\n\tgap: var(--space-xs);\n\tpadding: var(--space-xs) var(--space-sm);\n\tbackground-color: var(--surface-2);\n\tborder-radius: var(--radius-sm);\n\t// font-size: var(--font-size-sm);\n}\n\n/* Имя файла — обрезка с троеточием */\n.fileItemName {\n\tflex: 1;\n\toverflow: hidden;\n\ttext-overflow: ellipsis;\n\twhite-space: nowrap;\n}\n\n/* Кнопка удаления файла из списка */\n.removeButton {\n\tflex-shrink: 0;\n\twidth: 1.25em;\n\theight: 1.25em;\n\tcolor: var(--content-2);\n\n\t&:hover {\n\t\tcolor: var(--content-accent);\n\t}\n}\n","import { useCallback } from \"react\";\n\nimport { ReadFileResult } from \"@ryuzaki13/react-foundation-lib/file\";\nimport { cn } from \"@ryuzaki13/react-foundation-lib/utils\";\nimport { XIcon } from \"lucide-react\";\n\nimport styles from \"./InputFiles.module.scss\";\n\ninterface InputFilesListProps<TFile extends ReadFileResult> {\n\tfiles: TFile[];\n\tonChange: (files: TFile[]) => void;\n}\n\nexport function InputFilesList<TFile extends ReadFileResult>({ files, onChange }: InputFilesListProps<TFile>) {\n\tconst handleRemove = useCallback(\n\t\t(index: number) => {\n\t\t\tonChange(files.filter((_, i) => i !== index));\n\t\t},\n\t\t[files, onChange]\n\t);\n\n\tif (!files || !files.length) return null;\n\n\treturn (\n\t\t<ul className={styles.fileList}>\n\t\t\t{files.map((item, index) => (\n\t\t\t\t<li key={`${item.meta.name}-${item.meta.lastModified}`} className={styles.fileItem}>\n\t\t\t\t\t<span className={styles.fileItemName}>{item.meta.name}</span>\n\t\t\t\t\t<button\n\t\t\t\t\t\ttype=\"button\"\n\t\t\t\t\t\tclassName={cn(styles.removeButton, \"flexCenter\")}\n\t\t\t\t\t\tonClick={() => handleRemove(index)}\n\t\t\t\t\t\taria-label={`Удалить ${item.meta.name}`}>\n\t\t\t\t\t\t<XIcon />\n\t\t\t\t\t</button>\n\t\t\t\t</li>\n\t\t\t))}\n\t\t</ul>\n\t);\n}\n","import { useCallback, useRef } from \"react\";\n\nimport { assertValidAccept, assertValidAllowedMime, readFile, ReadFileError, ReadFileResult } from \"@ryuzaki13/react-foundation-lib/file\";\nimport { cn, handleKeyboardActivation } from \"@ryuzaki13/react-foundation-lib/utils\";\n\nimport { InputControl, InputUI, useInputFieldIds } from \"../input\";\nimport { UiBaseProps } from \"../types\";\nimport uiStyles from \"../ui.module.scss\";\n\nimport styles from \"./InputFiles.module.scss\";\nimport { InputFilesList } from \"./InputFilesList\";\n\ninterface InputFilesCommonProps extends Omit<UiBaseProps<undefined>, \"value\" | \"onChange\"> {\n\t/** Callback ошибки чтения файла */\n\tonReadError?: (error: ReadFileError) => void;\n\n\t/** HTML-атрибут accept для нативного input[type=\"file\"] (например `[\".pdf\", \".docx\"]`) */\n\taccept?: readonly string[];\n\t/** Список допустимых MIME-типов — передаётся в readFile */\n\tallowedMime?: readonly string[];\n\t/** Максимальный размер одного файла в байтах */\n\tmaxBytes?: number;\n\t/** Максимальное количество файлов. При достижении лимита input блокируется */\n\tmaxFiles?: number;\n\n\t/** Текст ошибки под полем */\n\terror?: string;\n\t/** Callback сброса ошибки */\n\tonClearError?: () => void;\n\t/** CSS-класс обёртки */\n\tclassName?: string;\n}\n\ntype InputFilesDataUrlResult = Extract<ReadFileResult, { mode: \"data-url\" }>;\ntype InputFilesArrayBufferResult = Extract<ReadFileResult, { mode: \"array-buffer\" }>;\n\n/**\n * Пропсы компонента InputFiles.\n *\n * Компонент предназначен для выбора нескольких файлов.\n * Выбранные файлы отображаются списком под полем ввода,\n * каждый с кнопкой удаления (крестик).\n *\n * В onChange передаётся обновлённый массив результатов readFile.\n */\nexport type InputFilesProps =\n\t| (InputFilesCommonProps & {\n\t\t\tvalue: InputFilesDataUrlResult[];\n\t\t\tonChange: (value: InputFilesDataUrlResult[]) => void;\n\t\t\t/** Режим чтения: \"data-url\" по умолчанию */\n\t\t\treadMode?: \"data-url\";\n\t })\n\t| (InputFilesCommonProps & {\n\t\t\tvalue: InputFilesArrayBufferResult[];\n\t\t\tonChange: (value: InputFilesArrayBufferResult[]) => void;\n\t\t\t/** Режим чтения файла как ArrayBuffer */\n\t\t\treadMode: \"array-buffer\";\n\t });\n\n/**\n * InputFiles — компонент выбора нескольких файлов.\n *\n * Поле стилизовано как InputText. При клике открывается нативный\n * диалог с multiple. Каждый выбранный файл читается через readFile\n * и добавляется в массив value.\n *\n * Список выбранных файлов отображается под полем.\n * Каждый файл можно удалить кнопкой «крестик».\n *\n * InputFiles типизирует массив по `readMode`.\n * Если `readMode` не задан или равен `\"data-url\"`, в `value` и `onChange`\n * используется массив объектов с `dataUrl`. Если `readMode` равен\n * `\"array-buffer\"`, используется массив объектов с `buffer`.\n */\nexport function InputFiles(props: InputFilesProps) {\n\tconst {\n\t\tvalue,\n\t\tonReadError,\n\t\taccept,\n\t\tallowedMime,\n\t\tmaxBytes,\n\t\tmaxFiles,\n\t\tlabel,\n\t\tdescription,\n\t\tplaceholder = \"Выберите файлы\",\n\t\tdisabled,\n\t\tsize,\n\t\terror,\n\t\tonClearError,\n\t\tclassName\n\t} = props;\n\n\tassertValidAllowedMime(allowedMime);\n\tassertValidAccept(accept);\n\n\t/** Реф на скрытый нативный input[type=\"file\"] */\n\tconst inputRef = useRef<HTMLInputElement>(null);\n\tconst { controlId, labelId, descriptionId, errorId, describedBy } = useInputFieldIds({\n\t\thasLabel: label !== undefined && label !== null,\n\t\thasDescription: !!description,\n\t\thasError: !!error\n\t});\n\n\t/** Достигнут ли лимит файлов */\n\tconst isLimitReached = typeof maxFiles === \"number\" && value.length >= maxFiles;\n\n\t/**\n\t * Обработчик выбора файлов из нативного диалога.\n\t * Каждый файл читается через readFile.\n\t * Успешно прочитанные файлы добавляются к текущему массиву value.\n\t */\n\tconst handleChange = useCallback(\n\t\tasync (e: React.ChangeEvent<HTMLInputElement>) => {\n\t\t\tconst files = e.target.files;\n\t\t\tif (!files || files.length === 0) return;\n\n\t\t\tconst selectedFiles = Array.from(files);\n\n\t\t\t// Сбрасываем значение input чтобы можно было выбрать те же файлы повторно\n\t\t\te.target.value = \"\";\n\n\t\t\t// Сбрасываем ошибку при выборе новых файлов\n\t\t\tif (error && onClearError) onClearError();\n\n\t\t\t// Определяем сколько файлов можно ещё добавить\n\t\t\tconst remaining = typeof maxFiles === \"number\" ? maxFiles - value.length : selectedFiles.length;\n\t\t\tconst filesToProcess = selectedFiles.slice(0, remaining);\n\n\t\t\tif (props.readMode === \"array-buffer\") {\n\t\t\t\t// Читаем файлы как ArrayBuffer и сохраняем точный тип массива для потребителя.\n\t\t\t\tconst results: InputFilesArrayBufferResult[] = [];\n\n\t\t\t\tfor (const file of filesToProcess) {\n\t\t\t\t\ttry {\n\t\t\t\t\t\tconst result = await readFile(file, { allowedMime, maxBytes, mode: \"array-buffer\" });\n\t\t\t\t\t\tresults.push(result);\n\t\t\t\t\t} catch (err) {\n\t\t\t\t\t\tif (err instanceof ReadFileError && onReadError) {\n\t\t\t\t\t\t\tonReadError(err);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif (results.length > 0) {\n\t\t\t\t\tprops.onChange([...props.value, ...results]);\n\t\t\t\t}\n\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t// Читаем файлы как Data URL и сохраняем точный тип массива для потребителя.\n\t\t\tconst results: InputFilesDataUrlResult[] = [];\n\t\t\tfor (const file of filesToProcess) {\n\t\t\t\ttry {\n\t\t\t\t\tconst result = await readFile(file, { allowedMime, maxBytes });\n\t\t\t\t\tresults.push(result);\n\t\t\t\t} catch (err) {\n\t\t\t\t\tif (err instanceof ReadFileError && onReadError) {\n\t\t\t\t\t\tonReadError(err);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (results.length > 0) {\n\t\t\t\tprops.onChange([...props.value, ...results]);\n\t\t\t}\n\t\t},\n\t\t[props, maxFiles, value.length, allowedMime, maxBytes, onReadError, error, onClearError]\n\t);\n\n\t/** Клик по видимому контролу открывает нативный диалог */\n\tconst handleClick = useCallback(() => {\n\t\tinputRef.current?.click();\n\t}, []);\n\n\tconst filesList =\n\t\tprops.readMode === \"array-buffer\" ? (\n\t\t\t<InputFilesList files={props.value} onChange={props.onChange} />\n\t\t) : (\n\t\t\t<InputFilesList files={props.value} onChange={props.onChange} />\n\t\t);\n\n\treturn (\n\t\t<InputUI\n\t\t\tlabel={label}\n\t\t\tdescription={description}\n\t\t\tdisabled={disabled}\n\t\t\tclassName={className}\n\t\t\tsize={size}\n\t\t\terror={error}\n\t\t\tcontrolId={controlId}\n\t\t\tlabelId={labelId}\n\t\t\tdescriptionId={descriptionId}\n\t\t\terrorId={errorId}>\n\t\t\t<input\n\t\t\t\tref={inputRef}\n\t\t\t\tid={controlId}\n\t\t\t\ttype=\"file\"\n\t\t\t\taccept={(accept ?? allowedMime)?.join(\",\")}\n\t\t\t\tmultiple\n\t\t\t\tdisabled={disabled || isLimitReached}\n\t\t\t\tclassName={styles.hiddenInput}\n\t\t\t\tonChange={handleChange}\n\t\t\t\ttabIndex={-1}\n\t\t\t/>\n\n\t\t\t<InputControl>\n\t\t\t\t{() => (\n\t\t\t\t\t<div\n\t\t\t\t\t\trole=\"button\"\n\t\t\t\t\t\ttabIndex={disabled || isLimitReached ? -1 : 0}\n\t\t\t\t\t\tonClick={handleClick}\n\t\t\t\t\t\tonKeyDown={(event) => handleKeyboardActivation(event, handleClick, { disabled: disabled || isLimitReached })}\n\t\t\t\t\t\tclassName={cn(uiStyles.uiInputControl, styles.control, !!error && \"invalid\")}\n\t\t\t\t\t\tdata-disabled={disabled || undefined}\n\t\t\t\t\t\taria-invalid={!!error || undefined}\n\t\t\t\t\t\taria-disabled={disabled || isLimitReached}\n\t\t\t\t\t\taria-labelledby={labelId}\n\t\t\t\t\t\taria-describedby={describedBy}>\n\t\t\t\t\t\t<span className={uiStyles.uiPlaceholder}>{isLimitReached ? `Максимум ${maxFiles} файлов` : placeholder}</span>\n\t\t\t\t\t</div>\n\t\t\t\t)}\n\t\t\t</InputControl>\n\n\t\t\t{/* Список выбран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,EAAA,EAAc,KAAK,GAAG;IACzC,UAAA;IACA,UAAU,KAAY;IACtB,WAAW,EAAO;IAClB,UAAU;IACV,UAAU;GACV,CAAA;GAED,kBAAC,GAAD,EAAA,gBAEE,kBAAC,OAAD;IACC,MAAK;IACL,UAAU,KAAY,IAAiB,KAAK;IAC5C,SAAS;IACT,YAAY,MAAU,EAAyB,GAAO,GAAa,EAAE,UAAU,KAAY,EAAe,CAAC;IAC3G,WAAW,EAAG,EAAS,gBAAgB,EAAO,SAAS,CAAC,CAAC,KAAS,SAAS;IAC3E,iBAAe,KAAY,KAAA;IAC3B,gBAAc,CAAC,CAAC,KAAS,KAAA;IACzB,iBAAe,KAAY;IAC3B,mBAAiB;IACjB,oBAAkB;IAClB,UAAA,kBAAC,QAAD;KAAM,WAAW,EAAS;KAAgB,UAAA,IAAiB,YAAY,EAAS,WAAW;IAAkB,CAAA;GACzG,CAAA,EAEO,CAAA;GAGb;EACO;;AAEX"}
1
+ {"version":3,"file":"input-files-CLtQ7p8j.js","names":[],"sources":["../../src/input-files/InputFiles.module.scss","../../src/input-files/InputFilesList.tsx","../../src/input-files/InputFiles.tsx"],"sourcesContent":["/* Контрол, имитирующий внешний вид InputText */\n.control {\n\theight: var(--control-height);\n\twidth: 100%;\n\tpadding: 0 var(--space-sm);\n\tfont-size: var(--font-size-md);\n\tcursor: pointer;\n\n\tdisplay: flex;\n\talign-items: center;\n}\n\n/* Скрытый нативный input[type=\"file\"] */\n.hiddenInput {\n\tposition: absolute;\n\twidth: 0;\n\theight: 0;\n\topacity: 0;\n\toverflow: hidden;\n\tpointer-events: none;\n}\n\n/* Список выбранных файлов */\n.fileList {\n\tdisplay: flex;\n\tflex-direction: column;\n\tgap: var(--space-xs);\n\tmargin-top: var(--space-xs);\n}\n\n/* Элемент списка — строка с именем файла и кнопкой удаления */\n.fileItem {\n\tdisplay: flex;\n\talign-items: center;\n\tgap: var(--space-xs);\n\tpadding: var(--space-xs) var(--space-sm);\n\tbackground-color: var(--surface-2);\n\tborder-radius: var(--radius-sm);\n\t// font-size: var(--font-size-sm);\n}\n\n/* Имя файла — обрезка с троеточием */\n.fileItemName {\n\tflex: 1;\n\toverflow: hidden;\n\ttext-overflow: ellipsis;\n\twhite-space: nowrap;\n}\n\n/* Кнопка удаления файла из списка */\n.removeButton {\n\tflex-shrink: 0;\n\twidth: 1.25em;\n\theight: 1.25em;\n\tcolor: var(--content-2);\n\n\t&:hover {\n\t\tcolor: var(--content-accent);\n\t}\n}\n","import { useCallback } from \"react\";\n\nimport { ReadFileResult } from \"@ryuzaki13/react-foundation-lib/file\";\nimport { cn } from \"@ryuzaki13/react-foundation-lib/utils\";\nimport { XIcon } from \"lucide-react\";\n\nimport styles from \"./InputFiles.module.scss\";\n\ninterface InputFilesListProps<TFile extends ReadFileResult> {\n\tfiles: TFile[];\n\tonChange: (files: TFile[]) => void;\n}\n\nexport function InputFilesList<TFile extends ReadFileResult>({ files, onChange }: InputFilesListProps<TFile>) {\n\tconst handleRemove = useCallback(\n\t\t(index: number) => {\n\t\t\tonChange(files.filter((_, i) => i !== index));\n\t\t},\n\t\t[files, onChange]\n\t);\n\n\tif (!files || !files.length) return null;\n\n\treturn (\n\t\t<ul className={styles.fileList}>\n\t\t\t{files.map((item, index) => (\n\t\t\t\t<li key={`${item.meta.name}-${item.meta.lastModified}`} className={styles.fileItem}>\n\t\t\t\t\t<span className={styles.fileItemName}>{item.meta.name}</span>\n\t\t\t\t\t<button\n\t\t\t\t\t\ttype=\"button\"\n\t\t\t\t\t\tclassName={cn(styles.removeButton, \"flexCenter\")}\n\t\t\t\t\t\tonClick={() => handleRemove(index)}\n\t\t\t\t\t\taria-label={`Удалить ${item.meta.name}`}>\n\t\t\t\t\t\t<XIcon />\n\t\t\t\t\t</button>\n\t\t\t\t</li>\n\t\t\t))}\n\t\t</ul>\n\t);\n}\n","import { useCallback, useRef } from \"react\";\n\nimport { assertValidAccept, assertValidAllowedMime, readFile, ReadFileError, ReadFileResult } from \"@ryuzaki13/react-foundation-lib/file\";\nimport { cn, handleKeyboardActivation } from \"@ryuzaki13/react-foundation-lib/utils\";\n\nimport { InputControl, InputUI, useInputFieldIds } from \"../input\";\nimport { UiBaseProps } from \"../types\";\nimport uiStyles from \"../ui.module.scss\";\n\nimport styles from \"./InputFiles.module.scss\";\nimport { InputFilesList } from \"./InputFilesList\";\n\ninterface InputFilesCommonProps extends Omit<UiBaseProps<undefined>, \"value\" | \"onChange\"> {\n\t/** Callback ошибки чтения файла */\n\tonReadError?: (error: ReadFileError) => void;\n\n\t/** HTML-атрибут accept для нативного input[type=\"file\"] (например `[\".pdf\", \".docx\"]`) */\n\taccept?: readonly string[];\n\t/** Список допустимых MIME-типов — передаётся в readFile */\n\tallowedMime?: readonly string[];\n\t/** Максимальный размер одного файла в байтах */\n\tmaxBytes?: number;\n\t/** Максимальное количество файлов. При достижении лимита input блокируется */\n\tmaxFiles?: number;\n\n\t/** Текст ошибки под полем */\n\terror?: string;\n\t/** Callback сброса ошибки */\n\tonClearError?: () => void;\n\t/** CSS-класс обёртки */\n\tclassName?: string;\n}\n\ntype InputFilesDataUrlResult = Extract<ReadFileResult, { mode: \"data-url\" }>;\ntype InputFilesArrayBufferResult = Extract<ReadFileResult, { mode: \"array-buffer\" }>;\n\n/**\n * Пропсы компонента InputFiles.\n *\n * Компонент предназначен для выбора нескольких файлов.\n * Выбранные файлы отображаются списком под полем ввода,\n * каждый с кнопкой удаления (крестик).\n *\n * В onChange передаётся обновлённый массив результатов readFile.\n */\nexport type InputFilesProps =\n\t| (InputFilesCommonProps & {\n\t\t\tvalue: InputFilesDataUrlResult[];\n\t\t\tonChange: (value: InputFilesDataUrlResult[]) => void;\n\t\t\t/** Режим чтения: \"data-url\" по умолчанию */\n\t\t\treadMode?: \"data-url\";\n\t })\n\t| (InputFilesCommonProps & {\n\t\t\tvalue: InputFilesArrayBufferResult[];\n\t\t\tonChange: (value: InputFilesArrayBufferResult[]) => void;\n\t\t\t/** Режим чтения файла как ArrayBuffer */\n\t\t\treadMode: \"array-buffer\";\n\t });\n\n/**\n * InputFiles — компонент выбора нескольких файлов.\n *\n * Поле стилизовано как InputText. При клике открывается нативный\n * диалог с multiple. Каждый выбранный файл читается через readFile\n * и добавляется в массив value.\n *\n * Список выбранных файлов отображается под полем.\n * Каждый файл можно удалить кнопкой «крестик».\n *\n * InputFiles типизирует массив по `readMode`.\n * Если `readMode` не задан или равен `\"data-url\"`, в `value` и `onChange`\n * используется массив объектов с `dataUrl`. Если `readMode` равен\n * `\"array-buffer\"`, используется массив объектов с `buffer`.\n */\nexport function InputFiles(props: InputFilesProps) {\n\tconst {\n\t\tvalue,\n\t\tonReadError,\n\t\taccept,\n\t\tallowedMime,\n\t\tmaxBytes,\n\t\tmaxFiles,\n\t\tlabel,\n\t\tdescription,\n\t\tplaceholder = \"Выберите файлы\",\n\t\tdisabled,\n\t\tsize,\n\t\terror,\n\t\tonClearError,\n\t\tclassName\n\t} = props;\n\n\tassertValidAllowedMime(allowedMime);\n\tassertValidAccept(accept);\n\n\t/** Реф на скрытый нативный input[type=\"file\"] */\n\tconst inputRef = useRef<HTMLInputElement>(null);\n\tconst { controlId, labelId, descriptionId, errorId, describedBy } = useInputFieldIds({\n\t\thasLabel: label !== undefined && label !== null,\n\t\thasDescription: !!description,\n\t\thasError: !!error\n\t});\n\n\t/** Достигнут ли лимит файлов */\n\tconst isLimitReached = typeof maxFiles === \"number\" && value.length >= maxFiles;\n\n\t/**\n\t * Обработчик выбора файлов из нативного диалога.\n\t * Каждый файл читается через readFile.\n\t * Успешно прочитанные файлы добавляются к текущему массиву value.\n\t */\n\tconst handleChange = useCallback(\n\t\tasync (e: React.ChangeEvent<HTMLInputElement>) => {\n\t\t\tconst files = e.target.files;\n\t\t\tif (!files || files.length === 0) return;\n\n\t\t\tconst selectedFiles = Array.from(files);\n\n\t\t\t// Сбрасываем значение input чтобы можно было выбрать те же файлы повторно\n\t\t\te.target.value = \"\";\n\n\t\t\t// Сбрасываем ошибку при выборе новых файлов\n\t\t\tif (error && onClearError) onClearError();\n\n\t\t\t// Определяем сколько файлов можно ещё добавить\n\t\t\tconst remaining = typeof maxFiles === \"number\" ? maxFiles - value.length : selectedFiles.length;\n\t\t\tconst filesToProcess = selectedFiles.slice(0, remaining);\n\n\t\t\tif (props.readMode === \"array-buffer\") {\n\t\t\t\t// Читаем файлы как ArrayBuffer и сохраняем точный тип массива для потребителя.\n\t\t\t\tconst results: InputFilesArrayBufferResult[] = [];\n\n\t\t\t\tfor (const file of filesToProcess) {\n\t\t\t\t\ttry {\n\t\t\t\t\t\tconst result = await readFile(file, { allowedMime, maxBytes, mode: \"array-buffer\" });\n\t\t\t\t\t\tresults.push(result);\n\t\t\t\t\t} catch (err) {\n\t\t\t\t\t\tif (err instanceof ReadFileError && onReadError) {\n\t\t\t\t\t\t\tonReadError(err);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif (results.length > 0) {\n\t\t\t\t\tprops.onChange([...props.value, ...results]);\n\t\t\t\t}\n\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t// Читаем файлы как Data URL и сохраняем точный тип массива для потребителя.\n\t\t\tconst results: InputFilesDataUrlResult[] = [];\n\t\t\tfor (const file of filesToProcess) {\n\t\t\t\ttry {\n\t\t\t\t\tconst result = await readFile(file, { allowedMime, maxBytes });\n\t\t\t\t\tresults.push(result);\n\t\t\t\t} catch (err) {\n\t\t\t\t\tif (err instanceof ReadFileError && onReadError) {\n\t\t\t\t\t\tonReadError(err);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (results.length > 0) {\n\t\t\t\tprops.onChange([...props.value, ...results]);\n\t\t\t}\n\t\t},\n\t\t[props, maxFiles, value.length, allowedMime, maxBytes, onReadError, error, onClearError]\n\t);\n\n\t/** Клик по видимому контролу открывает нативный диалог */\n\tconst handleClick = useCallback(() => {\n\t\tinputRef.current?.click();\n\t}, []);\n\n\tconst filesList =\n\t\tprops.readMode === \"array-buffer\" ? (\n\t\t\t<InputFilesList files={props.value} onChange={props.onChange} />\n\t\t) : (\n\t\t\t<InputFilesList files={props.value} onChange={props.onChange} />\n\t\t);\n\n\treturn (\n\t\t<InputUI\n\t\t\tlabel={label}\n\t\t\tdescription={description}\n\t\t\tdisabled={disabled}\n\t\t\tclassName={className}\n\t\t\tsize={size}\n\t\t\terror={error}\n\t\t\tcontrolId={controlId}\n\t\t\tlabelId={labelId}\n\t\t\tdescriptionId={descriptionId}\n\t\t\terrorId={errorId}>\n\t\t\t<input\n\t\t\t\tref={inputRef}\n\t\t\t\tid={controlId}\n\t\t\t\ttype=\"file\"\n\t\t\t\taccept={(accept ?? allowedMime)?.join(\",\")}\n\t\t\t\tmultiple\n\t\t\t\tdisabled={disabled || isLimitReached}\n\t\t\t\tclassName={styles.hiddenInput}\n\t\t\t\tonChange={handleChange}\n\t\t\t\ttabIndex={-1}\n\t\t\t/>\n\n\t\t\t<InputControl>\n\t\t\t\t{() => (\n\t\t\t\t\t<div\n\t\t\t\t\t\trole=\"button\"\n\t\t\t\t\t\ttabIndex={disabled || isLimitReached ? -1 : 0}\n\t\t\t\t\t\tonClick={handleClick}\n\t\t\t\t\t\tonKeyDown={(event) => handleKeyboardActivation(event, handleClick, { disabled: disabled || isLimitReached })}\n\t\t\t\t\t\tclassName={cn(uiStyles.uiInputControl, styles.control, !!error && \"invalid\")}\n\t\t\t\t\t\tdata-disabled={disabled || undefined}\n\t\t\t\t\t\taria-invalid={!!error || undefined}\n\t\t\t\t\t\taria-disabled={disabled || isLimitReached}\n\t\t\t\t\t\taria-labelledby={labelId}\n\t\t\t\t\t\taria-describedby={describedBy}>\n\t\t\t\t\t\t<span className={uiStyles.uiPlaceholder}>{isLimitReached ? `Максимум ${maxFiles} файлов` : placeholder}</span>\n\t\t\t\t\t</div>\n\t\t\t\t)}\n\t\t\t</InputControl>\n\n\t\t\t{/* Список выбранных файлов */}\n\t\t\t{filesList}\n\t\t</InputUI>\n\t);\n}\n"],"mappings":";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,WAAW,EAAO;IAClB,UAAU;IACV,UAAU;GACV,CAAA;GAED,kBAAC,GAAD,EAAA,gBAEE,kBAAC,OAAD;IACC,MAAK;IACL,UAAU,KAAY,IAAiB,KAAK;IAC5C,SAAS;IACT,YAAY,MAAU,EAAyB,GAAO,GAAa,EAAE,UAAU,KAAY,EAAe,CAAC;IAC3G,WAAW,EAAG,EAAS,gBAAgB,EAAO,SAAS,CAAC,CAAC,KAAS,SAAS;IAC3E,iBAAe,KAAY,KAAA;IAC3B,gBAAc,CAAC,CAAC,KAAS,KAAA;IACzB,iBAAe,KAAY;IAC3B,mBAAiB;IACjB,oBAAkB;IAClB,UAAA,kBAAC,QAAD;KAAM,WAAW,EAAS;KAAgB,UAAA,IAAiB,YAAY,EAAS,WAAW;IAAkB,CAAA;GACzG,CAAA,EAEO,CAAA;GAGb;EACO;;AAEX"}
@@ -1,4 +1,4 @@
1
- import { n as e } from "./input-BWCaVC06.js";
1
+ import { n as e } from "./input-CAw1Loze.js";
2
2
  import { useState as t } from "react";
3
3
  import { jsx as n } from "react/jsx-runtime";
4
4
  //#region src/input-search/InputSearch.tsx
@@ -27,4 +27,4 @@ function r({ onChange: r, ...i }) {
27
27
  //#endregion
28
28
  export { r as t };
29
29
 
30
- //# sourceMappingURL=input-search-CdPI1cb6.js.map
30
+ //# sourceMappingURL=input-search-F6MPrUGF.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"input-search-CdPI1cb6.js","names":[],"sources":["../../src/input-search/InputSearch.tsx"],"sourcesContent":["import React, { useState } from \"react\";\n\nimport { BaseInputProps, Input } from \"../input\";\n\ninterface SearchInputProps extends BaseInputProps<string> {\n\tonChange: (value: string) => void;\n}\n\nexport function InputSearch({ onChange, ...props }: SearchInputProps) {\n\tconst [searchTerm, setSearchTerm] = useState(() => props.defaultValue ?? props.value ?? \"\");\n\tconst [previousSearch, setPreviousSearch] = useState(() => props.defaultValue ?? props.value ?? \"\");\n\n\tconst handleSearch = (term: string) => {\n\t\tconst changedTerm = term.trim();\n\n\t\t// Проверяем, изменилось ли значение с предыдущего поиска\n\t\tif (changedTerm === previousSearch) return;\n\n\t\tsetPreviousSearch(changedTerm);\n\t\tonChange(changedTerm);\n\t};\n\n\tconst handleClear = () => {\n\t\tsetSearchTerm(\"\");\n\t\tsetPreviousSearch(\"\");\n\t\tonChange(\"\");\n\t};\n\n\tconst handleKeyDown = (event: React.KeyboardEvent<HTMLInputElement>) => {\n\t\tif (event.key === \"Enter\") {\n\t\t\tevent.preventDefault();\n\t\t\thandleSearch(searchTerm);\n\t\t}\n\t};\n\n\tconst handleBlur = () => {\n\t\thandleSearch(searchTerm);\n\t};\n\n\tconst handleChange = (value: string) => {\n\t\tsetSearchTerm(value);\n\t\t// Не вызываем onSearch здесь - только по Enter/blur\n\t};\n\n\treturn (\n\t\t<Input {...props} value={searchTerm} onChange={handleChange} onKeyDown={handleKeyDown} onBlur={handleBlur} onClear={handleClear} />\n\t);\n}\n"],"mappings":";;;;AAQA,SAAgB,EAAY,EAAE,aAAU,GAAG,KAA2B;CACrE,IAAM,CAAC,GAAY,KAAiB,QAAe,EAAM,gBAAgB,EAAM,SAAS,EAAE,GACpF,CAAC,GAAgB,KAAqB,QAAe,EAAM,gBAAgB,EAAM,SAAS,EAAE,GAE5F,KAAgB,MAAiB;EACtC,IAAM,IAAc,EAAK,KAAK;EAG1B,MAAgB,MAEpB,EAAkB,CAAW,GAC7B,EAAS,CAAW;CACrB,GAEM,UAAoB;EAGzB,AAFA,EAAc,EAAE,GAChB,EAAkB,EAAE,GACpB,EAAS,EAAE;CACZ,GAEM,KAAiB,MAAiD;EACvE,AAAI,EAAM,QAAQ,YACjB,EAAM,eAAe,GACrB,EAAa,CAAU;CAEzB,GAEM,UAAmB;EACxB,EAAa,CAAU;CACxB,GAEM,KAAgB,MAAkB;EACvC,EAAc,CAAK;CAEpB;CAEA,OACC,kBAAC,GAAD;EAAO,GAAI;EAAO,OAAO;EAAY,UAAU;EAAc,WAAW;EAAe,QAAQ;EAAY,SAAS;CAAc,CAAA;AAEpI"}
1
+ {"version":3,"file":"input-search-F6MPrUGF.js","names":[],"sources":["../../src/input-search/InputSearch.tsx"],"sourcesContent":["import React, { useState } from \"react\";\n\nimport { BaseInputProps, Input } from \"../input\";\n\ninterface SearchInputProps extends BaseInputProps<string> {\n\tonChange: (value: string) => void;\n}\n\nexport function InputSearch({ onChange, ...props }: SearchInputProps) {\n\tconst [searchTerm, setSearchTerm] = useState(() => props.defaultValue ?? props.value ?? \"\");\n\tconst [previousSearch, setPreviousSearch] = useState(() => props.defaultValue ?? props.value ?? \"\");\n\n\tconst handleSearch = (term: string) => {\n\t\tconst changedTerm = term.trim();\n\n\t\t// Проверяем, изменилось ли значение с предыдущего поиска\n\t\tif (changedTerm === previousSearch) return;\n\n\t\tsetPreviousSearch(changedTerm);\n\t\tonChange(changedTerm);\n\t};\n\n\tconst handleClear = () => {\n\t\tsetSearchTerm(\"\");\n\t\tsetPreviousSearch(\"\");\n\t\tonChange(\"\");\n\t};\n\n\tconst handleKeyDown = (event: React.KeyboardEvent<HTMLInputElement>) => {\n\t\tif (event.key === \"Enter\") {\n\t\t\tevent.preventDefault();\n\t\t\thandleSearch(searchTerm);\n\t\t}\n\t};\n\n\tconst handleBlur = () => {\n\t\thandleSearch(searchTerm);\n\t};\n\n\tconst handleChange = (value: string) => {\n\t\tsetSearchTerm(value);\n\t\t// Не вызываем onSearch здесь - только по Enter/blur\n\t};\n\n\treturn (\n\t\t<Input {...props} value={searchTerm} onChange={handleChange} onKeyDown={handleKeyDown} onBlur={handleBlur} onClear={handleClear} />\n\t);\n}\n"],"mappings":";;;;AAQA,SAAgB,EAAY,EAAE,aAAU,GAAG,KAA2B;CACrE,IAAM,CAAC,GAAY,KAAiB,QAAe,EAAM,gBAAgB,EAAM,SAAS,EAAE,GACpF,CAAC,GAAgB,KAAqB,QAAe,EAAM,gBAAgB,EAAM,SAAS,EAAE,GAE5F,KAAgB,MAAiB;EACtC,IAAM,IAAc,EAAK,KAAK;EAG1B,MAAgB,MAEpB,EAAkB,CAAW,GAC7B,EAAS,CAAW;CACrB,GAEM,UAAoB;EAGzB,AAFA,EAAc,EAAE,GAChB,EAAkB,EAAE,GACpB,EAAS,EAAE;CACZ,GAEM,KAAiB,MAAiD;EACvE,AAAI,EAAM,QAAQ,YACjB,EAAM,eAAe,GACrB,EAAa,CAAU;CAEzB,GAEM,UAAmB;EACxB,EAAa,CAAU;CACxB,GAEM,KAAgB,MAAkB;EACvC,EAAc,CAAK;CAEpB;CAEA,OACC,kBAAC,GAAD;EAAO,GAAI;EAAO,OAAO;EAAY,UAAU;EAAc,WAAW;EAAe,QAAQ;EAAY,SAAS;CAAc,CAAA;AAEpI"}
@@ -1 +1 @@
1
- {"version":3,"file":"modal-DPIXoMkB.js","names":[],"sources":["../../src/modal/Modal.module.scss","../../src/modal/modalMotion.ts","../../src/modal/useModalManager.ts","../../src/modal/Modal.tsx","../../src/modal/ModalManagerProvider.tsx"],"sourcesContent":["@use \"@/styles/mixins\" as *;\n\n.modal {\n\tdisplay: grid;\n\tgrid-auto-rows: auto 1fr;\n\n\tposition: fixed;\n\tinset: 0;\n\tmargin: auto;\n\tz-index: var(--z-modal);\n\twidth: 90%;\n\theight: fit-content;\n\tmax-height: calc(100dvh - var(--space-lg));\n\tborder: var(--border);\n\tborder-radius: var(--radius-md);\n\tbackground-color: var(--surface-1);\n\tbox-shadow: var(--shadow-lg);\n\n\t&:not(:last-child) {\n\t\tpointer-events: none;\n\t\tfilter: grayscale(0.5) opacity(0.75);\n\t\t// opacity: 0.5;\n\t}\n\n\t&.sm {\n\t\tmax-width: min(30em, 93dvw);\n\t}\n\n\t&.md {\n\t\tmax-width: min(50em, 93dvw);\n\t}\n\n\t&.lg {\n\t\tmax-width: min(70em, 93dvw);\n\t}\n\n\t&.xl {\n\t\tmax-width: min(80em, 93dvw);\n\t}\n\n\t&.xxl {\n\t\twidth: 93dvw;\n\t\theight: 90dvh;\n\t\tmax-width: none;\n\t\tmax-height: none;\n\t}\n\n\t&.inside {\n\t\twidth: 100%;\n\t\theight: 100%;\n\t\tmax-width: none;\n\t\tmax-height: none;\n\n\t\t.header,\n\t\t.body {\n\t\t\tborder-radius: 0;\n\t\t}\n\t}\n}\n\n.header {\n\tdisplay: flex;\n\talign-items: center;\n\tjustify-content: space-between;\n\tbackground-color: var(--surface-2);\n\tborder-top-left-radius: var(--radius-md);\n\tborder-top-right-radius: var(--radius-md);\n}\n\n.headerText {\n\tmargin: 0;\n\tpadding-inline: var(--space-md);\n\tfont-size: var(--font-size-md);\n\tfont-variation-settings: \"wght\" 600;\n}\n\n.headerButton {\n\tmargin-block: var(--space-xs);\n\tmargin-inline: var(--space-sm);\n\tflex: 0;\n}\n\n.body {\n\toverflow: hidden;\n\tborder-bottom-left-radius: var(--radius-md);\n\tborder-bottom-right-radius: var(--radius-md);\n}\n","import { type Transition, type Variants } from \"motion/react\";\n\n/**\n * Варианты задают единый спокойный переход для появления и удаления modal-панели.\n * Конфигурация приватна для primitive: потребители управляют только состоянием `isOpen`.\n */\nexport const modalMotionVariants = {\n\thidden: {\n\t\topacity: 0,\n\t\tscale: 0.96,\n\t\ty: 12\n\t},\n\tvisible: {\n\t\topacity: 1,\n\t\tscale: 1,\n\t\ty: 0\n\t}\n} satisfies Variants;\n\n/** Переход сохраняет отзывчивое открытие и дает exit-анимации завершиться до удаления portal content. */\nexport const modalMotionTransition = {\n\tduration: 0.18,\n\tease: [0.22, 1, 0.36, 1]\n} satisfies Transition;\n\n/** При системном reduced-motion остается только мгновенная смена видимости без пространственного движения. */\nexport const reducedModalMotionTransition = {\n\tduration: 0\n} satisfies Transition;\n","import { createContext, useContext } from \"react\";\n\nexport const ModalManagerContext = createContext<{\n\tmodals: string[];\n\topenModal: (id: string) => void;\n\tcloseModal: (id: string) => void;\n\tisTopModal: (id: string) => boolean;\n}>({\n\tmodals: [],\n\topenModal: () => {},\n\tcloseModal: () => {},\n\tisTopModal: () => false\n});\n\nexport const useModalManager = () => useContext(ModalManagerContext);\n","import React, { Children, useEffect, useId, useRef } from \"react\";\n\nimport { getOrCreatePortalRoot, useEscapeDismiss, useOverlayFocus } from \"@ryuzaki13/react-foundation-lib/dom\";\nimport { cn } from \"@ryuzaki13/react-foundation-lib/utils\";\nimport { X } from \"lucide-react\";\nimport { AnimatePresence, motion, useReducedMotion } from \"motion/react\";\nimport { createPortal } from \"react-dom\";\n\nimport { Button } from \"../button\";\nimport { FlexContainer } from \"../flex\";\nimport { GridContainer } from \"../grid\";\nimport { Scrollable } from \"../misc\";\n\nimport styles from \"./Modal.module.scss\";\nimport { modalMotionTransition, modalMotionVariants, reducedModalMotionTransition } from \"./modalMotion\";\nimport { ModalSize } from \"./types\";\nimport { useModalManager } from \"./useModalManager\";\n\n// Подкомпоненты\nexport interface ModalCompositionProps {\n\tchildren: React.ReactNode;\n\tclassName?: string;\n}\n\nexport const ModalToolbar: React.FC<ModalCompositionProps> = ({ children, className }) => {\n\treturn <div className={cn(\"surface2 paddingMd borderBottom\", className)}>{children}</div>;\n};\nModalToolbar.displayName = \"Modal.Toolbar\";\n\nexport const ModalContent: React.FC<ModalCompositionProps & { scrollable?: boolean }> = ({ children, className, scrollable }) => {\n\treturn (\n\t\t<div className={cn(\"paddingMd h100 overflowHidden\", className)}>\n\t\t\t{scrollable ? <Scrollable className=\"h100\">{children}</Scrollable> : children}\n\t\t</div>\n\t);\n};\nModalContent.displayName = \"Modal.Content\";\n\nexport const ModalFooter: React.FC<ModalCompositionProps> = ({ children, className }) => {\n\treturn (\n\t\t<div className={cn(\"surface2 borderTop paddingMd\", className)}>\n\t\t\t<FlexContainer gap=\"sm\" align=\"center\" justify=\"end\">\n\t\t\t\t{children}\n\t\t\t</FlexContainer>\n\t\t</div>\n\t);\n};\nModalFooter.displayName = \"Modal.Footer\";\n\ntype ToolbarElement = React.ReactElement<ModalCompositionProps, typeof ModalToolbar>;\ntype ContentElement = React.ReactElement<ModalCompositionProps, typeof ModalContent>;\ntype FooterElement = React.ReactElement<ModalCompositionProps, typeof ModalFooter>;\n\ntype ModalChildren =\n\t[ToolbarElement, ContentElement, FooterElement] | [ToolbarElement, ContentElement] | [ContentElement, FooterElement] | ContentElement;\n\nexport interface ModalProps {\n\t/** Открыто ли модальное окно */\n\tisOpen?: boolean;\n\t/** Заголовок */\n\ttitle?: string;\n\t/** Размер модального окна */\n\tsize?: keyof typeof ModalSize;\n\theight?: string;\n\t/** Обработчик закрытия */\n\tonClose: () => void;\n\tchildren: ModalChildren;\n}\n\nexport const Modal: React.FC<ModalProps> = ({ isOpen, title, size = \"sm\", height, onClose, children }) => {\n\tconst modalId = useId();\n\tconst titleId = useId();\n\n\tconst { modals, openModal, closeModal, isTopModal } = useModalManager();\n\tconst shouldReduceMotion = useReducedMotion();\n\tconst restoreFocusTargetRef = useRef<HTMLElement | null>(null);\n\tconst restoreFocusAnimationFrameRef = useRef(0);\n\n\t/**\n\t * Если provider менеджера не подключен, считаем одиночную модалку активной,\n\t * иначе логика Escape/focus trap никогда не включится.\n\t */\n\tconst isActive = isOpen && (modals.length === 0 || isTopModal(modalId));\n\n\tuseEffect(() => {\n\t\tif (isOpen) {\n\t\t\trestoreFocusTargetRef.current = document.activeElement instanceof HTMLElement ? document.activeElement : null;\n\t\t}\n\t}, [isOpen]);\n\n\tconst modalRef = useOverlayFocus<HTMLDivElement>({ active: isOpen || false, trapFocus: true, restoreFocus: false });\n\n\tuseEscapeDismiss({\n\t\tactive: isActive || false,\n\t\tonDismiss: onClose,\n\t\tcontainerRef: modalRef\n\t});\n\n\tuseEffect(() => {\n\t\tif (isOpen) {\n\t\t\topenModal(modalId);\n\t\t}\n\t}, [isOpen, modalId, openModal]);\n\n\tuseEffect(() => {\n\t\treturn () => {\n\t\t\twindow.cancelAnimationFrame(restoreFocusAnimationFrameRef.current);\n\t\t\tcloseModal(modalId);\n\t\t};\n\t}, [closeModal, modalId]);\n\n\tfunction handleExitComplete() {\n\t\tcloseModal(modalId);\n\t\tconst restoreFocusTarget = restoreFocusTargetRef.current;\n\n\t\t/**\n\t\t * Менеджер снимает inert в passive effect после обновления стека.\n\t\t * Следующий animation frame гарантирует, что trigger снова доступен для фокуса.\n\t\t */\n\t\trestoreFocusAnimationFrameRef.current = window.requestAnimationFrame(() => {\n\t\t\tif (restoreFocusTarget?.isConnected) {\n\t\t\t\trestoreFocusTarget.focus();\n\t\t\t}\n\t\t\trestoreFocusTargetRef.current = null;\n\t\t});\n\t}\n\n\tconst modalRoot = getOrCreatePortalRoot(\"modal-root\");\n\n\tif (!modalRoot) {\n\t\treturn null;\n\t}\n\n\tlet toolbar: React.ReactNode = null;\n\tlet content: React.ReactNode = null;\n\tlet footer: React.ReactNode = null;\n\n\tconst childArray = Children.toArray(children) as (ToolbarElement | ContentElement | FooterElement)[];\n\n\tfor (const child of childArray) {\n\t\tconst typeName = child.type.displayName;\n\n\t\tswitch (typeName) {\n\t\t\tcase ModalToolbar.displayName:\n\t\t\t\tif (toolbar) throw new Error(\"Modal: duplicate <Toolbar> found\");\n\t\t\t\ttoolbar = child; //.props.children;\n\t\t\t\tbreak;\n\t\t\tcase ModalFooter.displayName:\n\t\t\t\tif (footer) throw new Error(\"Modal: duplicate <Footer> found\");\n\t\t\t\tfooter = child; //props.children;\n\t\t\t\tbreak;\n\t\t\tcase ModalContent.displayName:\n\t\t\t\tif (content) throw new Error(\"Modal: duplicate <Content> found\");\n\t\t\t\tcontent = child; //.props.children;\n\t\t\t\tbreak;\n\t\t}\n\t}\n\n\treturn createPortal(\n\t\t<AnimatePresence onExitComplete={handleExitComplete}>\n\t\t\t{isOpen ? (\n\t\t\t\t<motion.div\n\t\t\t\t\tref={modalRef}\n\t\t\t\t\tclassName={cn(styles.modal, styles[size])}\n\t\t\t\t\tstyle={{ height }}\n\t\t\t\t\trole=\"dialog\"\n\t\t\t\t\taria-modal=\"true\"\n\t\t\t\t\taria-labelledby={titleId}\n\t\t\t\t\taria-describedby={`${titleId}-content`}\n\t\t\t\t\tinitial=\"hidden\"\n\t\t\t\t\tanimate=\"visible\"\n\t\t\t\t\texit=\"hidden\"\n\t\t\t\t\tvariants={modalMotionVariants}\n\t\t\t\t\ttransition={shouldReduceMotion ? reducedModalMotionTransition : modalMotionTransition}>\n\t\t\t\t\t<div className={cn(styles.header, toolbar ? \"\" : \"borderBottom\")}>\n\t\t\t\t\t\t<h3 className={styles.headerText} id={titleId}>\n\t\t\t\t\t\t\t{title}\n\t\t\t\t\t\t</h3>\n\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\ticon={<X />}\n\t\t\t\t\t\t\tclassName={styles.headerButton}\n\t\t\t\t\t\t\tvariant={\"ghost\"}\n\t\t\t\t\t\t\taria-label={\"Закрыть модальное окно\"}\n\t\t\t\t\t\t\tonClick={onClose}\n\t\t\t\t\t\t/>\n\t\t\t\t\t</div>\n\n\t\t\t\t\t<GridContainer\n\t\t\t\t\t\tid={`${titleId}-content`}\n\t\t\t\t\t\ttemplateRows={`${toolbar ? \"auto\" : \"\"} 1fr ${footer ? \"auto\" : \"\"}`.trim()}\n\t\t\t\t\t\t// gap=\"md\"\n\t\t\t\t\t\tclassName={styles.body}>\n\t\t\t\t\t\t{toolbar}\n\t\t\t\t\t\t{content}\n\t\t\t\t\t\t{footer}\n\t\t\t\t\t</GridContainer>\n\t\t\t\t</motion.div>\n\t\t\t) : null}\n\t\t</AnimatePresence>,\n\t\tmodalRoot\n\t);\n};\n","// ModalManagerContext.tsx\nimport React, { useCallback, useEffect, useRef, useState } from \"react\";\n\nimport { ModalManagerContext } from \"./useModalManager\";\n\nexport interface ModalManagerProviderProps {\n\tchildren: React.ReactNode;\n\t/** Компенсирует исчезновение скроллбара правым padding у body. */\n\tcompensateScrollbar?: boolean;\n}\n\n/**\n * Провайдер для централизованного управления стеком модальных окон. Дает вложенным компонентам доступ к открытию и закрытию модалок через контекст.\n */\nexport function ModalManagerProvider({ children, compensateScrollbar = false }: ModalManagerProviderProps) {\n\tconst [modals, setModals] = useState<string[]>([]);\n\tconst prevModalsLength = useRef(0);\n\tconst scrollbarWidth = useRef(0);\n\tconst bodyPaddingRight = useRef(\"\");\n\tconst isScrollbarCompensated = useRef(false);\n\n\tconst openModal = useCallback((id: string) => {\n\t\tsetModals((prev) => [...prev, id]);\n\t}, []);\n\n\tconst closeModal = useCallback((id: string) => {\n\t\tsetModals((prev) => prev.filter((mid) => mid !== id));\n\t}, []);\n\n\tconst isTopModal = useCallback(\n\t\t(id: string) => {\n\t\t\treturn modals[modals.length - 1] === id;\n\t\t},\n\t\t[modals]\n\t);\n\n\tuseEffect(() => {\n\t\tconst wasEmpty = prevModalsLength.current === 0;\n\n\t\tif (wasEmpty && modals.length > 0) {\n\t\t\t// первая модалка открыта — ставим стили\n\t\t\tconst scrollY = window.scrollY;\n\t\t\tconst appRoot = document.querySelector(\"#app-root\");\n\t\t\tscrollbarWidth.current = Math.max(0, window.innerWidth - document.documentElement.clientWidth);\n\t\t\tbodyPaddingRight.current = document.body.style.paddingRight;\n\n\t\t\tdocument.body.style.position = \"fixed\";\n\t\t\tdocument.body.style.top = `-${scrollY}px`;\n\t\t\tdocument.body.style.width = \"100%\";\n\n\t\t\tif (compensateScrollbar) {\n\t\t\t\tdocument.body.style.paddingRight = `${scrollbarWidth.current}px`;\n\t\t\t\tisScrollbarCompensated.current = true;\n\t\t\t}\n\n\t\t\tappRoot?.setAttribute(\"inert\", \"true\");\n\n\t\t\tprevModalsLength.current = modals.length;\n\t\t\treturn;\n\t\t}\n\n\t\tif (!wasEmpty && modals.length > 0 && compensateScrollbar !== isScrollbarCompensated.current) {\n\t\t\tdocument.body.style.paddingRight = compensateScrollbar ? `${scrollbarWidth.current}px` : bodyPaddingRight.current;\n\t\t\tisScrollbarCompensated.current = compensateScrollbar;\n\t\t}\n\n\t\tif (!wasEmpty && modals.length === 0) {\n\t\t\t// последняя модалка закрыта — снимаем стили\n\t\t\tconst appRoot = document.querySelector(\"#app-root\");\n\t\t\tconst scrollY = parseInt(document.body.style.top || \"0\") * -1;\n\n\t\t\tdocument.body.style.position = \"\";\n\t\t\tdocument.body.style.top = \"\";\n\t\t\tdocument.body.style.width = \"\";\n\n\t\t\tif (isScrollbarCompensated.current) {\n\t\t\t\tdocument.body.style.paddingRight = bodyPaddingRight.current;\n\t\t\t\tisScrollbarCompensated.current = false;\n\t\t\t}\n\n\t\t\tappRoot?.removeAttribute(\"inert\");\n\n\t\t\twindow.scrollTo({ top: scrollY, left: 0, behavior: \"instant\" });\n\t\t}\n\n\t\tprevModalsLength.current = modals.length;\n\t}, [compensateScrollbar, modals.length]);\n\n\treturn <ModalManagerContext.Provider value={{ modals, openModal, closeModal, isTopModal }}>{children}</ModalManagerContext.Provider>;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;GCMa,IAAsB;CAClC,QAAQ;EACP,SAAS;EACT,OAAO;EACP,GAAG;CACJ;CACA,SAAS;EACR,SAAS;EACT,OAAO;EACP,GAAG;CACJ;AACD,GAGa,IAAwB;CACpC,UAAU;CACV,MAAM;EAAC;EAAM;EAAG;EAAM;CAAC;AACxB,GAGa,IAA+B,EAC3C,UAAU,EACX,GC1Ba,IAAsB,EAKhC;CACF,QAAQ,CAAC;CACT,iBAAiB,CAAC;CAClB,kBAAkB,CAAC;CACnB,kBAAkB;AACnB,CAAC,GAEY,UAAwB,EAAW,CAAmB,GCUtD,KAAiD,EAAE,aAAU,mBAClE,kBAAC,OAAD;CAAK,WAAW,EAAG,mCAAmC,CAAS;CAAI;AAAc,CAAA;AAEzF,EAAa,cAAc;AAE3B,IAAa,KAA4E,EAAE,aAAU,cAAW,oBAE9G,kBAAC,OAAD;CAAK,WAAW,EAAG,iCAAiC,CAAS;CAC3D,UAAA,IAAa,kBAAC,GAAD;EAAY,WAAU;EAAQ;CAAqB,CAAA,IAAI;AACjE,CAAA;AAGP,EAAa,cAAc;AAE3B,IAAa,KAAgD,EAAE,aAAU,mBAEvE,kBAAC,OAAD;CAAK,WAAW,EAAG,gCAAgC,CAAS;CAC3D,UAAA,kBAAC,GAAD;EAAe,KAAI;EAAK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;IAAE,KAAK;IAAS,MAAM;IAAG,UAAU;GAAU,CAAC;EAC/D;EAEA,EAAiB,UAAU,EAAO;CACnC,GAAG,CAAC,GAAqB,EAAO,MAAM,CAAC,GAEhC,kBAAC,EAAoB,UAArB;EAA8B,OAAO;GAAE;GAAQ;GAAW;GAAY;EAAW;EAAI;CAAuC,CAAA;AACpI"}
1
+ {"version":3,"file":"modal-DPIXoMkB.js","names":[],"sources":["../../src/modal/Modal.module.scss","../../src/modal/modalMotion.ts","../../src/modal/useModalManager.ts","../../src/modal/Modal.tsx","../../src/modal/ModalManagerProvider.tsx"],"sourcesContent":["@use \"@/styles/mixins\" as *;\n\n.modal {\n\tdisplay: grid;\n\tgrid-auto-rows: auto 1fr;\n\n\tposition: fixed;\n\tinset: 0;\n\tmargin: auto;\n\tz-index: var(--z-modal);\n\twidth: 90%;\n\theight: fit-content;\n\tmax-height: calc(100dvh - var(--space-lg));\n\tborder: var(--border);\n\tborder-radius: var(--radius-md);\n\tbackground-color: var(--surface-0);\n\tbox-shadow: var(--shadow-lg);\n\n\t&:not(:last-child) {\n\t\tpointer-events: none;\n\t\tfilter: grayscale(0.5) opacity(0.75);\n\t\t// opacity: 0.5;\n\t}\n\n\t&.sm {\n\t\tmax-width: min(30em, 93dvw);\n\t}\n\n\t&.md {\n\t\tmax-width: min(50em, 93dvw);\n\t}\n\n\t&.lg {\n\t\tmax-width: min(70em, 93dvw);\n\t}\n\n\t&.xl {\n\t\tmax-width: min(80em, 93dvw);\n\t}\n\n\t&.xxl {\n\t\twidth: 93dvw;\n\t\theight: 90dvh;\n\t\tmax-width: none;\n\t\tmax-height: none;\n\t}\n\n\t&.inside {\n\t\twidth: 100%;\n\t\theight: 100%;\n\t\tmax-width: none;\n\t\tmax-height: none;\n\n\t\t.header,\n\t\t.body {\n\t\t\tborder-radius: 0;\n\t\t}\n\t}\n}\n\n.header {\n\tdisplay: flex;\n\talign-items: center;\n\tjustify-content: space-between;\n\tbackground-color: var(--surface-2);\n\tborder-top-left-radius: var(--radius-md);\n\tborder-top-right-radius: var(--radius-md);\n}\n\n.headerText {\n\tmargin: 0;\n\tpadding-inline: var(--space-md);\n\tfont-size: var(--font-size-md);\n\tfont-variation-settings: \"wght\" 600;\n}\n\n.headerButton {\n\tmargin-block: var(--space-xs);\n\tmargin-inline: var(--space-sm);\n\tflex: 0;\n}\n\n.body {\n\toverflow: hidden;\n\tborder-bottom-left-radius: var(--radius-md);\n\tborder-bottom-right-radius: var(--radius-md);\n}\n","import { type Transition, type Variants } from \"motion/react\";\n\n/**\n * Варианты задают единый спокойный переход для появления и удаления modal-панели.\n * Конфигурация приватна для primitive: потребители управляют только состоянием `isOpen`.\n */\nexport const modalMotionVariants = {\n\thidden: {\n\t\topacity: 0,\n\t\tscale: 0.96,\n\t\ty: 12\n\t},\n\tvisible: {\n\t\topacity: 1,\n\t\tscale: 1,\n\t\ty: 0\n\t}\n} satisfies Variants;\n\n/** Переход сохраняет отзывчивое открытие и дает exit-анимации завершиться до удаления portal content. */\nexport const modalMotionTransition = {\n\tduration: 0.18,\n\tease: [0.22, 1, 0.36, 1]\n} satisfies Transition;\n\n/** При системном reduced-motion остается только мгновенная смена видимости без пространственного движения. */\nexport const reducedModalMotionTransition = {\n\tduration: 0\n} satisfies Transition;\n","import { createContext, useContext } from \"react\";\n\nexport const ModalManagerContext = createContext<{\n\tmodals: string[];\n\topenModal: (id: string) => void;\n\tcloseModal: (id: string) => void;\n\tisTopModal: (id: string) => boolean;\n}>({\n\tmodals: [],\n\topenModal: () => {},\n\tcloseModal: () => {},\n\tisTopModal: () => false\n});\n\nexport const useModalManager = () => useContext(ModalManagerContext);\n","import React, { Children, useEffect, useId, useRef } from \"react\";\n\nimport { getOrCreatePortalRoot, useEscapeDismiss, useOverlayFocus } from \"@ryuzaki13/react-foundation-lib/dom\";\nimport { cn } from \"@ryuzaki13/react-foundation-lib/utils\";\nimport { X } from \"lucide-react\";\nimport { AnimatePresence, motion, useReducedMotion } from \"motion/react\";\nimport { createPortal } from \"react-dom\";\n\nimport { Button } from \"../button\";\nimport { FlexContainer } from \"../flex\";\nimport { GridContainer } from \"../grid\";\nimport { Scrollable } from \"../misc\";\n\nimport styles from \"./Modal.module.scss\";\nimport { modalMotionTransition, modalMotionVariants, reducedModalMotionTransition } from \"./modalMotion\";\nimport { ModalSize } from \"./types\";\nimport { useModalManager } from \"./useModalManager\";\n\n// Подкомпоненты\nexport interface ModalCompositionProps {\n\tchildren: React.ReactNode;\n\tclassName?: string;\n}\n\nexport const ModalToolbar: React.FC<ModalCompositionProps> = ({ children, className }) => {\n\treturn <div className={cn(\"surface2 paddingMd borderBottom\", className)}>{children}</div>;\n};\nModalToolbar.displayName = \"Modal.Toolbar\";\n\nexport const ModalContent: React.FC<ModalCompositionProps & { scrollable?: boolean }> = ({ children, className, scrollable }) => {\n\treturn (\n\t\t<div className={cn(\"paddingMd h100 overflowHidden\", className)}>\n\t\t\t{scrollable ? <Scrollable className=\"h100\">{children}</Scrollable> : children}\n\t\t</div>\n\t);\n};\nModalContent.displayName = \"Modal.Content\";\n\nexport const ModalFooter: React.FC<ModalCompositionProps> = ({ children, className }) => {\n\treturn (\n\t\t<div className={cn(\"surface2 borderTop paddingMd\", className)}>\n\t\t\t<FlexContainer gap=\"sm\" align=\"center\" justify=\"end\">\n\t\t\t\t{children}\n\t\t\t</FlexContainer>\n\t\t</div>\n\t);\n};\nModalFooter.displayName = \"Modal.Footer\";\n\ntype ToolbarElement = React.ReactElement<ModalCompositionProps, typeof ModalToolbar>;\ntype ContentElement = React.ReactElement<ModalCompositionProps, typeof ModalContent>;\ntype FooterElement = React.ReactElement<ModalCompositionProps, typeof ModalFooter>;\n\ntype ModalChildren =\n\t[ToolbarElement, ContentElement, FooterElement] | [ToolbarElement, ContentElement] | [ContentElement, FooterElement] | ContentElement;\n\nexport interface ModalProps {\n\t/** Открыто ли модальное окно */\n\tisOpen?: boolean;\n\t/** Заголовок */\n\ttitle?: string;\n\t/** Размер модального окна */\n\tsize?: keyof typeof ModalSize;\n\theight?: string;\n\t/** Обработчик закрытия */\n\tonClose: () => void;\n\tchildren: ModalChildren;\n}\n\nexport const Modal: React.FC<ModalProps> = ({ isOpen, title, size = \"sm\", height, onClose, children }) => {\n\tconst modalId = useId();\n\tconst titleId = useId();\n\n\tconst { modals, openModal, closeModal, isTopModal } = useModalManager();\n\tconst shouldReduceMotion = useReducedMotion();\n\tconst restoreFocusTargetRef = useRef<HTMLElement | null>(null);\n\tconst restoreFocusAnimationFrameRef = useRef(0);\n\n\t/**\n\t * Если provider менеджера не подключен, считаем одиночную модалку активной,\n\t * иначе логика Escape/focus trap никогда не включится.\n\t */\n\tconst isActive = isOpen && (modals.length === 0 || isTopModal(modalId));\n\n\tuseEffect(() => {\n\t\tif (isOpen) {\n\t\t\trestoreFocusTargetRef.current = document.activeElement instanceof HTMLElement ? document.activeElement : null;\n\t\t}\n\t}, [isOpen]);\n\n\tconst modalRef = useOverlayFocus<HTMLDivElement>({ active: isOpen || false, trapFocus: true, restoreFocus: false });\n\n\tuseEscapeDismiss({\n\t\tactive: isActive || false,\n\t\tonDismiss: onClose,\n\t\tcontainerRef: modalRef\n\t});\n\n\tuseEffect(() => {\n\t\tif (isOpen) {\n\t\t\topenModal(modalId);\n\t\t}\n\t}, [isOpen, modalId, openModal]);\n\n\tuseEffect(() => {\n\t\treturn () => {\n\t\t\twindow.cancelAnimationFrame(restoreFocusAnimationFrameRef.current);\n\t\t\tcloseModal(modalId);\n\t\t};\n\t}, [closeModal, modalId]);\n\n\tfunction handleExitComplete() {\n\t\tcloseModal(modalId);\n\t\tconst restoreFocusTarget = restoreFocusTargetRef.current;\n\n\t\t/**\n\t\t * Менеджер снимает inert в passive effect после обновления стека.\n\t\t * Следующий animation frame гарантирует, что trigger снова доступен для фокуса.\n\t\t */\n\t\trestoreFocusAnimationFrameRef.current = window.requestAnimationFrame(() => {\n\t\t\tif (restoreFocusTarget?.isConnected) {\n\t\t\t\trestoreFocusTarget.focus();\n\t\t\t}\n\t\t\trestoreFocusTargetRef.current = null;\n\t\t});\n\t}\n\n\tconst modalRoot = getOrCreatePortalRoot(\"modal-root\");\n\n\tif (!modalRoot) {\n\t\treturn null;\n\t}\n\n\tlet toolbar: React.ReactNode = null;\n\tlet content: React.ReactNode = null;\n\tlet footer: React.ReactNode = null;\n\n\tconst childArray = Children.toArray(children) as (ToolbarElement | ContentElement | FooterElement)[];\n\n\tfor (const child of childArray) {\n\t\tconst typeName = child.type.displayName;\n\n\t\tswitch (typeName) {\n\t\t\tcase ModalToolbar.displayName:\n\t\t\t\tif (toolbar) throw new Error(\"Modal: duplicate <Toolbar> found\");\n\t\t\t\ttoolbar = child; //.props.children;\n\t\t\t\tbreak;\n\t\t\tcase ModalFooter.displayName:\n\t\t\t\tif (footer) throw new Error(\"Modal: duplicate <Footer> found\");\n\t\t\t\tfooter = child; //props.children;\n\t\t\t\tbreak;\n\t\t\tcase ModalContent.displayName:\n\t\t\t\tif (content) throw new Error(\"Modal: duplicate <Content> found\");\n\t\t\t\tcontent = child; //.props.children;\n\t\t\t\tbreak;\n\t\t}\n\t}\n\n\treturn createPortal(\n\t\t<AnimatePresence onExitComplete={handleExitComplete}>\n\t\t\t{isOpen ? (\n\t\t\t\t<motion.div\n\t\t\t\t\tref={modalRef}\n\t\t\t\t\tclassName={cn(styles.modal, styles[size])}\n\t\t\t\t\tstyle={{ height }}\n\t\t\t\t\trole=\"dialog\"\n\t\t\t\t\taria-modal=\"true\"\n\t\t\t\t\taria-labelledby={titleId}\n\t\t\t\t\taria-describedby={`${titleId}-content`}\n\t\t\t\t\tinitial=\"hidden\"\n\t\t\t\t\tanimate=\"visible\"\n\t\t\t\t\texit=\"hidden\"\n\t\t\t\t\tvariants={modalMotionVariants}\n\t\t\t\t\ttransition={shouldReduceMotion ? reducedModalMotionTransition : modalMotionTransition}>\n\t\t\t\t\t<div className={cn(styles.header, toolbar ? \"\" : \"borderBottom\")}>\n\t\t\t\t\t\t<h3 className={styles.headerText} id={titleId}>\n\t\t\t\t\t\t\t{title}\n\t\t\t\t\t\t</h3>\n\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\ticon={<X />}\n\t\t\t\t\t\t\tclassName={styles.headerButton}\n\t\t\t\t\t\t\tvariant={\"ghost\"}\n\t\t\t\t\t\t\taria-label={\"Закрыть модальное окно\"}\n\t\t\t\t\t\t\tonClick={onClose}\n\t\t\t\t\t\t/>\n\t\t\t\t\t</div>\n\n\t\t\t\t\t<GridContainer\n\t\t\t\t\t\tid={`${titleId}-content`}\n\t\t\t\t\t\ttemplateRows={`${toolbar ? \"auto\" : \"\"} 1fr ${footer ? \"auto\" : \"\"}`.trim()}\n\t\t\t\t\t\t// gap=\"md\"\n\t\t\t\t\t\tclassName={styles.body}>\n\t\t\t\t\t\t{toolbar}\n\t\t\t\t\t\t{content}\n\t\t\t\t\t\t{footer}\n\t\t\t\t\t</GridContainer>\n\t\t\t\t</motion.div>\n\t\t\t) : null}\n\t\t</AnimatePresence>,\n\t\tmodalRoot\n\t);\n};\n","// ModalManagerContext.tsx\nimport React, { useCallback, useEffect, useRef, useState } from \"react\";\n\nimport { ModalManagerContext } from \"./useModalManager\";\n\nexport interface ModalManagerProviderProps {\n\tchildren: React.ReactNode;\n\t/** Компенсирует исчезновение скроллбара правым padding у body. */\n\tcompensateScrollbar?: boolean;\n}\n\n/**\n * Провайдер для централизованного управления стеком модальных окон. Дает вложенным компонентам доступ к открытию и закрытию модалок через контекст.\n */\nexport function ModalManagerProvider({ children, compensateScrollbar = false }: ModalManagerProviderProps) {\n\tconst [modals, setModals] = useState<string[]>([]);\n\tconst prevModalsLength = useRef(0);\n\tconst scrollbarWidth = useRef(0);\n\tconst bodyPaddingRight = useRef(\"\");\n\tconst isScrollbarCompensated = useRef(false);\n\n\tconst openModal = useCallback((id: string) => {\n\t\tsetModals((prev) => [...prev, id]);\n\t}, []);\n\n\tconst closeModal = useCallback((id: string) => {\n\t\tsetModals((prev) => prev.filter((mid) => mid !== id));\n\t}, []);\n\n\tconst isTopModal = useCallback(\n\t\t(id: string) => {\n\t\t\treturn modals[modals.length - 1] === id;\n\t\t},\n\t\t[modals]\n\t);\n\n\tuseEffect(() => {\n\t\tconst wasEmpty = prevModalsLength.current === 0;\n\n\t\tif (wasEmpty && modals.length > 0) {\n\t\t\t// первая модалка открыта — ставим стили\n\t\t\tconst scrollY = window.scrollY;\n\t\t\tconst appRoot = document.querySelector(\"#app-root\");\n\t\t\tscrollbarWidth.current = Math.max(0, window.innerWidth - document.documentElement.clientWidth);\n\t\t\tbodyPaddingRight.current = document.body.style.paddingRight;\n\n\t\t\tdocument.body.style.position = \"fixed\";\n\t\t\tdocument.body.style.top = `-${scrollY}px`;\n\t\t\tdocument.body.style.width = \"100%\";\n\n\t\t\tif (compensateScrollbar) {\n\t\t\t\tdocument.body.style.paddingRight = `${scrollbarWidth.current}px`;\n\t\t\t\tisScrollbarCompensated.current = true;\n\t\t\t}\n\n\t\t\tappRoot?.setAttribute(\"inert\", \"true\");\n\n\t\t\tprevModalsLength.current = modals.length;\n\t\t\treturn;\n\t\t}\n\n\t\tif (!wasEmpty && modals.length > 0 && compensateScrollbar !== isScrollbarCompensated.current) {\n\t\t\tdocument.body.style.paddingRight = compensateScrollbar ? `${scrollbarWidth.current}px` : bodyPaddingRight.current;\n\t\t\tisScrollbarCompensated.current = compensateScrollbar;\n\t\t}\n\n\t\tif (!wasEmpty && modals.length === 0) {\n\t\t\t// последняя модалка закрыта — снимаем стили\n\t\t\tconst appRoot = document.querySelector(\"#app-root\");\n\t\t\tconst scrollY = parseInt(document.body.style.top || \"0\") * -1;\n\n\t\t\tdocument.body.style.position = \"\";\n\t\t\tdocument.body.style.top = \"\";\n\t\t\tdocument.body.style.width = \"\";\n\n\t\t\tif (isScrollbarCompensated.current) {\n\t\t\t\tdocument.body.style.paddingRight = bodyPaddingRight.current;\n\t\t\t\tisScrollbarCompensated.current = false;\n\t\t\t}\n\n\t\t\tappRoot?.removeAttribute(\"inert\");\n\n\t\t\twindow.scrollTo({ top: scrollY, left: 0, behavior: \"instant\" });\n\t\t}\n\n\t\tprevModalsLength.current = modals.length;\n\t}, [compensateScrollbar, modals.length]);\n\n\treturn <ModalManagerContext.Provider value={{ modals, openModal, closeModal, isTopModal }}>{children}</ModalManagerContext.Provider>;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;GCMa,IAAsB;CAClC,QAAQ;EACP,SAAS;EACT,OAAO;EACP,GAAG;CACJ;CACA,SAAS;EACR,SAAS;EACT,OAAO;EACP,GAAG;CACJ;AACD,GAGa,IAAwB;CACpC,UAAU;CACV,MAAM;EAAC;EAAM;EAAG;EAAM;CAAC;AACxB,GAGa,IAA+B,EAC3C,UAAU,EACX,GC1Ba,IAAsB,EAKhC;CACF,QAAQ,CAAC;CACT,iBAAiB,CAAC;CAClB,kBAAkB,CAAC;CACnB,kBAAkB;AACnB,CAAC,GAEY,UAAwB,EAAW,CAAmB,GCUtD,KAAiD,EAAE,aAAU,mBAClE,kBAAC,OAAD;CAAK,WAAW,EAAG,mCAAmC,CAAS;CAAI;AAAc,CAAA;AAEzF,EAAa,cAAc;AAE3B,IAAa,KAA4E,EAAE,aAAU,cAAW,oBAE9G,kBAAC,OAAD;CAAK,WAAW,EAAG,iCAAiC,CAAS;CAC3D,UAAA,IAAa,kBAAC,GAAD;EAAY,WAAU;EAAQ;CAAqB,CAAA,IAAI;AACjE,CAAA;AAGP,EAAa,cAAc;AAE3B,IAAa,KAAgD,EAAE,aAAU,mBAEvE,kBAAC,OAAD;CAAK,WAAW,EAAG,gCAAgC,CAAS;CAC3D,UAAA,kBAAC,GAAD;EAAe,KAAI;EAAK,OAAM;EAAS,SAAQ;EAC7C;CACa,CAAA;AACX,CAAA;AAGP,EAAY,cAAc;AAsB1B,IAAa,KAA+B,EAAE,WAAQ,UAAO,UAAO,MAAM,WAAQ,YAAS,kBAAe;CACzG,IAAM,IAAU,EAAM,GAChB,IAAU,EAAM,GAEhB,EAAE,WAAQ,cAAW,eAAY,kBAAe,EA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