@ryuzaki13/react-foundation-ui 3.10.0 → 3.10.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/badge/index.js +1 -1
- package/dist/barcode-scanner/index.js +1 -1
- package/dist/base-table/index.js +1 -1
- package/dist/chunks/{TextEditorLexicalClient-BQH41FFT.js → TextEditorLexicalClient-Cj6yjCGm.js} +3 -3
- package/dist/chunks/{TextEditorLexicalClient-BQH41FFT.js.map → TextEditorLexicalClient-Cj6yjCGm.js.map} +1 -1
- package/dist/chunks/{base-table-CacTH3BE.js → base-table-CoVXG2FT.js} +4 -4
- package/dist/chunks/{base-table-CacTH3BE.js.map → base-table-CoVXG2FT.js.map} +1 -1
- package/dist/chunks/{context-menu-BV8636Ou.js → context-menu-BlLesqpZ.js} +2 -2
- package/dist/chunks/{context-menu-BV8636Ou.js.map → context-menu-BlLesqpZ.js.map} +1 -1
- package/dist/chunks/flex-BhrQCH4I.js +401 -0
- package/dist/chunks/flex-BhrQCH4I.js.map +1 -0
- package/dist/chunks/grid-D6wPRCjx.js +394 -0
- package/dist/chunks/grid-D6wPRCjx.js.map +1 -0
- package/dist/chunks/{misc-BjdDK6mm.js → misc-Dcr24uDY.js} +2 -2
- package/dist/chunks/{misc-BjdDK6mm.js.map → misc-Dcr24uDY.js.map} +1 -1
- package/dist/chunks/{modal-CBGNsqrq.js → modal-DeABSKrb.js} +4 -4
- package/dist/chunks/{modal-CBGNsqrq.js.map → modal-DeABSKrb.js.map} +1 -1
- package/dist/chunks/{picker-DagDe9OH.js → picker-CWx7vPE8.js} +2 -2
- package/dist/chunks/{picker-DagDe9OH.js.map → picker-CWx7vPE8.js.map} +1 -1
- package/dist/chunks/responsiveLayout-D2mtCDdh.js +28 -0
- package/dist/chunks/responsiveLayout-D2mtCDdh.js.map +1 -0
- package/dist/chunks/{select-C-1U-ujV.js → select-CHBBo5fn.js} +2 -2
- package/dist/chunks/{select-C-1U-ujV.js.map → select-CHBBo5fn.js.map} +1 -1
- package/dist/chunks/{table-Cx__DvpN.js → table-Cm9NhT9K.js} +2 -2
- package/dist/chunks/{table-Cx__DvpN.js.map → table-Cm9NhT9K.js.map} +1 -1
- package/dist/context-menu/index.js +1 -1
- package/dist/disclosure/index.js +1 -1
- package/dist/errors/index.js +1 -1
- package/dist/expandable-action-panel/index.js +1 -1
- package/dist/flex/FlexContainer.d.ts +1 -1
- package/dist/flex/FlexContainer.d.ts.map +1 -1
- package/dist/flex/FlexItem.d.ts +1 -1
- package/dist/flex/FlexItem.d.ts.map +1 -1
- package/dist/flex/PredefinedFlex.d.ts +1 -1
- package/dist/flex/PredefinedFlex.d.ts.map +1 -1
- package/dist/flex/getFlexClasses.d.ts +5 -0
- package/dist/flex/getFlexClasses.d.ts.map +1 -0
- package/dist/flex/index.js +1 -1
- package/dist/grid/GridContainer.d.ts.map +1 -1
- package/dist/grid/GridItem.d.ts.map +1 -1
- package/dist/grid/getGridClasses.d.ts +12 -0
- package/dist/grid/getGridClasses.d.ts.map +1 -0
- package/dist/grid/index.js +1 -1
- package/dist/image/index.js +2 -2
- package/dist/layout-picker/index.js +1 -1
- package/dist/list/index.js +2 -2
- package/dist/listbox/index.js +1 -1
- package/dist/misc/index.js +1 -1
- package/dist/modal/index.js +1 -1
- package/dist/multi-select/index.js +1 -1
- package/dist/notifications/index.js +1 -1
- package/dist/picker/index.js +1 -1
- package/dist/preset-range-date-input/index.js +1 -1
- package/dist/preset-select/index.js +1 -1
- package/dist/responsive-layout/responsiveLayout.d.ts +17 -0
- package/dist/responsive-layout/responsiveLayout.d.ts.map +1 -0
- package/dist/select/index.js +1 -1
- package/dist/simple-table/index.js +1 -1
- package/dist/slider/index.js +1 -1
- package/dist/state-select/index.js +1 -1
- package/dist/styles.css +1 -1
- package/dist/table/index.js +1 -1
- package/dist/table-sorting/index.js +1 -1
- package/dist/tabs/index.js +1 -1
- package/dist/text-editor/index.js +2 -2
- package/dist/toolbar/index.js +2 -2
- package/dist/tree-select/index.js +1 -1
- package/dist/tree-table/index.js +1 -1
- package/package.json +1 -1
- package/storybook-static/assets/{Badge-DxGi2POg.js → Badge-7nsS5Yyj.js} +1 -1
- package/storybook-static/assets/{Badge.stories-D6Em1fN8.js → Badge.stories-BzQKeDqC.js} +1 -1
- package/storybook-static/assets/{BadgeList-DemBuxUQ.js → BadgeList-WzFV9MB1.js} +1 -1
- package/storybook-static/assets/{BarcodeScannerDialog.stories-Bxnb0wH3.js → BarcodeScannerDialog.stories-Ci8Mf9WX.js} +1 -1
- package/storybook-static/assets/{Button-9vGUTM3m.js → Button-6F3OVyTc.js} +1 -1
- package/storybook-static/assets/{Button-dlGIhkja.js → Button-DqsSng-I.js} +1 -1
- package/storybook-static/assets/{Button.stories-WOE1_ovM.js → Button.stories-PNc3lIYB.js} +1 -1
- package/storybook-static/assets/{CalendarView-Co2EiQf9.js → CalendarView-BT9X9tky.js} +1 -1
- package/storybook-static/assets/{CheckBox-Dpg2QsvS.js → CheckBox-BJhTyl1K.js} +1 -1
- package/storybook-static/assets/{CheckBox-CwJshQX2.js → CheckBox-BasxUZYS.js} +1 -1
- package/storybook-static/assets/{CheckBox.stories-K8wng7-q.js → CheckBox.stories-DLRA5q3H.js} +1 -1
- package/storybook-static/assets/{Color-6AOWCN3U-D-64SqRn.js → Color-6AOWCN3U-C4R02nIA.js} +1 -1
- package/storybook-static/assets/{ContextMenu-DbmUWR4I.js → ContextMenu-BckwURZg.js} +1 -1
- package/storybook-static/assets/{ContextMenu-C1zzFMni.js → ContextMenu-OOsbvmOa.js} +1 -1
- package/storybook-static/assets/{ContextMenu.stories-D0tclMo1.js → ContextMenu.stories-BD-wMDNw.js} +1 -1
- package/storybook-static/assets/{DateInput-DxpENevn.js → DateInput-B5MxQUHL.js} +1 -1
- package/storybook-static/assets/{DateInput-BDxg1E80.js → DateInput-DT6btAWU.js} +1 -1
- package/storybook-static/assets/{DateInput.stories-De_AOkrK.js → DateInput.stories-BK2brwe_.js} +1 -1
- package/storybook-static/assets/{DateRangePresetSelect-CD7jNInU.js → DateRangePresetSelect-Dplr79Cm.js} +1 -1
- package/storybook-static/assets/{DateRangePresetSelect-CD8qu2LL.js → DateRangePresetSelect-gRdIuTx9.js} +1 -1
- package/storybook-static/assets/{DateRangePresetSelect.stories-phHkk3Q1.js → DateRangePresetSelect.stories-BRksGdxw.js} +1 -1
- package/storybook-static/assets/{DeprecatedMultiSelect-B4VEjiTj.js → DeprecatedMultiSelect-1MSPac-V.js} +1 -1
- package/storybook-static/assets/{DeprecatedMultiSelect-Bdv505U3.js → DeprecatedMultiSelect-BOxmEW2D.js} +1 -1
- package/storybook-static/assets/{DeprecatedMultiSelect.stories-DdPzDJjx.js → DeprecatedMultiSelect.stories-Ax0zv6Kb.js} +1 -1
- package/storybook-static/assets/{Detail-BoazSWw_.js → Detail-_5TyqOha.js} +1 -1
- package/storybook-static/assets/{Detail.stories-Cc9fEkdx.js → Detail.stories-CJbeEBiY.js} +1 -1
- package/storybook-static/assets/{Dialog-VJ62BLtp.js → Dialog-BodfEiIi.js} +1 -1
- package/storybook-static/assets/{Dialog-ieE9mpAU.js → Dialog-HBOYhMQq.js} +1 -1
- package/storybook-static/assets/{Dialog.stories-CUyAMGoD.js → Dialog.stories-Ds4F0ZoJ.js} +1 -1
- package/storybook-static/assets/{Disclosure-BP8VhRCA.js → Disclosure-BbvtIOyN.js} +1 -1
- package/storybook-static/assets/{Disclosure.stories-DwIo-o1J.js → Disclosure.stories-CnSK79hZ.js} +1 -1
- package/storybook-static/assets/{DisclosureGroup-LjgDW-Z6.js → DisclosureGroup-Dd0BeL4o.js} +1 -1
- package/storybook-static/assets/{DocsRenderer-JROSPFPF-BjRaiNDG.js → DocsRenderer-JROSPFPF-BX-ThlFg.js} +1 -1
- package/storybook-static/assets/{DropZone-Dg3GZxY8.js → DropZone-CCkHaYAD.js} +1 -1
- package/storybook-static/assets/{DropZone-BMT4jv2L.js → DropZone-DPqYieZH.js} +1 -1
- package/storybook-static/assets/{DropZone.stories-szOGIPHx.js → DropZone.stories-lfKkNIIl.js} +1 -1
- package/storybook-static/assets/{DropdownMenu-B0EI5ePH.js → DropdownMenu-QWp-lSol.js} +1 -1
- package/storybook-static/assets/{ExpandableActionPanel-D_qy2JID.js → ExpandableActionPanel-DxPp3zYd.js} +1 -1
- package/storybook-static/assets/{ExpandableActionPanel.stories-wdmlBDmK.js → ExpandableActionPanel.stories-BiklI55p.js} +1 -1
- package/storybook-static/assets/Flex-S4mwRnc2.js +81 -0
- package/storybook-static/assets/Flex.stories-DRBLrgrW.js +454 -0
- package/storybook-static/assets/FlexContainer-4Ap7vbIt.js +1 -0
- package/storybook-static/assets/{FlexItem-BE_4juAd.js → FlexItem-Dwqi7KeT.js} +2 -2
- package/storybook-static/assets/{FloatingPopover-DHxMCBdS.js → FloatingPopover-D8FScEoc.js} +1 -1
- package/storybook-static/assets/{FormattedTableCell-BfEiCYOi.js → FormattedTableCell-BKSpyxnu.js} +1 -1
- package/storybook-static/assets/{Grid-0NnWfTJ7.js → Grid-CJ5RLrgv.js} +2 -2
- package/storybook-static/assets/Grid-DIYjEdUA.js +84 -0
- package/storybook-static/assets/Grid.stories-Bl35lMkU.js +657 -0
- package/storybook-static/assets/{GridContainer-BHSfIiml.js → GridContainer-B2iAnXeB.js} +2 -2
- package/storybook-static/assets/GridContainer-DgBuOs_1.css +1 -0
- package/storybook-static/assets/{ImageCropper.stories-Cf5ogf7p.js → ImageCropper.stories--E79MUTS.js} +1 -1
- package/storybook-static/assets/{ImageRenderer-CsN1-IP6.js → ImageRenderer-D0stahXz.js} +1 -1
- package/storybook-static/assets/{ImageRenderer.stories-DIC-UR-l.js → ImageRenderer.stories-C_Ir6A3m.js} +1 -1
- package/storybook-static/assets/{ImageView.stories-DT6QZR-1.js → ImageView.stories-DbY7pwWs.js} +1 -1
- package/storybook-static/assets/{ImageViewer.stories-DxpCKbpk.js → ImageViewer.stories-D2jfTzCV.js} +2 -2
- package/storybook-static/assets/{ImageViewerRuntime-COhNh4_y.js → ImageViewerRuntime-DlvGnNv4.js} +1 -1
- package/storybook-static/assets/{Input-D2eqioLp.js → Input-CzvWPW0I.js} +1 -1
- package/storybook-static/assets/{Input-BJ3sPHt1.js → Input-av5ktymr.js} +1 -1
- package/storybook-static/assets/{Input.stories-MtAx6H2F.js → Input.stories-CvLnu270.js} +1 -1
- package/storybook-static/assets/{InputDateTime-CNNqhoo6.js → InputDateTime-D5bQuB9a.js} +1 -1
- package/storybook-static/assets/{InputDateTime.stories-DT3CvxRy.js → InputDateTime.stories-BD9Pt7vB.js} +1 -1
- package/storybook-static/assets/{InputFile-RfdomZEH.js → InputFile-C3nj3qsi.js} +1 -1
- package/storybook-static/assets/{InputFile-DiI_0QV5.js → InputFile-ulrG6ECh.js} +1 -1
- package/storybook-static/assets/{InputFile.stories-CiqGBnkS.js → InputFile.stories-CEewSWb_.js} +1 -1
- package/storybook-static/assets/{InputFiles-CgyVXpI1.js → InputFiles-DZ1nUYOE.js} +1 -1
- package/storybook-static/assets/{InputFiles-CBrPDNlV.js → InputFiles-lF7Ys1hh.js} +1 -1
- package/storybook-static/assets/{InputFiles.stories-QHNxJjiV.js → InputFiles.stories-CCptKLDn.js} +1 -1
- package/storybook-static/assets/{InputFilesList-BEIBTAEK.js → InputFilesList-DTJkMHNI.js} +1 -1
- package/storybook-static/assets/{InputImage-vXbhnE46.js → InputImage-CIPZL6uS.js} +1 -1
- package/storybook-static/assets/{InputImage-BBJr8TWl.js → InputImage-lDHbW_ac.js} +1 -1
- package/storybook-static/assets/{InputImage.stories-VoVU0QZB.js → InputImage.stories-CQ2BBGf-.js} +1 -1
- package/storybook-static/assets/{InteractiveComponents-CjkX3vU6.js → InteractiveComponents-DD7TZeA4.js} +1 -1
- package/storybook-static/assets/{InteractiveComponents.stories-Gc_Ju4xJ.js → InteractiveComponents.stories-Bbo3l8WO.js} +1 -1
- package/storybook-static/assets/{LayoutPicker-DwpDr_Is.js → LayoutPicker-A7VlDbc0.js} +1 -1
- package/storybook-static/assets/{LayoutPicker-ONnrtLDR.js → LayoutPicker-uw1knHzA.js} +1 -1
- package/storybook-static/assets/{LayoutPicker.stories-B-HIq6DD.js → LayoutPicker.stories-DDR6oiSN.js} +1 -1
- package/storybook-static/assets/{Listbox-DoF5nZIP.js → Listbox-CO1BjyFs.js} +1 -1
- package/storybook-static/assets/{Listbox-XIi0yHgl.js → Listbox-CmkI7dm_.js} +1 -1
- package/storybook-static/assets/{Listbox.stories-DT8FJQ3z.js → Listbox.stories-BIPmBbuG.js} +1 -1
- package/storybook-static/assets/{Modal-C3F4r2UA.js → Modal-C3JdXj6Q.js} +1 -1
- package/storybook-static/assets/{Modal-Ml7EuSvu.js → Modal-IXMZUaaw.js} +1 -1
- package/storybook-static/assets/{Modal.stories-DRwnYxst.js → Modal.stories-BD-UnVeM.js} +1 -1
- package/storybook-static/assets/{ModalManagerProvider-CmqdB_ni.js → ModalManagerProvider-zJVg8-dg.js} +1 -1
- package/storybook-static/assets/{MultiSelect-B1QokJ3C.js → MultiSelect-CGoyA8-m.js} +1 -1
- package/storybook-static/assets/{MultiSelect-CAg-L0dM.js → MultiSelect-DZKjK53B.js} +1 -1
- package/storybook-static/assets/{MultiSelect.stories-Dfh2Lp0N.js → MultiSelect.stories-D65mpYYt.js} +1 -1
- package/storybook-static/assets/{MultiSelectCore-GRGtCBO1.js → MultiSelectCore-ih1pgvuq.js} +1 -1
- package/storybook-static/assets/{NoData-BZhNhaYV.js → NoData-32gM9qt4.js} +1 -1
- package/storybook-static/assets/{NotificationsHost-BUPLrDM3.js → NotificationsHost-pkEhxgz2.js} +1 -1
- package/storybook-static/assets/{NotificationsHost.stories-CKbR-_nq.js → NotificationsHost.stories-BqIayryx.js} +1 -1
- package/storybook-static/assets/{ODataMultiSelect-CDW0B1az.js → ODataMultiSelect-D42gAcHg.js} +1 -1
- package/storybook-static/assets/{ODataMultiSelect.stories-BbKrxs7t.js → ODataMultiSelect.stories-DfAkKAsG.js} +1 -1
- package/storybook-static/assets/{ODataSelect-C5G0dCnn.js → ODataSelect-DPOMWPKO.js} +1 -1
- package/storybook-static/assets/{ODataSelect.stories-DcX50cyD.js → ODataSelect.stories-DHs3wp7E.js} +1 -1
- package/storybook-static/assets/{ODataTreeMultiSelect-4mTjhnlJ.js → ODataTreeMultiSelect-CC8yuaVP.js} +1 -1
- package/storybook-static/assets/{ODataTreeMultiSelect.stories-B-4UUg5l.js → ODataTreeMultiSelect.stories-BtwLdGK6.js} +1 -1
- package/storybook-static/assets/{ODataTreeSelect-D-wcx2OH.js → ODataTreeSelect-qcitpYxj.js} +1 -1
- package/storybook-static/assets/{ODataTreeSelect.stories-uB_sG4ga.js → ODataTreeSelect.stories-1r_tkUVi.js} +1 -1
- package/storybook-static/assets/{OneStepScroller-DQI5POnJ.js → OneStepScroller-wz4Qujpx.js} +1 -1
- package/storybook-static/assets/{Option-CrEWqsFF.js → Option-Beom2xTg.js} +1 -1
- package/storybook-static/assets/{OptionButton-BEQ2oSPf.js → OptionButton-D_ZCVbsd.js} +1 -1
- package/storybook-static/assets/{OptionContent-C8S7IjI3.js → OptionContent-FZ-u9L1s.js} +1 -1
- package/storybook-static/assets/{OptionContentContainer-ljQts_jY.js → OptionContentContainer-HVNOgpjm.js} +1 -1
- package/storybook-static/assets/{PeriodSelect-BTdDU06N.js → PeriodSelect-DbdeznMQ.js} +1 -1
- package/storybook-static/assets/{PeriodSelect-DuqatGdk.js → PeriodSelect-qevVtoSU.js} +1 -1
- package/storybook-static/assets/{PeriodSelect.stories-CX4DSFJG.js → PeriodSelect.stories-BLi_6rpY.js} +1 -1
- package/storybook-static/assets/{PickerField-Cgcm-Y5T.js → PickerField-BHSRcQY6.js} +1 -1
- package/storybook-static/assets/{PickerTriggerActions-DWe2uX0K.js → PickerTriggerActions-Cxk3YQGF.js} +1 -1
- package/storybook-static/assets/{Popover-C55I0GTn.js → Popover-BosMVXTI.js} +1 -1
- package/storybook-static/assets/{Popover-0QfSvwRS.js → Popover-De2fvkIB.js} +1 -1
- package/storybook-static/assets/{Popover.stories-Bgjomdgb.js → Popover.stories-DM-Plj05.js} +1 -1
- package/storybook-static/assets/{PresetRangeDateInput-Cai5fvRb.js → PresetRangeDateInput-CCQuBkJj.js} +1 -1
- package/storybook-static/assets/{PresetRangeDateInput-C-vQa5BZ.js → PresetRangeDateInput-jersOEYO.js} +1 -1
- package/storybook-static/assets/{PresetRangeDateInput.stories-CWtIukRG.js → PresetRangeDateInput.stories-DwqDWXX9.js} +1 -1
- package/storybook-static/assets/{PresetSelect-HqtmoRLb.js → PresetSelect-BhwHbWmS.js} +1 -1
- package/storybook-static/assets/{README-QWeHqOh2.js → README-1UUrJXjZ.js} +1 -1
- package/storybook-static/assets/{README-DycS0KDV.js → README-29WDFTDH.js} +1 -1
- package/storybook-static/assets/{README-CxMmicr4.js → README-33qTnj5l.js} +1 -1
- package/storybook-static/assets/{README-DlBBM40-.js → README-B5eMX8_9.js} +1 -1
- package/storybook-static/assets/{README-C6ryhIOV.js → README-B5rmNIab.js} +1 -1
- package/storybook-static/assets/{README-BgbNoj4_.js → README-BAlXRtAz.js} +1 -1
- package/storybook-static/assets/{README-C8oftQ5c.js → README-BCEKAY_J.js} +1 -1
- package/storybook-static/assets/{README-CM5yZ6jf.js → README-BD5f1if4.js} +1 -1
- package/storybook-static/assets/{README-CxEn3Q3j.js → README-BIvHy4kr.js} +1 -1
- package/storybook-static/assets/{README-_K214jGV.js → README-BK8k_Q4m.js} +1 -1
- package/storybook-static/assets/{README-BUKlvu1v.js → README-BKLeD4y3.js} +1 -1
- package/storybook-static/assets/{README-DBpH2nf1.js → README-BNsU3Cqx.js} +1 -1
- package/storybook-static/assets/{README-2lBx3R6g.js → README-BPSG9KrB.js} +1 -1
- package/storybook-static/assets/{README-BkFTTVE2.js → README-BQDFmWGi.js} +1 -1
- package/storybook-static/assets/{README-DUShQLyj.js → README-B_tg7QVI.js} +1 -1
- package/storybook-static/assets/{README-BFjx8Jxa.js → README-BfRKdJtw.js} +1 -1
- package/storybook-static/assets/{README-kvlO41U2.js → README-BoJXfTe6.js} +1 -1
- package/storybook-static/assets/{README-DF3qw7Jo.js → README-By0zyJQ-.js} +1 -1
- package/storybook-static/assets/{README-B5wBU6mA.js → README-BzVVPLXk.js} +1 -1
- package/storybook-static/assets/{README-Bl1rJEQE.js → README-CHllxFPj.js} +1 -1
- package/storybook-static/assets/{README-Bk6x-7we.js → README-CJ6rsYUk.js} +1 -1
- package/storybook-static/assets/{README-Dk7syFq-.js → README-CJFgcV8C.js} +1 -1
- package/storybook-static/assets/{README-DFGUcAOx.js → README-CPZBUXWs.js} +1 -1
- package/storybook-static/assets/{README-B1IMnjhg.js → README-CioPc-xb.js} +1 -1
- package/storybook-static/assets/{README-Brd9di5k.js → README-CmzO6bzh.js} +1 -1
- package/storybook-static/assets/{README-CdMmAh_G.js → README-Cpk-Tr_W.js} +1 -1
- package/storybook-static/assets/{README-C702dbsS.js → README-CrhHHw0i.js} +1 -1
- package/storybook-static/assets/{README-BTk3TSh8.js → README-CvReVgGJ.js} +1 -1
- package/storybook-static/assets/{README-ClH6EKpO.js → README-CvzdarfH.js} +1 -1
- package/storybook-static/assets/{README-BqMpFJKP.js → README-Cz14JUTC.js} +1 -1
- package/storybook-static/assets/{README-CxsbsDff.js → README-D09okhy9.js} +1 -1
- package/storybook-static/assets/{README-mxJzt2Xo.js → README-D5YLxtgR.js} +1 -1
- package/storybook-static/assets/{README-C2xdMez4.js → README-DK5aZdOt.js} +1 -1
- package/storybook-static/assets/{README-B5Lc1yT4.js → README-DKI2c8YJ.js} +1 -1
- package/storybook-static/assets/{README-UC0a4Wh9.js → README-DNeDK1_H.js} +1 -1
- package/storybook-static/assets/{README-BNLmyDfy.js → README-DQl_3tX1.js} +1 -1
- package/storybook-static/assets/{README-BhvWyeL_.js → README-DS63ZnOT.js} +1 -1
- package/storybook-static/assets/{README-DAozVWEl.js → README-DT96eoyc.js} +1 -1
- package/storybook-static/assets/{README-DitsKP8x.js → README-D_d6frx1.js} +1 -1
- package/storybook-static/assets/{README-RGQ7HMZR.js → README-Dc2qBccm.js} +1 -1
- package/storybook-static/assets/{README-BRJHDPaP.js → README-DeHGaTaW.js} +1 -1
- package/storybook-static/assets/{README-C1BajdmC.js → README-Df8F75dr.js} +1 -1
- package/storybook-static/assets/{README-DfVaZ9rz.js → README-DmJq-c8n.js} +1 -1
- package/storybook-static/assets/{README-BzIE9gSk.js → README-DzASMBMv.js} +1 -1
- package/storybook-static/assets/{README-CUUPvXQd.js → README-DzrrH56m.js} +1 -1
- package/storybook-static/assets/{README-eRuOqnaA.js → README-ECCgQcGo.js} +1 -1
- package/storybook-static/assets/{README-B41_J33v.js → README-LWfExOhc.js} +1 -1
- package/storybook-static/assets/{README-QZrJnhYv.js → README-NHHRscRF.js} +1 -1
- package/storybook-static/assets/{README-CdnQbIDn.js → README-O9BJmE-H.js} +1 -1
- package/storybook-static/assets/{README-B8RrtmaZ.js → README-Rk3Krdys.js} +1 -1
- package/storybook-static/assets/{README-SafL9Bz5.js → README-bWB0c7pN.js} +1 -1
- package/storybook-static/assets/{README-BEypAdTE.js → README-o4PUljT6.js} +1 -1
- package/storybook-static/assets/{README-BHrzFd3i.js → README-sPm51M3K.js} +1 -1
- package/storybook-static/assets/{RadioButton-BKsBk3--.js → RadioButton-BZiBFXe1.js} +1 -1
- package/storybook-static/assets/{RadioButton-CsM-RT0A.js → RadioButton-CBLdgMz4.js} +1 -1
- package/storybook-static/assets/{RadioButton.stories-D5PGiHj5.js → RadioButton.stories-BP5yM5qg.js} +1 -1
- package/storybook-static/assets/{RadioGroup-B3bLu8Qg.js → RadioGroup-DYRfZVGC.js} +1 -1
- package/storybook-static/assets/{RadioGroup-BZY_jeje.js → RadioGroup-epjQdSZn.js} +1 -1
- package/storybook-static/assets/{RadioGroup.stories-DMfcZFp0.js → RadioGroup.stories-UOjXIk6v.js} +1 -1
- package/storybook-static/assets/ResponsiveLayoutPreview-BHBxtn2W.js +1 -0
- package/storybook-static/assets/ResponsiveLayoutPreview-CyXawjCA.css +1 -0
- package/storybook-static/assets/{Scrollable-DLyQwImF.js → Scrollable-BBYov1Hn.js} +1 -1
- package/storybook-static/assets/{Scrollable-DdXQmkMU.js → Scrollable-DKQa75cf.js} +1 -1
- package/storybook-static/assets/{Scrollable.stories-Du5joHAp.js → Scrollable.stories-BH1-i6nI.js} +1 -1
- package/storybook-static/assets/{Select-8PYQeQRR.js → Select-DU6Eh0Lt.js} +1 -1
- package/storybook-static/assets/{Select-CT_wwcDN.js → Select-DYOCTPiv.js} +1 -1
- package/storybook-static/assets/{Select.stories-DIqia2Hb.js → Select.stories-BF3svbAH.js} +1 -1
- package/storybook-static/assets/{Separator-CelBAATq.js → Separator-CxviJxG5.js} +1 -1
- package/storybook-static/assets/{Separator-DJ93-Cvq.js → Separator-_gvt1sqm.js} +1 -1
- package/storybook-static/assets/{Separator.stories-DBEDpiqL.js → Separator.stories-DN6hlZl5.js} +1 -1
- package/storybook-static/assets/{SerializableSelect-C-00d6wC.js → SerializableSelect-BVTOrYLs.js} +1 -1
- package/storybook-static/assets/{SerializableSelect.stories-CP7fJBNa.js → SerializableSelect.stories-pcWq603M.js} +1 -1
- package/storybook-static/assets/{ShimmerText-qA7CslLE.js → ShimmerText-BDDa_Wf7.js} +1 -1
- package/storybook-static/assets/{ShimmerText.stories-CiGIbhCm.js → ShimmerText.stories-DdZPIKwl.js} +1 -1
- package/storybook-static/assets/{SingleDateTimeInput-DJ2vRS9H.js → SingleDateTimeInput-q-eu2xUU.js} +1 -1
- package/storybook-static/assets/{SingleDateTimeInput-B7tnYWQl.js → SingleDateTimeInput-sGTkT8ZA.js} +1 -1
- package/storybook-static/assets/{SingleDateTimeInput.stories-BK59HKLf.js → SingleDateTimeInput.stories-X7CMAFsq.js} +1 -1
- package/storybook-static/assets/{Slider-Cm6kd77G.js → Slider-CaKY8LIJ.js} +1 -1
- package/storybook-static/assets/{Slider-CXcIxUE3.js → Slider-CqNWljkT.js} +1 -1
- package/storybook-static/assets/{Slider.stories-BuhFWvUX.js → Slider.stories-CMxutCGM.js} +1 -1
- package/storybook-static/assets/{SliderInput-DI2h4X8P.js → SliderInput-HUUN5_IF.js} +1 -1
- package/storybook-static/assets/{SliderInput-DpmYS5Zb.js → SliderInput-scYwk-4g.js} +1 -1
- package/storybook-static/assets/{SliderInput.stories-CLdLS0_8.js → SliderInput.stories-CDhgeql1.js} +1 -1
- package/storybook-static/assets/{Sortable-CpjAZLxn.js → Sortable-CaysnUNW.js} +1 -1
- package/storybook-static/assets/{Sortable.stories-Ck2MHBoR.js → Sortable.stories-C4gHc5ka.js} +1 -1
- package/storybook-static/assets/{Splitter-Cpk_5dTf.js → Splitter-6cU1s7Qr.js} +1 -1
- package/storybook-static/assets/{Splitter.stories-BIf9NNWq.js → Splitter.stories-CA9A-CZ-.js} +1 -1
- package/storybook-static/assets/{StateSelect-BznE9WIu.js → StateSelect-BAqjdi4g.js} +1 -1
- package/storybook-static/assets/{StateSelect-C5tnrhWT.js → StateSelect-OHl6KWge.js} +1 -1
- package/storybook-static/assets/{StateSelect.stories-DLvSnAcF.js → StateSelect.stories-xX3ujKGO.js} +1 -1
- package/storybook-static/assets/{StatusIndicator-vJAPPq2m.js → StatusIndicator-C_7dWY2t.js} +1 -1
- package/storybook-static/assets/{StatusIndicator.stories-B7PGK2_C.js → StatusIndicator.stories-BRlVzKf7.js} +1 -1
- package/storybook-static/assets/{StringToggle.stories-DBpxJZL-.js → StringToggle.stories-DFPLwtHW.js} +1 -1
- package/storybook-static/assets/{Switch-BkTvYjyQ.js → Switch-CrlrIm3t.js} +1 -1
- package/storybook-static/assets/{Switch-DlRrk6o7.js → Switch-DHcMczAC.js} +1 -1
- package/storybook-static/assets/{Switch.stories-BtctkC2W.js → Switch.stories-LhTPX_R-.js} +1 -1
- package/storybook-static/assets/{Table-xOdM6spm.js → Table-Ct8iqJEY.js} +1 -1
- package/storybook-static/assets/{Table.stories-FORIU5CX.js → Table.stories-DO30v6VO.js} +1 -1
- package/storybook-static/assets/{TableEditor.stories-GU46gl20.js → TableEditor.stories-Qtqr_l4g.js} +1 -1
- package/storybook-static/assets/{Tabs-Cg_IYAXs.js → Tabs-CC0IIQwl.js} +1 -1
- package/storybook-static/assets/{Tabs.stories-2cS0B94o.js → Tabs.stories-Bo_Y-dq8.js} +1 -1
- package/storybook-static/assets/{TabsBox-Dz3AsaoR.js → TabsBox-BMNvHsCH.js} +1 -1
- package/storybook-static/assets/{TagInput-CCTgbRhQ.js → TagInput-BLwbzCit.js} +1 -1
- package/storybook-static/assets/{TagInput.stories-CevhCeXY.js → TagInput.stories-DNcD4tn4.js} +1 -1
- package/storybook-static/assets/{Text-CDCeYwIB.js → Text-Bih-aO3C.js} +1 -1
- package/storybook-static/assets/{Textarea-CNsrFSip.js → Textarea-D3os1biP.js} +1 -1
- package/storybook-static/assets/{Textarea-Ba4MyNoY.js → Textarea-DCnLF4aj.js} +1 -1
- package/storybook-static/assets/{Textarea.stories-laVFWVXL.js → Textarea.stories-CIFzZQ5Z.js} +1 -1
- package/storybook-static/assets/{TimePanel-Ddy67nzH.js → TimePanel-BcVGesht.js} +1 -1
- package/storybook-static/assets/{TimePanel.stories-OLefy0XD.js → TimePanel.stories-C6_xVdCq.js} +1 -1
- package/storybook-static/assets/{Toggle-BlCBtQd1.js → Toggle-BD0YAuO2.js} +1 -1
- package/storybook-static/assets/{Toggle-BGbyfmSW.js → Toggle-CtABgcO5.js} +1 -1
- package/storybook-static/assets/{Toggle.stories-BjeTDL90.js → Toggle.stories-DnTnFcGB.js} +1 -1
- package/storybook-static/assets/{TreeMultiSelect-BJnAzsFO.js → TreeMultiSelect-Bp_Akwgc.js} +1 -1
- package/storybook-static/assets/{TreeMultiSelect-ZVSLdnCU.js → TreeMultiSelect-DHk_QP2h.js} +1 -1
- package/storybook-static/assets/{TreeMultiSelect.stories-BJOtdIDe.js → TreeMultiSelect.stories-CBVQbR1c.js} +1 -1
- package/storybook-static/assets/{TreePickerBase-BQKfhufH.js → TreePickerBase-BhWXyIoO.js} +1 -1
- package/storybook-static/assets/{TreeSelect-BSr4FMlq.js → TreeSelect-DleoF0hJ.js} +1 -1
- package/storybook-static/assets/{TreeSelect-DSHQjGD1.js → TreeSelect-HNbghKYG.js} +1 -1
- package/storybook-static/assets/{TreeSelect.stories-GRcEv-kN.js → TreeSelect.stories-BigcPfEn.js} +1 -1
- package/storybook-static/assets/{TreeTable-CzmxD2ee.js → TreeTable-BNkuyFKP.js} +1 -1
- package/storybook-static/assets/{TreeTable.stories-35ufhVh1.js → TreeTable.stories-Bdx3y7Yb.js} +1 -1
- package/storybook-static/assets/{blocks-SX-KK9Lg.js → blocks-DGivDYe5.js} +3 -3
- package/storybook-static/assets/{check-BYM7OgKl.js → check-DRMDOowi.js} +1 -1
- package/storybook-static/assets/{chevron-down-Mu7usNfR.js → chevron-down-D0ohA4RZ.js} +1 -1
- package/storybook-static/assets/{chevron-left-CiOR-CGA.js → chevron-left-CLqpYqDQ.js} +1 -1
- package/storybook-static/assets/{chevron-right-5Rrk5UhO.js → chevron-right-CXryGzSx.js} +1 -1
- package/storybook-static/assets/{chunk-W22LQPXL-Cj8Y9DHq.js → chunk-W22LQPXL-CxLeSIMq.js} +1 -1
- package/storybook-static/assets/{circle-alert-BXB7LSDS.js → circle-alert-l6NwXGUY.js} +1 -1
- package/storybook-static/assets/{circle-check-DrVuYn1Q.js → circle-check-B-r716dD.js} +1 -1
- package/storybook-static/assets/{components-BEDJAYMp.js → components-Vmrwp1qC.js} +3 -3
- package/storybook-static/assets/{contextMenu-BaB_e0Tl.js → contextMenu-Br4n839h.js} +1 -1
- package/storybook-static/assets/{download-W-Vr_TI7.js → download-DqFSGBvN.js} +1 -1
- package/storybook-static/assets/{floating-ui.react-BTEwHffF.js → floating-ui.react-B-qFeMZZ.js} +1 -1
- package/storybook-static/assets/{foundationApi-BcoJ1zeX.js → foundationApi-DxO3oR-c.js} +1 -1
- package/storybook-static/assets/{foundationLib-B2kQ07LT.js → foundationLib-CTFFCQvn.js} +1 -1
- package/storybook-static/assets/getFlexClasses-BBvI2V8h.css +1 -0
- package/storybook-static/assets/getFlexClasses-DOf6NlyJ.js +1 -0
- package/storybook-static/assets/{hooks-BgMXxXbY.js → hooks-CAgVZJ-F.js} +1 -1
- package/storybook-static/assets/{iframe-CU98mtpe.js → iframe-E950Ehp0.js} +4 -4
- package/storybook-static/assets/iframe-dKozSQh6.js +1 -0
- package/storybook-static/assets/{info-BhHmytIH.js → info-Dp6XZGwP.js} +1 -1
- package/storybook-static/assets/{odata-yWIAioh9.js → odata-DuJbgix6.js} +1 -1
- package/storybook-static/assets/{odataStoryFixtures-CnZ_YrUb.js → odataStoryFixtures-CDArjyM7.js} +1 -1
- package/storybook-static/assets/{react-C2mSveWL.js → react-CGpO0FqR.js} +1 -1
- package/storybook-static/assets/{refresh-cw-D8_L8K4Y.js → refresh-cw-dMgbnEda.js} +1 -1
- package/storybook-static/assets/responsiveLayout-B9XAp69M.js +1 -0
- package/storybook-static/assets/{settings-2-jWGaWGT0.js → settings-2-CmW1dpao.js} +1 -1
- package/storybook-static/assets/{sortable-BteEe6X0.js → sortable-D7TAXZBK.js} +1 -1
- package/storybook-static/assets/{syntaxhighlighter-QEQV7K2Y-eEu1MRSg.js → syntaxhighlighter-QEQV7K2Y-ok7zY4QK.js} +1 -1
- package/storybook-static/assets/{trash-2-CwmbYA8i.js → trash-2-5v1tbQ2V.js} +1 -1
- package/storybook-static/assets/{triangle-alert-TRLt6Woa.js → triangle-alert-CVLPpc5j.js} +1 -1
- package/storybook-static/assets/{useODataSelectBase-BxHmAh7D.js → useODataSelectBase-Bkht6gRs.js} +1 -1
- package/storybook-static/assets/{useODataTreeData-dSt1HJsq.js → useODataTreeData-DTWPuC9Y.js} +1 -1
- package/storybook-static/assets/{usePickerQuery-ByBt1NRd.js → usePickerQuery-BmoBHlzm.js} +1 -1
- package/storybook-static/assets/{usePickerTriggerController-CqdXiV2q.js → usePickerTriggerController-Dvt7LsFZ.js} +1 -1
- package/storybook-static/assets/{x-BPRzfyys.js → x-DZpfbNy0.js} +1 -1
- package/storybook-static/iframe.html +2 -2
- package/storybook-static/index.json +1 -1
- package/storybook-static/project.json +1 -1
- package/dist/chunks/flex-D86M_h-0.js +0 -222
- package/dist/chunks/flex-D86M_h-0.js.map +0 -1
- package/dist/chunks/grid-CFuzBigM.js +0 -186
- package/dist/chunks/grid-CFuzBigM.js.map +0 -1
- package/dist/flex/useFlexClasses.d.ts +0 -8
- package/dist/flex/useFlexClasses.d.ts.map +0 -1
- package/dist/grid/useGridClasses.d.ts +0 -10
- package/dist/grid/useGridClasses.d.ts.map +0 -1
- package/storybook-static/assets/Flex-DYXuexPG.js +0 -61
- package/storybook-static/assets/Flex.stories-DH1BReS-.js +0 -300
- package/storybook-static/assets/FlexContainer-DO3X5f_1.js +0 -1
- package/storybook-static/assets/Grid-ChS0GzNg.js +0 -61
- package/storybook-static/assets/Grid.stories-ClZzgSfZ.js +0 -495
- package/storybook-static/assets/GridContainer-K9R_IHaw.css +0 -1
- package/storybook-static/assets/iframe-DaZCH1M-.js +0 -1
- package/storybook-static/assets/media-D9cE2tzi.js +0 -1
- package/storybook-static/assets/useFlexClasses-IXK2se1Y.css +0 -1
- package/storybook-static/assets/useFlexClasses-SgVG37Bb.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"misc-BjdDK6mm.js","names":[],"sources":["../../src/misc/AnimatedLogo.module.scss","../../src/misc/AnimatedLogo.tsx","../../src/misc/AnimatedLogoSegment.tsx","../../src/misc/CopyTextWrapper.tsx","../../src/misc/IconWrapper.module.scss","../../src/misc/IconWrapper.tsx","../../src/misc/LoadingMessage.module.scss","../../src/misc/Message.tsx","../../src/misc/LoadingMessage.tsx","../../src/misc/LazyDynamicComponent.tsx","../../src/misc/SkeletonLine.tsx","../../src/misc/LazyValue.tsx","../../src/misc/NoData.tsx","../../src/misc/Notice.tsx","../../src/misc/OneStepScroller.module.scss","../../src/misc/OneStepScroller.tsx","../../src/misc/Scrollable.tsx","../../src/misc/State.module.scss","../../src/misc/StateIcon.tsx","../../src/misc/StateWrapper.tsx"],"sourcesContent":[".logo {\n\tsvg {\n\t\tdisplay: block;\n\t\twidth: 100%;\n\t\theight: auto;\n\t}\n}\n\n.segment {\n\topacity: 0.2;\n\tanimation: pulseSteps 2s ease-in-out infinite;\n}\n\n@keyframes pulseSteps {\n\t0% {\n\t\topacity: 0.2;\n\t}\n\n\t35%,\n\t55% {\n\t\topacity: 1;\n\t}\n\n\t100% {\n\t\topacity: 0.2;\n\t}\n}\n\n@media (prefers-reduced-motion: reduce) {\n\t.segment {\n\t\tanimation: none;\n\t\topacity: 1;\n\t}\n}\n","import { type ComponentPropsWithoutRef, type ReactNode } from \"react\";\n\nimport { cn } from \"@ryuzaki13/react-foundation-lib/utils\";\n\nimport styles from \"./AnimatedLogo.module.scss\";\n\ntype AnimatedLogoProps = Omit<ComponentPropsWithoutRef<\"div\">, \"children\"> & {\n\tchildren: ReactNode;\n};\n\n/**\n * Контейнер анимированного логотипа без брендовой SVG-разметки.\n * Host-проект передаёт собственный `svg`, а его визуальные части оборачивает в `AnimatedLogoSegment`.\n */\nexport function AnimatedLogo({ children, className, ...htmlProps }: AnimatedLogoProps) {\n\treturn (\n\t\t<div {...htmlProps} className={cn(styles.logo, className)}>\n\t\t\t{children}\n\t\t</div>\n\t);\n}\n","import { type ComponentPropsWithoutRef, type ReactNode } from \"react\";\n\nimport { cn } from \"@ryuzaki13/react-foundation-lib/utils\";\n\nimport styles from \"./AnimatedLogo.module.scss\";\n\ntype AnimatedLogoSegmentProps = Omit<ComponentPropsWithoutRef<\"g\">, \"children\"> & {\n\tchildren: ReactNode;\n\torder: number;\n};\n\n/**\n * Анимирует одну смысловую часть host-логотипа и сдвигает её pulse относительно предыдущих частей.\n * `order` задаётся с нуля в визуальной последовательности сегментов и преобразуется в шаг задержки 200 мс.\n */\nexport function AnimatedLogoSegment({ children, className, order, style, ...svgGroupProps }: AnimatedLogoSegmentProps) {\n\treturn (\n\t\t<g {...svgGroupProps} className={cn(styles.segment, className)} style={{ ...style, animationDelay: `${order * 200}ms` }}>\n\t\t\t{children}\n\t\t</g>\n\t);\n}\n","import { Placement } from \"@floating-ui/react\";\nimport { useCopyElementTextWithFeedback } from \"@ryuzaki13/react-foundation-lib/copy\";\nimport { CheckCheckIcon, CopyIcon } from \"lucide-react\";\n\nimport { FloatingPopover } from \"../popover\";\n\ninterface CopyTextWrapperProps {\n\tchildren: React.ReactNode;\n\tposition?: Placement;\n\tshowOnHover?: boolean;\n\tclassName?: string;\n}\n\nexport function CopyTextWrapper({ children, position = \"top\", showOnHover = true, className }: CopyTextWrapperProps) {\n\tconst { containerRef, copyElementText, isCopied } = useCopyElementTextWithFeedback<HTMLSpanElement>();\n\n\treturn (\n\t\t<span ref={containerRef} className={className}>\n\t\t\t{children}\n\t\t\t<FloatingPopover openOnHover={showOnHover} placement={position} content={isCopied ? \"Скопировано!\" : \"Копировать текст\"}>\n\t\t\t\t<button onClick={copyElementText} aria-label={isCopied ? \"Скопировано!\" : \"Копировать текст\"}>\n\t\t\t\t\t{isCopied ? <CheckCheckIcon className=\"block statusSuccess\" /> : <CopyIcon className=\"block statusInfo\" />}\n\t\t\t\t</button>\n\t\t\t</FloatingPopover>\n\t\t</span>\n\t);\n}\n",".wrapper {\n\twidth: var(--control-height);\n\theight: var(--control-height);\n\tmargin: auto;\n\tdisplay: flex;\n\talign-items: center;\n\tjustify-content: center;\n}\n","import { ReactNode } from \"react\";\n\nimport { cn } from \"@ryuzaki13/react-foundation-lib/utils\";\n\nimport styles from \"./IconWrapper.module.scss\";\n\ninterface IconWrapperProps {\n\tchildren: ReactNode;\n\tclassName?: string;\n}\n\nexport function IconWrapper({ className, children }: IconWrapperProps) {\n\treturn <div className={cn(styles.wrapper, className)}>{children}</div>;\n}\n",".componentLoader {\n\tmin-height: 10em;\n}\n","import { type AriaAttributes, type AriaRole, type PropsWithChildren } from \"react\";\n\nimport { cn } from \"@ryuzaki13/react-foundation-lib/utils\";\n\nimport { FlexCenter } from \"../flex\";\nimport { Text, type TextColor } from \"../text\";\n\ntype MessageProps = PropsWithChildren<\n\tReadonly<{\n\t\tclassName?: string;\n\t\tcolor?: TextColor;\n\t\tminHeight?: string | number;\n\t\tuppercase?: boolean;\n\t\trole?: AriaRole;\n\t}>\n> &\n\tAriaAttributes;\n\nexport function Message({ className, children, color = \"muted\", role, minHeight, uppercase = true, ...ariaAttributes }: MessageProps) {\n\treturn (\n\t\t<FlexCenter className={cn(\"paddingMd textCenter\", className)} minHeight={minHeight}>\n\t\t\t<Text {...ariaAttributes} as=\"p\" weight=\"bold\" color={color} uppercase={uppercase} role={role}>\n\t\t\t\t{children}\n\t\t\t</Text>\n\t\t</FlexCenter>\n\t);\n}\n","import { type ReactNode } from \"react\";\n\nimport { cn } from \"@ryuzaki13/react-foundation-lib/utils\";\n\nimport styles from \"./LoadingMessage.module.scss\";\nimport { Message } from \"./Message\";\n\ntype LoadingMessageProps = {\n\tclassName?: string;\n\t/** Готовый брендовый знак, которым host-проект при необходимости дополняет сообщение о загрузке. */\n\tlogo?: ReactNode;\n\ttext?: string;\n};\n\nexport function LoadingMessage({ className, logo, text }: LoadingMessageProps) {\n\treturn (\n\t\t<Message className={cn(styles.componentLoader, logo ? undefined : \"skeletonLine\", className)}>\n\t\t\t{logo}\n\n\t\t\t{text || \"Загрузка...\"}\n\t\t</Message>\n\t);\n}\n","import { Suspense, useSyncExternalStore, type ComponentType, type ReactNode } from \"react\";\n\nimport { useLazyComponent } from \"@ryuzaki13/react-foundation-lib/hooks\";\n\nimport { LoadingMessage } from \"./LoadingMessage\";\n\ntype LazyDynamicComponentProps<T extends object> = {\n\timportFunc: () => Promise<Record<string, ComponentType<T>> | null>;\n\tcomponentName: string;\n\tcacheKey?: string;\n\tclientOnly?: boolean;\n\tfallback?: ReactNode;\n\tprops?: T;\n};\n\nconst subscribeClientOnlyMount = (onStoreChange: () => void) => {\n\tonStoreChange();\n\n\treturn () => undefined;\n};\n\nconst getClientSnapshot = () => true;\nconst getServerSnapshot = () => false;\n\n/**\n * Компонент ленивой загрузки динамически импортируемого React-компонента. Позволяет отложить загрузку тяжелых частей интерфейса до момента использования.\n */\nexport function LazyDynamicComponent<T extends object>({\n\tfallback,\n\timportFunc,\n\tcomponentName,\n\tclientOnly = false,\n\tcacheKey,\n\tprops\n}: LazyDynamicComponentProps<T>) {\n\tconst Component = useLazyComponent(importFunc, componentName, cacheKey);\n\tconst isClient = useSyncExternalStore(subscribeClientOnlyMount, getClientSnapshot, getServerSnapshot);\n\n\tconst fallbackNode = fallback ?? <LoadingMessage text=\"Ожидание компонента...\" />;\n\n\t// Client-only режим нужен для браузерных модулей, которые нельзя даже пытаться импортировать во время SSR.\n\tif (clientOnly && !isClient) return fallbackNode;\n\n\treturn (\n\t\t<Suspense fallback={fallbackNode}>\n\t\t\t{/* eslint-disable-next-line react-hooks/static-components */}\n\t\t\t<Component {...(props ?? ({} as T))} />\n\t\t</Suspense>\n\t);\n}\n","import React from \"react\";\n\nimport { cn } from \"@ryuzaki13/react-foundation-lib/utils\";\n\nimport { PolymorphicComponent, PolymorphicComponentBaseProps } from \"../polymorphic\";\n\ntype SkeletonLineOwnProps<E extends React.ElementType = React.ElementType> = PolymorphicComponentBaseProps<E> & {\n\tclassName?: string;\n};\n\ntype SkeletonLineProps<E extends React.ElementType> = SkeletonLineOwnProps<E> &\n\tOmit<React.ComponentPropsWithRef<E>, keyof SkeletonLineOwnProps>;\n\nexport function SkeletonLine<E extends React.ElementType>({ as, className, ...props }: SkeletonLineProps<E>) {\n\tconst Component = as || \"div\";\n\n\treturn (\n\t\t<PolymorphicComponent\n\t\t\tas={Component as React.ElementType}\n\t\t\tclassName={cn(\"skeletonLine colorTransparent radiusSm\", className)}\n\t\t\t{...props}\n\t\t/>\n\t);\n}\n","import React from \"react\";\n\nimport { SkeletonLine } from \"./SkeletonLine\";\n\ninterface LazyValueProps {\n\tvalue: React.ReactNode;\n\tisLoading?: boolean;\n}\n\nexport function LazyValue({ value, isLoading }: LazyValueProps) {\n\treturn isLoading ? <SkeletonLine>Загрузка...</SkeletonLine> : (value ?? \"-\");\n}\n","import { type AriaAttributes, type AriaRole } from \"react\";\n\nimport { Message } from \"./Message\";\n\ntype NoDataProps = Readonly<{\n\tclassName?: string;\n\ttext?: string;\n\tminHeight?: string | number;\n\trole?: AriaRole;\n}> &\n\tAriaAttributes;\n\nexport function NoData({ className, text, role, minHeight = \"5em\", ...ariaAttributes }: NoDataProps) {\n\treturn (\n\t\t<Message {...ariaAttributes} className={className} color=\"muted\" minHeight={minHeight} role={role}>\n\t\t\t{text || \"Нет данных\"}\n\t\t</Message>\n\t);\n}\n","import { type AriaAttributes, type AriaRole, type PropsWithChildren } from \"react\";\n\nimport { Message } from \"./Message\";\n\ntype NoticeProps = PropsWithChildren<\n\tReadonly<{\n\t\tisError?: boolean;\n\t\tclassName?: string;\n\t\trole?: AriaRole;\n\t}>\n> &\n\tAriaAttributes;\n\nexport function Notice({ className, isError, role, children, ...ariaAttributes }: NoticeProps) {\n\treturn (\n\t\t<Message {...ariaAttributes} className={className} color={isError ? \"error\" : \"secondary\"} role={role}>\n\t\t\t{children}\n\t\t</Message>\n\t);\n}\n",".oneStepScroller {\n\toverflow: hidden;\n\tdisplay: flex;\n\talign-items: center;\n\tgap: var(--space-xs);\n\tmin-width: 0;\n}\n\n.ossViewport {\n\toverflow: hidden;\n\toutline: none;\n\tmin-width: 0;\n\tflex: 1 1 auto;\n}\n\n.ossScroller {\n\tdisplay: flex;\n\tflex-wrap: nowrap;\n\tgap: var(--space-sm);\n\talign-items: end;\n\toverflow-x: auto;\n\toverflow-y: hidden;\n\tscroll-behavior: smooth;\n\t-webkit-overflow-scrolling: touch;\n\tscrollbar-width: none; /* firefox */\n\n\t::-webkit-scrollbar {\n\t\theight: 0;\n\t}\n}\n\n.ossButton {\n\t// position: absolute;\n\ttop: 0;\n\tz-index: 10;\n\twidth: var(--control-height);\n\theight: 100%;\n\tflex: 0 0 var(--control-height);\n\tdisplay: flex;\n\talign-items: center;\n\tjustify-content: center;\n\t// border: var(--border);\n\tborder-radius: var(--radius-sm);\n\tcolor: var(--content-2);\n\t// background-color: var(--surface-0);\n\t// opacity: 0.75;\n\n\ttransition-property: opacity, color;\n\ttransition-duration: var(--transition-fast);\n\n\t&:hover {\n\t\topacity: 1;\n\t\tcolor: var(--content-0);\n\t}\n\n\t&:disabled {\n\t\topacity: 0.5;\n\t\tpointer-events: none;\n\t}\n\n\t// &.prev {\n\t// \tleft: 0;\n\t// }\n\n\t// &.next {\n\t// \tright: 0;\n\t// }\n}\n","import React, { useCallback, useEffect, useRef, useState } from \"react\";\n\nimport { cn } from \"@ryuzaki13/react-foundation-lib/utils\";\nimport { ChevronLeftIcon, ChevronRightIcon } from \"lucide-react\";\n\nimport styles from \"./OneStepScroller.module.scss\";\n\ninterface OneStepScrollerProps {\n\tchildren: React.ReactNode;\n\tclassName?: string;\n\t/**\n\t * CSS-селектор элементов, которые считаются \"шагами\" скролла.\n\t * По умолчанию используются прямые потомки скроллера.\n\t */\n\titemSelector?: string;\n\t/**\n\t * Дополнительный внутренний отступ (px) при прокрутке к фокусируемому элементу.\n\t */\n\tscrollPadding?: number;\n\t/**\n\t * Плавная прокрутка для кнопок и авто-доводки до видимости.\n\t */\n\tsmooth?: boolean;\n}\n\nconst EDGE_EPSILON_PX = 1;\n\nfunction maxScrollLeft(scroller: HTMLElement) {\n\treturn Math.max(0, scroller.scrollWidth - scroller.clientWidth);\n}\n\n/**\n * Горизонтальный скроллер \"по одному элементу\".\n *\n * Ожидает элементы фиксированной ширины (или близкой к фиксированной),\n * чтобы шаг скролла соответствовал ширине одного элемента.\n */\nexport function OneStepScroller({ children, className, itemSelector, scrollPadding = 6, smooth = true }: OneStepScrollerProps) {\n\tconst scrollerRef = useRef<HTMLDivElement | null>(null);\n\tconst rafIdRef = useRef<number | null>(null);\n\n\tconst [canScrollPrev, setCanScrollPrev] = useState(false);\n\tconst [canScrollNext, setCanScrollNext] = useState(false);\n\n\t/**\n\t * Получить список элементов-\"шагов\".\n\t *\n\t * Оптимизация: для дефолтного поведения используем `children` DOM-узла,\n\t * чтобы не выполнять `querySelectorAll` на каждый вызов.\n\t */\n\tconst getItems = useCallback((): HTMLElement[] => {\n\t\tconst scroller = scrollerRef.current;\n\t\tif (!scroller) return [];\n\n\t\tif (!itemSelector) {\n\t\t\treturn Array.from(scroller.children).filter((node): node is HTMLElement => node instanceof HTMLElement);\n\t\t}\n\n\t\treturn Array.from(scroller.querySelectorAll<HTMLElement>(itemSelector));\n\t}, [itemSelector]);\n\n\t/**\n\t * Найти \"элемент шага\" для произвольного target внутри скроллера.\n\t */\n\tconst findItemForTarget = useCallback(\n\t\t(target: HTMLElement): HTMLElement | null => {\n\t\t\tconst scroller = scrollerRef.current;\n\t\t\tif (!scroller) return null;\n\n\t\t\tif (itemSelector) {\n\t\t\t\tconst item = target.closest<HTMLElement>(itemSelector);\n\t\t\t\tif (item && scroller.contains(item)) return item;\n\t\t\t\treturn null;\n\t\t\t}\n\n\t\t\tlet node: HTMLElement | null = target;\n\t\t\twhile (node && node.parentElement && node.parentElement !== scroller) {\n\t\t\t\tnode = node.parentElement;\n\t\t\t}\n\n\t\t\tif (node && node.parentElement === scroller) return node;\n\t\t\treturn null;\n\t\t},\n\t\t[itemSelector]\n\t);\n\n\t/**\n\t * Обновить состояние кнопок \"назад/вперед\".\n\t * Состояние меняется только при реальном отличии, чтобы не триггерить\n\t * лишние перерисовки на каждом событии scroll.\n\t */\n\tconst updateScrollButtons = useCallback(() => {\n\t\tconst scroller = scrollerRef.current;\n\t\tif (!scroller) {\n\t\t\tsetCanScrollPrev(false);\n\t\t\tsetCanScrollNext(false);\n\t\t\treturn;\n\t\t}\n\n\t\tconst maxScrollLeft = Math.max(0, scroller.scrollWidth - scroller.clientWidth);\n\t\tconst current = Math.max(0, Math.min(scroller.scrollLeft, maxScrollLeft));\n\n\t\tconst nextCanScrollPrev = current > EDGE_EPSILON_PX;\n\t\tconst nextCanScrollNext = current < maxScrollLeft - EDGE_EPSILON_PX;\n\n\t\tsetCanScrollPrev((prev) => (prev === nextCanScrollPrev ? prev : nextCanScrollPrev));\n\t\tsetCanScrollNext((prev) => (prev === nextCanScrollNext ? prev : nextCanScrollNext));\n\t}, []);\n\n\t/**\n\t * Запланировать обновление кнопок в следующий animation frame.\n\t * Это снижает частоту вычислений при интенсивном scroll/resize.\n\t */\n\tconst scheduleUpdateScrollButtons = useCallback(() => {\n\t\tif (rafIdRef.current !== null) return;\n\n\t\trafIdRef.current = requestAnimationFrame(() => {\n\t\t\trafIdRef.current = null;\n\t\t\tupdateScrollButtons();\n\t\t});\n\t}, [updateScrollButtons]);\n\n\t/**\n\t * Прокрутка на N элементов (N может быть отрицательным).\n\t */\n\tconst scrollByItems = useCallback(\n\t\t(count: number) => {\n\t\t\tconst scroller = scrollerRef.current;\n\t\t\tif (!scroller) return;\n\n\t\t\tconst firstItem = getItems()[0];\n\t\t\tif (!firstItem) return;\n\n\t\t\tconst step = firstItem.getBoundingClientRect().width;\n\t\t\tif (!step) return;\n\n\t\t\tconst delta = Math.round(count * step);\n\t\t\tconst maxScrollLeft = Math.max(0, scroller.scrollWidth - scroller.clientWidth);\n\t\t\tconst target = Math.max(0, Math.min(scroller.scrollLeft + delta, maxScrollLeft));\n\n\t\t\tscroller.scrollTo({\n\t\t\t\tleft: target,\n\t\t\t\tbehavior: smooth ? \"smooth\" : \"auto\"\n\t\t\t});\n\t\t},\n\t\t[getItems, smooth]\n\t);\n\n\t/**\n\t * Гарантировать полную видимость элемента в пределах viewport скроллера.\n\t */\n\tconst ensureFullyVisible = useCallback(\n\t\t(el: HTMLElement) => {\n\t\t\tconst scroller = scrollerRef.current;\n\t\t\tif (!scroller) return;\n\n\t\t\tconst scrollerRect = scroller.getBoundingClientRect();\n\t\t\tconst elementRect = el.getBoundingClientRect();\n\n\t\t\tconst elementLeft = elementRect.left - scrollerRect.left + scroller.scrollLeft;\n\t\t\tconst elementRight = elementLeft + elementRect.width;\n\n\t\t\tconst visibleLeft = scroller.scrollLeft;\n\t\t\tconst visibleRight = scroller.scrollLeft + scroller.clientWidth;\n\n\t\t\tif (elementLeft >= visibleLeft + EDGE_EPSILON_PX && elementRight <= visibleRight - EDGE_EPSILON_PX) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tlet targetScrollLeft = scroller.scrollLeft;\n\t\t\tif (elementLeft < visibleLeft) {\n\t\t\t\ttargetScrollLeft = Math.max(0, elementLeft - scrollPadding);\n\t\t\t} else if (elementRight > visibleRight) {\n\t\t\t\ttargetScrollLeft = Math.min(maxScrollLeft(scroller), elementRight - scroller.clientWidth + scrollPadding);\n\t\t\t}\n\n\t\t\tscroller.scrollTo({\n\t\t\t\tleft: Math.round(targetScrollLeft),\n\t\t\t\tbehavior: smooth ? \"smooth\" : \"auto\"\n\t\t\t});\n\t\t},\n\t\t[scrollPadding, smooth]\n\t);\n\n\tuseEffect(() => {\n\t\tconst scroller = scrollerRef.current;\n\t\tif (!scroller) return;\n\n\t\tconst handleFocusIn = (event: FocusEvent) => {\n\t\t\tconst target = event.target;\n\t\t\tif (!(target instanceof HTMLElement)) return;\n\n\t\t\tconst item = findItemForTarget(target);\n\t\t\tif (item) ensureFullyVisible(item);\n\t\t};\n\n\t\tscroller.addEventListener(\"focusin\", handleFocusIn);\n\t\treturn () => scroller.removeEventListener(\"focusin\", handleFocusIn);\n\t}, [ensureFullyVisible, findItemForTarget]);\n\n\t/**\n\t * Наблюдаем только за размером скроллера и изменением его DOM-структуры.\n\t * Это дешевле, чем подписка ResizeObserver на каждый элемент + IntersectionObserver.\n\t */\n\tuseEffect(() => {\n\t\tconst scroller = scrollerRef.current;\n\t\tif (!scroller) return;\n\n\t\tconst onScroll = () => scheduleUpdateScrollButtons();\n\t\tscroller.addEventListener(\"scroll\", onScroll, { passive: true });\n\n\t\tlet resizeObserver: ResizeObserver | null = null;\n\t\tif (typeof ResizeObserver !== \"undefined\") {\n\t\t\tresizeObserver = new ResizeObserver(scheduleUpdateScrollButtons);\n\t\t\tresizeObserver.observe(scroller);\n\t\t}\n\n\t\tlet mutationObserver: MutationObserver | null = null;\n\t\tif (typeof MutationObserver !== \"undefined\") {\n\t\t\tmutationObserver = new MutationObserver(scheduleUpdateScrollButtons);\n\t\t\tmutationObserver.observe(scroller, {\n\t\t\t\tchildList: true,\n\t\t\t\tsubtree: false\n\t\t\t});\n\t\t}\n\n\t\tscheduleUpdateScrollButtons();\n\n\t\treturn () => {\n\t\t\tscroller.removeEventListener(\"scroll\", onScroll);\n\t\t\tresizeObserver?.disconnect();\n\t\t\tmutationObserver?.disconnect();\n\n\t\t\tif (rafIdRef.current !== null) {\n\t\t\t\tcancelAnimationFrame(rafIdRef.current);\n\t\t\t\trafIdRef.current = null;\n\t\t\t}\n\t\t};\n\t}, [scheduleUpdateScrollButtons]);\n\n\t/**\n\t * При изменении children просим пересчитать видимость кнопок.\n\t */\n\tuseEffect(() => {\n\t\tscheduleUpdateScrollButtons();\n\t}, [children, scheduleUpdateScrollButtons]);\n\n\tconst handlePrev = () => scrollByItems(-1);\n\tconst handleNext = () => scrollByItems(1);\n\n\t/**\n\t * Клавиатурная доступность: стрелки влево/вправо двигают на один шаг.\n\t */\n\tconst onWrapperKeyDown = (e: React.KeyboardEvent) => {\n\t\tif (e.defaultPrevented) {\n\t\t\treturn;\n\t\t}\n\n\t\tif (e.key === \"ArrowLeft\") {\n\t\t\te.preventDefault();\n\t\t\thandlePrev();\n\t\t} else if (e.key === \"ArrowRight\") {\n\t\t\te.preventDefault();\n\t\t\thandleNext();\n\t\t}\n\t};\n\n\tconst hasScroll = canScrollPrev || canScrollNext;\n\n\treturn (\n\t\t<div className={cn(styles.oneStepScroller, className)} style={{ position: \"relative\" }}>\n\t\t\t{hasScroll && (\n\t\t\t\t<button\n\t\t\t\t\ttype=\"button\"\n\t\t\t\t\taria-label=\"Прокрутить шаг влево\"\n\t\t\t\t\tclassName={styles.ossButton}\n\t\t\t\t\tonClick={handlePrev}\n\t\t\t\t\tdisabled={!canScrollPrev}>\n\t\t\t\t\t<ChevronLeftIcon />\n\t\t\t\t</button>\n\t\t\t)}\n\n\t\t\t<div className={styles.ossViewport} onKeyDown={onWrapperKeyDown} role=\"group\" aria-label=\"Элементы прокрутки\">\n\t\t\t\t<div className={styles.ossScroller} ref={scrollerRef} aria-live=\"polite\">\n\t\t\t\t\t{children}\n\t\t\t\t</div>\n\t\t\t</div>\n\n\t\t\t{hasScroll && (\n\t\t\t\t<button\n\t\t\t\t\ttype=\"button\"\n\t\t\t\t\taria-label=\"Прокрутить шаг вправо\"\n\t\t\t\t\tclassName={styles.ossButton}\n\t\t\t\t\tonClick={handleNext}\n\t\t\t\t\tdisabled={!canScrollNext}>\n\t\t\t\t\t<ChevronRightIcon />\n\t\t\t\t</button>\n\t\t\t)}\n\t\t</div>\n\t);\n}\n","import { type ComponentPropsWithoutRef, type Ref } from \"react\";\n\nimport { cn } from \"@ryuzaki13/react-foundation-lib/utils\";\n\nexport interface ScrollableProps extends ComponentPropsWithoutRef<\"div\"> {\n\theight?: string | number;\n\tstable?: boolean;\n\toverscroll?: boolean;\n}\n\nexport function Scrollable({\n\tref,\n\tchildren,\n\theight,\n\tstable,\n\toverscroll,\n\tclassName,\n\tstyle,\n\t...htmlProps\n}: ScrollableProps & { ref?: Ref<HTMLDivElement> }) {\n\treturn (\n\t\t<div\n\t\t\t{...htmlProps}\n\t\t\tref={ref}\n\t\t\tclassName={cn(\"scrollable\", stable && \"stable\", overscroll && \"overscroll\", className)}\n\t\t\tstyle={{ ...style, height: height ?? style?.height }}>\n\t\t\t{children}\n\t\t</div>\n\t);\n}\n\nexport interface ScrollableBlockProps extends ScrollableProps {\n\tblockClassName?: string;\n}\n\nexport function ScrollableBlock({ ref, blockClassName, ...props }: ScrollableBlockProps & { ref?: Ref<HTMLDivElement> }) {\n\treturn (\n\t\t<div className={cn(blockClassName, \"overflowHidden w100 h100\")}>\n\t\t\t<Scrollable ref={ref} {...props} />\n\t\t</div>\n\t);\n}\n",".stateWrapper {\n\ttext-decoration: none;\n\tcolor: inherit;\n\tdisplay: block;\n\n\t// border: var(--border-width) solid var(--state-border-color, transparent);\n\tborder-left-style: solid;\n\tborder-left-color: var(--state-border-color, transparent);\n\tborder-left-width: 0.0625em; // 1px\n\tpadding-left: 0.25em; // 4px + 1px border\n\n\t&.status {\n\t\tborder-left-width: 0.3125em; // 5px\n\t\tpadding-left: 0;\n\n\t\t&.information {\n\t\t\tborder-left-color: var(--info-fill);\n\t\t}\n\n\t\t&.success {\n\t\t\tborder-left-color: var(--success-fill);\n\t\t}\n\n\t\t&.warning {\n\t\t\tborder-left-color: var(--warning-fill);\n\t\t}\n\n\t\t&.error {\n\t\t\tborder-left-color: var(--error-fill);\n\t\t}\n\t}\n}\n\n.state {\n\t&.information {\n\t\tcolor: var(--info-text);\n\n\t\tfill: var(--info-fill);\n\t\tstroke: var(--info-on-fill);\n\t}\n\n\t&.success {\n\t\tcolor: var(--success-text);\n\n\t\tfill: var(--success-fill);\n\t\tstroke: var(--success-on-fill);\n\t}\n\n\t&.warning {\n\t\tcolor: var(--warning-text);\n\n\t\tfill: var(--warning-fill);\n\t\tstroke: var(--warning-on-fill);\n\t\tstroke-width: 2px;\n\t}\n\n\t&.error {\n\t\tcolor: var(--error-text);\n\n\t\tfill: var(--error-fill);\n\t\tstroke: var(--error-on-fill);\n\t}\n}\n","import { State } from \"@ryuzaki13/react-foundation-lib/types\";\nimport { cn } from \"@ryuzaki13/react-foundation-lib/utils\";\nimport { CircleAlertIcon, CircleCheckIcon, CircleXIcon, InfoIcon } from \"lucide-react\";\n\nimport styles from \"./State.module.scss\";\n\ninterface StateIconProps {\n\tstate: State;\n\ttext: string;\n\tclassName?: string;\n}\n\nexport function StateIcon({ state = \"none\", text, className }: StateIconProps) {\n\tconst renderIcon = () => {\n\t\tswitch (state) {\n\t\t\tcase \"error\":\n\t\t\t\treturn <ErrorIcon />;\n\t\t\tcase \"warning\":\n\t\t\t\treturn <WarningIcon />;\n\t\t\tcase \"success\":\n\t\t\t\treturn <SuccessIcon />;\n\t\t\tcase \"information\":\n\t\t\t\treturn <InformationIcon />;\n\t\t\tdefault:\n\t\t\t\treturn null;\n\t\t}\n\t};\n\n\treturn (\n\t\t<div className={cn(\"flexCenter gapSm\", className)}>\n\t\t\t{renderIcon()}\n\t\t\t{text}\n\t\t</div>\n\t);\n}\n\ninterface RenderStateIconProps {\n\tstate?: State;\n}\n\nexport function RenderStateIcon({ state }: RenderStateIconProps) {\n\tswitch (state) {\n\t\tcase \"error\":\n\t\t\treturn <ErrorIcon />;\n\t\tcase \"warning\":\n\t\t\treturn <WarningIcon />;\n\t\tcase \"success\":\n\t\t\treturn <SuccessIcon />;\n\t\tcase \"information\":\n\t\t\treturn <InformationIcon />;\n\t\tdefault:\n\t\t\treturn null;\n\t}\n}\n\nexport function ErrorIcon() {\n\treturn <CircleXIcon className={cn(styles.state, styles.error)} />;\n}\nexport function WarningIcon() {\n\treturn <CircleAlertIcon className={cn(styles.state, styles.warning)} />;\n}\nexport function SuccessIcon() {\n\treturn <CircleCheckIcon className={cn(styles.state, styles.success)} />;\n}\nexport function InformationIcon() {\n\treturn <InfoIcon className={cn(styles.state, styles.information)} />;\n}\n","import React from \"react\";\n\nimport { State } from \"@ryuzaki13/react-foundation-lib/types\";\nimport { cn } from \"@ryuzaki13/react-foundation-lib/utils\";\n\nimport { PolymorphicComponent, PolymorphicComponentBaseProps } from \"../polymorphic\";\n\nimport styles from \"./State.module.scss\";\n\ntype StateWrapperOwnProps<E extends React.ElementType = React.ElementType> = PolymorphicComponentBaseProps<E> & {\n\tstate?: State;\n\tclassName?: string;\n};\n\ntype StateWrapperProps<E extends React.ElementType> = StateWrapperOwnProps<E> &\n\tOmit<React.ComponentPropsWithRef<E>, keyof StateWrapperOwnProps>;\n\nexport function StateWrapper<E extends React.ElementType>({ as, state, className, ...props }: StateWrapperProps<E>) {\n\tconst status = state?.toLowerCase() ?? \"none\";\n\tconst statusClass = styles[status as keyof typeof styles];\n\tconst isStatused = status && status !== \"none\";\n\n\tconst Component = as || \"div\";\n\n\treturn (\n\t\t<PolymorphicComponent\n\t\t\tas={Component as React.ElementType}\n\t\t\tclassName={cn(styles.stateWrapper, isStatused && styles.status, statusClass, className)}\n\t\t\t{...props}\n\t\t/>\n\t);\n}\n"],"mappings":";;;;;;;;;;;;;;;;;ACcA,SAAgB,EAAa,EAAE,aAAU,cAAW,GAAG,KAAgC;CACtF,OACC,kBAAC,OAAD;EAAK,GAAI;EAAW,WAAW,EAAG,EAAO,MAAM,CAAS;EACtD;CACG,CAAA;AAEP;;;ACLA,SAAgB,EAAoB,EAAE,aAAU,cAAW,UAAO,UAAO,GAAG,KAA2C;CACtH,OACC,kBAAC,KAAD;EAAG,GAAI;EAAe,WAAW,EAAG,EAAO,SAAS,CAAS;EAAG,OAAO;GAAE,GAAG;GAAO,gBAAgB,GAAG,IAAQ,IAAI;EAAI;EACpH;CACC,CAAA;AAEL;;;ACRA,SAAgB,EAAgB,EAAE,aAAU,cAAW,OAAO,iBAAc,IAAM,gBAAmC;CACpH,IAAM,EAAE,iBAAc,oBAAiB,gBAAa,EAAgD;CAEpG,OACC,kBAAC,QAAD;EAAM,KAAK;EAAyB;EAApC,UAAA,CACE,GACD,kBAAC,GAAD;GAAiB,aAAa;GAAa,WAAW;GAAU,SAAS,IAAW,iBAAiB;GACpG,UAAA,kBAAC,UAAD;IAAQ,SAAS;IAAiB,cAAY,IAAW,iBAAiB;IACxE,UAAA,IAAW,kBAAC,GAAD,EAAgB,WAAU,sBAAuB,CAAA,IAAI,kBAAC,GAAD,EAAU,WAAU,mBAAoB,CAAA;GAClG,CAAA;EACQ,CAAA,CACZ;;AAER;;;;AEfA,SAAgB,EAAY,EAAE,cAAW,eAA8B;CACtE,OAAO,kBAAC,OAAD;EAAK,WAAW,EAAG,EAAO,SAAS,CAAS;EAAI;CAAc,CAAA;AACtE;;;;AEKA,SAAgB,EAAQ,EAAE,cAAW,aAAU,WAAQ,SAAS,SAAM,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J,CAAA;AAEH"}
|
|
1
|
+
{"version":3,"file":"misc-Dcr24uDY.js","names":[],"sources":["../../src/misc/AnimatedLogo.module.scss","../../src/misc/AnimatedLogo.tsx","../../src/misc/AnimatedLogoSegment.tsx","../../src/misc/CopyTextWrapper.tsx","../../src/misc/IconWrapper.module.scss","../../src/misc/IconWrapper.tsx","../../src/misc/LoadingMessage.module.scss","../../src/misc/Message.tsx","../../src/misc/LoadingMessage.tsx","../../src/misc/LazyDynamicComponent.tsx","../../src/misc/SkeletonLine.tsx","../../src/misc/LazyValue.tsx","../../src/misc/NoData.tsx","../../src/misc/Notice.tsx","../../src/misc/OneStepScroller.module.scss","../../src/misc/OneStepScroller.tsx","../../src/misc/Scrollable.tsx","../../src/misc/State.module.scss","../../src/misc/StateIcon.tsx","../../src/misc/StateWrapper.tsx"],"sourcesContent":[".logo {\n\tsvg {\n\t\tdisplay: block;\n\t\twidth: 100%;\n\t\theight: auto;\n\t}\n}\n\n.segment {\n\topacity: 0.2;\n\tanimation: pulseSteps 2s ease-in-out infinite;\n}\n\n@keyframes pulseSteps {\n\t0% {\n\t\topacity: 0.2;\n\t}\n\n\t35%,\n\t55% {\n\t\topacity: 1;\n\t}\n\n\t100% {\n\t\topacity: 0.2;\n\t}\n}\n\n@media (prefers-reduced-motion: reduce) {\n\t.segment {\n\t\tanimation: none;\n\t\topacity: 1;\n\t}\n}\n","import { type ComponentPropsWithoutRef, type ReactNode } from \"react\";\n\nimport { cn } from \"@ryuzaki13/react-foundation-lib/utils\";\n\nimport styles from \"./AnimatedLogo.module.scss\";\n\ntype AnimatedLogoProps = Omit<ComponentPropsWithoutRef<\"div\">, \"children\"> & {\n\tchildren: ReactNode;\n};\n\n/**\n * Контейнер анимированного логотипа без брендовой SVG-разметки.\n * Host-проект передаёт собственный `svg`, а его визуальные части оборачивает в `AnimatedLogoSegment`.\n */\nexport function AnimatedLogo({ children, className, ...htmlProps }: AnimatedLogoProps) {\n\treturn (\n\t\t<div {...htmlProps} className={cn(styles.logo, className)}>\n\t\t\t{children}\n\t\t</div>\n\t);\n}\n","import { type ComponentPropsWithoutRef, type ReactNode } from \"react\";\n\nimport { cn } from \"@ryuzaki13/react-foundation-lib/utils\";\n\nimport styles from \"./AnimatedLogo.module.scss\";\n\ntype AnimatedLogoSegmentProps = Omit<ComponentPropsWithoutRef<\"g\">, \"children\"> & {\n\tchildren: ReactNode;\n\torder: number;\n};\n\n/**\n * Анимирует одну смысловую часть host-логотипа и сдвигает её pulse относительно предыдущих частей.\n * `order` задаётся с нуля в визуальной последовательности сегментов и преобразуется в шаг задержки 200 мс.\n */\nexport function AnimatedLogoSegment({ children, className, order, style, ...svgGroupProps }: AnimatedLogoSegmentProps) {\n\treturn (\n\t\t<g {...svgGroupProps} className={cn(styles.segment, className)} style={{ ...style, animationDelay: `${order * 200}ms` }}>\n\t\t\t{children}\n\t\t</g>\n\t);\n}\n","import { Placement } from \"@floating-ui/react\";\nimport { useCopyElementTextWithFeedback } from \"@ryuzaki13/react-foundation-lib/copy\";\nimport { CheckCheckIcon, CopyIcon } from \"lucide-react\";\n\nimport { FloatingPopover } from \"../popover\";\n\ninterface CopyTextWrapperProps {\n\tchildren: React.ReactNode;\n\tposition?: Placement;\n\tshowOnHover?: boolean;\n\tclassName?: string;\n}\n\nexport function CopyTextWrapper({ children, position = \"top\", showOnHover = true, className }: CopyTextWrapperProps) {\n\tconst { containerRef, copyElementText, isCopied } = useCopyElementTextWithFeedback<HTMLSpanElement>();\n\n\treturn (\n\t\t<span ref={containerRef} className={className}>\n\t\t\t{children}\n\t\t\t<FloatingPopover openOnHover={showOnHover} placement={position} content={isCopied ? \"Скопировано!\" : \"Копировать текст\"}>\n\t\t\t\t<button onClick={copyElementText} aria-label={isCopied ? \"Скопировано!\" : \"Копировать текст\"}>\n\t\t\t\t\t{isCopied ? <CheckCheckIcon className=\"block statusSuccess\" /> : <CopyIcon className=\"block statusInfo\" />}\n\t\t\t\t</button>\n\t\t\t</FloatingPopover>\n\t\t</span>\n\t);\n}\n",".wrapper {\n\twidth: var(--control-height);\n\theight: var(--control-height);\n\tmargin: auto;\n\tdisplay: flex;\n\talign-items: center;\n\tjustify-content: center;\n}\n","import { ReactNode } from \"react\";\n\nimport { cn } from \"@ryuzaki13/react-foundation-lib/utils\";\n\nimport styles from \"./IconWrapper.module.scss\";\n\ninterface IconWrapperProps {\n\tchildren: ReactNode;\n\tclassName?: string;\n}\n\nexport function IconWrapper({ className, children }: IconWrapperProps) {\n\treturn <div className={cn(styles.wrapper, className)}>{children}</div>;\n}\n",".componentLoader {\n\tmin-height: 10em;\n}\n","import { type AriaAttributes, type AriaRole, type PropsWithChildren } from \"react\";\n\nimport { cn } from \"@ryuzaki13/react-foundation-lib/utils\";\n\nimport { FlexCenter } from \"../flex\";\nimport { Text, type TextColor } from \"../text\";\n\ntype MessageProps = PropsWithChildren<\n\tReadonly<{\n\t\tclassName?: string;\n\t\tcolor?: TextColor;\n\t\tminHeight?: string | number;\n\t\tuppercase?: boolean;\n\t\trole?: AriaRole;\n\t}>\n> &\n\tAriaAttributes;\n\nexport function Message({ className, children, color = \"muted\", role, minHeight, uppercase = true, ...ariaAttributes }: MessageProps) {\n\treturn (\n\t\t<FlexCenter className={cn(\"paddingMd textCenter\", className)} minHeight={minHeight}>\n\t\t\t<Text {...ariaAttributes} as=\"p\" weight=\"bold\" color={color} uppercase={uppercase} role={role}>\n\t\t\t\t{children}\n\t\t\t</Text>\n\t\t</FlexCenter>\n\t);\n}\n","import { type ReactNode } from \"react\";\n\nimport { cn } from \"@ryuzaki13/react-foundation-lib/utils\";\n\nimport styles from \"./LoadingMessage.module.scss\";\nimport { Message } from \"./Message\";\n\ntype LoadingMessageProps = {\n\tclassName?: string;\n\t/** Готовый брендовый знак, которым host-проект при необходимости дополняет сообщение о загрузке. */\n\tlogo?: ReactNode;\n\ttext?: string;\n};\n\nexport function LoadingMessage({ className, logo, text }: LoadingMessageProps) {\n\treturn (\n\t\t<Message className={cn(styles.componentLoader, logo ? undefined : \"skeletonLine\", className)}>\n\t\t\t{logo}\n\n\t\t\t{text || \"Загрузка...\"}\n\t\t</Message>\n\t);\n}\n","import { Suspense, useSyncExternalStore, type ComponentType, type ReactNode } from \"react\";\n\nimport { useLazyComponent } from \"@ryuzaki13/react-foundation-lib/hooks\";\n\nimport { LoadingMessage } from \"./LoadingMessage\";\n\ntype LazyDynamicComponentProps<T extends object> = {\n\timportFunc: () => Promise<Record<string, ComponentType<T>> | null>;\n\tcomponentName: string;\n\tcacheKey?: string;\n\tclientOnly?: boolean;\n\tfallback?: ReactNode;\n\tprops?: T;\n};\n\nconst subscribeClientOnlyMount = (onStoreChange: () => void) => {\n\tonStoreChange();\n\n\treturn () => undefined;\n};\n\nconst getClientSnapshot = () => true;\nconst getServerSnapshot = () => false;\n\n/**\n * Компонент ленивой загрузки динамически импортируемого React-компонента. Позволяет отложить загрузку тяжелых частей интерфейса до момента использования.\n */\nexport function LazyDynamicComponent<T extends object>({\n\tfallback,\n\timportFunc,\n\tcomponentName,\n\tclientOnly = false,\n\tcacheKey,\n\tprops\n}: LazyDynamicComponentProps<T>) {\n\tconst Component = useLazyComponent(importFunc, componentName, cacheKey);\n\tconst isClient = useSyncExternalStore(subscribeClientOnlyMount, getClientSnapshot, getServerSnapshot);\n\n\tconst fallbackNode = fallback ?? <LoadingMessage text=\"Ожидание компонента...\" />;\n\n\t// Client-only режим нужен для браузерных модулей, которые нельзя даже пытаться импортировать во время SSR.\n\tif (clientOnly && !isClient) return fallbackNode;\n\n\treturn (\n\t\t<Suspense fallback={fallbackNode}>\n\t\t\t{/* eslint-disable-next-line react-hooks/static-components */}\n\t\t\t<Component {...(props ?? ({} as T))} />\n\t\t</Suspense>\n\t);\n}\n","import React from \"react\";\n\nimport { cn } from \"@ryuzaki13/react-foundation-lib/utils\";\n\nimport { PolymorphicComponent, PolymorphicComponentBaseProps } from \"../polymorphic\";\n\ntype SkeletonLineOwnProps<E extends React.ElementType = React.ElementType> = PolymorphicComponentBaseProps<E> & {\n\tclassName?: string;\n};\n\ntype SkeletonLineProps<E extends React.ElementType> = SkeletonLineOwnProps<E> &\n\tOmit<React.ComponentPropsWithRef<E>, keyof SkeletonLineOwnProps>;\n\nexport function SkeletonLine<E extends React.ElementType>({ as, className, ...props }: SkeletonLineProps<E>) {\n\tconst Component = as || \"div\";\n\n\treturn (\n\t\t<PolymorphicComponent\n\t\t\tas={Component as React.ElementType}\n\t\t\tclassName={cn(\"skeletonLine colorTransparent radiusSm\", className)}\n\t\t\t{...props}\n\t\t/>\n\t);\n}\n","import React from \"react\";\n\nimport { SkeletonLine } from \"./SkeletonLine\";\n\ninterface LazyValueProps {\n\tvalue: React.ReactNode;\n\tisLoading?: boolean;\n}\n\nexport function LazyValue({ value, isLoading }: LazyValueProps) {\n\treturn isLoading ? <SkeletonLine>Загрузка...</SkeletonLine> : (value ?? \"-\");\n}\n","import { type AriaAttributes, type AriaRole } from \"react\";\n\nimport { Message } from \"./Message\";\n\ntype NoDataProps = Readonly<{\n\tclassName?: string;\n\ttext?: string;\n\tminHeight?: string | number;\n\trole?: AriaRole;\n}> &\n\tAriaAttributes;\n\nexport function NoData({ className, text, role, minHeight = \"5em\", ...ariaAttributes }: NoDataProps) {\n\treturn (\n\t\t<Message {...ariaAttributes} className={className} color=\"muted\" minHeight={minHeight} role={role}>\n\t\t\t{text || \"Нет данных\"}\n\t\t</Message>\n\t);\n}\n","import { type AriaAttributes, type AriaRole, type PropsWithChildren } from \"react\";\n\nimport { Message } from \"./Message\";\n\ntype NoticeProps = PropsWithChildren<\n\tReadonly<{\n\t\tisError?: boolean;\n\t\tclassName?: string;\n\t\trole?: AriaRole;\n\t}>\n> &\n\tAriaAttributes;\n\nexport function Notice({ className, isError, role, children, ...ariaAttributes }: NoticeProps) {\n\treturn (\n\t\t<Message {...ariaAttributes} className={className} color={isError ? \"error\" : \"secondary\"} role={role}>\n\t\t\t{children}\n\t\t</Message>\n\t);\n}\n",".oneStepScroller {\n\toverflow: hidden;\n\tdisplay: flex;\n\talign-items: center;\n\tgap: var(--space-xs);\n\tmin-width: 0;\n}\n\n.ossViewport {\n\toverflow: hidden;\n\toutline: none;\n\tmin-width: 0;\n\tflex: 1 1 auto;\n}\n\n.ossScroller {\n\tdisplay: flex;\n\tflex-wrap: nowrap;\n\tgap: var(--space-sm);\n\talign-items: end;\n\toverflow-x: auto;\n\toverflow-y: hidden;\n\tscroll-behavior: smooth;\n\t-webkit-overflow-scrolling: touch;\n\tscrollbar-width: none; /* firefox */\n\n\t::-webkit-scrollbar {\n\t\theight: 0;\n\t}\n}\n\n.ossButton {\n\t// position: absolute;\n\ttop: 0;\n\tz-index: 10;\n\twidth: var(--control-height);\n\theight: 100%;\n\tflex: 0 0 var(--control-height);\n\tdisplay: flex;\n\talign-items: center;\n\tjustify-content: center;\n\t// border: var(--border);\n\tborder-radius: var(--radius-sm);\n\tcolor: var(--content-2);\n\t// background-color: var(--surface-0);\n\t// opacity: 0.75;\n\n\ttransition-property: opacity, color;\n\ttransition-duration: var(--transition-fast);\n\n\t&:hover {\n\t\topacity: 1;\n\t\tcolor: var(--content-0);\n\t}\n\n\t&:disabled {\n\t\topacity: 0.5;\n\t\tpointer-events: none;\n\t}\n\n\t// &.prev {\n\t// \tleft: 0;\n\t// }\n\n\t// &.next {\n\t// \tright: 0;\n\t// }\n}\n","import React, { useCallback, useEffect, useRef, useState } from \"react\";\n\nimport { cn } from \"@ryuzaki13/react-foundation-lib/utils\";\nimport { ChevronLeftIcon, ChevronRightIcon } from \"lucide-react\";\n\nimport styles from \"./OneStepScroller.module.scss\";\n\ninterface OneStepScrollerProps {\n\tchildren: React.ReactNode;\n\tclassName?: string;\n\t/**\n\t * CSS-селектор элементов, которые считаются \"шагами\" скролла.\n\t * По умолчанию используются прямые потомки скроллера.\n\t */\n\titemSelector?: string;\n\t/**\n\t * Дополнительный внутренний отступ (px) при прокрутке к фокусируемому элементу.\n\t */\n\tscrollPadding?: number;\n\t/**\n\t * Плавная прокрутка для кнопок и авто-доводки до видимости.\n\t */\n\tsmooth?: boolean;\n}\n\nconst EDGE_EPSILON_PX = 1;\n\nfunction maxScrollLeft(scroller: HTMLElement) {\n\treturn Math.max(0, scroller.scrollWidth - scroller.clientWidth);\n}\n\n/**\n * Горизонтальный скроллер \"по одному элементу\".\n *\n * Ожидает элементы фиксированной ширины (или близкой к фиксированной),\n * чтобы шаг скролла соответствовал ширине одного элемента.\n */\nexport function OneStepScroller({ children, className, itemSelector, scrollPadding = 6, smooth = true }: OneStepScrollerProps) {\n\tconst scrollerRef = useRef<HTMLDivElement | null>(null);\n\tconst rafIdRef = useRef<number | null>(null);\n\n\tconst [canScrollPrev, setCanScrollPrev] = useState(false);\n\tconst [canScrollNext, setCanScrollNext] = useState(false);\n\n\t/**\n\t * Получить список элементов-\"шагов\".\n\t *\n\t * Оптимизация: для дефолтного поведения используем `children` DOM-узла,\n\t * чтобы не выполнять `querySelectorAll` на каждый вызов.\n\t */\n\tconst getItems = useCallback((): HTMLElement[] => {\n\t\tconst scroller = scrollerRef.current;\n\t\tif (!scroller) return [];\n\n\t\tif (!itemSelector) {\n\t\t\treturn Array.from(scroller.children).filter((node): node is HTMLElement => node instanceof HTMLElement);\n\t\t}\n\n\t\treturn Array.from(scroller.querySelectorAll<HTMLElement>(itemSelector));\n\t}, [itemSelector]);\n\n\t/**\n\t * Найти \"элемент шага\" для произвольного target внутри скроллера.\n\t */\n\tconst findItemForTarget = useCallback(\n\t\t(target: HTMLElement): HTMLElement | null => {\n\t\t\tconst scroller = scrollerRef.current;\n\t\t\tif (!scroller) return null;\n\n\t\t\tif (itemSelector) {\n\t\t\t\tconst item = target.closest<HTMLElement>(itemSelector);\n\t\t\t\tif (item && scroller.contains(item)) return item;\n\t\t\t\treturn null;\n\t\t\t}\n\n\t\t\tlet node: HTMLElement | null = target;\n\t\t\twhile (node && node.parentElement && node.parentElement !== scroller) {\n\t\t\t\tnode = node.parentElement;\n\t\t\t}\n\n\t\t\tif (node && node.parentElement === scroller) return node;\n\t\t\treturn null;\n\t\t},\n\t\t[itemSelector]\n\t);\n\n\t/**\n\t * Обновить состояние кнопок \"назад/вперед\".\n\t * Состояние меняется только при реальном отличии, чтобы не триггерить\n\t * лишние перерисовки на каждом событии scroll.\n\t */\n\tconst updateScrollButtons = useCallback(() => {\n\t\tconst scroller = scrollerRef.current;\n\t\tif (!scroller) {\n\t\t\tsetCanScrollPrev(false);\n\t\t\tsetCanScrollNext(false);\n\t\t\treturn;\n\t\t}\n\n\t\tconst maxScrollLeft = Math.max(0, scroller.scrollWidth - scroller.clientWidth);\n\t\tconst current = Math.max(0, Math.min(scroller.scrollLeft, maxScrollLeft));\n\n\t\tconst nextCanScrollPrev = current > EDGE_EPSILON_PX;\n\t\tconst nextCanScrollNext = current < maxScrollLeft - EDGE_EPSILON_PX;\n\n\t\tsetCanScrollPrev((prev) => (prev === nextCanScrollPrev ? prev : nextCanScrollPrev));\n\t\tsetCanScrollNext((prev) => (prev === nextCanScrollNext ? prev : nextCanScrollNext));\n\t}, []);\n\n\t/**\n\t * Запланировать обновление кнопок в следующий animation frame.\n\t * Это снижает частоту вычислений при интенсивном scroll/resize.\n\t */\n\tconst scheduleUpdateScrollButtons = useCallback(() => {\n\t\tif (rafIdRef.current !== null) return;\n\n\t\trafIdRef.current = requestAnimationFrame(() => {\n\t\t\trafIdRef.current = null;\n\t\t\tupdateScrollButtons();\n\t\t});\n\t}, [updateScrollButtons]);\n\n\t/**\n\t * Прокрутка на N элементов (N может быть отрицательным).\n\t */\n\tconst scrollByItems = useCallback(\n\t\t(count: number) => {\n\t\t\tconst scroller = scrollerRef.current;\n\t\t\tif (!scroller) return;\n\n\t\t\tconst firstItem = getItems()[0];\n\t\t\tif (!firstItem) return;\n\n\t\t\tconst step = firstItem.getBoundingClientRect().width;\n\t\t\tif (!step) return;\n\n\t\t\tconst delta = Math.round(count * step);\n\t\t\tconst maxScrollLeft = Math.max(0, scroller.scrollWidth - scroller.clientWidth);\n\t\t\tconst target = Math.max(0, Math.min(scroller.scrollLeft + delta, maxScrollLeft));\n\n\t\t\tscroller.scrollTo({\n\t\t\t\tleft: target,\n\t\t\t\tbehavior: smooth ? \"smooth\" : \"auto\"\n\t\t\t});\n\t\t},\n\t\t[getItems, smooth]\n\t);\n\n\t/**\n\t * Гарантировать полную видимость элемента в пределах viewport скроллера.\n\t */\n\tconst ensureFullyVisible = useCallback(\n\t\t(el: HTMLElement) => {\n\t\t\tconst scroller = scrollerRef.current;\n\t\t\tif (!scroller) return;\n\n\t\t\tconst scrollerRect = scroller.getBoundingClientRect();\n\t\t\tconst elementRect = el.getBoundingClientRect();\n\n\t\t\tconst elementLeft = elementRect.left - scrollerRect.left + scroller.scrollLeft;\n\t\t\tconst elementRight = elementLeft + elementRect.width;\n\n\t\t\tconst visibleLeft = scroller.scrollLeft;\n\t\t\tconst visibleRight = scroller.scrollLeft + scroller.clientWidth;\n\n\t\t\tif (elementLeft >= visibleLeft + EDGE_EPSILON_PX && elementRight <= visibleRight - EDGE_EPSILON_PX) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tlet targetScrollLeft = scroller.scrollLeft;\n\t\t\tif (elementLeft < visibleLeft) {\n\t\t\t\ttargetScrollLeft = Math.max(0, elementLeft - scrollPadding);\n\t\t\t} else if (elementRight > visibleRight) {\n\t\t\t\ttargetScrollLeft = Math.min(maxScrollLeft(scroller), elementRight - scroller.clientWidth + scrollPadding);\n\t\t\t}\n\n\t\t\tscroller.scrollTo({\n\t\t\t\tleft: Math.round(targetScrollLeft),\n\t\t\t\tbehavior: smooth ? \"smooth\" : \"auto\"\n\t\t\t});\n\t\t},\n\t\t[scrollPadding, smooth]\n\t);\n\n\tuseEffect(() => {\n\t\tconst scroller = scrollerRef.current;\n\t\tif (!scroller) return;\n\n\t\tconst handleFocusIn = (event: FocusEvent) => {\n\t\t\tconst target = event.target;\n\t\t\tif (!(target instanceof HTMLElement)) return;\n\n\t\t\tconst item = findItemForTarget(target);\n\t\t\tif (item) ensureFullyVisible(item);\n\t\t};\n\n\t\tscroller.addEventListener(\"focusin\", handleFocusIn);\n\t\treturn () => scroller.removeEventListener(\"focusin\", handleFocusIn);\n\t}, [ensureFullyVisible, findItemForTarget]);\n\n\t/**\n\t * Наблюдаем только за размером скроллера и изменением его DOM-структуры.\n\t * Это дешевле, чем подписка ResizeObserver на каждый элемент + IntersectionObserver.\n\t */\n\tuseEffect(() => {\n\t\tconst scroller = scrollerRef.current;\n\t\tif (!scroller) return;\n\n\t\tconst onScroll = () => scheduleUpdateScrollButtons();\n\t\tscroller.addEventListener(\"scroll\", onScroll, { passive: true });\n\n\t\tlet resizeObserver: ResizeObserver | null = null;\n\t\tif (typeof ResizeObserver !== \"undefined\") {\n\t\t\tresizeObserver = new ResizeObserver(scheduleUpdateScrollButtons);\n\t\t\tresizeObserver.observe(scroller);\n\t\t}\n\n\t\tlet mutationObserver: MutationObserver | null = null;\n\t\tif (typeof MutationObserver !== \"undefined\") {\n\t\t\tmutationObserver = new MutationObserver(scheduleUpdateScrollButtons);\n\t\t\tmutationObserver.observe(scroller, {\n\t\t\t\tchildList: true,\n\t\t\t\tsubtree: false\n\t\t\t});\n\t\t}\n\n\t\tscheduleUpdateScrollButtons();\n\n\t\treturn () => {\n\t\t\tscroller.removeEventListener(\"scroll\", onScroll);\n\t\t\tresizeObserver?.disconnect();\n\t\t\tmutationObserver?.disconnect();\n\n\t\t\tif (rafIdRef.current !== null) {\n\t\t\t\tcancelAnimationFrame(rafIdRef.current);\n\t\t\t\trafIdRef.current = null;\n\t\t\t}\n\t\t};\n\t}, [scheduleUpdateScrollButtons]);\n\n\t/**\n\t * При изменении children просим пересчитать видимость кнопок.\n\t */\n\tuseEffect(() => {\n\t\tscheduleUpdateScrollButtons();\n\t}, [children, scheduleUpdateScrollButtons]);\n\n\tconst handlePrev = () => scrollByItems(-1);\n\tconst handleNext = () => scrollByItems(1);\n\n\t/**\n\t * Клавиатурная доступность: стрелки влево/вправо двигают на один шаг.\n\t */\n\tconst onWrapperKeyDown = (e: React.KeyboardEvent) => {\n\t\tif (e.defaultPrevented) {\n\t\t\treturn;\n\t\t}\n\n\t\tif (e.key === \"ArrowLeft\") {\n\t\t\te.preventDefault();\n\t\t\thandlePrev();\n\t\t} else if (e.key === \"ArrowRight\") {\n\t\t\te.preventDefault();\n\t\t\thandleNext();\n\t\t}\n\t};\n\n\tconst hasScroll = canScrollPrev || canScrollNext;\n\n\treturn (\n\t\t<div className={cn(styles.oneStepScroller, className)} style={{ position: \"relative\" }}>\n\t\t\t{hasScroll && (\n\t\t\t\t<button\n\t\t\t\t\ttype=\"button\"\n\t\t\t\t\taria-label=\"Прокрутить шаг влево\"\n\t\t\t\t\tclassName={styles.ossButton}\n\t\t\t\t\tonClick={handlePrev}\n\t\t\t\t\tdisabled={!canScrollPrev}>\n\t\t\t\t\t<ChevronLeftIcon />\n\t\t\t\t</button>\n\t\t\t)}\n\n\t\t\t<div className={styles.ossViewport} onKeyDown={onWrapperKeyDown} role=\"group\" aria-label=\"Элементы прокрутки\">\n\t\t\t\t<div className={styles.ossScroller} ref={scrollerRef} aria-live=\"polite\">\n\t\t\t\t\t{children}\n\t\t\t\t</div>\n\t\t\t</div>\n\n\t\t\t{hasScroll && (\n\t\t\t\t<button\n\t\t\t\t\ttype=\"button\"\n\t\t\t\t\taria-label=\"Прокрутить шаг вправо\"\n\t\t\t\t\tclassName={styles.ossButton}\n\t\t\t\t\tonClick={handleNext}\n\t\t\t\t\tdisabled={!canScrollNext}>\n\t\t\t\t\t<ChevronRightIcon />\n\t\t\t\t</button>\n\t\t\t)}\n\t\t</div>\n\t);\n}\n","import { type ComponentPropsWithoutRef, type Ref } from \"react\";\n\nimport { cn } from \"@ryuzaki13/react-foundation-lib/utils\";\n\nexport interface ScrollableProps extends ComponentPropsWithoutRef<\"div\"> {\n\theight?: string | number;\n\tstable?: boolean;\n\toverscroll?: boolean;\n}\n\nexport function Scrollable({\n\tref,\n\tchildren,\n\theight,\n\tstable,\n\toverscroll,\n\tclassName,\n\tstyle,\n\t...htmlProps\n}: ScrollableProps & { ref?: Ref<HTMLDivElement> }) {\n\treturn (\n\t\t<div\n\t\t\t{...htmlProps}\n\t\t\tref={ref}\n\t\t\tclassName={cn(\"scrollable\", stable && \"stable\", overscroll && \"overscroll\", className)}\n\t\t\tstyle={{ ...style, height: height ?? style?.height }}>\n\t\t\t{children}\n\t\t</div>\n\t);\n}\n\nexport interface ScrollableBlockProps extends ScrollableProps {\n\tblockClassName?: string;\n}\n\nexport function ScrollableBlock({ ref, blockClassName, ...props }: ScrollableBlockProps & { ref?: Ref<HTMLDivElement> }) {\n\treturn (\n\t\t<div className={cn(blockClassName, \"overflowHidden w100 h100\")}>\n\t\t\t<Scrollable ref={ref} {...props} />\n\t\t</div>\n\t);\n}\n",".stateWrapper {\n\ttext-decoration: none;\n\tcolor: inherit;\n\tdisplay: block;\n\n\t// border: var(--border-width) solid var(--state-border-color, transparent);\n\tborder-left-style: solid;\n\tborder-left-color: var(--state-border-color, transparent);\n\tborder-left-width: 0.0625em; // 1px\n\tpadding-left: 0.25em; // 4px + 1px border\n\n\t&.status {\n\t\tborder-left-width: 0.3125em; // 5px\n\t\tpadding-left: 0;\n\n\t\t&.information {\n\t\t\tborder-left-color: var(--info-fill);\n\t\t}\n\n\t\t&.success {\n\t\t\tborder-left-color: var(--success-fill);\n\t\t}\n\n\t\t&.warning {\n\t\t\tborder-left-color: var(--warning-fill);\n\t\t}\n\n\t\t&.error {\n\t\t\tborder-left-color: var(--error-fill);\n\t\t}\n\t}\n}\n\n.state {\n\t&.information {\n\t\tcolor: var(--info-text);\n\n\t\tfill: var(--info-fill);\n\t\tstroke: var(--info-on-fill);\n\t}\n\n\t&.success {\n\t\tcolor: var(--success-text);\n\n\t\tfill: var(--success-fill);\n\t\tstroke: var(--success-on-fill);\n\t}\n\n\t&.warning {\n\t\tcolor: var(--warning-text);\n\n\t\tfill: var(--warning-fill);\n\t\tstroke: var(--warning-on-fill);\n\t\tstroke-width: 2px;\n\t}\n\n\t&.error {\n\t\tcolor: var(--error-text);\n\n\t\tfill: var(--error-fill);\n\t\tstroke: var(--error-on-fill);\n\t}\n}\n","import { State } from \"@ryuzaki13/react-foundation-lib/types\";\nimport { cn } from \"@ryuzaki13/react-foundation-lib/utils\";\nimport { CircleAlertIcon, CircleCheckIcon, CircleXIcon, InfoIcon } from \"lucide-react\";\n\nimport styles from \"./State.module.scss\";\n\ninterface StateIconProps {\n\tstate: State;\n\ttext: string;\n\tclassName?: string;\n}\n\nexport function StateIcon({ state = \"none\", text, className }: StateIconProps) {\n\tconst renderIcon = () => {\n\t\tswitch (state) {\n\t\t\tcase \"error\":\n\t\t\t\treturn <ErrorIcon />;\n\t\t\tcase \"warning\":\n\t\t\t\treturn <WarningIcon />;\n\t\t\tcase \"success\":\n\t\t\t\treturn <SuccessIcon />;\n\t\t\tcase \"information\":\n\t\t\t\treturn <InformationIcon />;\n\t\t\tdefault:\n\t\t\t\treturn null;\n\t\t}\n\t};\n\n\treturn (\n\t\t<div className={cn(\"flexCenter gapSm\", className)}>\n\t\t\t{renderIcon()}\n\t\t\t{text}\n\t\t</div>\n\t);\n}\n\ninterface RenderStateIconProps {\n\tstate?: State;\n}\n\nexport function RenderStateIcon({ state }: RenderStateIconProps) {\n\tswitch (state) {\n\t\tcase \"error\":\n\t\t\treturn <ErrorIcon />;\n\t\tcase \"warning\":\n\t\t\treturn <WarningIcon />;\n\t\tcase \"success\":\n\t\t\treturn <SuccessIcon />;\n\t\tcase \"information\":\n\t\t\treturn <InformationIcon />;\n\t\tdefault:\n\t\t\treturn null;\n\t}\n}\n\nexport function ErrorIcon() {\n\treturn <CircleXIcon className={cn(styles.state, styles.error)} />;\n}\nexport function WarningIcon() {\n\treturn <CircleAlertIcon className={cn(styles.state, styles.warning)} />;\n}\nexport function SuccessIcon() {\n\treturn <CircleCheckIcon className={cn(styles.state, styles.success)} />;\n}\nexport function InformationIcon() {\n\treturn <InfoIcon className={cn(styles.state, styles.information)} />;\n}\n","import React from \"react\";\n\nimport { State } from \"@ryuzaki13/react-foundation-lib/types\";\nimport { cn } from \"@ryuzaki13/react-foundation-lib/utils\";\n\nimport { PolymorphicComponent, PolymorphicComponentBaseProps } from \"../polymorphic\";\n\nimport styles from \"./State.module.scss\";\n\ntype StateWrapperOwnProps<E extends React.ElementType = React.ElementType> = PolymorphicComponentBaseProps<E> & {\n\tstate?: State;\n\tclassName?: string;\n};\n\ntype StateWrapperProps<E extends React.ElementType> = StateWrapperOwnProps<E> &\n\tOmit<React.ComponentPropsWithRef<E>, keyof StateWrapperOwnProps>;\n\nexport function StateWrapper<E extends React.ElementType>({ as, state, className, ...props }: StateWrapperProps<E>) {\n\tconst status = state?.toLowerCase() ?? \"none\";\n\tconst statusClass = styles[status as keyof typeof styles];\n\tconst isStatused = status && status !== \"none\";\n\n\tconst Component = as || \"div\";\n\n\treturn (\n\t\t<PolymorphicComponent\n\t\t\tas={Component as React.ElementType}\n\t\t\tclassName={cn(styles.stateWrapper, isStatused && styles.status, statusClass, className)}\n\t\t\t{...props}\n\t\t/>\n\t);\n}\n"],"mappings":";;;;;;;;;;;;;;;;;ACcA,SAAgB,EAAa,EAAE,aAAU,cAAW,GAAG,KAAgC;CACtF,OACC,kBAAC,OAAD;EAAK,GAAI;EAAW,WAAW,EAAG,EAAO,MAAM,CAAS;EACtD;CACG,CAAA;AAEP;;;ACLA,SAAgB,EAAoB,EAAE,aAAU,cAAW,UAAO,UAAO,GAAG,KAA2C;CACtH,OACC,kBAAC,KAAD;EAAG,GAAI;EAAe,WAAW,EAAG,EAAO,SAAS,CAAS;EAAG,OAAO;GAAE,GAAG;GAAO,gBAAgB,GAAG,IAAQ,IAAI;EAAI;EACpH;CACC,CAAA;AAEL;;;ACRA,SAAgB,EAAgB,EAAE,aAAU,cAAW,OAAO,iBAAc,IAAM,gBAAmC;CACpH,IAAM,EAAE,iBAAc,oBAAiB,gBAAa,EAAgD;CAEpG,OACC,kBAAC,QAAD;EAAM,KAAK;EAAyB;EAApC,UAAA,CACE,GACD,kBA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AAc;CAC7B,OAAO,kBAAC,GAAD,EAAiB,WAAW,EAAG,EAAO,OAAO,EAAO,OAAO,EAAI,CAAA;AACvE;AACA,SAAgB,IAAkB;CACjC,OAAO,kBAAC,GAAD,EAAU,WAAW,EAAG,EAAO,OAAO,EAAO,WAAW,EAAI,CAAA;AACpE;;;ACjDA,SAAgB,EAA0C,EAAE,OAAI,UAAO,cAAW,GAAG,KAA+B;CACnH,IAAM,IAAS,GAAO,YAAY,KAAK,QACjC,IAAc,EAAO,IACrB,IAAa,KAAU,MAAW;CAIxC,OACC,kBAAC,GAAD;EACC,IAJgB,KAAM;EAKtB,WAAW,EAAG,EAAO,cAAc,KAAc,EAAO,QAAQ,GAAa,CAAS;EACtF,GAAI;CACJ,CAAA;AAEH"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { o as e } from "./flex-
|
|
1
|
+
import { o as e } from "./flex-BhrQCH4I.js";
|
|
2
2
|
import { n as t } from "./button-DudCl375.js";
|
|
3
|
-
import { r as n } from "./grid-
|
|
4
|
-
import { c as r } from "./misc-
|
|
3
|
+
import { r as n } from "./grid-D6wPRCjx.js";
|
|
4
|
+
import { c as r } from "./misc-Dcr24uDY.js";
|
|
5
5
|
import { cn as i } from "@ryuzaki13/react-foundation-lib/utils";
|
|
6
6
|
import { X as a } from "lucide-react";
|
|
7
7
|
import { jsx as o, jsxs as s } from "react/jsx-runtime";
|
|
@@ -201,4 +201,4 @@ function N({ children: e, compensateScrollbar: t = !1 }) {
|
|
|
201
201
|
//#endregion
|
|
202
202
|
export { k as a, j as i, M as n, D as o, A as r, O as s, N as t };
|
|
203
203
|
|
|
204
|
-
//# sourceMappingURL=modal-
|
|
204
|
+
//# sourceMappingURL=modal-DeABSKrb.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"modal-CBGNsqrq.js","names":[],"sources":["../../src/modal/Modal.module.scss","../../src/modal/modalMotion.ts","../../src/modal/useModalManager.ts","../../src/modal/Modal.tsx","../../src/modal/ModalManagerProvider.tsx"],"sourcesContent":["@use \"@/styles/mixins\" as *;\n\n.modal {\n\t--modal-border-radius: 0;\n\n\tdisplay: grid;\n\tgrid-auto-rows: auto 1fr;\n\tgrid-area: 1 / 1;\n\tz-index: var(--z-modal);\n\n\tborder: var(--border);\n\tborder-radius: var(--modal-border-radius);\n\tbackground-color: var(--surface-1);\n\tbox-shadow: var(--shadow-lg);\n\n\t&:not(:last-child) {\n\t\tpointer-events: none;\n\t\tfilter: grayscale(0.5) opacity(0.75);\n\t\t// opacity: 0.5;\n\t}\n\n\twidth: 100%;\n\theight: 100%;\n\tmax-width: none;\n\tmax-height: none;\n}\n\n.header {\n\tdisplay: flex;\n\talign-items: center;\n\tjustify-content: space-between;\n\tbackground-color: var(--surface-2);\n\tborder-top-left-radius: var(--modal-border-radius);\n\tborder-top-right-radius: var(--modal-border-radius);\n}\n\n.headerText {\n\tmargin: 0;\n\tpadding-inline: var(--space-md);\n\tfont-size: var(--font-size-md);\n\tfont-variation-settings: \"wght\" 600;\n}\n\n.headerButton {\n\tmargin-block: var(--space-xs);\n\tmargin-inline: var(--space-sm);\n\tflex: 0;\n}\n\n.body {\n\toverflow: hidden;\n\tborder-bottom-left-radius: var(--modal-border-radius);\n\tborder-bottom-right-radius: var(--modal-border-radius);\n}\n\n@include mobile-above {\n\t.modal {\n\t\theight: var(--modal-height, fit-content);\n\t\tmax-height: calc(100dvh - var(--space-lg));\n\t\t--modal-border-radius: var(--radius-md);\n\n\t\t&.sm {\n\t\t\tmax-width: min(30em, 93dvw);\n\t\t}\n\n\t\t&.md {\n\t\t\tmax-width: min(50em, 93dvw);\n\t\t}\n\n\t\t&.lg {\n\t\t\tmax-width: min(70em, 93dvw);\n\t\t}\n\n\t\t&.xl {\n\t\t\tmax-width: min(80em, 93dvw);\n\t\t}\n\n\t\t&.xxl {\n\t\t\twidth: 95dvw;\n\t\t\theight: 92dvh;\n\t\t\tmax-width: none;\n\t\t\tmax-height: none;\n\t\t}\n\n\t\t&.inside {\n\t\t\twidth: 100%;\n\t\t\theight: 100%;\n\t\t\tmax-width: none;\n\t\t\tmax-height: none;\n\n\t\t\t--modal-border-radius: 0;\n\t\t}\n\t}\n}\n","import { type Transition, type Variants } from \"motion/react\";\n\n/**\n * Варианты задают единый спокойный переход для появления и удаления modal-панели.\n * Конфигурация приватна для primitive: потребители управляют только состоянием `isOpen`.\n */\nexport const modalMotionVariants = {\n\thidden: {\n\t\topacity: 0,\n\t\tscale: 0.96,\n\t\ty: 12\n\t},\n\tvisible: {\n\t\topacity: 1,\n\t\tscale: 1,\n\t\ty: 0\n\t}\n} satisfies Variants;\n\n/** Переход сохраняет отзывчивое открытие и дает exit-анимации завершиться до удаления portal content. */\nexport const modalMotionTransition = {\n\tduration: 0.18,\n\tease: [0.22, 1, 0.36, 1]\n} satisfies Transition;\n\n/** При системном reduced-motion остается только мгновенная смена видимости без пространственного движения. */\nexport const reducedModalMotionTransition = {\n\tduration: 0\n} satisfies Transition;\n","import { createContext, useContext } from \"react\";\n\nexport const ModalManagerContext = createContext<{\n\tmodals: string[];\n\topenModal: (id: string) => void;\n\tcloseModal: (id: string) => void;\n\tisTopModal: (id: string) => boolean;\n}>({\n\tmodals: [],\n\topenModal: () => {},\n\tcloseModal: () => {},\n\tisTopModal: () => false\n});\n\nexport const useModalManager = () => useContext(ModalManagerContext);\n","import React, { Children, useEffect, useId, useRef } from \"react\";\n\nimport { getOrCreatePortalRoot, useEscapeDismiss, useOverlayFocus } from \"@ryuzaki13/react-foundation-lib/dom\";\nimport { cn } from \"@ryuzaki13/react-foundation-lib/utils\";\nimport { X } from \"lucide-react\";\nimport { AnimatePresence, motion, useReducedMotion } from \"motion/react\";\nimport { createPortal } from \"react-dom\";\n\nimport { Button } from \"../button\";\nimport { FlexContainer } from \"../flex\";\nimport { GridContainer } from \"../grid\";\nimport { Scrollable } from \"../misc\";\n\nimport styles from \"./Modal.module.scss\";\nimport { modalMotionTransition, modalMotionVariants, reducedModalMotionTransition } from \"./modalMotion\";\nimport { ModalSize } from \"./types\";\nimport { useModalManager } from \"./useModalManager\";\n\n// Подкомпоненты\nexport interface ModalCompositionProps {\n\tchildren: React.ReactNode;\n\tclassName?: string;\n}\n\nexport function ModalToolbar({ children, className }: ModalCompositionProps) {\n\treturn <div className={cn(\"surface2 paddingMd borderBottom\", className)}>{children}</div>;\n}\nModalToolbar.displayName = \"Modal.Toolbar\";\n\nexport function ModalContent({ children, className, scrollable }: ModalCompositionProps & { scrollable?: boolean }) {\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 function ModalFooter({ children, className }: ModalCompositionProps) {\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\ntype ModalStyle = React.CSSProperties & {\n\t\"--modal-height\"?: string;\n};\n\nexport interface ModalProps {\n\t/** Открыто ли модальное окно */\n\tisOpen?: boolean;\n\t/** Заголовок */\n\ttitle?: string;\n\t/** Размер модального окна */\n\tsize?: keyof typeof ModalSize;\n\t/** Явная высота модального окна выше мобильного breakpoint */\n\theight?: string;\n\t/** Обработчик закрытия */\n\tonClose: () => void;\n\tchildren: ModalChildren;\n}\n\nexport function Modal({ isOpen, title, size = \"sm\", height, onClose, children }: ModalProps) {\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\tconst modalStyle: ModalStyle = { \"--modal-height\": height };\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={modalStyle}\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;;;ACUnE,SAAgB,EAAa,EAAE,aAAU,gBAAoC;CAC5E,OAAO,kBAAC,OAAD;EAAK,WAAW,EAAG,mCAAmC,CAAS;EAAI;CAAc,CAAA;AACzF;AACA,EAAa,cAAc;AAE3B,SAAgB,EAAa,EAAE,aAAU,cAAW,iBAAgE;CACnH,OACC,kBAAC,OAAD;EAAK,WAAW,EAAG,iCAAiC,CAAS;EAC3D,UAAA,IAAa,kBAAC,GAAD;GAAY,WAAU;GAAQ;EAAqB,CAAA,IAAI;CACjE,CAAA;AAEP;AACA,EAAa,cAAc;AAE3B,SAAgB,EAAY,EAAE,aAAU,gBAAoC;CAC3E,OACC,kBAAC,OAAD;EAAK,WAAW,EAAG,gCAAgC,CAAS;EAC3D,UAAA,kBAAC,GAAD;GAAe,KAAI;GAAK,OAAM;GAAS,SAAQ;GAC7C;EACa,CAAA;CACX,CAAA;AAEP;AACA,EAAY,cAAc;AA2B1B,SAAgB,EAAM,EAAE,WAAQ,UAAO,UAAO,MAAM,WAAQ,YAAS,eAAwB;CAC5F,IAAM,IAAU,EAAM,GAChB,IAAU,EAAM,GAEhB,EAAE,WAAQ,cAAW,eAAY,kBAAe,EAAgB,GAChE,IAAqB,EAAiB,GACtC,IAAwB,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,"file":"modal-DeABSKrb.js","names":[],"sources":["../../src/modal/Modal.module.scss","../../src/modal/modalMotion.ts","../../src/modal/useModalManager.ts","../../src/modal/Modal.tsx","../../src/modal/ModalManagerProvider.tsx"],"sourcesContent":["@use \"@/styles/mixins\" as *;\n\n.modal {\n\t--modal-border-radius: 0;\n\n\tdisplay: grid;\n\tgrid-auto-rows: auto 1fr;\n\tgrid-area: 1 / 1;\n\tz-index: var(--z-modal);\n\n\tborder: var(--border);\n\tborder-radius: var(--modal-border-radius);\n\tbackground-color: var(--surface-1);\n\tbox-shadow: var(--shadow-lg);\n\n\t&:not(:last-child) {\n\t\tpointer-events: none;\n\t\tfilter: grayscale(0.5) opacity(0.75);\n\t\t// opacity: 0.5;\n\t}\n\n\twidth: 100%;\n\theight: 100%;\n\tmax-width: none;\n\tmax-height: none;\n}\n\n.header {\n\tdisplay: flex;\n\talign-items: center;\n\tjustify-content: space-between;\n\tbackground-color: var(--surface-2);\n\tborder-top-left-radius: var(--modal-border-radius);\n\tborder-top-right-radius: var(--modal-border-radius);\n}\n\n.headerText {\n\tmargin: 0;\n\tpadding-inline: var(--space-md);\n\tfont-size: var(--font-size-md);\n\tfont-variation-settings: \"wght\" 600;\n}\n\n.headerButton {\n\tmargin-block: var(--space-xs);\n\tmargin-inline: var(--space-sm);\n\tflex: 0;\n}\n\n.body {\n\toverflow: hidden;\n\tborder-bottom-left-radius: var(--modal-border-radius);\n\tborder-bottom-right-radius: var(--modal-border-radius);\n}\n\n@include mobile-above {\n\t.modal {\n\t\theight: var(--modal-height, fit-content);\n\t\tmax-height: calc(100dvh - var(--space-lg));\n\t\t--modal-border-radius: var(--radius-md);\n\n\t\t&.sm {\n\t\t\tmax-width: min(30em, 93dvw);\n\t\t}\n\n\t\t&.md {\n\t\t\tmax-width: min(50em, 93dvw);\n\t\t}\n\n\t\t&.lg {\n\t\t\tmax-width: min(70em, 93dvw);\n\t\t}\n\n\t\t&.xl {\n\t\t\tmax-width: min(80em, 93dvw);\n\t\t}\n\n\t\t&.xxl {\n\t\t\twidth: 95dvw;\n\t\t\theight: 92dvh;\n\t\t\tmax-width: none;\n\t\t\tmax-height: none;\n\t\t}\n\n\t\t&.inside {\n\t\t\twidth: 100%;\n\t\t\theight: 100%;\n\t\t\tmax-width: none;\n\t\t\tmax-height: none;\n\n\t\t\t--modal-border-radius: 0;\n\t\t}\n\t}\n}\n","import { type Transition, type Variants } from \"motion/react\";\n\n/**\n * Варианты задают единый спокойный переход для появления и удаления modal-панели.\n * Конфигурация приватна для primitive: потребители управляют только состоянием `isOpen`.\n */\nexport const modalMotionVariants = {\n\thidden: {\n\t\topacity: 0,\n\t\tscale: 0.96,\n\t\ty: 12\n\t},\n\tvisible: {\n\t\topacity: 1,\n\t\tscale: 1,\n\t\ty: 0\n\t}\n} satisfies Variants;\n\n/** Переход сохраняет отзывчивое открытие и дает exit-анимации завершиться до удаления portal content. */\nexport const modalMotionTransition = {\n\tduration: 0.18,\n\tease: [0.22, 1, 0.36, 1]\n} satisfies Transition;\n\n/** При системном reduced-motion остается только мгновенная смена видимости без пространственного движения. */\nexport const reducedModalMotionTransition = {\n\tduration: 0\n} satisfies Transition;\n","import { createContext, useContext } from \"react\";\n\nexport const ModalManagerContext = createContext<{\n\tmodals: string[];\n\topenModal: (id: string) => void;\n\tcloseModal: (id: string) => void;\n\tisTopModal: (id: string) => boolean;\n}>({\n\tmodals: [],\n\topenModal: () => {},\n\tcloseModal: () => {},\n\tisTopModal: () => false\n});\n\nexport const useModalManager = () => useContext(ModalManagerContext);\n","import React, { Children, useEffect, useId, useRef } from \"react\";\n\nimport { getOrCreatePortalRoot, useEscapeDismiss, useOverlayFocus } from \"@ryuzaki13/react-foundation-lib/dom\";\nimport { cn } from \"@ryuzaki13/react-foundation-lib/utils\";\nimport { X } from \"lucide-react\";\nimport { AnimatePresence, motion, useReducedMotion } from \"motion/react\";\nimport { createPortal } from \"react-dom\";\n\nimport { Button } from \"../button\";\nimport { FlexContainer } from \"../flex\";\nimport { GridContainer } from \"../grid\";\nimport { Scrollable } from \"../misc\";\n\nimport styles from \"./Modal.module.scss\";\nimport { modalMotionTransition, modalMotionVariants, reducedModalMotionTransition } from \"./modalMotion\";\nimport { ModalSize } from \"./types\";\nimport { useModalManager } from \"./useModalManager\";\n\n// Подкомпоненты\nexport interface ModalCompositionProps {\n\tchildren: React.ReactNode;\n\tclassName?: string;\n}\n\nexport function ModalToolbar({ children, className }: ModalCompositionProps) {\n\treturn <div className={cn(\"surface2 paddingMd borderBottom\", className)}>{children}</div>;\n}\nModalToolbar.displayName = \"Modal.Toolbar\";\n\nexport function ModalContent({ children, className, scrollable }: ModalCompositionProps & { scrollable?: boolean }) {\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 function ModalFooter({ children, className }: ModalCompositionProps) {\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\ntype ModalStyle = React.CSSProperties & {\n\t\"--modal-height\"?: string;\n};\n\nexport interface ModalProps {\n\t/** Открыто ли модальное окно */\n\tisOpen?: boolean;\n\t/** Заголовок */\n\ttitle?: string;\n\t/** Размер модального окна */\n\tsize?: keyof typeof ModalSize;\n\t/** Явная высота модального окна выше мобильного breakpoint */\n\theight?: string;\n\t/** Обработчик закрытия */\n\tonClose: () => void;\n\tchildren: ModalChildren;\n}\n\nexport function Modal({ isOpen, title, size = \"sm\", height, onClose, children }: ModalProps) {\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\tconst modalStyle: ModalStyle = { \"--modal-height\": height };\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={modalStyle}\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;;;ACUnE,SAAgB,EAAa,EAAE,aAAU,gBAAoC;CAC5E,OAAO,kBAAC,OAAD;EAAK,WAAW,EAAG,mCAAmC,CAAS;EAAI;CAAc,CAAA;AACzF;AACA,EAAa,cAAc;AAE3B,SAAgB,EAAa,EAAE,aAAU,cAAW,iBAAgE;CACnH,OACC,kBAAC,OAAD;EAAK,WAAW,EAAG,iCAAiC,CAAS;EAC3D,UAAA,IAAa,kBAAC,GAAD;GAAY,WAAU;GAAQ;EAAqB,CAAA,IAAI;CACjE,CAAA;AAEP;AACA,EAAa,cAAc;AAE3B,SAAgB,EAAY,EAAE,aAAU,gBAAoC;CAC3E,OACC,kBAAC,OAAD;EAAK,WAAW,EAAG,gCAAgC,CAAS;EAC3D,UAAA,kBAAC,GAAD;GAAe,KAAI;GAAK,OAAM;GAAS,SAAQ;GAC7C;EACa,CAAA;CACX,CAAA;AAEP;AACA,EAAY,cAAc;AA2B1B,SAAgB,EAAM,EAAE,WAAQ,UAAO,UAAO,MAAM,WAAQ,YAAS,eAAwB;CAC5F,IAAM,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kBAAC,EAAoB,UAArB;EAA8B,OAAO;GAAE;GAAQ;GAAW;GAAY;EAAW;EAAI;CAAuC,CAAA;AACpI"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { t as e } from "./ui.module-oRwY3Zli.js";
|
|
2
|
-
import { t } from "./grid-
|
|
2
|
+
import { t } from "./grid-D6wPRCjx.js";
|
|
3
3
|
import { a as n, c as r, d as i, i as a } from "./input-KXI7o06g.js";
|
|
4
4
|
import { t as o } from "./separator-CHpBud1e.js";
|
|
5
5
|
import { cn as s } from "@ryuzaki13/react-foundation-lib/utils";
|
|
@@ -460,4 +460,4 @@ function G({ mode: e, open: t, currentQuery: n, hasDisplayValue: r, inputRef: i,
|
|
|
460
460
|
//#endregion
|
|
461
461
|
export { T as _, B as a, I as c, N as d, M as f, D as g, O as h, V as i, F as l, k as m, U as n, R as o, A as p, H as r, L as s, G as t, P as u, w as v };
|
|
462
462
|
|
|
463
|
-
//# sourceMappingURL=picker-
|
|
463
|
+
//# sourceMappingURL=picker-CWx7vPE8.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"picker-DagDe9OH.js","names":[],"sources":["../../src/picker/PickerField.tsx","../../src/picker/PickerClearButton.tsx","../../src/picker/Picker.module.scss","../../src/picker/PickerSelectionToolbar.tsx","../../src/picker/PickerOptions.tsx","../../src/picker/model/extractPickerTextContent.ts","../../src/picker/PickerPlaceholder.ts","../../src/picker/PickerPopup.tsx","../../src/picker/PickerSelectedToken.tsx","../../src/picker/PickerStatus.tsx","../../src/picker/PickerTriggerActions.tsx","../../src/picker/PickerTriggerInput.tsx","../../src/picker/PickerTrigger.tsx","../../src/picker/model/createPickerTriggerPolicy.ts","../../src/picker/model/usePickerDefaultFilter.ts","../../src/picker/model/usePickerFloatingListbox.ts","../../src/picker/model/usePickerQuery.ts","../../src/picker/model/usePickerSelectionLifecycle.ts","../../src/picker/model/usePickerTriggerController.ts"],"sourcesContent":["import { InputType } from \"@ryuzaki13/react-foundation-lib/types\";\n\nimport { InputUI } from \"../input\";\nimport { useInputFieldIds } from \"../input/lib/useInputFieldIds\";\n\nimport { PickerFieldProps } from \"./types\";\n\nexport function PickerField<TValue extends InputType>({\n\tid,\n\tlabel,\n\tdescription,\n\tdisabled,\n\tsize,\n\tclassName,\n\terror,\n\trequired,\n\tchildren\n}: PickerFieldProps<TValue>) {\n\tconst { controlId, labelId, descriptionId, errorId, describedBy } = useInputFieldIds({\n\t\tid,\n\t\thasLabel: label !== undefined && label !== null,\n\t\thasDescription: !!description,\n\t\thasError: !!error\n\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\tsize={size}\n\t\t\tclassName={className}\n\t\t\terror={error}\n\t\t\trequired={required}\n\t\t\tcontrolId={controlId}\n\t\t\tlabelId={labelId}\n\t\t\tdescriptionId={descriptionId}\n\t\t\terrorId={errorId}>\n\t\t\t{children({ controlId, labelId, descriptionId, errorId, describedBy })}\n\t\t</InputUI>\n\t);\n}\n","import { type MouseEvent } from \"react\";\n\nimport { XIcon } from \"lucide-react\";\n\nimport uiStyles from \"../ui.module.scss\";\n\ntype PickerClearButtonProps = {\n\tdisabled?: boolean;\n\tariaLabel?: string;\n\tonClear: () => void;\n};\n\n/** Единое действие очистки выбранного значения во всех clearable picker-компонентах. */\nexport function PickerClearButton({ disabled, ariaLabel = \"Очистить выбор\", onClear }: PickerClearButtonProps) {\n\tconst stopTriggerInteraction = (event: MouseEvent<HTMLButtonElement>) => {\n\t\tevent.preventDefault();\n\t\tevent.stopPropagation();\n\t};\n\n\treturn (\n\t\t<button\n\t\t\ttype=\"button\"\n\t\t\tdisabled={disabled}\n\t\t\tclassName={uiStyles.uiClearButton}\n\t\t\tdata-ui=\"picker-clear-button\"\n\t\t\tdata-action=\"clear-picker\"\n\t\t\tonMouseDown={stopTriggerInteraction}\n\t\t\tonClick={(event) => {\n\t\t\t\tstopTriggerInteraction(event);\n\t\t\t\tonClear();\n\t\t\t}}\n\t\t\taria-label={ariaLabel}>\n\t\t\t<XIcon />\n\t\t</button>\n\t);\n}\n","@use \"@/styles/mixins\" as *;\n\n.popupPositioner,\n.options {\n\toverflow: hidden;\n\tdisplay: grid;\n\tgrid-template-rows: minmax(0, 1fr);\n\tborder-radius: var(--radius-sm);\n}\n\n.popupPositioner {\n\t--anchor-gap: var(--space-xs);\n\t--anchor-padding: var(--space-xs);\n\t--anchor-offset: 0;\n\t// Минимальная ширина нужна только floating-панели. Встроенный Listbox получает ширину от UiBaseProps.size.\n\t--input-width: min(100vw, var(--base-width, 15em));\n\n\tmin-width: 0;\n\tz-index: var(--z-dropdown);\n\tbox-shadow: var(--shadow-md);\n\n\t.options {\n\t\tmin-width: var(--input-width);\n\t}\n}\n\n.options {\n\twidth: 100%;\n\tmin-height: 0;\n\tmax-height: 75vh;\n\n\tpadding: var(--space-sm);\n\tbackground-color: var(--surface-0);\n\tborder: var(--border);\n\n\t&:empty {\n\t\tvisibility: hidden;\n\t}\n\n\t&[data-has-toolbar=\"true\"] {\n\t\tgrid-template-rows: auto minmax(0, 1fr);\n\t}\n}\n\n.optionsToolbar {\n\tdisplay: grid;\n\tgap: var(--space-xs);\n\tpadding: var(--space-xs);\n}\n\n.optionsBody {\n\tmin-height: 0;\n}\n\n.status {\n\tpadding: var(--space-xs) var(--space-sm);\n\tcolor: var(--content-2);\n}\n\n.statusError {\n\tcolor: var(--error-text);\n}\n\n.triggerContainer {\n\tposition: relative;\n\n\t&[data-has-overlay=\"true\"] input {\n\t\t--ui-color: transparent;\n\t\t--ui-color-hover: transparent;\n\t\t--ui-color-active: transparent;\n\n\t\tcolor: transparent;\n\t\tcaret-color: transparent;\n\t\t-webkit-text-fill-color: transparent;\n\t}\n}\n\n.triggerHasClear {\n\t--trigger-count: 2;\n\t// Резервирует в input место для кнопок очистки и открытия списка.\n\t--input-end-adornment-width: calc(var(--control-height) * 2);\n}\n\n.selectedToken {\n\tposition: absolute;\n\tinset: 0 calc(var(--control-height) * var(--trigger-count, 1) + var(--space-sm)) 0 var(--space-sm);\n\tdisplay: flex;\n\talign-items: center;\n\tjustify-content: flex-end;\n\tmin-width: 0;\n\tpointer-events: none;\n}\n\n.selectedTokenText {\n\toverflow: hidden;\n\twhite-space: nowrap;\n\ttext-overflow: ellipsis;\n}\n\n@include mobile {\n\t.popupPositioner {\n\t\t--input-width: calc(100dvw - var(--space-xl));\n\t}\n}\n\n.selectionActionButton {\n\tpadding-block: var(--space-xs);\n\tborder-radius: var(--radius-sm);\n\n\t&:hover {\n\t\tbackground-color: var(--surface-2);\n\t}\n}\n","import { type Ref } from \"react\";\n\nimport { Grid } from \"../grid\";\n\nimport styles from \"./Picker.module.scss\";\n\ntype PickerSelectionToolbarProps = {\n\tonSelectAll: () => void;\n\tonDeselectAll: () => void;\n\tselectAllButtonRef?: Ref<HTMLButtonElement>;\n};\n\n/**\n * Общая панель массовых действий для picker-компонентов с множественным выбором.\n * Компонент не знает формат значения и делегирует изменение владельцу selection-модели.\n */\nexport function PickerSelectionToolbar({ onSelectAll, onDeselectAll, selectAllButtonRef }: PickerSelectionToolbarProps) {\n\treturn (\n\t\t<Grid.Container gap=\"xs\" templateColumns=\"1fr 1fr\">\n\t\t\t<button\n\t\t\t\tref={selectAllButtonRef}\n\t\t\t\ttype=\"button\"\n\t\t\t\tclassName={styles.selectionActionButton}\n\t\t\t\tonClick={onSelectAll}\n\t\t\t\tdata-ui=\"picker-select-all\"\n\t\t\t\tdata-action=\"select-all\">\n\t\t\t\tВыбрать все\n\t\t\t</button>\n\t\t\t<button\n\t\t\t\ttype=\"button\"\n\t\t\t\tclassName={styles.selectionActionButton}\n\t\t\t\tonClick={onDeselectAll}\n\t\t\t\tdata-ui=\"picker-deselect-all\"\n\t\t\t\tdata-action=\"deselect-all\">\n\t\t\t\tСнять выбор\n\t\t\t</button>\n\t\t</Grid.Container>\n\t);\n}\n","import { type HTMLAttributes, type ReactNode, type Ref } from \"react\";\n\nimport { cn } from \"@ryuzaki13/react-foundation-lib/utils\";\n\nimport { Separator } from \"../separator\";\n\nimport styles from \"./Picker.module.scss\";\nimport { PickerSelectionToolbar } from \"./PickerSelectionToolbar\";\n\nexport type PickerSelectionActions = {\n\tonSelectAll: () => void;\n\tonDeselectAll: () => void;\n\tselectAllButtonRef?: Ref<HTMLButtonElement>;\n};\n\nexport interface PickerOptionsProps extends Omit<HTMLAttributes<HTMLDivElement>, \"children\"> {\n\trootRef?: Ref<HTMLDivElement>;\n\tbodyRef?: Ref<HTMLDivElement>;\n\tbodyProps?: Omit<HTMLAttributes<HTMLDivElement>, \"children\" | \"className\">;\n\tchildren: ReactNode;\n\ttoolbar?: ReactNode | false;\n\tselectionActions?: PickerSelectionActions;\n\tlayoutClassName?: string;\n\tbodyClassName?: string;\n\tscrollable?: boolean;\n}\n\n/**\n * Единая оболочка списка опций для picker, listbox и menu. Если переданы\n * selectionActions, но не передан toolbar, компонент показывает стандартные\n * действия выбора и снятия выбора.\n */\nexport function PickerOptions({\n\trootRef,\n\tbodyRef,\n\tbodyProps,\n\tchildren,\n\ttoolbar,\n\tselectionActions,\n\tlayoutClassName,\n\tbodyClassName,\n\tscrollable = true,\n\tclassName,\n\t...props\n}: PickerOptionsProps) {\n\tconst resolvedToolbar = toolbar === undefined && selectionActions ? <PickerSelectionToolbar {...selectionActions} /> : toolbar || null;\n\n\treturn (\n\t\t<div\n\t\t\t{...props}\n\t\t\tref={rootRef}\n\t\t\tclassName={cn(styles.options, layoutClassName, className)}\n\t\t\tdata-ui=\"picker-options\"\n\t\t\tdata-has-toolbar={resolvedToolbar ? \"true\" : undefined}>\n\t\t\t{resolvedToolbar ? (\n\t\t\t\t<div className={styles.optionsToolbar}>\n\t\t\t\t\t{resolvedToolbar}\n\t\t\t\t\t<Separator />\n\t\t\t\t</div>\n\t\t\t) : null}\n\t\t\t<div\n\t\t\t\t{...bodyProps}\n\t\t\t\tref={bodyRef}\n\t\t\t\tclassName={cn(styles.optionsBody, scrollable ? \"scrollable overscroll\" : \"overflowHidden\", bodyClassName)}>\n\t\t\t\t{children}\n\t\t\t</div>\n\t\t</div>\n\t);\n}\n","import { isValidElement, type ReactNode } from \"react\";\n\nexport function extractPickerTextContent(node: ReactNode): string | undefined {\n\tif (typeof node === \"string\" || typeof node === \"number\") {\n\t\treturn String(node);\n\t}\n\n\tif (Array.isArray(node)) {\n\t\tconst values = node\n\t\t\t.map(extractPickerTextContent)\n\t\t\t.filter((value): value is string => Boolean(value))\n\t\t\t.map((value) => value.trim())\n\t\t\t.filter(Boolean);\n\t\treturn values.length ? values.join(\" \") : undefined;\n\t}\n\n\tif (isValidElement<{ children?: ReactNode; searchText?: unknown }>(node)) {\n\t\tif (typeof node.props.searchText === \"string\") {\n\t\t\treturn node.props.searchText;\n\t\t}\n\n\t\treturn extractPickerTextContent(node.props.children);\n\t}\n\n\treturn undefined;\n}\n","import { type ReactNode } from \"react\";\n\nimport { extractPickerTextContent } from \"./model/extractPickerTextContent\";\n\ntype PickerPlaceholderParams = {\n\tplaceholder?: string;\n\tlabel?: ReactNode;\n\toptionCount: number;\n\tfallback?: string;\n};\n\n/**\n * Формирует единый текст placeholder для picker-компонентов и всегда показывает\n * актуальное количество доступных вариантов.\n */\nexport function getPickerPlaceholder({ placeholder, label, optionCount, fallback = \"Выберите значение\" }: PickerPlaceholderParams) {\n\tconst labelText = extractPickerTextContent(label);\n\tconst text = placeholder ?? labelText ?? fallback;\n\n\treturn `${text} <${optionCount}>`;\n}\n","import { type CSSProperties, type FocusEvent, type KeyboardEvent, type MouseEvent, type ReactNode, useRef } from \"react\";\n\nimport { FloatingContext, FloatingFocusManager, FloatingPortal } from \"@floating-ui/react\";\nimport { AnimatePresence, motion } from \"motion/react\";\n\nimport styles from \"./Picker.module.scss\";\nimport { PickerOptions, type PickerSelectionActions } from \"./PickerOptions\";\n\ninterface PickerPopupProps {\n\topen: boolean;\n\tcontext: FloatingContext;\n\tfloatingStyles: CSSProperties;\n\tlistId: string;\n\tlabelId?: string;\n\tpopupAriaLabel?: string;\n\tdescriptionId?: string;\n\tactiveOptionId?: string;\n\tariaMultiselectable?: boolean;\n\tpopupRole?: \"listbox\" | \"tree\" | \"treegrid\" | \"grid\" | \"dialog\";\n\tsetFloating: (node: HTMLElement | null) => void;\n\tgetFloatingProps: (userProps?: Record<string, unknown>) => Record<string, unknown>;\n\tonKeyDown: (event: KeyboardEvent<HTMLElement>) => void;\n\tinitialFocus?: number;\n\treturnFocus?: boolean;\n\ttabIndex?: number;\n\tclassName?: string;\n\tmaxWidth?: CSSProperties[\"maxWidth\"];\n\tlayoutClassName?: string;\n\tbodyClassName?: string;\n\ttoolbar?: ReactNode | false;\n\tselectionActions?: PickerSelectionActions;\n\tchildren: ReactNode;\n}\n\nfunction stopNestedFloatingMouseDown(event: MouseEvent<HTMLElement>): void {\n\tevent.stopPropagation();\n}\n\nexport function PickerPopup({\n\topen,\n\tcontext,\n\tfloatingStyles,\n\tlistId,\n\tlabelId,\n\tpopupAriaLabel,\n\tdescriptionId,\n\tactiveOptionId,\n\tariaMultiselectable,\n\tpopupRole = \"listbox\",\n\tsetFloating,\n\tgetFloatingProps,\n\tonKeyDown,\n\tinitialFocus = -1,\n\treturnFocus = false,\n\ttabIndex = 0,\n\tclassName,\n\tmaxWidth,\n\tlayoutClassName,\n\tbodyClassName,\n\ttoolbar,\n\tselectionActions,\n\tchildren\n}: PickerPopupProps) {\n\tconst compositeRef = useRef<HTMLDivElement | null>(null);\n\tconst isDialog = popupRole === \"dialog\";\n\tconst compositeProps = isDialog\n\t\t? undefined\n\t\t: getFloatingProps({\n\t\t\t\tid: listId,\n\t\t\t\trole: popupRole,\n\t\t\t\ttabIndex,\n\t\t\t\t\"aria-labelledby\": labelId,\n\t\t\t\t\"aria-label\": labelId ? undefined : popupAriaLabel,\n\t\t\t\t\"aria-describedby\": descriptionId,\n\t\t\t\t\"aria-activedescendant\": activeOptionId,\n\t\t\t\t\"aria-multiselectable\": ariaMultiselectable || undefined,\n\t\t\t\tonKeyDown\n\t\t\t});\n\tconst handlePositionerFocus = (event: FocusEvent<HTMLDivElement>) => {\n\t\tif (!isDialog && event.target === event.currentTarget) {\n\t\t\tcompositeRef.current?.focus();\n\t\t}\n\t};\n\n\treturn (\n\t\t<AnimatePresence>\n\t\t\t{open && (\n\t\t\t\t<FloatingPortal preserveTabOrder={false}>\n\t\t\t\t\t<FloatingFocusManager\n\t\t\t\t\t\tcontext={context}\n\t\t\t\t\t\tmodal={false}\n\t\t\t\t\t\tguards={false}\n\t\t\t\t\t\tinitialFocus={initialFocus}\n\t\t\t\t\t\treturnFocus={returnFocus}>\n\t\t\t\t\t\t<motion.div\n\t\t\t\t\t\t\tref={setFloating}\n\t\t\t\t\t\t\tstyle={{ ...floatingStyles, maxWidth }}\n\t\t\t\t\t\t\tclassName={styles.popupPositioner}\n\t\t\t\t\t\t\tinitial={{ opacity: 0, scale: 0.95 }}\n\t\t\t\t\t\t\tanimate={{ opacity: 1, scale: 1 }}\n\t\t\t\t\t\t\texit={{ opacity: 0, scale: 0.95 }}\n\t\t\t\t\t\t\ttabIndex={isDialog ? undefined : -1}\n\t\t\t\t\t\t\tonMouseDown={stopNestedFloatingMouseDown}\n\t\t\t\t\t\t\tonFocus={isDialog ? undefined : handlePositionerFocus}\n\t\t\t\t\t\t\t{...(isDialog\n\t\t\t\t\t\t\t\t? getFloatingProps({\n\t\t\t\t\t\t\t\t\t\tid: listId,\n\t\t\t\t\t\t\t\t\t\trole: \"dialog\",\n\t\t\t\t\t\t\t\t\t\ttabIndex,\n\t\t\t\t\t\t\t\t\t\t\"aria-labelledby\": labelId,\n\t\t\t\t\t\t\t\t\t\t\"aria-label\": labelId ? undefined : popupAriaLabel,\n\t\t\t\t\t\t\t\t\t\t\"aria-describedby\": descriptionId,\n\t\t\t\t\t\t\t\t\t\tonMouseDown: stopNestedFloatingMouseDown,\n\t\t\t\t\t\t\t\t\t\tonKeyDown\n\t\t\t\t\t\t\t\t\t})\n\t\t\t\t\t\t\t\t: {})}>\n\t\t\t\t\t\t\t<PickerOptions\n\t\t\t\t\t\t\t\tclassName={className}\n\t\t\t\t\t\t\t\tlayoutClassName={layoutClassName}\n\t\t\t\t\t\t\t\tbodyClassName={bodyClassName}\n\t\t\t\t\t\t\t\ttoolbar={toolbar}\n\t\t\t\t\t\t\t\tselectionActions={selectionActions}\n\t\t\t\t\t\t\t\tbodyRef={isDialog ? undefined : compositeRef}\n\t\t\t\t\t\t\t\tbodyProps={isDialog ? undefined : compositeProps}\n\t\t\t\t\t\t\t\tscrollable={false}>\n\t\t\t\t\t\t\t\t{children}\n\t\t\t\t\t\t\t</PickerOptions>\n\t\t\t\t\t\t</motion.div>\n\t\t\t\t\t</FloatingFocusManager>\n\t\t\t\t</FloatingPortal>\n\t\t\t)}\n\t\t</AnimatePresence>\n\t);\n}\n","import { type HTMLAttributes, type ReactNode } from \"react\";\n\nimport { cn } from \"@ryuzaki13/react-foundation-lib/utils\";\n\nimport styles from \"./Picker.module.scss\";\n\nexport interface PickerSelectedTokenProps extends Omit<HTMLAttributes<HTMLSpanElement>, \"children\"> {\n\tchildren: ReactNode;\n}\n\n/** Единое визуальное представление выбранного значения внутри picker-trigger. */\nexport function PickerSelectedToken({ children, className, ...props }: PickerSelectedTokenProps) {\n\treturn (\n\t\t<span {...props} className={cn(styles.selectedToken, className)} data-ui=\"picker-selected-token\">\n\t\t\t<span className={styles.selectedTokenText}>{children}</span>\n\t\t</span>\n\t);\n}\n","import { ReactNode } from \"react\";\n\nimport { cn } from \"@ryuzaki13/react-foundation-lib/utils\";\n\nimport uiStyles from \"../ui.module.scss\";\n\nimport styles from \"./Picker.module.scss\";\n\ninterface PickerStatusProps {\n\temptyState?: ReactNode;\n\t// loadingState?: ReactNode;\n\terrorState?: ReactNode;\n}\n\nexport function PickerStatus({ emptyState, errorState }: PickerStatusProps) {\n\tconst content = errorState ?? emptyState;\n\n\tif (content === undefined || content === null) {\n\t\treturn null;\n\t}\n\n\treturn (\n\t\t<div className={cn(uiStyles.uiPopupOption, styles.status, errorState !== undefined && styles.statusError)} aria-disabled={true}>\n\t\t\t{content}\n\t\t</div>\n\t);\n}\n","import { type AriaAttributes, type MouseEvent, type ReactNode } from \"react\";\n\nimport { cn } from \"@ryuzaki13/react-foundation-lib/utils\";\nimport { ChevronDownIcon } from \"lucide-react\";\n\nimport uiStyles from \"../ui.module.scss\";\n\ninterface PickerTriggerActionsProps {\n\topen: boolean;\n\tdisabled?: boolean;\n\tchildren?: ReactNode;\n\tonToggleMouseDown?: (event: MouseEvent<HTMLButtonElement>) => void;\n\tonToggleClick: () => void;\n\topenAriaLabel?: string;\n\tcloseAriaLabel?: string;\n\t/**\n\t * Передаёт ARIA-связи непосредственно кнопке раскрытия, не меняя геометрию\n\t * контейнера с adornment-действиями.\n\t */\n\ttoggleAria?: Pick<AriaAttributes, \"aria-controls\" | \"aria-expanded\" | \"aria-haspopup\">;\n}\n\nexport function PickerTriggerActions({\n\topen,\n\tdisabled,\n\tchildren,\n\tonToggleMouseDown,\n\tonToggleClick,\n\topenAriaLabel = \"Открыть список\",\n\tcloseAriaLabel = \"Закрыть список\",\n\ttoggleAria\n}: PickerTriggerActionsProps) {\n\treturn (\n\t\t<div className={uiStyles.uiToggleButtonContainer} data-disabled={disabled || undefined}>\n\t\t\t{children}\n\n\t\t\t<div className={uiStyles.uiButtonSeparator} />\n\n\t\t\t<button\n\t\t\t\t{...toggleAria}\n\t\t\t\ttype=\"button\"\n\t\t\t\tdisabled={disabled}\n\t\t\t\taria-label={open ? closeAriaLabel : openAriaLabel}\n\t\t\t\tclassName={uiStyles.uiToggleButton}\n\t\t\t\tonMouseDown={onToggleMouseDown}\n\t\t\t\tonClick={onToggleClick}>\n\t\t\t\t<ChevronDownIcon className={cn(uiStyles.uiToggleIcon, open && uiStyles.uiToggleIconOpen)} />\n\t\t\t</button>\n\t\t</div>\n\t);\n}\n","import { type ComponentPropsWithoutRef, type ReactNode, type Ref } from \"react\";\n\nimport { cn } from \"@ryuzaki13/react-foundation-lib/utils\";\n\nimport { InputControl, InputLoadingFrame } from \"../input\";\nimport uiStyles from \"../ui.module.scss\";\n\nimport styles from \"./Picker.module.scss\";\n\nexport interface PickerTriggerInputProps extends Omit<ComponentPropsWithoutRef<\"input\">, \"size\"> {\n\trootRef?: (node: HTMLDivElement | null) => void;\n\tendAdornment?: ReactNode;\n\toverlay?: ReactNode;\n\trootClassName?: string;\n\tinputClassName?: string;\n\tisLoading?: boolean;\n}\n\nexport function PickerTriggerInput({\n\tref,\n\trootRef,\n\tendAdornment,\n\toverlay,\n\trootClassName,\n\tinputClassName,\n\tisLoading,\n\t...props\n}: PickerTriggerInputProps & { ref?: Ref<HTMLInputElement> }) {\n\tconst hasOverlay = overlay !== undefined && overlay !== null;\n\t// Picker проверяет выбранное значение, поэтому визуальная ошибка следует aria-invalid, а не native :invalid поискового input.\n\tconst isInvalid = props[\"aria-invalid\"] === true || props[\"aria-invalid\"] === \"true\";\n\n\treturn (\n\t\t<div\n\t\t\tref={rootRef}\n\t\t\tclassName={cn(uiStyles.uiInputContainer, styles.triggerContainer, rootClassName)}\n\t\t\tdata-has-overlay={hasOverlay || undefined}>\n\t\t\t{isLoading ? (\n\t\t\t\t<InputLoadingFrame />\n\t\t\t) : (\n\t\t\t\t<>\n\t\t\t\t\t<InputControl endAdornment={endAdornment}>\n\t\t\t\t\t\t{({ controlClassName }) => (\n\t\t\t\t\t\t\t<input\n\t\t\t\t\t\t\t\t{...props}\n\t\t\t\t\t\t\t\tref={ref}\n\t\t\t\t\t\t\t\tclassName={cn(uiStyles.uiInputWithToggle, isInvalid && uiStyles.invalid, controlClassName, inputClassName)}\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t)}\n\t\t\t\t\t</InputControl>\n\t\t\t\t\t{hasOverlay ? overlay : null}\n\t\t\t\t</>\n\t\t\t)}\n\t\t</div>\n\t);\n}\n\nPickerTriggerInput.displayName = \"PickerTriggerInput\";\n","import { type ReactNode, type Ref } from \"react\";\n\nimport styles from \"./Picker.module.scss\";\nimport { PickerClearButton } from \"./PickerClearButton\";\nimport { getPickerPlaceholder } from \"./PickerPlaceholder\";\nimport { PickerSelectedToken } from \"./PickerSelectedToken\";\nimport { PickerTriggerActions } from \"./PickerTriggerActions\";\nimport { PickerTriggerInput, type PickerTriggerInputProps } from \"./PickerTriggerInput\";\n\nexport interface PickerTriggerProps extends Omit<PickerTriggerInputProps, \"placeholder\" | \"overlay\" | \"endAdornment\"> {\n\tref?: Ref<HTMLInputElement>;\n\topen: boolean;\n\toptionCount: number;\n\tplaceholder?: string;\n\tlabel?: ReactNode;\n\tplaceholderFallback?: string;\n\tselectedValue?: ReactNode;\n\thasSelection?: boolean;\n\tshowSelectedValue?: boolean;\n\tclearable?: boolean;\n\tonClear?: () => void;\n\tclearAriaLabel?: string;\n\tonToggleMouseDown?: PickerTriggerActionsProps[\"onToggleMouseDown\"];\n\tonToggleClick: PickerTriggerActionsProps[\"onToggleClick\"];\n\topenAriaLabel?: string;\n\tcloseAriaLabel?: string;\n}\n\ntype PickerTriggerActionsProps = Parameters<typeof PickerTriggerActions>[0];\n\n/**\n * Общая композиция picker-trigger: input, выбранное значение, очистка и кнопка\n * открытия. Владельцы picker-моделей передают только состояние и обработчики.\n */\nexport function PickerTrigger({\n\tref,\n\topen,\n\toptionCount,\n\tplaceholder,\n\tlabel,\n\tplaceholderFallback,\n\tselectedValue,\n\thasSelection,\n\tshowSelectedValue = selectedValue !== undefined && selectedValue !== null,\n\tclearable = false,\n\tonClear,\n\tclearAriaLabel,\n\tonToggleMouseDown,\n\tonToggleClick,\n\topenAriaLabel,\n\tcloseAriaLabel,\n\tdisabled,\n\tinputClassName,\n\t...inputProps\n}: PickerTriggerProps) {\n\tconst hasSelectedValue = hasSelection ?? (selectedValue !== undefined && selectedValue !== null);\n\tconst canClear = clearable && hasSelectedValue && onClear !== undefined && !disabled;\n\n\treturn (\n\t\t<PickerTriggerInput\n\t\t\t{...inputProps}\n\t\t\tref={ref}\n\t\t\tdisabled={disabled}\n\t\t\tplaceholder={\n\t\t\t\tshowSelectedValue ? undefined : getPickerPlaceholder({ placeholder, label, optionCount, fallback: placeholderFallback })\n\t\t\t}\n\t\t\tinputClassName={inputClassName}\n\t\t\trootClassName={clearable ? styles.triggerHasClear : undefined}\n\t\t\toverlay={showSelectedValue ? <PickerSelectedToken>{selectedValue}</PickerSelectedToken> : undefined}\n\t\t\tendAdornment={\n\t\t\t\t<PickerTriggerActions\n\t\t\t\t\topen={open}\n\t\t\t\t\tdisabled={disabled}\n\t\t\t\t\tonToggleMouseDown={onToggleMouseDown}\n\t\t\t\t\tonToggleClick={onToggleClick}\n\t\t\t\t\topenAriaLabel={openAriaLabel}\n\t\t\t\t\tcloseAriaLabel={closeAriaLabel}>\n\t\t\t\t\t{canClear ? <PickerClearButton ariaLabel={clearAriaLabel} onClear={onClear} /> : null}\n\t\t\t\t</PickerTriggerActions>\n\t\t\t}\n\t\t/>\n\t);\n}\n","export type PickerTriggerMode = \"display\" | \"search-single\" | \"search-multi\";\n\ninterface PickerTriggerTextFocusParams {\n\topen: boolean;\n\tcurrentQuery: string;\n\thasDisplayValue: boolean;\n}\n\nexport interface PickerTriggerPolicy {\n\tfocusFloatingOnOpen: boolean;\n\trestoreFocusOnClose: boolean;\n\tresetQueryOnClose: boolean;\n\tshouldOpenOnTriggerClick: (open: boolean) => boolean;\n\tshouldOpenOnInputChange: (open: boolean) => boolean;\n\tshouldFocusReferenceOnToggle: (open: boolean) => boolean;\n\tshouldSelectTriggerTextOnFocus: (params: PickerTriggerTextFocusParams) => boolean;\n}\n\n/**\n * Единая политика поведения trigger-input для picker-компонентов.\n * Нормализует различия между display-режимом, single-search и multi-search.\n */\nexport function createPickerTriggerPolicy(mode: PickerTriggerMode): PickerTriggerPolicy {\n\tswitch (mode) {\n\t\tcase \"search-single\":\n\t\t\treturn {\n\t\t\t\tfocusFloatingOnOpen: false,\n\t\t\t\trestoreFocusOnClose: false,\n\t\t\t\tresetQueryOnClose: true,\n\t\t\t\tshouldOpenOnTriggerClick: () => false,\n\t\t\t\tshouldOpenOnInputChange: (open) => !open,\n\t\t\t\tshouldFocusReferenceOnToggle: (open) => !open,\n\t\t\t\tshouldSelectTriggerTextOnFocus: ({ open, currentQuery, hasDisplayValue }) =>\n\t\t\t\t\t!open && currentQuery.length === 0 && hasDisplayValue\n\t\t\t};\n\t\tcase \"search-multi\":\n\t\t\treturn {\n\t\t\t\tfocusFloatingOnOpen: false,\n\t\t\t\trestoreFocusOnClose: false,\n\t\t\t\tresetQueryOnClose: true,\n\t\t\t\tshouldOpenOnTriggerClick: () => false,\n\t\t\t\tshouldOpenOnInputChange: (open) => !open,\n\t\t\t\tshouldFocusReferenceOnToggle: (open) => !open,\n\t\t\t\tshouldSelectTriggerTextOnFocus: () => false\n\t\t\t};\n\t\tcase \"display\":\n\t\tdefault:\n\t\t\treturn {\n\t\t\t\tfocusFloatingOnOpen: true,\n\t\t\t\trestoreFocusOnClose: true,\n\t\t\t\tresetQueryOnClose: false,\n\t\t\t\tshouldOpenOnTriggerClick: (open) => !open,\n\t\t\t\tshouldOpenOnInputChange: () => false,\n\t\t\t\tshouldFocusReferenceOnToggle: () => false,\n\t\t\t\tshouldSelectTriggerTextOnFocus: () => false\n\t\t\t};\n\t}\n}\n","import { useMemo } from \"react\";\n\nimport { normalizeTextToLower } from \"@ryuzaki13/react-foundation-lib/formatters\";\n\ninterface UsePickerDefaultFilterOptions<T> {\n\toptions: readonly T[];\n\tquery: string;\n\tenabled?: boolean;\n\tgetSearchText: (option: T) => unknown;\n}\n\nfunction normalizeSearchText(value: unknown) {\n\tconst parts = Array.isArray(value) ? value : [value];\n\n\treturn normalizeTextToLower(parts.filter(Boolean).join(\" \"));\n}\n\nexport function usePickerDefaultFilter<T>({ options, query, enabled = true, getSearchText }: UsePickerDefaultFilterOptions<T>) {\n\tconst normalizedQuery = normalizeTextToLower(query);\n\n\treturn useMemo(() => {\n\t\tif (!enabled || !normalizedQuery) {\n\t\t\treturn [...options];\n\t\t}\n\n\t\treturn options.filter((option) => normalizeSearchText(getSearchText(option)).includes(normalizedQuery));\n\t}, [enabled, getSearchText, normalizedQuery, options]);\n}\n","import { Placement } from \"@floating-ui/react\";\nimport {\n\ttype FloatingListboxPlacementStrategy,\n\ttype FloatingListboxSizeResolver,\n\tuseFloatingListbox\n} from \"@ryuzaki13/react-foundation-lib/hooks\";\n\nimport { PickerTriggerMode, createPickerTriggerPolicy } from \"./createPickerTriggerPolicy\";\n\ninterface UsePickerFloatingListboxParams<T> {\n\toptions: readonly T[];\n\tselectedIndex: number;\n\topen?: boolean;\n\tonOpenChange?: (open: boolean) => void;\n\tgetOptionDisabled?: (option: T) => boolean;\n\tonSelect?: (option: T) => void;\n\tdisabled?: boolean;\n\tplacement?: Placement;\n\tplacementStrategy?: FloatingListboxPlacementStrategy;\n\tcloseOnSelect?: boolean;\n\tfocusFloatingOnOpen?: boolean;\n\tallowOpenWithoutOptions?: boolean;\n\trestoreFocusOnClose?: boolean;\n\ttriggerMode?: PickerTriggerMode;\n\tresolveFloatingSize?: FloatingListboxSizeResolver;\n}\n\n/**\n * Единая точка входа для popup/listbox поведения во всех picker-компонентах.\n */\nexport function usePickerFloatingListbox<T>(params: UsePickerFloatingListboxParams<T>) {\n\tconst triggerPolicy = params.triggerMode ? createPickerTriggerPolicy(params.triggerMode) : undefined;\n\n\treturn useFloatingListbox({\n\t\t...params,\n\t\tfocusFloatingOnOpen: params.focusFloatingOnOpen ?? triggerPolicy?.focusFloatingOnOpen,\n\t\trestoreFocusOnClose: params.restoreFocusOnClose ?? triggerPolicy?.restoreFocusOnClose\n\t});\n}\n","import { useState } from \"react\";\n\nimport { PickerTriggerMode, createPickerTriggerPolicy } from \"./createPickerTriggerPolicy\";\n\ninterface UsePickerQueryOptions {\n\tquery?: string;\n\tdefaultQuery?: string;\n\tonQuery?: (value: string) => void;\n\tresetOnClose?: boolean;\n\ttriggerMode?: PickerTriggerMode;\n}\n\n/**\n * Управляет controlled/uncontrolled query и возвращает policy закрытия владельцу open-state.\n * Сброс выполняется самим владельцем в событии close, поэтому hook не зеркалит lifecycle через effect.\n */\nexport function usePickerQuery({ query, defaultQuery, onQuery, resetOnClose, triggerMode }: UsePickerQueryOptions) {\n\tconst isControlled = query !== undefined;\n\tconst [internalQuery, setInternalQuery] = useState(defaultQuery ?? \"\");\n\tconst currentQuery = isControlled ? (query ?? \"\") : internalQuery;\n\tconst resolvedResetOnClose = resetOnClose ?? (triggerMode ? createPickerTriggerPolicy(triggerMode).resetQueryOnClose : true);\n\n\tconst setQuery = (nextValue: string) => {\n\t\tif (!isControlled) {\n\t\t\tsetInternalQuery(nextValue);\n\t\t}\n\n\t\tonQuery?.(nextValue);\n\t};\n\n\treturn {\n\t\tquery: currentQuery,\n\t\tsetQuery,\n\t\tclearQuery: () => setQuery(\"\"),\n\t\tresetQueryOnClose: resolvedResetOnClose\n\t};\n}\n","import { useEffect, useRef, useState } from \"react\";\n\ninterface UsePickerSelectionLifecycleOptions<TValue> {\n\tvalue: TValue;\n\topen: boolean;\n\tonCommit: (value: TValue) => void;\n\tonOpen?: () => void;\n\tonClose?: (value: TValue) => void;\n\tisEqual: (left: TValue, right: TValue) => boolean;\n}\n\n/**\n * Общий жизненный цикл чернового выбора для picker-компонентов,\n * где изменения подтверждаются при закрытии popup.\n */\nexport function usePickerSelectionLifecycle<TValue>({\n\tvalue,\n\topen,\n\tonCommit,\n\tonOpen,\n\tonClose,\n\tisEqual\n}: UsePickerSelectionLifecycleOptions<TValue>) {\n\tconst previousOpenRef = useRef(false);\n\tconst [draftValue, setDraftValue] = useState(value);\n\n\tuseEffect(() => {\n\t\tif (previousOpenRef.current && !open) {\n\t\t\tif (!isEqual(draftValue, value)) {\n\t\t\t\tonCommit(draftValue);\n\t\t\t}\n\n\t\t\tonClose?.(draftValue);\n\t\t}\n\n\t\tpreviousOpenRef.current = open;\n\t}, [draftValue, isEqual, onClose, onCommit, open, value]);\n\n\tconst prepareOpen = () => {\n\t\tsetDraftValue(value);\n\t\tonOpen?.();\n\t};\n\n\treturn {\n\t\tdraftValue,\n\t\tsetDraftValue,\n\t\tprepareOpen\n\t};\n}\n","import { MouseEvent, RefObject } from \"react\";\n\nimport { PickerTriggerMode, createPickerTriggerPolicy } from \"./createPickerTriggerPolicy\";\n\ninterface UsePickerTriggerControllerOptions {\n\tmode: PickerTriggerMode;\n\topen: boolean;\n\tcurrentQuery: string;\n\thasDisplayValue: boolean;\n\tinputRef: RefObject<HTMLInputElement | null>;\n\tsetQuery?: (value: string) => void;\n\topenList?: () => void;\n\tclose?: () => void;\n\ttoggleOpen?: () => void;\n\tonBeforeOpen?: () => void;\n}\n\ninterface HandleTriggerKeyDownOptions {\n\tevent: React.KeyboardEvent<HTMLElement>;\n\tonActivateWhenOpen?: () => void;\n\tenableSpaceActivation?: boolean;\n\tenableClosedArrowDownOpen?: boolean;\n\tsuppressClosedArrowUp?: boolean;\n}\n\nfunction focusInput(inputRef: RefObject<HTMLInputElement | null>) {\n\trequestAnimationFrame(() => {\n\t\tinputRef.current?.focus();\n\t});\n}\n\n/**\n * Единый контроллер пользовательских действий на trigger-input.\n * Держит поведение display/search-single/search-multi в одном месте.\n */\nexport function usePickerTriggerController({\n\tmode,\n\topen,\n\tcurrentQuery,\n\thasDisplayValue,\n\tinputRef,\n\tsetQuery,\n\topenList,\n\tclose,\n\ttoggleOpen,\n\tonBeforeOpen\n}: UsePickerTriggerControllerOptions) {\n\tconst policy = createPickerTriggerPolicy(mode);\n\n\tconst openTrigger = () => {\n\t\tonBeforeOpen?.();\n\n\t\tif (openList) {\n\t\t\topenList();\n\t\t\treturn;\n\t\t}\n\n\t\ttoggleOpen?.();\n\t};\n\n\tconst closeTrigger = () => {\n\t\tif (close) {\n\t\t\tclose();\n\t\t\treturn;\n\t\t}\n\n\t\ttoggleOpen?.();\n\t};\n\n\tconst toggleTrigger = () => {\n\t\tif (open) {\n\t\t\tcloseTrigger();\n\t\t} else {\n\t\t\topenTrigger();\n\t\t}\n\n\t\tif (policy.shouldFocusReferenceOnToggle(open)) {\n\t\t\tfocusInput(inputRef);\n\t\t}\n\t};\n\n\treturn {\n\t\tpolicy,\n\t\thandleTriggerInputChange: (nextValue: string) => {\n\t\t\tsetQuery?.(nextValue);\n\n\t\t\tif (policy.shouldOpenOnInputChange(open)) {\n\t\t\t\topenTrigger();\n\t\t\t}\n\t\t},\n\t\thandleTriggerClick: () => {\n\t\t\tif (policy.shouldOpenOnTriggerClick(open)) {\n\t\t\t\topenTrigger();\n\t\t\t}\n\t\t},\n\t\thandleTriggerFocus: (input: HTMLInputElement) => {\n\t\t\tif (\n\t\t\t\tpolicy.shouldSelectTriggerTextOnFocus({\n\t\t\t\t\topen,\n\t\t\t\t\tcurrentQuery,\n\t\t\t\t\thasDisplayValue\n\t\t\t\t})\n\t\t\t) {\n\t\t\t\trequestAnimationFrame(() => {\n\t\t\t\t\tinput.select();\n\t\t\t\t});\n\t\t\t}\n\t\t},\n\t\thandleToggleMouseDown: (event: MouseEvent<HTMLButtonElement>) => {\n\t\t\tevent.preventDefault();\n\t\t},\n\t\thandleToggleClick: () => {\n\t\t\ttoggleTrigger();\n\t\t},\n\t\thandleTriggerKeyDown: ({\n\t\t\tevent,\n\t\t\tonActivateWhenOpen,\n\t\t\tenableSpaceActivation = false,\n\t\t\tenableClosedArrowDownOpen = false,\n\t\t\tsuppressClosedArrowUp = false\n\t\t}: HandleTriggerKeyDownOptions) => {\n\t\t\tif (!open && suppressClosedArrowUp && event.key === \"ArrowUp\") {\n\t\t\t\tevent.preventDefault();\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif (!open && enableClosedArrowDownOpen && event.key === \"ArrowDown\") {\n\t\t\t\tevent.preventDefault();\n\t\t\t\ttoggleTrigger();\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif (event.key === \"Enter\") {\n\t\t\t\tevent.preventDefault();\n\n\t\t\t\tif (open) {\n\t\t\t\t\tonActivateWhenOpen?.();\n\t\t\t\t} else {\n\t\t\t\t\ttoggleTrigger();\n\t\t\t\t}\n\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif (enableSpaceActivation && event.key === \" \") {\n\t\t\t\tevent.preventDefault();\n\n\t\t\t\tif (open) {\n\t\t\t\t\tonActivateWhenOpen?.();\n\t\t\t\t} else {\n\t\t\t\t\ttoggleTrigger();\n\t\t\t\t}\n\t\t\t}\n\t\t},\n\t\ttoggleTrigger\n\t};\n}\n"],"mappings":";;;;;;;;;;;;;AAOA,SAAgB,EAAsC,EACrD,OACA,UACA,gBACA,aACA,SACA,cACA,UACA,aACA,eAC4B;CAC5B,IAAM,EAAE,cAAW,YAAS,kBAAe,YAAS,mBAAgB,EAAiB;EACpF;EACA,UAAU,KAAiC;EAC3C,gBAAgB,CAAC,CAAC;EAClB,UAAU,CAAC,CAAC;CACb,CAAC;CAED,OACC,kBAAC,GAAD;EACQ;EACM;EACH;EACJ;EACK;EACJ;EACG;EACC;EACF;EACM;EACN;EACR,UAAA,EAAS;GAAE;GAAW;GAAS;GAAe;GAAS;EAAY,CAAC;CAC7D,CAAA;AAEX;;;AC5BA,SAAgB,EAAkB,EAAE,aAAU,eAAY,kBAAkB,cAAmC;CAC9G,IAAM,KAA0B,MAAyC;EAExE,AADA,EAAM,eAAe,GACrB,EAAM,gBAAgB;CACvB;CAEA,OACC,kBAAC,UAAD;EACC,MAAK;EACK;EACV,WAAW,EAAS;EACpB,WAAQ;EACR,eAAY;EACZ,aAAa;EACb,UAAU,MAAU;GAEnB,AADA,EAAuB,CAAK,GAC5B,EAAQ;EACT;EACA,cAAY;EACZ,UAAA,kBAAC,GAAD,CAAQ,CAAA;CACD,CAAA;AAEV;;;;;;;;;;;;;;;;AEnBA,SAAgB,EAAuB,EAAE,gBAAa,kBAAe,yBAAmD;CACvH,OACC,kBAAC,EAAK,WAAN;EAAgB,KAAI;EAAK,iBAAgB;EAAzC,UAAA,CACC,kBAAC,UAAD;GACC,KAAK;GACL,MAAK;GACL,WAAW,EAAO;GAClB,SAAS;GACT,WAAQ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I,EAAO,yBAAyB,CAAI,KACvC,EAAY;EAEd;EACA,qBAAqB,MAA4B;GAChD,AACC,EAAO,+BAA+B;IACrC;IACA;IACA;GACD,CAAC,KAED,4BAA4B;IAC3B,EAAM,OAAO;GACd,CAAC;EAEH;EACA,wBAAwB,MAAyC;GAChE,EAAM,eAAe;EACtB;EACA,yBAAyB;GACxB,EAAc;EACf;EACA,uBAAuB,EACtB,UACA,uBACA,2BAAwB,IACxB,+BAA4B,IAC5B,2BAAwB,SACU;GAClC,IAAI,CAAC,KAAQ,KAAyB,EAAM,QAAQ,WAAW;IAC9D,EAAM,eAAe;IACrB;GACD;GAEA,IAAI,CAAC,KAAQ,KAA6B,EAAM,QAAQ,aAAa;IAEpE,AADA,EAAM,eAAe,GACrB,EAAc;IACd;GACD;GAEA,IAAI,EAAM,QAAQ,SAAS;IAG1B,AAFA,EAAM,eAAe,GAEjB,IACH,IAAqB,IAErB,EAAc;IAGf;GACD;GAEA,AAAI,KAAyB,EAAM,QAAQ,QAC1C,EAAM,eAAe,GAEjB,IACH,IAAqB,IAErB,EAAc;EAGjB;EACA;CACD;AACD"}
|
|
1
|
+
{"version":3,"file":"picker-CWx7vPE8.js","names":[],"sources":["../../src/picker/PickerField.tsx","../../src/picker/PickerClearButton.tsx","../../src/picker/Picker.module.scss","../../src/picker/PickerSelectionToolbar.tsx","../../src/picker/PickerOptions.tsx","../../src/picker/model/extractPickerTextContent.ts","../../src/picker/PickerPlaceholder.ts","../../src/picker/PickerPopup.tsx","../../src/picker/PickerSelectedToken.tsx","../../src/picker/PickerStatus.tsx","../../src/picker/PickerTriggerActions.tsx","../../src/picker/PickerTriggerInput.tsx","../../src/picker/PickerTrigger.tsx","../../src/picker/model/createPickerTriggerPolicy.ts","../../src/picker/model/usePickerDefaultFilter.ts","../../src/picker/model/usePickerFloatingListbox.ts","../../src/picker/model/usePickerQuery.ts","../../src/picker/model/usePickerSelectionLifecycle.ts","../../src/picker/model/usePickerTriggerController.ts"],"sourcesContent":["import { InputType } from \"@ryuzaki13/react-foundation-lib/types\";\n\nimport { InputUI } from \"../input\";\nimport { useInputFieldIds } from \"../input/lib/useInputFieldIds\";\n\nimport { PickerFieldProps } from \"./types\";\n\nexport function PickerField<TValue extends InputType>({\n\tid,\n\tlabel,\n\tdescription,\n\tdisabled,\n\tsize,\n\tclassName,\n\terror,\n\trequired,\n\tchildren\n}: PickerFieldProps<TValue>) {\n\tconst { controlId, labelId, descriptionId, errorId, describedBy } = useInputFieldIds({\n\t\tid,\n\t\thasLabel: label !== undefined && label !== null,\n\t\thasDescription: !!description,\n\t\thasError: !!error\n\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\tsize={size}\n\t\t\tclassName={className}\n\t\t\terror={error}\n\t\t\trequired={required}\n\t\t\tcontrolId={controlId}\n\t\t\tlabelId={labelId}\n\t\t\tdescriptionId={descriptionId}\n\t\t\terrorId={errorId}>\n\t\t\t{children({ controlId, labelId, descriptionId, errorId, describedBy })}\n\t\t</InputUI>\n\t);\n}\n","import { type MouseEvent } from \"react\";\n\nimport { XIcon } from \"lucide-react\";\n\nimport uiStyles from \"../ui.module.scss\";\n\ntype PickerClearButtonProps = {\n\tdisabled?: boolean;\n\tariaLabel?: string;\n\tonClear: () => void;\n};\n\n/** Единое действие очистки выбранного значения во всех clearable picker-компонентах. */\nexport function PickerClearButton({ disabled, ariaLabel = \"Очистить выбор\", onClear }: PickerClearButtonProps) {\n\tconst stopTriggerInteraction = (event: MouseEvent<HTMLButtonElement>) => {\n\t\tevent.preventDefault();\n\t\tevent.stopPropagation();\n\t};\n\n\treturn (\n\t\t<button\n\t\t\ttype=\"button\"\n\t\t\tdisabled={disabled}\n\t\t\tclassName={uiStyles.uiClearButton}\n\t\t\tdata-ui=\"picker-clear-button\"\n\t\t\tdata-action=\"clear-picker\"\n\t\t\tonMouseDown={stopTriggerInteraction}\n\t\t\tonClick={(event) => {\n\t\t\t\tstopTriggerInteraction(event);\n\t\t\t\tonClear();\n\t\t\t}}\n\t\t\taria-label={ariaLabel}>\n\t\t\t<XIcon />\n\t\t</button>\n\t);\n}\n","@use \"@/styles/mixins\" as *;\n\n.popupPositioner,\n.options {\n\toverflow: hidden;\n\tdisplay: grid;\n\tgrid-template-rows: minmax(0, 1fr);\n\tborder-radius: var(--radius-sm);\n}\n\n.popupPositioner {\n\t--anchor-gap: var(--space-xs);\n\t--anchor-padding: var(--space-xs);\n\t--anchor-offset: 0;\n\t// Минимальная ширина нужна только floating-панели. Встроенный Listbox получает ширину от UiBaseProps.size.\n\t--input-width: min(100vw, var(--base-width, 15em));\n\n\tmin-width: 0;\n\tz-index: var(--z-dropdown);\n\tbox-shadow: var(--shadow-md);\n\n\t.options {\n\t\tmin-width: var(--input-width);\n\t}\n}\n\n.options {\n\twidth: 100%;\n\tmin-height: 0;\n\tmax-height: 75vh;\n\n\tpadding: var(--space-sm);\n\tbackground-color: var(--surface-0);\n\tborder: var(--border);\n\n\t&:empty {\n\t\tvisibility: hidden;\n\t}\n\n\t&[data-has-toolbar=\"true\"] {\n\t\tgrid-template-rows: auto minmax(0, 1fr);\n\t}\n}\n\n.optionsToolbar {\n\tdisplay: grid;\n\tgap: var(--space-xs);\n\tpadding: var(--space-xs);\n}\n\n.optionsBody {\n\tmin-height: 0;\n}\n\n.status {\n\tpadding: var(--space-xs) var(--space-sm);\n\tcolor: var(--content-2);\n}\n\n.statusError {\n\tcolor: var(--error-text);\n}\n\n.triggerContainer {\n\tposition: relative;\n\n\t&[data-has-overlay=\"true\"] input {\n\t\t--ui-color: transparent;\n\t\t--ui-color-hover: transparent;\n\t\t--ui-color-active: transparent;\n\n\t\tcolor: transparent;\n\t\tcaret-color: transparent;\n\t\t-webkit-text-fill-color: transparent;\n\t}\n}\n\n.triggerHasClear {\n\t--trigger-count: 2;\n\t// Резервирует в input место для кнопок очистки и открытия списка.\n\t--input-end-adornment-width: calc(var(--control-height) * 2);\n}\n\n.selectedToken {\n\tposition: absolute;\n\tinset: 0 calc(var(--control-height) * var(--trigger-count, 1) + var(--space-sm)) 0 var(--space-sm);\n\tdisplay: flex;\n\talign-items: center;\n\tjustify-content: flex-end;\n\tmin-width: 0;\n\tpointer-events: none;\n}\n\n.selectedTokenText {\n\toverflow: hidden;\n\twhite-space: nowrap;\n\ttext-overflow: ellipsis;\n}\n\n@include mobile {\n\t.popupPositioner {\n\t\t--input-width: calc(100dvw - var(--space-xl));\n\t}\n}\n\n.selectionActionButton {\n\tpadding-block: var(--space-xs);\n\tborder-radius: var(--radius-sm);\n\n\t&:hover {\n\t\tbackground-color: var(--surface-2);\n\t}\n}\n","import { type Ref } from \"react\";\n\nimport { Grid } from \"../grid\";\n\nimport styles from \"./Picker.module.scss\";\n\ntype PickerSelectionToolbarProps = {\n\tonSelectAll: () => void;\n\tonDeselectAll: () => void;\n\tselectAllButtonRef?: Ref<HTMLButtonElement>;\n};\n\n/**\n * Общая панель массовых действий для picker-компонентов с множественным выбором.\n * Компонент не знает формат значения и делегирует изменение владельцу selection-модели.\n */\nexport function PickerSelectionToolbar({ onSelectAll, onDeselectAll, selectAllButtonRef }: PickerSelectionToolbarProps) {\n\treturn (\n\t\t<Grid.Container gap=\"xs\" templateColumns=\"1fr 1fr\">\n\t\t\t<button\n\t\t\t\tref={selectAllButtonRef}\n\t\t\t\ttype=\"button\"\n\t\t\t\tclassName={styles.selectionActionButton}\n\t\t\t\tonClick={onSelectAll}\n\t\t\t\tdata-ui=\"picker-select-all\"\n\t\t\t\tdata-action=\"select-all\">\n\t\t\t\tВыбрать все\n\t\t\t</button>\n\t\t\t<button\n\t\t\t\ttype=\"button\"\n\t\t\t\tclassName={styles.selectionActionButton}\n\t\t\t\tonClick={onDeselectAll}\n\t\t\t\tdata-ui=\"picker-deselect-all\"\n\t\t\t\tdata-action=\"deselect-all\">\n\t\t\t\tСнять выбор\n\t\t\t</button>\n\t\t</Grid.Container>\n\t);\n}\n","import { type HTMLAttributes, type ReactNode, type Ref } from \"react\";\n\nimport { cn } from \"@ryuzaki13/react-foundation-lib/utils\";\n\nimport { Separator } from \"../separator\";\n\nimport styles from \"./Picker.module.scss\";\nimport { PickerSelectionToolbar } from \"./PickerSelectionToolbar\";\n\nexport type PickerSelectionActions = {\n\tonSelectAll: () => void;\n\tonDeselectAll: () => void;\n\tselectAllButtonRef?: Ref<HTMLButtonElement>;\n};\n\nexport interface PickerOptionsProps extends Omit<HTMLAttributes<HTMLDivElement>, \"children\"> {\n\trootRef?: Ref<HTMLDivElement>;\n\tbodyRef?: Ref<HTMLDivElement>;\n\tbodyProps?: Omit<HTMLAttributes<HTMLDivElement>, \"children\" | \"className\">;\n\tchildren: ReactNode;\n\ttoolbar?: ReactNode | false;\n\tselectionActions?: PickerSelectionActions;\n\tlayoutClassName?: string;\n\tbodyClassName?: string;\n\tscrollable?: boolean;\n}\n\n/**\n * Единая оболочка списка опций для picker, listbox и menu. Если переданы\n * selectionActions, но не передан toolbar, компонент показывает стандартные\n * действия выбора и снятия выбора.\n */\nexport function PickerOptions({\n\trootRef,\n\tbodyRef,\n\tbodyProps,\n\tchildren,\n\ttoolbar,\n\tselectionActions,\n\tlayoutClassName,\n\tbodyClassName,\n\tscrollable = true,\n\tclassName,\n\t...props\n}: PickerOptionsProps) {\n\tconst resolvedToolbar = toolbar === undefined && selectionActions ? <PickerSelectionToolbar {...selectionActions} /> : toolbar || null;\n\n\treturn (\n\t\t<div\n\t\t\t{...props}\n\t\t\tref={rootRef}\n\t\t\tclassName={cn(styles.options, layoutClassName, className)}\n\t\t\tdata-ui=\"picker-options\"\n\t\t\tdata-has-toolbar={resolvedToolbar ? \"true\" : undefined}>\n\t\t\t{resolvedToolbar ? (\n\t\t\t\t<div className={styles.optionsToolbar}>\n\t\t\t\t\t{resolvedToolbar}\n\t\t\t\t\t<Separator />\n\t\t\t\t</div>\n\t\t\t) : null}\n\t\t\t<div\n\t\t\t\t{...bodyProps}\n\t\t\t\tref={bodyRef}\n\t\t\t\tclassName={cn(styles.optionsBody, scrollable ? \"scrollable overscroll\" : \"overflowHidden\", bodyClassName)}>\n\t\t\t\t{children}\n\t\t\t</div>\n\t\t</div>\n\t);\n}\n","import { isValidElement, type ReactNode } from \"react\";\n\nexport function extractPickerTextContent(node: ReactNode): string | undefined {\n\tif (typeof node === \"string\" || typeof node === \"number\") {\n\t\treturn String(node);\n\t}\n\n\tif (Array.isArray(node)) {\n\t\tconst values = node\n\t\t\t.map(extractPickerTextContent)\n\t\t\t.filter((value): value is string => Boolean(value))\n\t\t\t.map((value) => value.trim())\n\t\t\t.filter(Boolean);\n\t\treturn values.length ? values.join(\" \") : undefined;\n\t}\n\n\tif (isValidElement<{ children?: ReactNode; searchText?: unknown }>(node)) {\n\t\tif (typeof node.props.searchText === \"string\") {\n\t\t\treturn node.props.searchText;\n\t\t}\n\n\t\treturn extractPickerTextContent(node.props.children);\n\t}\n\n\treturn undefined;\n}\n","import { type ReactNode } from \"react\";\n\nimport { extractPickerTextContent } from \"./model/extractPickerTextContent\";\n\ntype PickerPlaceholderParams = {\n\tplaceholder?: string;\n\tlabel?: ReactNode;\n\toptionCount: number;\n\tfallback?: string;\n};\n\n/**\n * Формирует единый текст placeholder для picker-компонентов и всегда показывает\n * актуальное количество доступных вариантов.\n */\nexport function getPickerPlaceholder({ placeholder, label, optionCount, fallback = \"Выберите значение\" }: PickerPlaceholderParams) {\n\tconst labelText = extractPickerTextContent(label);\n\tconst text = placeholder ?? labelText ?? fallback;\n\n\treturn `${text} <${optionCount}>`;\n}\n","import { type CSSProperties, type FocusEvent, type KeyboardEvent, type MouseEvent, type ReactNode, useRef } from \"react\";\n\nimport { FloatingContext, FloatingFocusManager, FloatingPortal } from \"@floating-ui/react\";\nimport { AnimatePresence, motion } from \"motion/react\";\n\nimport styles from \"./Picker.module.scss\";\nimport { PickerOptions, type PickerSelectionActions } from \"./PickerOptions\";\n\ninterface PickerPopupProps {\n\topen: boolean;\n\tcontext: FloatingContext;\n\tfloatingStyles: CSSProperties;\n\tlistId: string;\n\tlabelId?: string;\n\tpopupAriaLabel?: string;\n\tdescriptionId?: string;\n\tactiveOptionId?: string;\n\tariaMultiselectable?: boolean;\n\tpopupRole?: \"listbox\" | \"tree\" | \"treegrid\" | \"grid\" | \"dialog\";\n\tsetFloating: (node: HTMLElement | null) => void;\n\tgetFloatingProps: (userProps?: Record<string, unknown>) => Record<string, unknown>;\n\tonKeyDown: (event: KeyboardEvent<HTMLElement>) => void;\n\tinitialFocus?: number;\n\treturnFocus?: boolean;\n\ttabIndex?: number;\n\tclassName?: string;\n\tmaxWidth?: CSSProperties[\"maxWidth\"];\n\tlayoutClassName?: string;\n\tbodyClassName?: string;\n\ttoolbar?: ReactNode | false;\n\tselectionActions?: PickerSelectionActions;\n\tchildren: ReactNode;\n}\n\nfunction stopNestedFloatingMouseDown(event: MouseEvent<HTMLElement>): void {\n\tevent.stopPropagation();\n}\n\nexport function PickerPopup({\n\topen,\n\tcontext,\n\tfloatingStyles,\n\tlistId,\n\tlabelId,\n\tpopupAriaLabel,\n\tdescriptionId,\n\tactiveOptionId,\n\tariaMultiselectable,\n\tpopupRole = \"listbox\",\n\tsetFloating,\n\tgetFloatingProps,\n\tonKeyDown,\n\tinitialFocus = -1,\n\treturnFocus = false,\n\ttabIndex = 0,\n\tclassName,\n\tmaxWidth,\n\tlayoutClassName,\n\tbodyClassName,\n\ttoolbar,\n\tselectionActions,\n\tchildren\n}: PickerPopupProps) {\n\tconst compositeRef = useRef<HTMLDivElement | null>(null);\n\tconst isDialog = popupRole === \"dialog\";\n\tconst compositeProps = isDialog\n\t\t? undefined\n\t\t: getFloatingProps({\n\t\t\t\tid: listId,\n\t\t\t\trole: popupRole,\n\t\t\t\ttabIndex,\n\t\t\t\t\"aria-labelledby\": labelId,\n\t\t\t\t\"aria-label\": labelId ? undefined : popupAriaLabel,\n\t\t\t\t\"aria-describedby\": descriptionId,\n\t\t\t\t\"aria-activedescendant\": activeOptionId,\n\t\t\t\t\"aria-multiselectable\": ariaMultiselectable || undefined,\n\t\t\t\tonKeyDown\n\t\t\t});\n\tconst handlePositionerFocus = (event: FocusEvent<HTMLDivElement>) => {\n\t\tif (!isDialog && event.target === event.currentTarget) {\n\t\t\tcompositeRef.current?.focus();\n\t\t}\n\t};\n\n\treturn (\n\t\t<AnimatePresence>\n\t\t\t{open && (\n\t\t\t\t<FloatingPortal preserveTabOrder={false}>\n\t\t\t\t\t<FloatingFocusManager\n\t\t\t\t\t\tcontext={context}\n\t\t\t\t\t\tmodal={false}\n\t\t\t\t\t\tguards={false}\n\t\t\t\t\t\tinitialFocus={initialFocus}\n\t\t\t\t\t\treturnFocus={returnFocus}>\n\t\t\t\t\t\t<motion.div\n\t\t\t\t\t\t\tref={setFloating}\n\t\t\t\t\t\t\tstyle={{ ...floatingStyles, maxWidth }}\n\t\t\t\t\t\t\tclassName={styles.popupPositioner}\n\t\t\t\t\t\t\tinitial={{ opacity: 0, scale: 0.95 }}\n\t\t\t\t\t\t\tanimate={{ opacity: 1, scale: 1 }}\n\t\t\t\t\t\t\texit={{ opacity: 0, scale: 0.95 }}\n\t\t\t\t\t\t\ttabIndex={isDialog ? undefined : -1}\n\t\t\t\t\t\t\tonMouseDown={stopNestedFloatingMouseDown}\n\t\t\t\t\t\t\tonFocus={isDialog ? undefined : handlePositionerFocus}\n\t\t\t\t\t\t\t{...(isDialog\n\t\t\t\t\t\t\t\t? getFloatingProps({\n\t\t\t\t\t\t\t\t\t\tid: listId,\n\t\t\t\t\t\t\t\t\t\trole: \"dialog\",\n\t\t\t\t\t\t\t\t\t\ttabIndex,\n\t\t\t\t\t\t\t\t\t\t\"aria-labelledby\": labelId,\n\t\t\t\t\t\t\t\t\t\t\"aria-label\": labelId ? undefined : popupAriaLabel,\n\t\t\t\t\t\t\t\t\t\t\"aria-describedby\": descriptionId,\n\t\t\t\t\t\t\t\t\t\tonMouseDown: stopNestedFloatingMouseDown,\n\t\t\t\t\t\t\t\t\t\tonKeyDown\n\t\t\t\t\t\t\t\t\t})\n\t\t\t\t\t\t\t\t: {})}>\n\t\t\t\t\t\t\t<PickerOptions\n\t\t\t\t\t\t\t\tclassName={className}\n\t\t\t\t\t\t\t\tlayoutClassName={layoutClassName}\n\t\t\t\t\t\t\t\tbodyClassName={bodyClassName}\n\t\t\t\t\t\t\t\ttoolbar={toolbar}\n\t\t\t\t\t\t\t\tselectionActions={selectionActions}\n\t\t\t\t\t\t\t\tbodyRef={isDialog ? undefined : compositeRef}\n\t\t\t\t\t\t\t\tbodyProps={isDialog ? undefined : compositeProps}\n\t\t\t\t\t\t\t\tscrollable={false}>\n\t\t\t\t\t\t\t\t{children}\n\t\t\t\t\t\t\t</PickerOptions>\n\t\t\t\t\t\t</motion.div>\n\t\t\t\t\t</FloatingFocusManager>\n\t\t\t\t</FloatingPortal>\n\t\t\t)}\n\t\t</AnimatePresence>\n\t);\n}\n","import { type HTMLAttributes, type ReactNode } from \"react\";\n\nimport { cn } from \"@ryuzaki13/react-foundation-lib/utils\";\n\nimport styles from \"./Picker.module.scss\";\n\nexport interface PickerSelectedTokenProps extends Omit<HTMLAttributes<HTMLSpanElement>, \"children\"> {\n\tchildren: ReactNode;\n}\n\n/** Единое визуальное представление выбранного значения внутри picker-trigger. */\nexport function PickerSelectedToken({ children, className, ...props }: PickerSelectedTokenProps) {\n\treturn (\n\t\t<span {...props} className={cn(styles.selectedToken, className)} data-ui=\"picker-selected-token\">\n\t\t\t<span className={styles.selectedTokenText}>{children}</span>\n\t\t</span>\n\t);\n}\n","import { ReactNode } from \"react\";\n\nimport { cn } from \"@ryuzaki13/react-foundation-lib/utils\";\n\nimport uiStyles from \"../ui.module.scss\";\n\nimport styles from \"./Picker.module.scss\";\n\ninterface PickerStatusProps {\n\temptyState?: ReactNode;\n\t// loadingState?: ReactNode;\n\terrorState?: ReactNode;\n}\n\nexport function PickerStatus({ emptyState, errorState }: PickerStatusProps) {\n\tconst content = errorState ?? emptyState;\n\n\tif (content === undefined || content === null) {\n\t\treturn null;\n\t}\n\n\treturn (\n\t\t<div className={cn(uiStyles.uiPopupOption, styles.status, errorState !== undefined && styles.statusError)} aria-disabled={true}>\n\t\t\t{content}\n\t\t</div>\n\t);\n}\n","import { type AriaAttributes, type MouseEvent, type ReactNode } from \"react\";\n\nimport { cn } from \"@ryuzaki13/react-foundation-lib/utils\";\nimport { ChevronDownIcon } from \"lucide-react\";\n\nimport uiStyles from \"../ui.module.scss\";\n\ninterface PickerTriggerActionsProps {\n\topen: boolean;\n\tdisabled?: boolean;\n\tchildren?: ReactNode;\n\tonToggleMouseDown?: (event: MouseEvent<HTMLButtonElement>) => void;\n\tonToggleClick: () => void;\n\topenAriaLabel?: string;\n\tcloseAriaLabel?: string;\n\t/**\n\t * Передаёт ARIA-связи непосредственно кнопке раскрытия, не меняя геометрию\n\t * контейнера с adornment-действиями.\n\t */\n\ttoggleAria?: Pick<AriaAttributes, \"aria-controls\" | \"aria-expanded\" | \"aria-haspopup\">;\n}\n\nexport function PickerTriggerActions({\n\topen,\n\tdisabled,\n\tchildren,\n\tonToggleMouseDown,\n\tonToggleClick,\n\topenAriaLabel = \"Открыть список\",\n\tcloseAriaLabel = \"Закрыть список\",\n\ttoggleAria\n}: PickerTriggerActionsProps) {\n\treturn (\n\t\t<div className={uiStyles.uiToggleButtonContainer} data-disabled={disabled || undefined}>\n\t\t\t{children}\n\n\t\t\t<div className={uiStyles.uiButtonSeparator} />\n\n\t\t\t<button\n\t\t\t\t{...toggleAria}\n\t\t\t\ttype=\"button\"\n\t\t\t\tdisabled={disabled}\n\t\t\t\taria-label={open ? closeAriaLabel : openAriaLabel}\n\t\t\t\tclassName={uiStyles.uiToggleButton}\n\t\t\t\tonMouseDown={onToggleMouseDown}\n\t\t\t\tonClick={onToggleClick}>\n\t\t\t\t<ChevronDownIcon className={cn(uiStyles.uiToggleIcon, open && uiStyles.uiToggleIconOpen)} />\n\t\t\t</button>\n\t\t</div>\n\t);\n}\n","import { type ComponentPropsWithoutRef, type ReactNode, type Ref } from \"react\";\n\nimport { cn } from \"@ryuzaki13/react-foundation-lib/utils\";\n\nimport { InputControl, InputLoadingFrame } from \"../input\";\nimport uiStyles from \"../ui.module.scss\";\n\nimport styles from \"./Picker.module.scss\";\n\nexport interface PickerTriggerInputProps extends Omit<ComponentPropsWithoutRef<\"input\">, \"size\"> {\n\trootRef?: (node: HTMLDivElement | null) => void;\n\tendAdornment?: ReactNode;\n\toverlay?: ReactNode;\n\trootClassName?: string;\n\tinputClassName?: string;\n\tisLoading?: boolean;\n}\n\nexport function PickerTriggerInput({\n\tref,\n\trootRef,\n\tendAdornment,\n\toverlay,\n\trootClassName,\n\tinputClassName,\n\tisLoading,\n\t...props\n}: PickerTriggerInputProps & { ref?: Ref<HTMLInputElement> }) {\n\tconst hasOverlay = overlay !== undefined && overlay !== null;\n\t// Picker проверяет выбранное значение, поэтому визуальная ошибка следует aria-invalid, а не native :invalid поискового input.\n\tconst isInvalid = props[\"aria-invalid\"] === true || props[\"aria-invalid\"] === \"true\";\n\n\treturn (\n\t\t<div\n\t\t\tref={rootRef}\n\t\t\tclassName={cn(uiStyles.uiInputContainer, styles.triggerContainer, rootClassName)}\n\t\t\tdata-has-overlay={hasOverlay || undefined}>\n\t\t\t{isLoading ? (\n\t\t\t\t<InputLoadingFrame />\n\t\t\t) : (\n\t\t\t\t<>\n\t\t\t\t\t<InputControl endAdornment={endAdornment}>\n\t\t\t\t\t\t{({ controlClassName }) => (\n\t\t\t\t\t\t\t<input\n\t\t\t\t\t\t\t\t{...props}\n\t\t\t\t\t\t\t\tref={ref}\n\t\t\t\t\t\t\t\tclassName={cn(uiStyles.uiInputWithToggle, isInvalid && uiStyles.invalid, controlClassName, inputClassName)}\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t)}\n\t\t\t\t\t</InputControl>\n\t\t\t\t\t{hasOverlay ? overlay : null}\n\t\t\t\t</>\n\t\t\t)}\n\t\t</div>\n\t);\n}\n\nPickerTriggerInput.displayName = \"PickerTriggerInput\";\n","import { type ReactNode, type Ref } from \"react\";\n\nimport styles from \"./Picker.module.scss\";\nimport { PickerClearButton } from \"./PickerClearButton\";\nimport { getPickerPlaceholder } from \"./PickerPlaceholder\";\nimport { PickerSelectedToken } from \"./PickerSelectedToken\";\nimport { PickerTriggerActions } from \"./PickerTriggerActions\";\nimport { PickerTriggerInput, type PickerTriggerInputProps } from \"./PickerTriggerInput\";\n\nexport interface PickerTriggerProps extends Omit<PickerTriggerInputProps, \"placeholder\" | \"overlay\" | \"endAdornment\"> {\n\tref?: Ref<HTMLInputElement>;\n\topen: boolean;\n\toptionCount: number;\n\tplaceholder?: string;\n\tlabel?: ReactNode;\n\tplaceholderFallback?: string;\n\tselectedValue?: ReactNode;\n\thasSelection?: boolean;\n\tshowSelectedValue?: boolean;\n\tclearable?: boolean;\n\tonClear?: () => void;\n\tclearAriaLabel?: string;\n\tonToggleMouseDown?: PickerTriggerActionsProps[\"onToggleMouseDown\"];\n\tonToggleClick: PickerTriggerActionsProps[\"onToggleClick\"];\n\topenAriaLabel?: string;\n\tcloseAriaLabel?: string;\n}\n\ntype PickerTriggerActionsProps = Parameters<typeof PickerTriggerActions>[0];\n\n/**\n * Общая композиция picker-trigger: input, выбранное значение, очистка и кнопка\n * открытия. Владельцы picker-моделей передают только состояние и обработчики.\n */\nexport function PickerTrigger({\n\tref,\n\topen,\n\toptionCount,\n\tplaceholder,\n\tlabel,\n\tplaceholderFallback,\n\tselectedValue,\n\thasSelection,\n\tshowSelectedValue = selectedValue !== undefined && selectedValue !== null,\n\tclearable = false,\n\tonClear,\n\tclearAriaLabel,\n\tonToggleMouseDown,\n\tonToggleClick,\n\topenAriaLabel,\n\tcloseAriaLabel,\n\tdisabled,\n\tinputClassName,\n\t...inputProps\n}: PickerTriggerProps) {\n\tconst hasSelectedValue = hasSelection ?? (selectedValue !== undefined && selectedValue !== null);\n\tconst canClear = clearable && hasSelectedValue && onClear !== undefined && !disabled;\n\n\treturn (\n\t\t<PickerTriggerInput\n\t\t\t{...inputProps}\n\t\t\tref={ref}\n\t\t\tdisabled={disabled}\n\t\t\tplaceholder={\n\t\t\t\tshowSelectedValue ? undefined : getPickerPlaceholder({ placeholder, label, optionCount, fallback: placeholderFallback })\n\t\t\t}\n\t\t\tinputClassName={inputClassName}\n\t\t\trootClassName={clearable ? styles.triggerHasClear : undefined}\n\t\t\toverlay={showSelectedValue ? <PickerSelectedToken>{selectedValue}</PickerSelectedToken> : undefined}\n\t\t\tendAdornment={\n\t\t\t\t<PickerTriggerActions\n\t\t\t\t\topen={open}\n\t\t\t\t\tdisabled={disabled}\n\t\t\t\t\tonToggleMouseDown={onToggleMouseDown}\n\t\t\t\t\tonToggleClick={onToggleClick}\n\t\t\t\t\topenAriaLabel={openAriaLabel}\n\t\t\t\t\tcloseAriaLabel={closeAriaLabel}>\n\t\t\t\t\t{canClear ? <PickerClearButton ariaLabel={clearAriaLabel} onClear={onClear} /> : null}\n\t\t\t\t</PickerTriggerActions>\n\t\t\t}\n\t\t/>\n\t);\n}\n","export type PickerTriggerMode = \"display\" | \"search-single\" | \"search-multi\";\n\ninterface PickerTriggerTextFocusParams {\n\topen: boolean;\n\tcurrentQuery: string;\n\thasDisplayValue: boolean;\n}\n\nexport interface PickerTriggerPolicy {\n\tfocusFloatingOnOpen: boolean;\n\trestoreFocusOnClose: boolean;\n\tresetQueryOnClose: boolean;\n\tshouldOpenOnTriggerClick: (open: boolean) => boolean;\n\tshouldOpenOnInputChange: (open: boolean) => boolean;\n\tshouldFocusReferenceOnToggle: (open: boolean) => boolean;\n\tshouldSelectTriggerTextOnFocus: (params: PickerTriggerTextFocusParams) => boolean;\n}\n\n/**\n * Единая политика поведения trigger-input для picker-компонентов.\n * Нормализует различия между display-режимом, single-search и multi-search.\n */\nexport function createPickerTriggerPolicy(mode: PickerTriggerMode): PickerTriggerPolicy {\n\tswitch (mode) {\n\t\tcase \"search-single\":\n\t\t\treturn {\n\t\t\t\tfocusFloatingOnOpen: false,\n\t\t\t\trestoreFocusOnClose: false,\n\t\t\t\tresetQueryOnClose: true,\n\t\t\t\tshouldOpenOnTriggerClick: () => false,\n\t\t\t\tshouldOpenOnInputChange: (open) => !open,\n\t\t\t\tshouldFocusReferenceOnToggle: (open) => !open,\n\t\t\t\tshouldSelectTriggerTextOnFocus: ({ open, currentQuery, hasDisplayValue }) =>\n\t\t\t\t\t!open && currentQuery.length === 0 && hasDisplayValue\n\t\t\t};\n\t\tcase \"search-multi\":\n\t\t\treturn {\n\t\t\t\tfocusFloatingOnOpen: false,\n\t\t\t\trestoreFocusOnClose: false,\n\t\t\t\tresetQueryOnClose: true,\n\t\t\t\tshouldOpenOnTriggerClick: () => false,\n\t\t\t\tshouldOpenOnInputChange: (open) => !open,\n\t\t\t\tshouldFocusReferenceOnToggle: (open) => !open,\n\t\t\t\tshouldSelectTriggerTextOnFocus: () => false\n\t\t\t};\n\t\tcase \"display\":\n\t\tdefault:\n\t\t\treturn {\n\t\t\t\tfocusFloatingOnOpen: true,\n\t\t\t\trestoreFocusOnClose: true,\n\t\t\t\tresetQueryOnClose: false,\n\t\t\t\tshouldOpenOnTriggerClick: (open) => !open,\n\t\t\t\tshouldOpenOnInputChange: () => false,\n\t\t\t\tshouldFocusReferenceOnToggle: () => false,\n\t\t\t\tshouldSelectTriggerTextOnFocus: () => false\n\t\t\t};\n\t}\n}\n","import { useMemo } from \"react\";\n\nimport { normalizeTextToLower } from \"@ryuzaki13/react-foundation-lib/formatters\";\n\ninterface UsePickerDefaultFilterOptions<T> {\n\toptions: readonly T[];\n\tquery: string;\n\tenabled?: boolean;\n\tgetSearchText: (option: T) => unknown;\n}\n\nfunction normalizeSearchText(value: unknown) {\n\tconst parts = Array.isArray(value) ? value : [value];\n\n\treturn normalizeTextToLower(parts.filter(Boolean).join(\" \"));\n}\n\nexport function usePickerDefaultFilter<T>({ options, query, enabled = true, getSearchText }: UsePickerDefaultFilterOptions<T>) {\n\tconst normalizedQuery = normalizeTextToLower(query);\n\n\treturn useMemo(() => {\n\t\tif (!enabled || !normalizedQuery) {\n\t\t\treturn [...options];\n\t\t}\n\n\t\treturn options.filter((option) => normalizeSearchText(getSearchText(option)).includes(normalizedQuery));\n\t}, [enabled, getSearchText, normalizedQuery, options]);\n}\n","import { Placement } from \"@floating-ui/react\";\nimport {\n\ttype FloatingListboxPlacementStrategy,\n\ttype FloatingListboxSizeResolver,\n\tuseFloatingListbox\n} from \"@ryuzaki13/react-foundation-lib/hooks\";\n\nimport { PickerTriggerMode, createPickerTriggerPolicy } from \"./createPickerTriggerPolicy\";\n\ninterface UsePickerFloatingListboxParams<T> {\n\toptions: readonly T[];\n\tselectedIndex: number;\n\topen?: boolean;\n\tonOpenChange?: (open: boolean) => void;\n\tgetOptionDisabled?: (option: T) => boolean;\n\tonSelect?: (option: T) => void;\n\tdisabled?: boolean;\n\tplacement?: Placement;\n\tplacementStrategy?: FloatingListboxPlacementStrategy;\n\tcloseOnSelect?: boolean;\n\tfocusFloatingOnOpen?: boolean;\n\tallowOpenWithoutOptions?: boolean;\n\trestoreFocusOnClose?: boolean;\n\ttriggerMode?: PickerTriggerMode;\n\tresolveFloatingSize?: FloatingListboxSizeResolver;\n}\n\n/**\n * Единая точка входа для popup/listbox поведения во всех picker-компонентах.\n */\nexport function usePickerFloatingListbox<T>(params: UsePickerFloatingListboxParams<T>) {\n\tconst triggerPolicy = params.triggerMode ? createPickerTriggerPolicy(params.triggerMode) : undefined;\n\n\treturn useFloatingListbox({\n\t\t...params,\n\t\tfocusFloatingOnOpen: params.focusFloatingOnOpen ?? triggerPolicy?.focusFloatingOnOpen,\n\t\trestoreFocusOnClose: params.restoreFocusOnClose ?? triggerPolicy?.restoreFocusOnClose\n\t});\n}\n","import { useState } from \"react\";\n\nimport { PickerTriggerMode, createPickerTriggerPolicy } from \"./createPickerTriggerPolicy\";\n\ninterface UsePickerQueryOptions {\n\tquery?: string;\n\tdefaultQuery?: string;\n\tonQuery?: (value: string) => void;\n\tresetOnClose?: boolean;\n\ttriggerMode?: PickerTriggerMode;\n}\n\n/**\n * Управляет controlled/uncontrolled query и возвращает policy закрытия владельцу open-state.\n * Сброс выполняется самим владельцем в событии close, поэтому hook не зеркалит lifecycle через effect.\n */\nexport function usePickerQuery({ query, defaultQuery, onQuery, resetOnClose, triggerMode }: UsePickerQueryOptions) {\n\tconst isControlled = query !== undefined;\n\tconst [internalQuery, setInternalQuery] = useState(defaultQuery ?? \"\");\n\tconst currentQuery = isControlled ? (query ?? \"\") : internalQuery;\n\tconst resolvedResetOnClose = resetOnClose ?? (triggerMode ? createPickerTriggerPolicy(triggerMode).resetQueryOnClose : true);\n\n\tconst setQuery = (nextValue: string) => {\n\t\tif (!isControlled) {\n\t\t\tsetInternalQuery(nextValue);\n\t\t}\n\n\t\tonQuery?.(nextValue);\n\t};\n\n\treturn {\n\t\tquery: currentQuery,\n\t\tsetQuery,\n\t\tclearQuery: () => setQuery(\"\"),\n\t\tresetQueryOnClose: resolvedResetOnClose\n\t};\n}\n","import { useEffect, useRef, useState } from \"react\";\n\ninterface UsePickerSelectionLifecycleOptions<TValue> {\n\tvalue: TValue;\n\topen: boolean;\n\tonCommit: (value: TValue) => void;\n\tonOpen?: () => void;\n\tonClose?: (value: TValue) => void;\n\tisEqual: (left: TValue, right: TValue) => boolean;\n}\n\n/**\n * Общий жизненный цикл чернового выбора для picker-компонентов,\n * где изменения подтверждаются при закрытии popup.\n */\nexport function usePickerSelectionLifecycle<TValue>({\n\tvalue,\n\topen,\n\tonCommit,\n\tonOpen,\n\tonClose,\n\tisEqual\n}: UsePickerSelectionLifecycleOptions<TValue>) {\n\tconst previousOpenRef = useRef(false);\n\tconst [draftValue, setDraftValue] = useState(value);\n\n\tuseEffect(() => {\n\t\tif (previousOpenRef.current && !open) {\n\t\t\tif (!isEqual(draftValue, value)) {\n\t\t\t\tonCommit(draftValue);\n\t\t\t}\n\n\t\t\tonClose?.(draftValue);\n\t\t}\n\n\t\tpreviousOpenRef.current = open;\n\t}, [draftValue, isEqual, onClose, onCommit, open, value]);\n\n\tconst prepareOpen = () => {\n\t\tsetDraftValue(value);\n\t\tonOpen?.();\n\t};\n\n\treturn {\n\t\tdraftValue,\n\t\tsetDraftValue,\n\t\tprepareOpen\n\t};\n}\n","import { MouseEvent, RefObject } from \"react\";\n\nimport { PickerTriggerMode, createPickerTriggerPolicy } from \"./createPickerTriggerPolicy\";\n\ninterface UsePickerTriggerControllerOptions {\n\tmode: PickerTriggerMode;\n\topen: boolean;\n\tcurrentQuery: string;\n\thasDisplayValue: boolean;\n\tinputRef: RefObject<HTMLInputElement | null>;\n\tsetQuery?: (value: string) => void;\n\topenList?: () => void;\n\tclose?: () => void;\n\ttoggleOpen?: () => void;\n\tonBeforeOpen?: () => void;\n}\n\ninterface HandleTriggerKeyDownOptions {\n\tevent: React.KeyboardEvent<HTMLElement>;\n\tonActivateWhenOpen?: () => void;\n\tenableSpaceActivation?: boolean;\n\tenableClosedArrowDownOpen?: boolean;\n\tsuppressClosedArrowUp?: boolean;\n}\n\nfunction focusInput(inputRef: RefObject<HTMLInputElement | null>) {\n\trequestAnimationFrame(() => {\n\t\tinputRef.current?.focus();\n\t});\n}\n\n/**\n * Единый контроллер пользовательских действий на trigger-input.\n * Держит поведение display/search-single/search-multi в одном месте.\n */\nexport function usePickerTriggerController({\n\tmode,\n\topen,\n\tcurrentQuery,\n\thasDisplayValue,\n\tinputRef,\n\tsetQuery,\n\topenList,\n\tclose,\n\ttoggleOpen,\n\tonBeforeOpen\n}: UsePickerTriggerControllerOptions) {\n\tconst policy = createPickerTriggerPolicy(mode);\n\n\tconst openTrigger = () => {\n\t\tonBeforeOpen?.();\n\n\t\tif (openList) {\n\t\t\topenList();\n\t\t\treturn;\n\t\t}\n\n\t\ttoggleOpen?.();\n\t};\n\n\tconst closeTrigger = () => {\n\t\tif (close) {\n\t\t\tclose();\n\t\t\treturn;\n\t\t}\n\n\t\ttoggleOpen?.();\n\t};\n\n\tconst toggleTrigger = () => {\n\t\tif (open) {\n\t\t\tcloseTrigger();\n\t\t} else {\n\t\t\topenTrigger();\n\t\t}\n\n\t\tif (policy.shouldFocusReferenceOnToggle(open)) {\n\t\t\tfocusInput(inputRef);\n\t\t}\n\t};\n\n\treturn {\n\t\tpolicy,\n\t\thandleTriggerInputChange: (nextValue: string) => {\n\t\t\tsetQuery?.(nextValue);\n\n\t\t\tif (policy.shouldOpenOnInputChange(open)) {\n\t\t\t\topenTrigger();\n\t\t\t}\n\t\t},\n\t\thandleTriggerClick: () => {\n\t\t\tif (policy.shouldOpenOnTriggerClick(open)) {\n\t\t\t\topenTrigger();\n\t\t\t}\n\t\t},\n\t\thandleTriggerFocus: (input: HTMLInputElement) => {\n\t\t\tif (\n\t\t\t\tpolicy.shouldSelectTriggerTextOnFocus({\n\t\t\t\t\topen,\n\t\t\t\t\tcurrentQuery,\n\t\t\t\t\thasDisplayValue\n\t\t\t\t})\n\t\t\t) {\n\t\t\t\trequestAnimationFrame(() => {\n\t\t\t\t\tinput.select();\n\t\t\t\t});\n\t\t\t}\n\t\t},\n\t\thandleToggleMouseDown: (event: MouseEvent<HTMLButtonElement>) => {\n\t\t\tevent.preventDefault();\n\t\t},\n\t\thandleToggleClick: () => {\n\t\t\ttoggleTrigger();\n\t\t},\n\t\thandleTriggerKeyDown: ({\n\t\t\tevent,\n\t\t\tonActivateWhenOpen,\n\t\t\tenableSpaceActivation = false,\n\t\t\tenableClosedArrowDownOpen = false,\n\t\t\tsuppressClosedArrowUp = false\n\t\t}: HandleTriggerKeyDownOptions) => {\n\t\t\tif (!open && suppressClosedArrowUp && event.key === \"ArrowUp\") {\n\t\t\t\tevent.preventDefault();\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif (!open && enableClosedArrowDownOpen && event.key === \"ArrowDown\") {\n\t\t\t\tevent.preventDefault();\n\t\t\t\ttoggleTrigger();\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif (event.key === \"Enter\") {\n\t\t\t\tevent.preventDefault();\n\n\t\t\t\tif (open) {\n\t\t\t\t\tonActivateWhenOpen?.();\n\t\t\t\t} else {\n\t\t\t\t\ttoggleTrigger();\n\t\t\t\t}\n\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif (enableSpaceActivation && event.key === \" \") {\n\t\t\t\tevent.preventDefault();\n\n\t\t\t\tif (open) {\n\t\t\t\t\tonActivateWhenOpen?.();\n\t\t\t\t} else {\n\t\t\t\t\ttoggleTrigger();\n\t\t\t\t}\n\t\t\t}\n\t\t},\n\t\ttoggleTrigger\n\t};\n}\n"],"mappings":";;;;;;;;;;;;;AAOA,SAAgB,EAAsC,EACrD,OACA,UACA,gBACA,aACA,SACA,cACA,UACA,aACA,eAC4B;CAC5B,IAAM,EAAE,cAAW,YAAS,kBAAe,YAAS,mBAAgB,EAAiB;EACpF;EACA,UAAU,KAAiC;EAC3C,gBAAgB,CAAC,CAAC;EAClB,UAAU,CAAC,CAAC;CACb,CAAC;CAED,OACC,kBAAC,GAAD;EACQ;EACM;EACH;EACJ;EACK;EACJ;EACG;EACC;EACF;EACM;EACN;EACR,UAAA,EAAS;GAAE;GAAW;GAAS;GAAe;GAAS;EAAY,CAAC;CAC7D,CAAA;AAEX;;;AC5BA,SAAgB,EAAkB,EAAE,aAAU,eAAY,kBAAkB,cAAmC;CAC9G,IAAM,KAA0B,MAAyC;EAExE,AADA,EAAM,eAAe,GACrB,EAAM,gBAAgB;CACvB;CAEA,OACC,kBAAC,UAAD;EACC,MAAK;EACK;EACV,WAAW,EAAS;EACpB,WAAQ;EACR,eAAY;EACZ,aAAa;EACb,UAAU,MAAU;GAEnB,AADA,EAAuB,CAAK,GAC5B,EAAQ;EACT;EACA,cAAY;EACZ,UAAA,kBAAC,GAAD,CAAQ,CAAA;CACD,CAAA;AAEV;;;;;;;;;;;;;;;;AEnBA,SAAgB,EAAuB,EAAE,gBAAa,kBAAe,yBAAmD;CACvH,OACC,kBAAC,EAAK,WAAN;EAAgB,KAAI;EAAK,iBAAgB;EAAzC,UAAA,CACC,kBAAC,UAAD;GACC,KAAK;GACL,MAAK;GACL,WAAW,EAAO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;EACA,0BAA0B;GACzB,AAAI,EAAO,yBAAyB,CAAI,KACvC,EAAY;EAEd;EACA,qBAAqB,MAA4B;GAChD,AACC,EAAO,+BAA+B;IACrC;IACA;IACA;GACD,CAAC,KAED,4BAA4B;IAC3B,EAAM,OAAO;GACd,CAAC;EAEH;EACA,wBAAwB,MAAyC;GAChE,EAAM,eAAe;EACtB;EACA,yBAAyB;GACxB,EAAc;EACf;EACA,uBAAuB,EACtB,UACA,uBACA,2BAAwB,IACxB,+BAA4B,IAC5B,2BAAwB,SACU;GAClC,IAAI,CAAC,KAAQ,KAAyB,EAAM,QAAQ,WAAW;IAC9D,EAAM,eAAe;IACrB;GACD;GAEA,IAAI,CAAC,KAAQ,KAA6B,EAAM,QAAQ,aAAa;IAEpE,AADA,EAAM,eAAe,GACrB,EAAc;IACd;GACD;GAEA,IAAI,EAAM,QAAQ,SAAS;IAG1B,AAFA,EAAM,eAAe,GAEjB,IACH,IAAqB,IAErB,EAAc;IAGf;GACD;GAEA,AAAI,KAAyB,EAAM,QAAQ,QAC1C,EAAM,eAAe,GAEjB,IACH,IAAqB,IAErB,EAAc;EAGjB;EACA;CACD;AACD"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { isResponsiveMap as e, resolveProps as t, resolveResponsiveValue as n } from "@ryuzaki13/react-foundation-lib/media";
|
|
2
|
+
//#region src/responsive-layout/responsiveLayout.ts
|
|
3
|
+
var r = [
|
|
4
|
+
"mobile",
|
|
5
|
+
"tablet",
|
|
6
|
+
"laptop"
|
|
7
|
+
];
|
|
8
|
+
function i(t) {
|
|
9
|
+
return t.some((t) => t !== void 0 && e(t));
|
|
10
|
+
}
|
|
11
|
+
function a(e, n) {
|
|
12
|
+
return {
|
|
13
|
+
mobile: t(e, "mobile", n),
|
|
14
|
+
tablet: t(e, "tablet", n),
|
|
15
|
+
laptop: t(e, "laptop", n)
|
|
16
|
+
};
|
|
17
|
+
}
|
|
18
|
+
function o(e) {
|
|
19
|
+
return {
|
|
20
|
+
mobile: n(e, "mobile"),
|
|
21
|
+
tablet: n(e, "tablet"),
|
|
22
|
+
laptop: n(e, "laptop")
|
|
23
|
+
};
|
|
24
|
+
}
|
|
25
|
+
//#endregion
|
|
26
|
+
export { o as i, i as n, a as r, r as t };
|
|
27
|
+
|
|
28
|
+
//# sourceMappingURL=responsiveLayout-D2mtCDdh.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"responsiveLayout-D2mtCDdh.js","names":[],"sources":["../../src/responsive-layout/responsiveLayout.ts"],"sourcesContent":["import {\n\ttype Breakpoint,\n\tisResponsiveMap,\n\tresolveProps,\n\tresolveResponsiveValue,\n\ttype ResponsiveValue,\n\ttype ResolvedProps\n} from \"@ryuzaki13/react-foundation-lib/media\";\n\n/**\n * Порядок используется только для формирования стабильного SSR markup.\n * Фактический активный breakpoint выбирает CSS до запуска React hydration.\n */\nexport const RESPONSIVE_LAYOUT_BREAKPOINTS = [\"mobile\", \"tablet\", \"laptop\"] as const satisfies readonly Breakpoint[];\n\nexport type ResponsiveLayoutValues<T> = Readonly<Record<Breakpoint, T | undefined>>;\n\n/** Проверяет, содержит ли набор layout-пропсов хотя бы одну responsive map. */\nexport function hasResponsiveLayoutValue(values: readonly unknown[]): boolean {\n\treturn values.some((value) => value !== undefined && isResponsiveMap(value as ResponsiveValue<unknown>));\n}\n\n/**\n * Разворачивает layout-пропсы сразу для всех viewport breakpoint.\n * Функция не читает browser API, поэтому сервер и первый клиентский render получают одинаковый результат.\n */\nexport function resolveLayoutPropsForBreakpoints<T extends object>(\n\tprops: T,\n\tresponsiveKeys: readonly (keyof T)[]\n): Readonly<Record<Breakpoint, ResolvedProps<T>>> {\n\treturn {\n\t\tmobile: resolveProps(props, \"mobile\", responsiveKeys),\n\t\ttablet: resolveProps(props, \"tablet\", responsiveKeys),\n\t\tlaptop: resolveProps(props, \"laptop\", responsiveKeys)\n\t};\n}\n\n/** Разворачивает одно CSS-значение во все breakpoint с сохранением действующей fallback-семантики. */\nexport function resolveLayoutValueForBreakpoints<T>(value: ResponsiveValue<T> | undefined): ResponsiveLayoutValues<T> {\n\treturn {\n\t\tmobile: resolveResponsiveValue(value, \"mobile\"),\n\t\ttablet: resolveResponsiveValue(value, \"tablet\"),\n\t\tlaptop: resolveResponsiveValue(value, \"laptop\")\n\t};\n}\n"],"mappings":";;AAaA,IAAa,IAAgC;CAAC;CAAU;CAAU;AAAQ;AAK1E,SAAgB,EAAyB,GAAqC;CAC7E,OAAO,EAAO,MAAM,MAAU,MAAU,KAAA,KAAa,EAAgB,CAAiC,CAAC;AACxG;AAMA,SAAgB,EACf,GACA,GACiD;CACjD,OAAO;EACN,QAAQ,EAAa,GAAO,UAAU,CAAc;EACpD,QAAQ,EAAa,GAAO,UAAU,CAAc;EACpD,QAAQ,EAAa,GAAO,UAAU,CAAc;CACrD;AACD;AAGA,SAAgB,EAAoC,GAAkE;CACrH,OAAO;EACN,QAAQ,EAAuB,GAAO,QAAQ;EAC9C,QAAQ,EAAuB,GAAO,QAAQ;EAC9C,QAAQ,EAAuB,GAAO,QAAQ;CAC/C;AACD"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { HighlightText as e } from "../text/index.js";
|
|
2
2
|
import { t } from "./ui.module-oRwY3Zli.js";
|
|
3
3
|
import { u as n } from "./input-KXI7o06g.js";
|
|
4
|
-
import { a as r, f as i, i as a, m as o, r as s, s as c, t as l, u, v as d } from "./picker-
|
|
4
|
+
import { a as r, f as i, i as a, m as o, r as s, s as c, t as l, u, v as d } from "./picker-CWx7vPE8.js";
|
|
5
5
|
import { Option as f, OptionCode as p, OptionContent as m, OptionText as h } from "../option/index.js";
|
|
6
6
|
import { t as g } from "./odata-dependent-C_DCbKY2.js";
|
|
7
7
|
import { n as _ } from "./useODataSelectBase-DwR4Lfv-.js";
|
|
@@ -365,4 +365,4 @@ function N({ label: e, description: t, disabled: n, placeholder: r, size: i, opt
|
|
|
365
365
|
//#endregion
|
|
366
366
|
export { w as a, E as i, A as n, k as r, N as t };
|
|
367
367
|
|
|
368
|
-
//# sourceMappingURL=select-
|
|
368
|
+
//# sourceMappingURL=select-CHBBo5fn.js.map
|