@ryuzaki13/react-foundation-ui 1.6.5 → 1.6.7
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/advanced-search/index.js +4 -4
- package/dist/base-table/index.js +1 -1
- package/dist/button/index.js +1 -1
- package/dist/chunks/{CalendarView-DqA-PbAU.js → CalendarView-DGElHRTJ.js} +2 -2
- package/dist/chunks/{CalendarView-DqA-PbAU.js.map → CalendarView-DGElHRTJ.js.map} +1 -1
- package/dist/chunks/{TextEditorLexicalClient-ChVeb3f3.js → TextEditorLexicalClient-iTf_y4Bu.js} +3 -3
- package/dist/chunks/{TextEditorLexicalClient-ChVeb3f3.js.map → TextEditorLexicalClient-iTf_y4Bu.js.map} +1 -1
- package/dist/chunks/{base-table-CJdKCKhb.js → base-table-CTafaxo2.js} +2 -2
- package/dist/chunks/{base-table-CJdKCKhb.js.map → base-table-CTafaxo2.js.map} +1 -1
- package/dist/chunks/{button-CzUO5rzq.js → button-BsvHGWPc.js} +2 -2
- package/dist/chunks/{button-CzUO5rzq.js.map → button-BsvHGWPc.js.map} +1 -1
- package/dist/chunks/{date-input-QRwRTMmy.js → date-input-BbsvnayB.js} +3 -3
- package/dist/chunks/{date-input-QRwRTMmy.js.map → date-input-BbsvnayB.js.map} +1 -1
- package/dist/chunks/{misc-CkRRma5E.js → misc-aGQBhywJ.js} +2 -2
- package/dist/chunks/{misc-CkRRma5E.js.map → misc-aGQBhywJ.js.map} +1 -1
- package/dist/chunks/{modal-LHkNxBko.js → modal-DLRYn-Lr.js} +3 -3
- package/dist/chunks/{modal-LHkNxBko.js.map → modal-DLRYn-Lr.js.map} +1 -1
- package/dist/chunks/{popover-IExDrsF6.js → popover-IztNF45J.js} +2 -2
- package/dist/chunks/{popover-IExDrsF6.js.map → popover-IztNF45J.js.map} +1 -1
- package/dist/chunks/{table-CIWdAcPY.js → table-DOwANXnt.js} +2 -2
- package/dist/chunks/{table-CIWdAcPY.js.map → table-DOwANXnt.js.map} +1 -1
- package/dist/date-input/index.js +2 -2
- package/dist/date-time-input/index.js +2 -2
- package/dist/expandable-action-panel/index.js +2 -2
- package/dist/image/index.js +2 -2
- package/dist/list/index.js +1 -1
- package/dist/misc/index.js +1 -1
- package/dist/modal/index.js +1 -1
- package/dist/notifications/index.js +1 -1
- package/dist/popover/index.js +1 -1
- package/dist/preset-range-date-input/index.js +1 -1
- package/dist/simple-table/index.js +1 -1
- package/dist/slider/index.js +1 -1
- package/dist/table/index.js +1 -1
- package/dist/tabs/index.js +1 -1
- package/dist/text/index.js +1 -1
- package/dist/text-editor/index.js +2 -2
- package/dist/tree-select/TreeNodeContent.d.ts.map +1 -1
- package/dist/tree-select/index.js +238 -242
- package/dist/tree-select/index.js.map +1 -1
- package/dist/tree-table/index.js +1 -1
- package/package.json +1 -1
- package/storybook-static/assets/{Badge-Badi80m4.js → Badge-T2DnH5Eg.js} +1 -1
- package/storybook-static/assets/{Badge.stories-Bh2b6j3z.js → Badge.stories-yHlNwSo9.js} +1 -1
- package/storybook-static/assets/{BadgeList-CPBVo6AJ.js → BadgeList-Dacu6xT6.js} +1 -1
- package/storybook-static/assets/{Button-CVATKXtE.js → Button-C4o_c6D9.js} +1 -1
- package/storybook-static/assets/{Button-CKXKnB90.js → Button-DaLwIh2R.js} +1 -1
- package/storybook-static/assets/{Button.stories-DDi3X51G.js → Button.stories-NG-zzrXi.js} +1 -1
- package/storybook-static/assets/{CalendarView-cY_cm8NE.js → CalendarView-CmcmZ94a.js} +1 -1
- package/storybook-static/assets/{CheckBox-CHN9e0G4.js → CheckBox-C-SGihs5.js} +2 -2
- package/storybook-static/assets/{CheckBox-BQ3w0Jba.js → CheckBox-D4-UfeUl.js} +1 -1
- package/storybook-static/assets/{CheckBox.stories-D1Krpn3W.js → CheckBox.stories-CLUes28D.js} +1 -1
- package/storybook-static/assets/{Color-6AOWCN3U-CDuGBg-Y.js → Color-6AOWCN3U-CFsM6Nu1.js} +1 -1
- package/storybook-static/assets/{ContextMenu-CdB_-NN2.js → ContextMenu-CWS6XFbw.js} +1 -1
- package/storybook-static/assets/{ContextMenu-CjGE7GKP.js → ContextMenu-DHDLF12P.js} +1 -1
- package/storybook-static/assets/{ContextMenu.stories-C6ohsfSp.js → ContextMenu.stories-Cck4dJTd.js} +1 -1
- package/storybook-static/assets/{DateInput-DEf4uE-7.js → DateInput-CIytFvb0.js} +1 -1
- package/storybook-static/assets/{DateInput-Dsv5gb1z.js → DateInput-CLOaWkul.js} +1 -1
- package/storybook-static/assets/{DateInput.stories-BPeOBH-A.js → DateInput.stories-BKNaozV5.js} +1 -1
- package/storybook-static/assets/{DateRangePresetSelect-CqihJaXP.js → DateRangePresetSelect-Bp0RsOqP.js} +1 -1
- package/storybook-static/assets/{DateRangePresetSelect-DPWJDsz8.js → DateRangePresetSelect-iL0Rjaf1.js} +1 -1
- package/storybook-static/assets/{DateRangePresetSelect.stories-yMCBnhF8.js → DateRangePresetSelect.stories-CPkWn6Sp.js} +1 -1
- package/storybook-static/assets/{Detail-BM_6a8H_.js → Detail-UEbvC-Ce.js} +1 -1
- package/storybook-static/assets/{Detail.stories-C60fYFqf.js → Detail.stories-IUJzwbiu.js} +1 -1
- package/storybook-static/assets/{Dialog-DwkTEbo6.js → Dialog-BFGtrVSt.js} +1 -1
- package/storybook-static/assets/{Dialog-C_9d2KtR.js → Dialog-DAXoGKHp.js} +1 -1
- package/storybook-static/assets/{Dialog.stories-CWXhoWJQ.js → Dialog.stories-CUPKMtdw.js} +1 -1
- package/storybook-static/assets/{Disclosure-Dr_uv2O8.js → Disclosure-CzDKZx_8.js} +1 -1
- package/storybook-static/assets/{Disclosure.stories-vKEuQXkJ.js → Disclosure.stories-DEqK3gnb.js} +1 -1
- package/storybook-static/assets/{DisclosureGroup-CqoWix9A.js → DisclosureGroup-Ce7Biitw.js} +1 -1
- package/storybook-static/assets/{DocsRenderer-JROSPFPF-DPviY6Wu.js → DocsRenderer-JROSPFPF-kg4vf_Yl.js} +1 -1
- package/storybook-static/assets/{DropZone-X5glc4Pi.js → DropZone-BwyPveSU.js} +1 -1
- package/storybook-static/assets/{DropZone-BGaq994l.js → DropZone-gIfOTL4-.js} +1 -1
- package/storybook-static/assets/{DropZone.stories-DG16huIK.js → DropZone.stories-Dm_Y_SK3.js} +1 -1
- package/storybook-static/assets/{DropdownMenu-1L80coFy.js → DropdownMenu-f4PnfAhr.js} +1 -1
- package/storybook-static/assets/{ExpandableActionPanel-DmLqoHfQ.js → ExpandableActionPanel-DZ9eMI2c.js} +1 -1
- package/storybook-static/assets/{ExpandableActionPanel.stories-BoelN-tK.js → ExpandableActionPanel.stories-D1Y5DVA2.js} +1 -1
- package/storybook-static/assets/{Flex-C8C44oNE.js → Flex-B0V5n4aM.js} +1 -1
- package/storybook-static/assets/{Flex.stories-DMc5vP-G.js → Flex.stories-CUlq5u0j.js} +1 -1
- package/storybook-static/assets/FloatingPopover-Bs-XDHL-.js +1 -0
- package/storybook-static/assets/{FormattedTableCell-DXtk8oM0.js → FormattedTableCell-CRX697bA.js} +1 -1
- package/storybook-static/assets/{Grid-BtTvwDWx.js → Grid-5en5ujNM.js} +1 -1
- package/storybook-static/assets/{Grid.stories-NJgMRYsF.js → Grid.stories-CESmBzP3.js} +1 -1
- package/storybook-static/assets/{ImageCropper.stories-C-Ozu6_A.js → ImageCropper.stories-BSJOypKX.js} +1 -1
- package/storybook-static/assets/{ImageRenderer-DWybFMTW.js → ImageRenderer-nl8AW8Yh.js} +1 -1
- package/storybook-static/assets/{ImageRenderer.stories-PsVi0vQL.js → ImageRenderer.stories-BmESnlhV.js} +1 -1
- package/storybook-static/assets/{ImageView.stories-BUkBr59-.js → ImageView.stories-C2BP0XXR.js} +1 -1
- package/storybook-static/assets/{ImageViewer.stories-C9tabRxx.js → ImageViewer.stories-CyEvR1FU.js} +2 -2
- package/storybook-static/assets/{ImageViewerRuntime-BEWr2aIc.js → ImageViewerRuntime-Djf7ZpJG.js} +1 -1
- package/storybook-static/assets/{Input-BwIlSQ9_.js → Input-BTRkiJGs.js} +1 -1
- package/storybook-static/assets/{Input-CeBqWWZH.js → Input-BtjewvGu.js} +1 -1
- package/storybook-static/assets/{Input.stories-DA42tEpS.js → Input.stories-CM8J3eBT.js} +1 -1
- package/storybook-static/assets/{InputDateTime-D5LB-EM_.js → InputDateTime-CcYQ78oP.js} +1 -1
- package/storybook-static/assets/{InputDateTime.stories-Bz3idwQ3.js → InputDateTime.stories-VXbUqvYV.js} +1 -1
- package/storybook-static/assets/{InputFile-CUa7CalY.js → InputFile-5RTqvB0Q.js} +1 -1
- package/storybook-static/assets/{InputFile-DjDgsohv.js → InputFile-D89Thp4U.js} +1 -1
- package/storybook-static/assets/{InputFile.stories-B8AE_WYV.js → InputFile.stories-DagAWIkQ.js} +1 -1
- package/storybook-static/assets/{InputFiles-BSGPBkVx.js → InputFiles-CFxmk3hZ.js} +1 -1
- package/storybook-static/assets/{InputFiles-EqqzDwjd.js → InputFiles-DWz3bdAl.js} +1 -1
- package/storybook-static/assets/{InputFiles.stories-t43ndgmw.js → InputFiles.stories-CROgdLIF.js} +1 -1
- package/storybook-static/assets/{InputFilesList-B-5l8V8x.js → InputFilesList-D2BzAMGe.js} +1 -1
- package/storybook-static/assets/{InputImage-kOsP0ZXL.js → InputImage-K-MKlDJb.js} +1 -1
- package/storybook-static/assets/{InputImage-JYWPaC-j.js → InputImage-qHkOcHtC.js} +1 -1
- package/storybook-static/assets/{InputImage.stories-Cprp6HWC.js → InputImage.stories-DC5L8SnI.js} +1 -1
- package/storybook-static/assets/{InteractiveComponents-BtfaaxwI.js → InteractiveComponents-Cz5LBcgE.js} +1 -1
- package/storybook-static/assets/{InteractiveComponents.stories-DJNmjTjG.js → InteractiveComponents.stories-DVdB6kME.js} +1 -1
- package/storybook-static/assets/{LayoutPicker-RxcyKf54.js → LayoutPicker-BftN8KOQ.js} +1 -1
- package/storybook-static/assets/{LayoutPicker-CGnUeQ7c.js → LayoutPicker-DYb-n8Y8.js} +1 -1
- package/storybook-static/assets/{LayoutPicker.stories-kpUJYwvp.js → LayoutPicker.stories-DNS7ZssI.js} +1 -1
- package/storybook-static/assets/{Listbox-D-9m1OtQ.js → Listbox-ZVmBzfhc.js} +1 -1
- package/storybook-static/assets/{Listbox-ks-UlR45.js → Listbox-adSyAExq.js} +1 -1
- package/storybook-static/assets/{Listbox.stories-z7qyefxY.js → Listbox.stories-BeQJsKwH.js} +1 -1
- package/storybook-static/assets/{Modal-COPKt34y.js → Modal-B3h2ESY9.js} +1 -1
- package/storybook-static/assets/{Modal.stories-BuzJrStF.js → Modal.stories-6YERWF83.js} +1 -1
- package/storybook-static/assets/{ModalManagerProvider-8oVsafKe.js → ModalManagerProvider-4zbeYaNP.js} +1 -1
- package/storybook-static/assets/{MultiSelect-CXZsBwEY.js → MultiSelect-BDUPLSrj.js} +1 -1
- package/storybook-static/assets/{MultiSelect-Cwu59ver.js → MultiSelect-BcivpjpX.js} +1 -1
- package/storybook-static/assets/{MultiSelect.stories-D0n-LtYi.js → MultiSelect.stories-Cn3EAsFu.js} +1 -1
- package/storybook-static/assets/{NoData-CYkI7TRF.js → NoData-BBFTTBrp.js} +1 -1
- package/storybook-static/assets/{NotificationsHost-CdjoqlHV.js → NotificationsHost-CHdMwxdH.js} +1 -1
- package/storybook-static/assets/{NotificationsHost.stories-Cw02scrX.js → NotificationsHost.stories-DKsrbc5D.js} +1 -1
- package/storybook-static/assets/{ODataMultiSelect-Bjx7j3x_.js → ODataMultiSelect-Cyy64Cpz.js} +1 -1
- package/storybook-static/assets/{ODataMultiSelect.stories-D1uEm53D.js → ODataMultiSelect.stories-CHajHfGS.js} +1 -1
- package/storybook-static/assets/{ODataSelect-CPXvbCdZ.js → ODataSelect-CW8vWLLM.js} +1 -1
- package/storybook-static/assets/{ODataSelect.stories-OfmjejKB.js → ODataSelect.stories-BE9VEmnU.js} +1 -1
- package/storybook-static/assets/{ODataTreeMultiSelect-CzJXiKY9.js → ODataTreeMultiSelect-BT6JzPLE.js} +1 -1
- package/storybook-static/assets/{ODataTreeMultiSelect.stories-B3-YDpm7.js → ODataTreeMultiSelect.stories-D6yHAJjB.js} +1 -1
- package/storybook-static/assets/{ODataTreeSelect-DX5TM_rA.js → ODataTreeSelect-CuvW2F0H.js} +1 -1
- package/storybook-static/assets/{ODataTreeSelect.stories-CtMxqqgr.js → ODataTreeSelect.stories-B65nqSkM.js} +1 -1
- package/storybook-static/assets/{OneStepScroller-DOs9Loxj.js → OneStepScroller-C9Xlg-cE.js} +1 -1
- package/storybook-static/assets/{PeriodSelect-BbqQUMjA.js → PeriodSelect-D7ef0-Fq.js} +1 -1
- package/storybook-static/assets/{PeriodSelect-DFR-gdmD.js → PeriodSelect-HA5WBzsC.js} +1 -1
- package/storybook-static/assets/{PeriodSelect.stories-Dv_9THvM.js → PeriodSelect.stories-D0Fs3PJu.js} +1 -1
- package/storybook-static/assets/{PickerSelectionToolbar-DnTlpeHD.js → PickerSelectionToolbar-Dm1i3nmH.js} +1 -1
- package/storybook-static/assets/{PickerTriggerActions-CUNsf_w4.js → PickerTriggerActions-dwSbM4v4.js} +1 -1
- package/storybook-static/assets/{Popover-DtdokOxB.js → Popover-Ca3xNvkr.js} +1 -1
- package/storybook-static/assets/{Popover-qCAM7oNm.js → Popover-DNGptNYD.js} +1 -1
- package/storybook-static/assets/{Popover.stories-BAln3oQU.js → Popover.stories-CUjD592u.js} +1 -1
- package/storybook-static/assets/{PresetRangeDateInput-DjN_bvqq.js → PresetRangeDateInput-C8SgNVHP.js} +1 -1
- package/storybook-static/assets/{PresetRangeDateInput-Wtjix3jj.js → PresetRangeDateInput-MxclJups.js} +1 -1
- package/storybook-static/assets/{PresetRangeDateInput.stories-B198NCDW.js → PresetRangeDateInput.stories-CkXkJvqc.js} +1 -1
- package/storybook-static/assets/{PresetSelect-BZa1_U3q.js → PresetSelect-BO9b6GVZ.js} +1 -1
- package/storybook-static/assets/{RadioButton-D9icZqCg.js → RadioButton-B6rPDENe.js} +1 -1
- package/storybook-static/assets/{RadioButton-BeT9sgAH.js → RadioButton-DgA-X6NX.js} +1 -1
- package/storybook-static/assets/{RadioButton.stories-BlZyVi-W.js → RadioButton.stories-CeNlA9Lz.js} +1 -1
- package/storybook-static/assets/{RadioGroup-FyIYfXl0.js → RadioGroup-BPAozXpx.js} +1 -1
- package/storybook-static/assets/{RadioGroup-By-qGpHC.js → RadioGroup-CJBGpqlR.js} +1 -1
- package/storybook-static/assets/{RadioGroup.stories-DgMaeL70.js → RadioGroup.stories-dBWvwVEA.js} +1 -1
- package/storybook-static/assets/{Scrollable-DPFSeZGF.js → Scrollable-BeOEIo9e.js} +1 -1
- package/storybook-static/assets/{Select-CfWYx2GB.js → Select-Bue-zr2R.js} +1 -1
- package/storybook-static/assets/{Select-C_O6yFA8.js → Select-SdQ8xNVz.js} +1 -1
- package/storybook-static/assets/{Select.stories-CMobpAbQ.js → Select.stories-Dt8tObCS.js} +1 -1
- package/storybook-static/assets/{SelectOptionContent-Degde5-0.js → SelectOptionContent-BLgtBAod.js} +1 -1
- package/storybook-static/assets/{SerializableSelect-Cy93AKVX.js → SerializableSelect-iFoRTCsV.js} +1 -1
- package/storybook-static/assets/{SerializableSelect.stories-C1zO_RWC.js → SerializableSelect.stories-Byq7iFWS.js} +1 -1
- package/storybook-static/assets/{SingleDateTimeInput-DxZzBwAX.js → SingleDateTimeInput-B_d-exWJ.js} +1 -1
- package/storybook-static/assets/{SingleDateTimeInput-B0tE46zj.js → SingleDateTimeInput-De9Q9K6O.js} +1 -1
- package/storybook-static/assets/{SingleDateTimeInput.stories-CmTC_z6q.js → SingleDateTimeInput.stories-D6dQ6iA3.js} +1 -1
- package/storybook-static/assets/{Slider-rTxbeWHF.js → Slider-BZwdAhe6.js} +1 -1
- package/storybook-static/assets/{Slider-DmM2dPXy.js → Slider-D8kHpzol.js} +1 -1
- package/storybook-static/assets/{Slider.stories-CDFrjoMD.js → Slider.stories-A_T3CYjJ.js} +1 -1
- package/storybook-static/assets/{SliderInput-DvzJvm59.js → SliderInput-CHJbL5Wn.js} +1 -1
- package/storybook-static/assets/{SliderInput-BbLeUtoV.js → SliderInput-CJ8V5fkI.js} +1 -1
- package/storybook-static/assets/{SliderInput.stories-CpYqdHe0.js → SliderInput.stories-CbMX32-_.js} +1 -1
- package/storybook-static/assets/{Sortable-B61mX8UD.js → Sortable-e7UHOW9k.js} +1 -1
- package/storybook-static/assets/{Sortable.stories-Cs3L9wn-.js → Sortable.stories-D7MXnPpY.js} +1 -1
- package/storybook-static/assets/{Splitter-D4q-ZPl3.js → Splitter-BLHg8XIk.js} +1 -1
- package/storybook-static/assets/{Splitter.stories-De7DpSvR.js → Splitter.stories-B5oN45hq.js} +1 -1
- package/storybook-static/assets/{StateSelect-CYS6OD81.js → StateSelect-BoBWQtYQ.js} +1 -1
- package/storybook-static/assets/{StateSelect-CgACNPR0.js → StateSelect-CKdt0gF_.js} +1 -1
- package/storybook-static/assets/{StateSelect.stories-CVygV7Yf.js → StateSelect.stories-BN15wtV8.js} +1 -1
- package/storybook-static/assets/{StringToggle.stories-DK7JGIlf.js → StringToggle.stories-BO6sljVJ.js} +1 -1
- package/storybook-static/assets/{Switch-CgC6u3sh.js → Switch-CDoAIXwA.js} +1 -1
- package/storybook-static/assets/{Switch-DFTAt-28.js → Switch-D1J--xl_.js} +1 -1
- package/storybook-static/assets/{Switch.stories-BWMP7Sjc.js → Switch.stories-DShId7rz.js} +1 -1
- package/storybook-static/assets/{Table-CNbbSGjI.js → Table-pKUwrAwT.js} +1 -1
- package/storybook-static/assets/{Table.stories-CxBOA7ix.js → Table.stories-Cx5Yk_Sz.js} +1 -1
- package/storybook-static/assets/{Tabs-BIU69aVv.js → Tabs-CA6gOZC5.js} +1 -1
- package/storybook-static/assets/{Tabs.stories-C9_u-clc.js → Tabs.stories-Dy0SGxWc.js} +1 -1
- package/storybook-static/assets/{TabsBox-B3wkJa0L.js → TabsBox-4QUSTFJ8.js} +1 -1
- package/storybook-static/assets/{TagInput-CR6HxYZA.js → TagInput-Cxi6NsAk.js} +1 -1
- package/storybook-static/assets/{TagInput.stories-CtfqVbxl.js → TagInput.stories-CxJ4qGbd.js} +1 -1
- package/storybook-static/assets/{Text-DoG0h_5c.js → Text-DarnW-f6.js} +1 -1
- package/storybook-static/assets/{Textarea-t4a7XVJX.js → Textarea-BCXegAU7.js} +1 -1
- package/storybook-static/assets/{Textarea-BRL3p619.js → Textarea-BGnhUywk.js} +1 -1
- package/storybook-static/assets/{Textarea.stories-C59azjLd.js → Textarea.stories-DkzpFXFq.js} +1 -1
- package/storybook-static/assets/{TimePanel-C3WBrZQp.js → TimePanel-CYYYXMUG.js} +1 -1
- package/storybook-static/assets/{TimePanel.stories-DMX-7eZd.js → TimePanel.stories-BJoG56iD.js} +1 -1
- package/storybook-static/assets/{Toggle-Tak1R2Zm.js → Toggle-CEG2bv5m.js} +1 -1
- package/storybook-static/assets/{Toggle-BOWusKKj.js → Toggle-ovOl1Mlw.js} +1 -1
- package/storybook-static/assets/{Toggle.stories-1KQpm8VM.js → Toggle.stories-B-eEpu7l.js} +1 -1
- package/storybook-static/assets/{TreeMultiSelect-fSxzLWkj.js → TreeMultiSelect-CFtCP3Uo.js} +1 -1
- package/storybook-static/assets/{TreeMultiSelect-DUYiFByA.js → TreeMultiSelect-ubfuJGU_.js} +1 -1
- package/storybook-static/assets/{TreeMultiSelect.stories-DAd8NIUE.js → TreeMultiSelect.stories-0oCL1ngU.js} +1 -1
- package/storybook-static/assets/TreePickerBase-DTPh-ggy.js +24 -0
- package/storybook-static/assets/{TreeSelect-Jz1ne-hp.js → TreeSelect-B2OKkixN.js} +1 -1
- package/storybook-static/assets/{TreeSelect-DxEraGtZ.js → TreeSelect-CvqXDtpl.js} +1 -1
- package/storybook-static/assets/{TreeSelect.stories-vAacDFVY.js → TreeSelect.stories-KgDe0L08.js} +1 -1
- package/storybook-static/assets/{TreeTable-BVKaRU-W.js → TreeTable-DrzTRidR.js} +1 -1
- package/storybook-static/assets/{TreeTable.stories-BSRT4W3L.js → TreeTable.stories-DgFOx0dG.js} +1 -1
- package/storybook-static/assets/{async-DpzfUrH-.js → async-BSp50umT.js} +1 -1
- package/storybook-static/assets/{blocks-DB1eHUIS.js → blocks-kiHuQc2H.js} +3 -3
- package/storybook-static/assets/{browserAndReact-qmvoynbe.js → browserAndReact-DlZsO8hD.js} +1 -1
- package/storybook-static/assets/{check-OVXob3eq.js → check-8DLQNq-v.js} +1 -1
- package/storybook-static/assets/{chevron-down-Bpd9dt89.js → chevron-down-6v5ZgviY.js} +1 -1
- package/storybook-static/assets/{chevron-left-CP0LPRnu.js → chevron-left-C1sR-z7J.js} +1 -1
- package/storybook-static/assets/{chevron-right-D8Axh6ZC.js → chevron-right-CYlMHuqB.js} +1 -1
- package/storybook-static/assets/{chunk-W22LQPXL-JW4HcnJi.js → chunk-W22LQPXL-Bep1OJIj.js} +1 -1
- package/storybook-static/assets/{circle-alert-D338kTDS.js → circle-alert--c1OalNC.js} +1 -1
- package/storybook-static/assets/{circle-check-qWrcGPp-.js → circle-check-C9h4OfP-.js} +1 -1
- package/storybook-static/assets/{components-DJJgxodi.js → components-K62f4PqB.js} +3 -3
- package/storybook-static/assets/{contextMenu-mlD7uW-f.js → contextMenu-TEMirOLD.js} +1 -1
- package/storybook-static/assets/{defaultRenderers-C5s5umkj.js → defaultRenderers-DJCn0kJs.js} +1 -1
- package/storybook-static/assets/{download-AzFgabSk.js → download-D8uoT2yH.js} +1 -1
- package/storybook-static/assets/{filesAndExcel-DyRPrZqZ.js → filesAndExcel-BiytXyMK.js} +1 -1
- package/storybook-static/assets/{floating-ui.react-DDt799w_.js → floating-ui.react-DyUBdQZn.js} +1 -1
- package/storybook-static/assets/{formatters-D8WQlQlM.js → formatters-B6fldInM.js} +1 -1
- package/storybook-static/assets/{formatters-runtime-ySsJZ1Tu.js → formatters-runtime-Bpszl2RV.js} +1 -1
- package/storybook-static/assets/{foundationLib-5_tX-DbX.js → foundationLib-Bi3NVYke.js} +1 -1
- package/storybook-static/assets/{hooks-RCF1FX8h.js → hooks-C8nxS79o.js} +1 -1
- package/storybook-static/assets/iframe-B7EOi5Kn.js +1 -0
- package/storybook-static/assets/{iframe-E-RW9GdU.js → iframe-BcAXu9R3.js} +3 -3
- package/storybook-static/assets/{info-BloY2WcJ.js → info-Dx2BZ5M3.js} +1 -1
- package/storybook-static/assets/{odata-BtJOrkyu.js → odata-BPISBTNl.js} +1 -1
- package/storybook-static/assets/{odataAndTables-K84Qoh0l.js → odataAndTables-DuCOKpHk.js} +1 -1
- package/storybook-static/assets/{odataFetchFn-QjHsMudx.js → odataFetchFn-GjZht5q7.js} +1 -1
- package/storybook-static/assets/{odataStoryFixtures-DHZstKaO.js → odataStoryFixtures-KA2h2rh_.js} +1 -1
- package/storybook-static/assets/{persisted-Cz_dN0z5.js → persisted-QNagTHWS.js} +1 -1
- package/storybook-static/assets/{pureUtilities-58GohRlw.js → pureUtilities-ClpHTP6a.js} +1 -1
- package/storybook-static/assets/{react-D-JEL2AK.js → react-CeQeKObP.js} +1 -1
- package/storybook-static/assets/{refresh-cw-ClUCX52-.js → refresh-cw-SZb3G2mk.js} +1 -1
- package/storybook-static/assets/{runtimeAndState-DaqvHZTU.js → runtimeAndState-BF3fYqfd.js} +1 -1
- package/storybook-static/assets/{settings-2-BaD4Vuv_.js → settings-2-CVECJKrd.js} +1 -1
- package/storybook-static/assets/{sortable-Cdh47lvC.js → sortable-DdSKxc2K.js} +1 -1
- package/storybook-static/assets/{syntaxhighlighter-T5IQBZDB-LlSxR-aL.js → syntaxhighlighter-T5IQBZDB-CwTiRfc8.js} +1 -1
- package/storybook-static/assets/{trash-2-ZsLhc9Um.js → trash-2-9exqCXXp.js} +1 -1
- package/storybook-static/assets/{triangle-alert-CSSWj_Ql.js → triangle-alert-CeSzz9g1.js} +1 -1
- package/storybook-static/assets/{useODataSelectBase-dK1hhs0B.js → useODataSelectBase-_C64vBRb.js} +1 -1
- package/storybook-static/assets/{useODataTreeData-BS2csWTj.js → useODataTreeData-BnKvwasd.js} +1 -1
- package/storybook-static/assets/{usePickerQuery-CR-H7j-z.js → usePickerQuery-B0sHg-ZY.js} +1 -1
- package/storybook-static/assets/{usePickerTriggerController-C4HAPzsM.js → usePickerTriggerController-CQbgVipx.js} +1 -1
- package/storybook-static/assets/{x-BG-Wb06q.js → x-DRQlgdYS.js} +1 -1
- package/storybook-static/iframe.html +2 -2
- package/storybook-static/project.json +1 -1
- package/storybook-static/assets/FloatingPopover-CdQ6khYD.js +0 -1
- package/storybook-static/assets/TreePickerBase-CdLWTzBZ.js +0 -24
- package/storybook-static/assets/iframe-DIeNJ3Xb.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"misc-CkRRma5E.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 const CopyTextWrapper: React.FC<CopyTextWrapperProps> = ({ children, position = \"top\", showOnHover = true, className }) => {\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 { PropsWithChildren } from \"react\";\n\nimport { cn } from \"@ryuzaki13/react-foundation-lib/utils\";\n\nimport { FlexCenter } from \"../flex\";\nimport { Text, TextColor } from \"../text\";\n\ninterface MessageProps extends PropsWithChildren {\n\tclassName?: string;\n\tcolor?: TextColor;\n\tminHeight?: string | number;\n\tuppercase?: boolean;\n}\n\nexport const Message: React.FC<MessageProps> = ({ className, children, color = \"muted\", minHeight, uppercase = true }) => (\n\t<FlexCenter className={cn(\"paddingMd textCenter\", className)} minHeight={minHeight}>\n\t\t<Text as=\"div\" weight=\"bold\" color={color} uppercase={uppercase}>\n\t\t\t{children}\n\t\t</Text>\n\t</FlexCenter>\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 const 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 { Message } from \"./Message\";\n\ninterface NoDataProps {\n\tclassName?: string;\n\ttext?: string;\n\tminHeight?: string | number;\n}\n\nexport const NoData = ({ className, text, minHeight = \"5em\" }: NoDataProps) => {\n\treturn (\n\t\t<Message className={className} color=\"muted\" minHeight={minHeight}>\n\t\t\t{text || \"Нет данных\"}\n\t\t</Message>\n\t);\n};\n","import { PropsWithChildren } from \"react\";\n\nimport { Message } from \"./Message\";\n\ninterface NoticeProps extends PropsWithChildren {\n\tisError?: boolean;\n\tclassName?: string;\n}\n\nexport const Notice: React.FC<NoticeProps> = ({ className, isError, children }) => (\n\t<Message className={className} color={isError ? \"error\" : \"secondary\"}>\n\t\t{children}\n\t</Message>\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 const OneStepScroller: React.FC<OneStepScrollerProps> = ({\n\tchildren,\n\tclassName,\n\titemSelector,\n\tscrollPadding = 6,\n\tsmooth = true\n}) => {\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.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 { forwardRef, PropsWithChildren } from \"react\";\n\nimport { cn } from \"@ryuzaki13/react-foundation-lib/utils\";\n\ninterface ScrollableProps extends PropsWithChildren {\n\tclassName?: string;\n\theight?: string | number;\n\tstable?: boolean;\n\toverscroll?: boolean;\n}\n\nexport const Scrollable = forwardRef<HTMLDivElement, ScrollableProps>(({ children, height, stable, overscroll, className }, ref) => {\n\treturn (\n\t\t<div ref={ref} className={cn(\"scrollable\", stable && \"stable\", overscroll && \"overscroll\", className)} style={{ height }}>\n\t\t\t{children}\n\t\t</div>\n\t);\n});\n\ninterface ScrollableBlockProps extends ScrollableProps {\n\tblockClassName?: string;\n}\n\nexport const ScrollableBlock = forwardRef<HTMLDivElement, ScrollableBlockProps>(({ blockClassName, ...props }, ref) => {\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(--status-info-fill);\n\t\t}\n\n\t\t&.success {\n\t\t\tborder-left-color: var(--status-success-fill);\n\t\t}\n\n\t\t&.warning {\n\t\t\tborder-left-color: var(--status-warning-fill);\n\t\t}\n\n\t\t&.error {\n\t\t\tborder-left-color: var(--status-error-fill);\n\t\t}\n\t}\n}\n\n.state {\n\t&.information {\n\t\tcolor: var(--status-info-text);\n\n\t\tfill: var(--status-info-fill);\n\t\tstroke: var(--status-info-on-fill);\n\t}\n\n\t&.success {\n\t\tcolor: var(--status-success-text);\n\n\t\tfill: var(--status-success-fill);\n\t\tstroke: var(--status-success-on-fill);\n\t}\n\n\t&.warning {\n\t\tcolor: var(--status-warning-text);\n\n\t\tfill: var(--status-warning-fill);\n\t\tstroke: var(--status-warning-on-fill);\n\t\tstroke-width: 2px;\n\t}\n\n\t&.error {\n\t\tcolor: var(--status-error-text);\n\n\t\tfill: var(--status-error-fill);\n\t\tstroke: var(--status-error-on-fill);\n\t}\n}\n","import React from \"react\";\n\nimport { 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 const StateIcon: React.FC<StateIconProps> = ({ state = \"none\", text, className }) => {\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 const RenderStateIcon: React.FC<RenderStateIconProps> = ({ state }) => {\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 const ErrorIcon = () => {\n\treturn <CircleXIcon className={cn(styles.state, styles.error)} />;\n};\nexport const WarningIcon = () => {\n\treturn <CircleAlertIcon className={cn(styles.state, styles.warning)} />;\n};\nexport const SuccessIcon = () => {\n\treturn <CircleCheckIcon className={cn(styles.state, styles.success)} />;\n};\nexport const 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,IAAa,KAAmD,EAAE,aAAU,cAAW,OAAO,iBAAc,IAAM,mBAAgB;CACjI,IAAM,EAAE,iBAAc,oBAAiB,gBAAa,EAAgD;CAEpG,OACC,kBAAC,QAAD;EAAM,KAAK;EAAyB;EAApC,UAAA,CACE,GACD,kBAAC,GAAD;GAAiB,aAAa;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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
|
+
{"version":3,"file":"misc-aGQBhywJ.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 const CopyTextWrapper: React.FC<CopyTextWrapperProps> = ({ children, position = \"top\", showOnHover = true, className }) => {\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 { PropsWithChildren } from \"react\";\n\nimport { cn } from \"@ryuzaki13/react-foundation-lib/utils\";\n\nimport { FlexCenter } from \"../flex\";\nimport { Text, TextColor } from \"../text\";\n\ninterface MessageProps extends PropsWithChildren {\n\tclassName?: string;\n\tcolor?: TextColor;\n\tminHeight?: string | number;\n\tuppercase?: boolean;\n}\n\nexport const Message: React.FC<MessageProps> = ({ className, children, color = \"muted\", minHeight, uppercase = true }) => (\n\t<FlexCenter className={cn(\"paddingMd textCenter\", className)} minHeight={minHeight}>\n\t\t<Text as=\"div\" weight=\"bold\" color={color} uppercase={uppercase}>\n\t\t\t{children}\n\t\t</Text>\n\t</FlexCenter>\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 const 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 { Message } from \"./Message\";\n\ninterface NoDataProps {\n\tclassName?: string;\n\ttext?: string;\n\tminHeight?: string | number;\n}\n\nexport const NoData = ({ className, text, minHeight = \"5em\" }: NoDataProps) => {\n\treturn (\n\t\t<Message className={className} color=\"muted\" minHeight={minHeight}>\n\t\t\t{text || \"Нет данных\"}\n\t\t</Message>\n\t);\n};\n","import { PropsWithChildren } from \"react\";\n\nimport { Message } from \"./Message\";\n\ninterface NoticeProps extends PropsWithChildren {\n\tisError?: boolean;\n\tclassName?: string;\n}\n\nexport const Notice: React.FC<NoticeProps> = ({ className, isError, children }) => (\n\t<Message className={className} color={isError ? \"error\" : \"secondary\"}>\n\t\t{children}\n\t</Message>\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 const OneStepScroller: React.FC<OneStepScrollerProps> = ({\n\tchildren,\n\tclassName,\n\titemSelector,\n\tscrollPadding = 6,\n\tsmooth = true\n}) => {\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.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 { forwardRef, PropsWithChildren } from \"react\";\n\nimport { cn } from \"@ryuzaki13/react-foundation-lib/utils\";\n\ninterface ScrollableProps extends PropsWithChildren {\n\tclassName?: string;\n\theight?: string | number;\n\tstable?: boolean;\n\toverscroll?: boolean;\n}\n\nexport const Scrollable = forwardRef<HTMLDivElement, ScrollableProps>(({ children, height, stable, overscroll, className }, ref) => {\n\treturn (\n\t\t<div ref={ref} className={cn(\"scrollable\", stable && \"stable\", overscroll && \"overscroll\", className)} style={{ height }}>\n\t\t\t{children}\n\t\t</div>\n\t);\n});\n\ninterface ScrollableBlockProps extends ScrollableProps {\n\tblockClassName?: string;\n}\n\nexport const ScrollableBlock = forwardRef<HTMLDivElement, ScrollableBlockProps>(({ blockClassName, ...props }, ref) => {\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(--status-info-fill);\n\t\t}\n\n\t\t&.success {\n\t\t\tborder-left-color: var(--status-success-fill);\n\t\t}\n\n\t\t&.warning {\n\t\t\tborder-left-color: var(--status-warning-fill);\n\t\t}\n\n\t\t&.error {\n\t\t\tborder-left-color: var(--status-error-fill);\n\t\t}\n\t}\n}\n\n.state {\n\t&.information {\n\t\tcolor: var(--status-info-text);\n\n\t\tfill: var(--status-info-fill);\n\t\tstroke: var(--status-info-on-fill);\n\t}\n\n\t&.success {\n\t\tcolor: var(--status-success-text);\n\n\t\tfill: var(--status-success-fill);\n\t\tstroke: var(--status-success-on-fill);\n\t}\n\n\t&.warning {\n\t\tcolor: var(--status-warning-text);\n\n\t\tfill: var(--status-warning-fill);\n\t\tstroke: var(--status-warning-on-fill);\n\t\tstroke-width: 2px;\n\t}\n\n\t&.error {\n\t\tcolor: var(--status-error-text);\n\n\t\tfill: var(--status-error-fill);\n\t\tstroke: var(--status-error-on-fill);\n\t}\n}\n","import React from \"react\";\n\nimport { 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 const StateIcon: React.FC<StateIconProps> = ({ state = \"none\", text, className }) => {\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 const RenderStateIcon: React.FC<RenderStateIconProps> = ({ state }) => {\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 const ErrorIcon = () => {\n\treturn <CircleXIcon className={cn(styles.state, styles.error)} />;\n};\nexport const WarningIcon = () => {\n\treturn <CircleAlertIcon className={cn(styles.state, styles.warning)} />;\n};\nexport const SuccessIcon = () => {\n\treturn <CircleCheckIcon className={cn(styles.state, styles.success)} />;\n};\nexport const 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,IAAa,KAAmD,EAAE,aAAU,cAAW,OAAO,iBAAc,IAAM,mBAAgB;CACjI,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,E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CACJ,CAAA;AAEH"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { n as e } from "./button-
|
|
2
|
-
import { c as t } from "./misc-
|
|
1
|
+
import { n as e } from "./button-BsvHGWPc.js";
|
|
2
|
+
import { c as t } from "./misc-aGQBhywJ.js";
|
|
3
3
|
import { o as n } from "./flex-C7njxZ74.js";
|
|
4
4
|
import { r } from "./grid-dI94AAbi.js";
|
|
5
5
|
import { Children as i, createContext as a, useCallback as o, useContext as s, useEffect as c, useId as l, useRef as u, useState as d } from "react";
|
|
@@ -192,4 +192,4 @@ function N({ children: e, compensateScrollbar: t = !1 }) {
|
|
|
192
192
|
//#endregion
|
|
193
193
|
export { k as a, j as i, M as n, D as o, A as r, O as s, N as t };
|
|
194
194
|
|
|
195
|
-
//# sourceMappingURL=modal-
|
|
195
|
+
//# sourceMappingURL=modal-DLRYn-Lr.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"modal-LHkNxBko.js","names":[],"sources":["../../src/modal/Modal.module.scss","../../src/modal/modalMotion.ts","../../src/modal/useModalManager.ts","../../src/modal/Modal.tsx","../../src/modal/ModalManagerProvider.tsx"],"sourcesContent":["@use \"@/styles/mixins\" as *;\n\n.modal {\n\tdisplay: grid;\n\tgrid-auto-rows: auto 1fr;\n\n\tposition: fixed;\n\tinset: 0;\n\tmargin: auto;\n\tz-index: var(--z-modal);\n\twidth: 90%;\n\theight: fit-content;\n\tmax-height: calc(100dvh - var(--space-lg));\n\tborder: var(--border);\n\tborder-radius: var(--radius-md);\n\tbackground-color: var(--surface-1);\n\tbox-shadow: var(--shadow-lg);\n\n\t&:not(:last-child) {\n\t\tpointer-events: none;\n\t\tfilter: grayscale(0.5) opacity(0.75);\n\t\t// opacity: 0.5;\n\t}\n\n\t&.sm {\n\t\tmax-width: min(30em, 93dvw);\n\t}\n\n\t&.md {\n\t\tmax-width: min(50em, 93dvw);\n\t}\n\n\t&.lg {\n\t\tmax-width: min(70em, 93dvw);\n\t}\n\n\t&.xl {\n\t\tmax-width: min(80em, 93dvw);\n\t}\n\n\t&.xxl {\n\t\twidth: 95dvw;\n\t\theight: 92dvh;\n\t\tmax-width: none;\n\t\tmax-height: none;\n\t}\n\n\t&.inside {\n\t\twidth: 100%;\n\t\theight: 100%;\n\t\tmax-width: none;\n\t\tmax-height: none;\n\n\t\t.header,\n\t\t.body {\n\t\t\tborder-radius: 0;\n\t\t}\n\t}\n}\n\n.header {\n\tdisplay: flex;\n\talign-items: center;\n\tjustify-content: space-between;\n\tbackground-color: var(--surface-2);\n\tborder-top-left-radius: var(--radius-md);\n\tborder-top-right-radius: var(--radius-md);\n}\n\n.headerText {\n\tmargin: 0;\n\tpadding-inline: var(--space-md);\n\tfont-size: var(--font-size-md);\n\tfont-variation-settings: \"wght\" 600;\n}\n\n.headerButton {\n\tmargin-block: var(--space-xs);\n\tmargin-inline: var(--space-sm);\n\tflex: 0;\n}\n\n.body {\n\toverflow: hidden;\n\tborder-bottom-left-radius: var(--radius-md);\n\tborder-bottom-right-radius: var(--radius-md);\n}\n","import { type Transition, type Variants } from \"motion/react\";\n\n/**\n * Варианты задают единый спокойный переход для появления и удаления modal-панели.\n * Конфигурация приватна для primitive: потребители управляют только состоянием `isOpen`.\n */\nexport const modalMotionVariants = {\n\thidden: {\n\t\topacity: 0,\n\t\tscale: 0.96,\n\t\ty: 12\n\t},\n\tvisible: {\n\t\topacity: 1,\n\t\tscale: 1,\n\t\ty: 0\n\t}\n} satisfies Variants;\n\n/** Переход сохраняет отзывчивое открытие и дает exit-анимации завершиться до удаления portal content. */\nexport const modalMotionTransition = {\n\tduration: 0.18,\n\tease: [0.22, 1, 0.36, 1]\n} satisfies Transition;\n\n/** При системном reduced-motion остается только мгновенная смена видимости без пространственного движения. */\nexport const reducedModalMotionTransition = {\n\tduration: 0\n} satisfies Transition;\n","import { createContext, useContext } from \"react\";\n\nexport const ModalManagerContext = createContext<{\n\tmodals: string[];\n\topenModal: (id: string) => void;\n\tcloseModal: (id: string) => void;\n\tisTopModal: (id: string) => boolean;\n}>({\n\tmodals: [],\n\topenModal: () => {},\n\tcloseModal: () => {},\n\tisTopModal: () => false\n});\n\nexport const useModalManager = () => useContext(ModalManagerContext);\n","import React, { Children, useEffect, useId, useRef } from \"react\";\n\nimport { getOrCreatePortalRoot, useEscapeDismiss, useOverlayFocus } from \"@ryuzaki13/react-foundation-lib/dom\";\nimport { cn } from \"@ryuzaki13/react-foundation-lib/utils\";\nimport { X } from \"lucide-react\";\nimport { AnimatePresence, motion, useReducedMotion } from \"motion/react\";\nimport { createPortal } from \"react-dom\";\n\nimport { Button } from \"../button\";\nimport { FlexContainer } from \"../flex\";\nimport { GridContainer } from \"../grid\";\nimport { Scrollable } from \"../misc\";\n\nimport styles from \"./Modal.module.scss\";\nimport { modalMotionTransition, modalMotionVariants, reducedModalMotionTransition } from \"./modalMotion\";\nimport { ModalSize } from \"./types\";\nimport { useModalManager } from \"./useModalManager\";\n\n// Подкомпоненты\nexport interface ModalCompositionProps {\n\tchildren: React.ReactNode;\n\tclassName?: string;\n}\n\nexport const ModalToolbar: React.FC<ModalCompositionProps> = ({ children, className }) => {\n\treturn <div className={cn(\"surface2 paddingMd borderBottom\", className)}>{children}</div>;\n};\nModalToolbar.displayName = \"Modal.Toolbar\";\n\nexport const ModalContent: React.FC<ModalCompositionProps & { scrollable?: boolean }> = ({ children, className, scrollable }) => {\n\treturn (\n\t\t<div className={cn(\"paddingMd h100 overflowHidden\", className)}>\n\t\t\t{scrollable ? <Scrollable className=\"h100\">{children}</Scrollable> : children}\n\t\t</div>\n\t);\n};\nModalContent.displayName = \"Modal.Content\";\n\nexport const ModalFooter: React.FC<ModalCompositionProps> = ({ children, className }) => {\n\treturn (\n\t\t<div className={cn(\"surface2 borderTop paddingMd\", className)}>\n\t\t\t<FlexContainer gap=\"sm\" align=\"center\" justify=\"end\">\n\t\t\t\t{children}\n\t\t\t</FlexContainer>\n\t\t</div>\n\t);\n};\nModalFooter.displayName = \"Modal.Footer\";\n\ntype ToolbarElement = React.ReactElement<ModalCompositionProps, typeof ModalToolbar>;\ntype ContentElement = React.ReactElement<ModalCompositionProps, typeof ModalContent>;\ntype FooterElement = React.ReactElement<ModalCompositionProps, typeof ModalFooter>;\n\ntype ModalChildren =\n\t[ToolbarElement, ContentElement, FooterElement] | [ToolbarElement, ContentElement] | [ContentElement, FooterElement] | ContentElement;\n\nexport interface ModalProps {\n\t/** Открыто ли модальное окно */\n\tisOpen?: boolean;\n\t/** Заголовок */\n\ttitle?: string;\n\t/** Размер модального окна */\n\tsize?: keyof typeof ModalSize;\n\theight?: string;\n\t/** Обработчик закрытия */\n\tonClose: () => void;\n\tchildren: ModalChildren;\n}\n\nexport const Modal: React.FC<ModalProps> = ({ isOpen, title, size = \"sm\", height, onClose, children }) => {\n\tconst modalId = useId();\n\tconst titleId = useId();\n\n\tconst { modals, openModal, closeModal, isTopModal } = useModalManager();\n\tconst shouldReduceMotion = useReducedMotion();\n\tconst restoreFocusTargetRef = useRef<HTMLElement | null>(null);\n\tconst restoreFocusAnimationFrameRef = useRef(0);\n\n\t/**\n\t * Если provider менеджера не подключен, считаем одиночную модалку активной,\n\t * иначе логика Escape/focus trap никогда не включится.\n\t */\n\tconst isActive = isOpen && (modals.length === 0 || isTopModal(modalId));\n\n\tuseEffect(() => {\n\t\tif (isOpen) {\n\t\t\trestoreFocusTargetRef.current = document.activeElement instanceof HTMLElement ? document.activeElement : null;\n\t\t}\n\t}, [isOpen]);\n\n\tconst modalRef = useOverlayFocus<HTMLDivElement>({ active: isOpen || false, trapFocus: true, restoreFocus: false });\n\n\tuseEscapeDismiss({\n\t\tactive: isActive || false,\n\t\tonDismiss: onClose,\n\t\tcontainerRef: modalRef\n\t});\n\n\tuseEffect(() => {\n\t\tif (isOpen) {\n\t\t\topenModal(modalId);\n\t\t}\n\t}, [isOpen, modalId, openModal]);\n\n\tuseEffect(() => {\n\t\treturn () => {\n\t\t\twindow.cancelAnimationFrame(restoreFocusAnimationFrameRef.current);\n\t\t\tcloseModal(modalId);\n\t\t};\n\t}, [closeModal, modalId]);\n\n\tfunction handleExitComplete() {\n\t\tcloseModal(modalId);\n\t\tconst restoreFocusTarget = restoreFocusTargetRef.current;\n\n\t\t/**\n\t\t * Менеджер снимает inert в passive effect после обновления стека.\n\t\t * Следующий animation frame гарантирует, что trigger снова доступен для фокуса.\n\t\t */\n\t\trestoreFocusAnimationFrameRef.current = window.requestAnimationFrame(() => {\n\t\t\tif (restoreFocusTarget?.isConnected) {\n\t\t\t\trestoreFocusTarget.focus();\n\t\t\t}\n\t\t\trestoreFocusTargetRef.current = null;\n\t\t});\n\t}\n\n\tconst modalRoot = getOrCreatePortalRoot(\"modal-root\");\n\n\tif (!modalRoot) {\n\t\treturn null;\n\t}\n\n\tlet toolbar: React.ReactNode = null;\n\tlet content: React.ReactNode = null;\n\tlet footer: React.ReactNode = null;\n\n\tconst childArray = Children.toArray(children) as (ToolbarElement | ContentElement | FooterElement)[];\n\n\tfor (const child of childArray) {\n\t\tconst typeName = child.type.displayName;\n\n\t\tswitch (typeName) {\n\t\t\tcase ModalToolbar.displayName:\n\t\t\t\tif (toolbar) throw new Error(\"Modal: duplicate <Toolbar> found\");\n\t\t\t\ttoolbar = child; //.props.children;\n\t\t\t\tbreak;\n\t\t\tcase ModalFooter.displayName:\n\t\t\t\tif (footer) throw new Error(\"Modal: duplicate <Footer> found\");\n\t\t\t\tfooter = child; //props.children;\n\t\t\t\tbreak;\n\t\t\tcase ModalContent.displayName:\n\t\t\t\tif (content) throw new Error(\"Modal: duplicate <Content> found\");\n\t\t\t\tcontent = child; //.props.children;\n\t\t\t\tbreak;\n\t\t}\n\t}\n\n\treturn createPortal(\n\t\t<AnimatePresence onExitComplete={handleExitComplete}>\n\t\t\t{isOpen ? (\n\t\t\t\t<motion.div\n\t\t\t\t\tref={modalRef}\n\t\t\t\t\tclassName={cn(styles.modal, styles[size])}\n\t\t\t\t\tstyle={{ height }}\n\t\t\t\t\trole=\"dialog\"\n\t\t\t\t\taria-modal=\"true\"\n\t\t\t\t\taria-labelledby={titleId}\n\t\t\t\t\taria-describedby={`${titleId}-content`}\n\t\t\t\t\tinitial=\"hidden\"\n\t\t\t\t\tanimate=\"visible\"\n\t\t\t\t\texit=\"hidden\"\n\t\t\t\t\tvariants={modalMotionVariants}\n\t\t\t\t\ttransition={shouldReduceMotion ? reducedModalMotionTransition : modalMotionTransition}>\n\t\t\t\t\t<div className={cn(styles.header, toolbar ? \"\" : \"borderBottom\")}>\n\t\t\t\t\t\t<h3 className={styles.headerText} id={titleId}>\n\t\t\t\t\t\t\t{title}\n\t\t\t\t\t\t</h3>\n\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\ticon={<X />}\n\t\t\t\t\t\t\tclassName={styles.headerButton}\n\t\t\t\t\t\t\tvariant={\"ghost\"}\n\t\t\t\t\t\t\taria-label={\"Закрыть модальное окно\"}\n\t\t\t\t\t\t\tonClick={onClose}\n\t\t\t\t\t\t/>\n\t\t\t\t\t</div>\n\n\t\t\t\t\t<GridContainer\n\t\t\t\t\t\tid={`${titleId}-content`}\n\t\t\t\t\t\ttemplateRows={`${toolbar ? \"auto\" : \"\"} 1fr ${footer ? \"auto\" : \"\"}`.trim()}\n\t\t\t\t\t\t// gap=\"md\"\n\t\t\t\t\t\tclassName={styles.body}>\n\t\t\t\t\t\t{toolbar}\n\t\t\t\t\t\t{content}\n\t\t\t\t\t\t{footer}\n\t\t\t\t\t</GridContainer>\n\t\t\t\t</motion.div>\n\t\t\t) : null}\n\t\t</AnimatePresence>,\n\t\tmodalRoot\n\t);\n};\n","// ModalManagerContext.tsx\nimport React, { useCallback, useEffect, useRef, useState } from \"react\";\n\nimport { ModalManagerContext } from \"./useModalManager\";\n\nexport interface ModalManagerProviderProps {\n\tchildren: React.ReactNode;\n\t/** Компенсирует исчезновение скроллбара правым padding у body. */\n\tcompensateScrollbar?: boolean;\n}\n\n/**\n * Провайдер для централизованного управления стеком модальных окон. Дает вложенным компонентам доступ к открытию и закрытию модалок через контекст.\n */\nexport function ModalManagerProvider({ children, compensateScrollbar = false }: ModalManagerProviderProps) {\n\tconst [modals, setModals] = useState<string[]>([]);\n\tconst prevModalsLength = useRef(0);\n\tconst scrollbarWidth = useRef(0);\n\tconst bodyPaddingRight = useRef(\"\");\n\tconst isScrollbarCompensated = useRef(false);\n\n\tconst openModal = useCallback((id: string) => {\n\t\tsetModals((prev) => [...prev, id]);\n\t}, []);\n\n\tconst closeModal = useCallback((id: string) => {\n\t\tsetModals((prev) => prev.filter((mid) => mid !== id));\n\t}, []);\n\n\tconst isTopModal = useCallback(\n\t\t(id: string) => {\n\t\t\treturn modals[modals.length - 1] === id;\n\t\t},\n\t\t[modals]\n\t);\n\n\tuseEffect(() => {\n\t\tconst wasEmpty = prevModalsLength.current === 0;\n\n\t\tif (wasEmpty && modals.length > 0) {\n\t\t\t// первая модалка открыта — ставим стили\n\t\t\tconst scrollY = window.scrollY;\n\t\t\tconst appRoot = document.querySelector(\"#app-root\");\n\t\t\tscrollbarWidth.current = Math.max(0, window.innerWidth - document.documentElement.clientWidth);\n\t\t\tbodyPaddingRight.current = document.body.style.paddingRight;\n\n\t\t\tdocument.body.style.position = \"fixed\";\n\t\t\tdocument.body.style.top = `-${scrollY}px`;\n\t\t\tdocument.body.style.width = \"100%\";\n\n\t\t\tif (compensateScrollbar) {\n\t\t\t\tdocument.body.style.paddingRight = `${scrollbarWidth.current}px`;\n\t\t\t\tisScrollbarCompensated.current = true;\n\t\t\t}\n\n\t\t\tappRoot?.setAttribute(\"inert\", \"true\");\n\n\t\t\tprevModalsLength.current = modals.length;\n\t\t\treturn;\n\t\t}\n\n\t\tif (!wasEmpty && modals.length > 0 && compensateScrollbar !== isScrollbarCompensated.current) {\n\t\t\tdocument.body.style.paddingRight = compensateScrollbar ? `${scrollbarWidth.current}px` : bodyPaddingRight.current;\n\t\t\tisScrollbarCompensated.current = compensateScrollbar;\n\t\t}\n\n\t\tif (!wasEmpty && modals.length === 0) {\n\t\t\t// последняя модалка закрыта — снимаем стили\n\t\t\tconst appRoot = document.querySelector(\"#app-root\");\n\t\t\tconst scrollY = parseInt(document.body.style.top || \"0\") * -1;\n\n\t\t\tdocument.body.style.position = \"\";\n\t\t\tdocument.body.style.top = \"\";\n\t\t\tdocument.body.style.width = \"\";\n\n\t\t\tif (isScrollbarCompensated.current) {\n\t\t\t\tdocument.body.style.paddingRight = bodyPaddingRight.current;\n\t\t\t\tisScrollbarCompensated.current = false;\n\t\t\t}\n\n\t\t\tappRoot?.removeAttribute(\"inert\");\n\n\t\t\twindow.scrollTo({ top: scrollY, left: 0, behavior: \"instant\" });\n\t\t}\n\n\t\tprevModalsLength.current = modals.length;\n\t}, [compensateScrollbar, modals.length]);\n\n\treturn <ModalManagerContext.Provider value={{ modals, openModal, closeModal, isTopModal }}>{children}</ModalManagerContext.Provider>;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;GCMa,IAAsB;CAClC,QAAQ;EACP,SAAS;EACT,OAAO;EACP,GAAG;CACJ;CACA,SAAS;EACR,SAAS;EACT,OAAO;EACP,GAAG;CACJ;AACD,GAGa,IAAwB;CACpC,UAAU;CACV,MAAM;EAAC;EAAM;EAAG;EAAM;CAAC;AACxB,GAGa,IAA+B,EAC3C,UAAU,EACX,GC1Ba,IAAsB,EAKhC;CACF,QAAQ,CAAC;CACT,iBAAiB,CAAC;CAClB,kBAAkB,CAAC;CACnB,kBAAkB;AACnB,CAAC,GAEY,UAAwB,EAAW,CAAmB,GCUtD,KAAiD,EAAE,aAAU,mBAClE,kBAAC,OAAD;CAAK,WAAW,EAAG,mCAAmC,CAAS;CAAI;AAAc,CAAA;AAEzF,EAAa,cAAc;AAE3B,IAAa,KAA4E,EAAE,aAAU,cAAW,oBAE9G,kBAAC,OAAD;CAAK,WAAW,EAAG,iCAAiC,CAAS;CAC3D,UAAA,IAAa,kBAAC,GAAD;EAAY,WAAU;EAAQ;CAAqB,CAAA,IAAI;AACjE,CAAA;AAGP,EAAa,cAAc;AA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AAK,MAAM,QAAQ,IAE5B,AAEC,EAAuB,aADvB,SAAS,KAAK,MAAM,eAAe,EAAiB,SACnB,KAGlC,GAAS,gBAAgB,OAAO,GAEhC,OAAO,SAAS;IAAE,KAAK;IAAS,MAAM;IAAG,UAAU;GAAU,CAAC;EAC/D;EAEA,EAAiB,UAAU,EAAO;CACnC,GAAG,CAAC,GAAqB,EAAO,MAAM,CAAC,GAEhC,kBAAC,EAAoB,UAArB;EAA8B,OAAO;GAAE;GAAQ;GAAW;GAAY;EAAW;EAAI;CAAuC,CAAA;AACpI"}
|
|
1
|
+
{"version":3,"file":"modal-DLRYn-Lr.js","names":[],"sources":["../../src/modal/Modal.module.scss","../../src/modal/modalMotion.ts","../../src/modal/useModalManager.ts","../../src/modal/Modal.tsx","../../src/modal/ModalManagerProvider.tsx"],"sourcesContent":["@use \"@/styles/mixins\" as *;\n\n.modal {\n\tdisplay: grid;\n\tgrid-auto-rows: auto 1fr;\n\n\tposition: fixed;\n\tinset: 0;\n\tmargin: auto;\n\tz-index: var(--z-modal);\n\twidth: 90%;\n\theight: fit-content;\n\tmax-height: calc(100dvh - var(--space-lg));\n\tborder: var(--border);\n\tborder-radius: var(--radius-md);\n\tbackground-color: var(--surface-1);\n\tbox-shadow: var(--shadow-lg);\n\n\t&:not(:last-child) {\n\t\tpointer-events: none;\n\t\tfilter: grayscale(0.5) opacity(0.75);\n\t\t// opacity: 0.5;\n\t}\n\n\t&.sm {\n\t\tmax-width: min(30em, 93dvw);\n\t}\n\n\t&.md {\n\t\tmax-width: min(50em, 93dvw);\n\t}\n\n\t&.lg {\n\t\tmax-width: min(70em, 93dvw);\n\t}\n\n\t&.xl {\n\t\tmax-width: min(80em, 93dvw);\n\t}\n\n\t&.xxl {\n\t\twidth: 95dvw;\n\t\theight: 92dvh;\n\t\tmax-width: none;\n\t\tmax-height: none;\n\t}\n\n\t&.inside {\n\t\twidth: 100%;\n\t\theight: 100%;\n\t\tmax-width: none;\n\t\tmax-height: none;\n\n\t\t.header,\n\t\t.body {\n\t\t\tborder-radius: 0;\n\t\t}\n\t}\n}\n\n.header {\n\tdisplay: flex;\n\talign-items: center;\n\tjustify-content: space-between;\n\tbackground-color: var(--surface-2);\n\tborder-top-left-radius: var(--radius-md);\n\tborder-top-right-radius: var(--radius-md);\n}\n\n.headerText {\n\tmargin: 0;\n\tpadding-inline: var(--space-md);\n\tfont-size: var(--font-size-md);\n\tfont-variation-settings: \"wght\" 600;\n}\n\n.headerButton {\n\tmargin-block: var(--space-xs);\n\tmargin-inline: var(--space-sm);\n\tflex: 0;\n}\n\n.body {\n\toverflow: hidden;\n\tborder-bottom-left-radius: var(--radius-md);\n\tborder-bottom-right-radius: var(--radius-md);\n}\n","import { type Transition, type Variants } from \"motion/react\";\n\n/**\n * Варианты задают единый спокойный переход для появления и удаления modal-панели.\n * Конфигурация приватна для primitive: потребители управляют только состоянием `isOpen`.\n */\nexport const modalMotionVariants = {\n\thidden: {\n\t\topacity: 0,\n\t\tscale: 0.96,\n\t\ty: 12\n\t},\n\tvisible: {\n\t\topacity: 1,\n\t\tscale: 1,\n\t\ty: 0\n\t}\n} satisfies Variants;\n\n/** Переход сохраняет отзывчивое открытие и дает exit-анимации завершиться до удаления portal content. */\nexport const modalMotionTransition = {\n\tduration: 0.18,\n\tease: [0.22, 1, 0.36, 1]\n} satisfies Transition;\n\n/** При системном reduced-motion остается только мгновенная смена видимости без пространственного движения. */\nexport const reducedModalMotionTransition = {\n\tduration: 0\n} satisfies Transition;\n","import { createContext, useContext } from \"react\";\n\nexport const ModalManagerContext = createContext<{\n\tmodals: string[];\n\topenModal: (id: string) => void;\n\tcloseModal: (id: string) => void;\n\tisTopModal: (id: string) => boolean;\n}>({\n\tmodals: [],\n\topenModal: () => {},\n\tcloseModal: () => {},\n\tisTopModal: () => false\n});\n\nexport const useModalManager = () => useContext(ModalManagerContext);\n","import React, { Children, useEffect, useId, useRef } from \"react\";\n\nimport { getOrCreatePortalRoot, useEscapeDismiss, useOverlayFocus } from \"@ryuzaki13/react-foundation-lib/dom\";\nimport { cn } from \"@ryuzaki13/react-foundation-lib/utils\";\nimport { X } from \"lucide-react\";\nimport { AnimatePresence, motion, useReducedMotion } from \"motion/react\";\nimport { createPortal } from \"react-dom\";\n\nimport { Button } from \"../button\";\nimport { FlexContainer } from \"../flex\";\nimport { GridContainer } from \"../grid\";\nimport { Scrollable } from \"../misc\";\n\nimport styles from \"./Modal.module.scss\";\nimport { modalMotionTransition, modalMotionVariants, reducedModalMotionTransition } from \"./modalMotion\";\nimport { ModalSize } from \"./types\";\nimport { useModalManager } from \"./useModalManager\";\n\n// Подкомпоненты\nexport interface ModalCompositionProps {\n\tchildren: React.ReactNode;\n\tclassName?: string;\n}\n\nexport const ModalToolbar: React.FC<ModalCompositionProps> = ({ children, className }) => {\n\treturn <div className={cn(\"surface2 paddingMd borderBottom\", className)}>{children}</div>;\n};\nModalToolbar.displayName = \"Modal.Toolbar\";\n\nexport const ModalContent: React.FC<ModalCompositionProps & { scrollable?: boolean }> = ({ children, className, scrollable }) => {\n\treturn (\n\t\t<div className={cn(\"paddingMd h100 overflowHidden\", className)}>\n\t\t\t{scrollable ? <Scrollable className=\"h100\">{children}</Scrollable> : children}\n\t\t</div>\n\t);\n};\nModalContent.displayName = \"Modal.Content\";\n\nexport const ModalFooter: React.FC<ModalCompositionProps> = ({ children, className }) => {\n\treturn (\n\t\t<div className={cn(\"surface2 borderTop paddingMd\", className)}>\n\t\t\t<FlexContainer gap=\"sm\" align=\"center\" justify=\"end\">\n\t\t\t\t{children}\n\t\t\t</FlexContainer>\n\t\t</div>\n\t);\n};\nModalFooter.displayName = \"Modal.Footer\";\n\ntype ToolbarElement = React.ReactElement<ModalCompositionProps, typeof ModalToolbar>;\ntype ContentElement = React.ReactElement<ModalCompositionProps, typeof ModalContent>;\ntype FooterElement = React.ReactElement<ModalCompositionProps, typeof ModalFooter>;\n\ntype ModalChildren =\n\t[ToolbarElement, ContentElement, FooterElement] | [ToolbarElement, ContentElement] | [ContentElement, FooterElement] | ContentElement;\n\nexport interface ModalProps {\n\t/** Открыто ли модальное окно */\n\tisOpen?: boolean;\n\t/** Заголовок */\n\ttitle?: string;\n\t/** Размер модального окна */\n\tsize?: keyof typeof ModalSize;\n\theight?: string;\n\t/** Обработчик закрытия */\n\tonClose: () => void;\n\tchildren: ModalChildren;\n}\n\nexport const Modal: React.FC<ModalProps> = ({ isOpen, title, size = \"sm\", height, onClose, children }) => {\n\tconst modalId = useId();\n\tconst titleId = useId();\n\n\tconst { modals, openModal, closeModal, isTopModal } = useModalManager();\n\tconst shouldReduceMotion = useReducedMotion();\n\tconst restoreFocusTargetRef = useRef<HTMLElement | null>(null);\n\tconst restoreFocusAnimationFrameRef = useRef(0);\n\n\t/**\n\t * Если provider менеджера не подключен, считаем одиночную модалку активной,\n\t * иначе логика Escape/focus trap никогда не включится.\n\t */\n\tconst isActive = isOpen && (modals.length === 0 || isTopModal(modalId));\n\n\tuseEffect(() => {\n\t\tif (isOpen) {\n\t\t\trestoreFocusTargetRef.current = document.activeElement instanceof HTMLElement ? document.activeElement : null;\n\t\t}\n\t}, [isOpen]);\n\n\tconst modalRef = useOverlayFocus<HTMLDivElement>({ active: isOpen || false, trapFocus: true, restoreFocus: false });\n\n\tuseEscapeDismiss({\n\t\tactive: isActive || false,\n\t\tonDismiss: onClose,\n\t\tcontainerRef: modalRef\n\t});\n\n\tuseEffect(() => {\n\t\tif (isOpen) {\n\t\t\topenModal(modalId);\n\t\t}\n\t}, [isOpen, modalId, openModal]);\n\n\tuseEffect(() => {\n\t\treturn () => {\n\t\t\twindow.cancelAnimationFrame(restoreFocusAnimationFrameRef.current);\n\t\t\tcloseModal(modalId);\n\t\t};\n\t}, [closeModal, modalId]);\n\n\tfunction handleExitComplete() {\n\t\tcloseModal(modalId);\n\t\tconst restoreFocusTarget = restoreFocusTargetRef.current;\n\n\t\t/**\n\t\t * Менеджер снимает inert в passive effect после обновления стека.\n\t\t * Следующий animation frame гарантирует, что trigger снова доступен для фокуса.\n\t\t */\n\t\trestoreFocusAnimationFrameRef.current = window.requestAnimationFrame(() => {\n\t\t\tif (restoreFocusTarget?.isConnected) {\n\t\t\t\trestoreFocusTarget.focus();\n\t\t\t}\n\t\t\trestoreFocusTargetRef.current = null;\n\t\t});\n\t}\n\n\tconst modalRoot = getOrCreatePortalRoot(\"modal-root\");\n\n\tif (!modalRoot) {\n\t\treturn null;\n\t}\n\n\tlet toolbar: React.ReactNode = null;\n\tlet content: React.ReactNode = null;\n\tlet footer: React.ReactNode = null;\n\n\tconst childArray = Children.toArray(children) as (ToolbarElement | ContentElement | FooterElement)[];\n\n\tfor (const child of childArray) {\n\t\tconst typeName = child.type.displayName;\n\n\t\tswitch (typeName) {\n\t\t\tcase ModalToolbar.displayName:\n\t\t\t\tif (toolbar) throw new Error(\"Modal: duplicate <Toolbar> found\");\n\t\t\t\ttoolbar = child; //.props.children;\n\t\t\t\tbreak;\n\t\t\tcase ModalFooter.displayName:\n\t\t\t\tif (footer) throw new Error(\"Modal: duplicate <Footer> found\");\n\t\t\t\tfooter = child; //props.children;\n\t\t\t\tbreak;\n\t\t\tcase ModalContent.displayName:\n\t\t\t\tif (content) throw new Error(\"Modal: duplicate <Content> found\");\n\t\t\t\tcontent = child; //.props.children;\n\t\t\t\tbreak;\n\t\t}\n\t}\n\n\treturn createPortal(\n\t\t<AnimatePresence onExitComplete={handleExitComplete}>\n\t\t\t{isOpen ? (\n\t\t\t\t<motion.div\n\t\t\t\t\tref={modalRef}\n\t\t\t\t\tclassName={cn(styles.modal, styles[size])}\n\t\t\t\t\tstyle={{ height }}\n\t\t\t\t\trole=\"dialog\"\n\t\t\t\t\taria-modal=\"true\"\n\t\t\t\t\taria-labelledby={titleId}\n\t\t\t\t\taria-describedby={`${titleId}-content`}\n\t\t\t\t\tinitial=\"hidden\"\n\t\t\t\t\tanimate=\"visible\"\n\t\t\t\t\texit=\"hidden\"\n\t\t\t\t\tvariants={modalMotionVariants}\n\t\t\t\t\ttransition={shouldReduceMotion ? reducedModalMotionTransition : modalMotionTransition}>\n\t\t\t\t\t<div className={cn(styles.header, toolbar ? \"\" : \"borderBottom\")}>\n\t\t\t\t\t\t<h3 className={styles.headerText} id={titleId}>\n\t\t\t\t\t\t\t{title}\n\t\t\t\t\t\t</h3>\n\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\ticon={<X />}\n\t\t\t\t\t\t\tclassName={styles.headerButton}\n\t\t\t\t\t\t\tvariant={\"ghost\"}\n\t\t\t\t\t\t\taria-label={\"Закрыть модальное окно\"}\n\t\t\t\t\t\t\tonClick={onClose}\n\t\t\t\t\t\t/>\n\t\t\t\t\t</div>\n\n\t\t\t\t\t<GridContainer\n\t\t\t\t\t\tid={`${titleId}-content`}\n\t\t\t\t\t\ttemplateRows={`${toolbar ? \"auto\" : \"\"} 1fr ${footer ? \"auto\" : \"\"}`.trim()}\n\t\t\t\t\t\t// gap=\"md\"\n\t\t\t\t\t\tclassName={styles.body}>\n\t\t\t\t\t\t{toolbar}\n\t\t\t\t\t\t{content}\n\t\t\t\t\t\t{footer}\n\t\t\t\t\t</GridContainer>\n\t\t\t\t</motion.div>\n\t\t\t) : null}\n\t\t</AnimatePresence>,\n\t\tmodalRoot\n\t);\n};\n","// ModalManagerContext.tsx\nimport React, { useCallback, useEffect, useRef, useState } from \"react\";\n\nimport { ModalManagerContext } from \"./useModalManager\";\n\nexport interface ModalManagerProviderProps {\n\tchildren: React.ReactNode;\n\t/** Компенсирует исчезновение скроллбара правым padding у body. */\n\tcompensateScrollbar?: boolean;\n}\n\n/**\n * Провайдер для централизованного управления стеком модальных окон. Дает вложенным компонентам доступ к открытию и закрытию модалок через контекст.\n */\nexport function ModalManagerProvider({ children, compensateScrollbar = false }: ModalManagerProviderProps) {\n\tconst [modals, setModals] = useState<string[]>([]);\n\tconst prevModalsLength = useRef(0);\n\tconst scrollbarWidth = useRef(0);\n\tconst bodyPaddingRight = useRef(\"\");\n\tconst isScrollbarCompensated = useRef(false);\n\n\tconst openModal = useCallback((id: string) => {\n\t\tsetModals((prev) => [...prev, id]);\n\t}, []);\n\n\tconst closeModal = useCallback((id: string) => {\n\t\tsetModals((prev) => prev.filter((mid) => mid !== id));\n\t}, []);\n\n\tconst isTopModal = useCallback(\n\t\t(id: string) => {\n\t\t\treturn modals[modals.length - 1] === id;\n\t\t},\n\t\t[modals]\n\t);\n\n\tuseEffect(() => {\n\t\tconst wasEmpty = prevModalsLength.current === 0;\n\n\t\tif (wasEmpty && modals.length > 0) {\n\t\t\t// первая модалка открыта — ставим стили\n\t\t\tconst scrollY = window.scrollY;\n\t\t\tconst appRoot = document.querySelector(\"#app-root\");\n\t\t\tscrollbarWidth.current = Math.max(0, window.innerWidth - document.documentElement.clientWidth);\n\t\t\tbodyPaddingRight.current = document.body.style.paddingRight;\n\n\t\t\tdocument.body.style.position = \"fixed\";\n\t\t\tdocument.body.style.top = `-${scrollY}px`;\n\t\t\tdocument.body.style.width = \"100%\";\n\n\t\t\tif (compensateScrollbar) {\n\t\t\t\tdocument.body.style.paddingRight = `${scrollbarWidth.current}px`;\n\t\t\t\tisScrollbarCompensated.current = true;\n\t\t\t}\n\n\t\t\tappRoot?.setAttribute(\"inert\", \"true\");\n\n\t\t\tprevModalsLength.current = modals.length;\n\t\t\treturn;\n\t\t}\n\n\t\tif (!wasEmpty && modals.length > 0 && compensateScrollbar !== isScrollbarCompensated.current) {\n\t\t\tdocument.body.style.paddingRight = compensateScrollbar ? `${scrollbarWidth.current}px` : bodyPaddingRight.current;\n\t\t\tisScrollbarCompensated.current = compensateScrollbar;\n\t\t}\n\n\t\tif (!wasEmpty && modals.length === 0) {\n\t\t\t// последняя модалка закрыта — снимаем стили\n\t\t\tconst appRoot = document.querySelector(\"#app-root\");\n\t\t\tconst scrollY = parseInt(document.body.style.top || \"0\") * -1;\n\n\t\t\tdocument.body.style.position = \"\";\n\t\t\tdocument.body.style.top = \"\";\n\t\t\tdocument.body.style.width = \"\";\n\n\t\t\tif (isScrollbarCompensated.current) {\n\t\t\t\tdocument.body.style.paddingRight = bodyPaddingRight.current;\n\t\t\t\tisScrollbarCompensated.current = false;\n\t\t\t}\n\n\t\t\tappRoot?.removeAttribute(\"inert\");\n\n\t\t\twindow.scrollTo({ top: scrollY, left: 0, behavior: \"instant\" });\n\t\t}\n\n\t\tprevModalsLength.current = modals.length;\n\t}, [compensateScrollbar, modals.length]);\n\n\treturn <ModalManagerContext.Provider value={{ modals, openModal, closeModal, isTopModal }}>{children}</ModalManagerContext.Provider>;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;GCMa,IAAsB;CAClC,QAAQ;EACP,SAAS;EACT,OAAO;EACP,GAAG;CACJ;CACA,SAAS;EACR,SAAS;EACT,OAAO;EACP,GAAG;CACJ;AACD,GAGa,IAAwB;CACpC,UAAU;CACV,MAAM;EAAC;EAAM;EAAG;EAAM;CAAC;AACxB,GAGa,IAA+B,EAC3C,UAAU,EACX,GC1Ba,IAAsB,EAKhC;CACF,QAAQ,CAAC;CACT,iBAAiB,CAAC;CAClB,kBAAkB,CAAC;CACnB,kBAAkB;AACnB,CAAC,GAEY,UAAwB,EAAW,CAAmB,GCUtD,KAAiD,EAAE,aAAU,mBAClE,kBAAC,OAAD;CAAK,WAAW,EAAG,mCAAmC,CAAS;CAAI;AAAc,CAAA;AAEzF,EAAa,cAAc;AAE3B,IAAa,KAA4E,EAAE,aAAU,cAAW,oBAE9G,kBAAC,OAAD;CAAK,WAAW,EAAG,iCAAiC,CAAS;CAC3D,UAAA,IAAa,kBAAC,GAAD;EAAY,WAAU;EAAQ;CAAqB,CAAA,IAAI;AACjE,CAAA;AAGP,EAAa,cAAc;AAE3B,IAAa,KAAgD,EAAE,aAAU,mBAEvE,kBAAC,OAAD;CAAK,WAAW,EAAG,gCAAgC,CAAS;CAC3D,UAAA,kBAAC,GAAD;EAAe,KAAI;EAAK,OAAM;EAAS,SAAQ;EAC7C;CACa,CAAA;AACX,CAAA;AAGP,EAAY,cAAc;AAsB1B,IAAa,KAA+B,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AAG,CAAC,GAAqB,EAAO,MAAM,CAAC,GAEhC,kBAAC,EAAoB,UAArB;EAA8B,OAAO;GAAE;GAAQ;GAAW;GAAY;EAAW;EAAI;CAAuC,CAAA;AACpI"}
|
|
@@ -134,7 +134,7 @@ var M = ({ children: t, onClose: n, closeOnOutside: i = !0, closeOnEscape: a = !
|
|
|
134
134
|
"bottom"
|
|
135
135
|
]
|
|
136
136
|
}),
|
|
137
|
-
h({ padding:
|
|
137
|
+
h({ padding: 8 }),
|
|
138
138
|
d({
|
|
139
139
|
element: j,
|
|
140
140
|
padding: 8
|
|
@@ -227,4 +227,4 @@ var M = ({ children: t, onClose: n, closeOnOutside: i = !0, closeOnEscape: a = !
|
|
|
227
227
|
//#endregion
|
|
228
228
|
export { M as a, N as i, I as n, j as o, P as r, L as t };
|
|
229
229
|
|
|
230
|
-
//# sourceMappingURL=popover-
|
|
230
|
+
//# sourceMappingURL=popover-IztNF45J.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"popover-IExDrsF6.js","names":[],"sources":["../../src/popover/components/Popover.module.scss","../../src/popover/components/PopoverContext.tsx","../../src/popover/components/PopoverContent.tsx","../../src/popover/components/PopoverTrigger.tsx","../../src/popover/components/Popover.tsx","../../src/popover/Popover.module.scss","../../src/popover/FloatingPopover.tsx","../../src/popover/FloatingTooltip.tsx"],"sourcesContent":[".popover {\n\tpadding: var(--space-sm);\n\t// background-image: radial-gradient(var(--surface-0) 50%, var(--surface-1) 100%);\n\n\tborder: var(--border-width) solid var(--border-1);\n\tborder-radius: var(--radius-sm);\n\tcolor: var(--content-0);\n\n\tfilter: drop-shadow(var(--shadow-md));\n\n\tz-index: var(--z-popover);\n\n\t&.primary {\n\t\tbackground-color: var(--surface-0);\n\t}\n\n\t&.secondary {\n\t\tbackground-color: var(--surface-1);\n\t}\n}\n","import React, { createContext, useContext } from \"react\";\n\nimport { Placement, useFloating } from \"@floating-ui/react\";\nimport { createMissingContextError } from \"@ryuzaki13/react-foundation-lib/error\";\n\ninterface PopoverContextValue {\n\topen: boolean;\n\tsetOpen: React.Dispatch<React.SetStateAction<boolean>>;\n\trefs: ReturnType<typeof useFloating>[\"refs\"];\n\tfloatingStyles: React.CSSProperties;\n\tplacement: Placement;\n\tmiddlewareData: ReturnType<typeof useFloating>[\"middlewareData\"];\n\tarrowRef: React.RefObject<HTMLDivElement | null>;\n}\n\nexport const PopoverContext = createContext<PopoverContextValue | null>(null);\n\nexport function usePopoverContext() {\n\tconst context = useContext(PopoverContext);\n\tif (!context) {\n\t\tthrow createMissingContextError({\n\t\t\thookName: \"usePopoverContext\",\n\t\t\tproviderName: \"Popover\"\n\t\t});\n\t}\n\treturn context;\n}\n","import React, { useCallback, useRef } from \"react\";\n\nimport { FloatingPortal } from \"@floating-ui/react\";\nimport { useClickOutside, useEscapeDismiss, useOverlayFocus } from \"@ryuzaki13/react-foundation-lib/dom\";\nimport { cn } from \"@ryuzaki13/react-foundation-lib/utils\";\n\nimport { TooltipArrow } from \"../../floating-arrow\";\n\nimport styles from \"./Popover.module.scss\";\nimport { usePopoverContext } from \"./PopoverContext\";\n\nexport interface PopoverContentProps {\n\tchildren: React.ReactNode | ((ctx: { setClose: () => void }) => React.ReactNode);\n\tonClose?: () => void;\n\tcloseOnOutside?: boolean;\n\tcloseOnEscape?: boolean;\n\tdisableOutsideClick?: boolean;\n\tbackground?: \"primary\" | \"secondary\";\n}\n\n/**\n * Содержимое Popover, отображаемое в портале.\n */\nexport const PopoverContent: React.FC<PopoverContentProps> = ({\n\tchildren,\n\tonClose,\n\tcloseOnOutside = true,\n\tcloseOnEscape = true,\n\tdisableOutsideClick = false,\n\tbackground = \"secondary\"\n}) => {\n\tconst { open, setOpen, refs, floatingStyles, middlewareData, placement, arrowRef } = usePopoverContext();\n\tconst floatingElementRef = useRef<HTMLDivElement | null>(null);\n\tconst setFloating = useCallback(\n\t\t(node: HTMLDivElement | null) => {\n\t\t\tfloatingElementRef.current = node;\n\t\t\trefs.setFloating(node);\n\t\t},\n\t\t[refs]\n\t);\n\n\tconst floatingRef = useOverlayFocus<HTMLDivElement>({\n\t\tactive: open,\n\t\tinitialFocus: \"container\",\n\t\trestoreFocus: true,\n\t\tcontainerRef: floatingElementRef\n\t});\n\n\tconst setClose = useCallback(() => {\n\t\tif (!open) return;\n\t\tsetOpen(false);\n\t\tonClose?.();\n\t}, [setOpen, onClose, open]);\n\n\tuseEscapeDismiss({\n\t\tactive: open,\n\t\tenabled: closeOnEscape,\n\t\tonDismiss: setClose,\n\t\tcontainerRef: floatingRef as React.RefObject<HTMLElement | null>\n\t});\n\n\tconst outsideClose = useCallback(() => {\n\t\tif (!open || disableOutsideClick) return;\n\t\tif (closeOnOutside) setClose();\n\t}, [open, disableOutsideClick, closeOnOutside, setClose]);\n\n\tuseClickOutside([refs.floating as React.RefObject<HTMLElement>, refs.reference as React.RefObject<HTMLElement>], outsideClose);\n\n\tif (!open) return null;\n\n\treturn (\n\t\t<FloatingPortal>\n\t\t\t<div\n\t\t\t\tref={setFloating}\n\t\t\t\tstyle={floatingStyles}\n\t\t\t\tclassName={cn(styles.popover, styles[background])}\n\t\t\t\trole=\"dialog\"\n\t\t\t\taria-modal=\"true\"\n\t\t\t\ttabIndex={-1}>\n\t\t\t\t{typeof children === \"function\" ? children({ setClose }) : children}\n\t\t\t\t<TooltipArrow ref={arrowRef} placement={placement} middlewareData={middlewareData} />\n\t\t\t</div>\n\t\t</FloatingPortal>\n\t);\n};\n","import React, { cloneElement, useCallback } from \"react\";\n\nimport { usePopoverContext } from \"./PopoverContext\";\n\nexport interface PopoverTriggerProps {\n\tpassive?: true;\n\tchildren: React.ReactElement<React.HTMLAttributes<Element> & { ref?: React.Ref<Element> }>;\n}\n\nexport const PopoverTrigger: React.FC<PopoverTriggerProps> = ({ passive, children }) => {\n\tconst { open, setOpen, refs } = usePopoverContext();\n\n\tconst handleClick = useCallback(\n\t\t(e: React.MouseEvent) => {\n\t\t\tif (children.props.onClick) {\n\t\t\t\tchildren.props.onClick(e);\n\t\t\t}\n\t\t\tif (e.defaultPrevented) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\te.preventDefault();\n\t\t\te.stopPropagation();\n\n\t\t\tif (passive) return;\n\n\t\t\tsetOpen((v) => !v);\n\t\t},\n\t\t[children, setOpen, passive]\n\t);\n\n\treturn cloneElement(children as React.JSX.Element, {\n\t\tref: refs.setReference,\n\t\t\"aria-expanded\": open,\n\t\tonClick: handleClick\n\t});\n};\n","/* eslint-disable react-refresh/only-export-components */\nimport React, { useCallback, useRef, useState } from \"react\";\n\nimport { arrow, autoUpdate, flip, offset, Placement, shift, useFloating } from \"@floating-ui/react\";\n\nimport { PopoverContent } from \"./PopoverContent\";\nimport { PopoverContext } from \"./PopoverContext\";\nimport { PopoverTrigger } from \"./PopoverTrigger\";\n\nexport interface PopoverProps {\n\tchildren: React.ReactNode;\n\tplacement?: Placement;\n\topen?: boolean;\n\tdefaultOpen?: boolean;\n\tonOpenChange?: (open: boolean) => void;\n}\n\n/**\n * Контролируемый Popover.\n * Используется в связке с Popover.Trigger и Popover.Content.\n */\nconst PopoverRoot: React.FC<PopoverProps> = ({ children, open: controlledOpen, defaultOpen, onOpenChange, placement = \"bottom\" }) => {\n\tconst [uncontrolledOpen, setUncontrolledOpen] = useState(defaultOpen ?? false);\n\n\tconst isControlled = controlledOpen !== undefined;\n\tconst open = isControlled ? controlledOpen : uncontrolledOpen;\n\tconst setOpen = useCallback<React.Dispatch<React.SetStateAction<boolean>>>(\n\t\t(value) => {\n\t\t\tconst next = typeof value === \"function\" ? value(open) : value;\n\t\t\tif (!isControlled) setUncontrolledOpen(next);\n\t\t\tonOpenChange?.(next);\n\t\t},\n\t\t[isControlled, onOpenChange, open]\n\t);\n\n\tconst arrowRef = useRef<HTMLDivElement | null>(null);\n\n\tconst {\n\t\trefs,\n\t\tfloatingStyles,\n\t\tmiddlewareData,\n\t\tplacement: actualPlacement\n\t} = useFloating({\n\t\topen,\n\t\tonOpenChange: setOpen,\n\t\tplacement,\n\t\t// eslint-disable-next-line react-hooks/refs\n\t\tmiddleware: [offset(8), flip(), shift({ padding: 16 }), arrow({ element: arrowRef.current })],\n\t\twhileElementsMounted: autoUpdate\n\t});\n\n\treturn (\n\t\t<PopoverContext.Provider value={{ open, setOpen, refs, floatingStyles, placement: actualPlacement, middlewareData, arrowRef }}>\n\t\t\t{children}\n\t\t</PopoverContext.Provider>\n\t);\n};\n\n/**\n * Композиционное API:\n * <Popover>\n * <Popover.Trigger />\n * <Popover.Content />\n * </Popover>\n */\nexport const Popover = Object.assign(PopoverRoot, {\n\tTrigger: PopoverTrigger,\n\tContent: PopoverContent\n});\n",".tooltipPanel {\n\tpadding: var(--space-sm);\n\t// background-image: radial-gradient(var(--surface-0) 50%, var(--surface-1) 100%);\n\tbackground-color: var(--surface-1);\n\tborder: var(--border-width) solid var(--border-2);\n\tborder-radius: var(--radius-sm);\n\tcolor: var(--content-0);\n\n\tfilter: drop-shadow(var(--shadow-sm));\n\n\t&.negative {\n\t\t--border-1: var(--content-0);\n\n\t\tbackground-color: var(--content-0);\n\t\tborder-color: var(--border-1);\n\t\tcolor: var(--surface-1);\n\t}\n\n\t&.information {\n\t\t--border-1: var(--status-info-text);\n\n\t\tbackground-color: var(--status-info-text);\n\t\tborder-color: var(--status-info-text);\n\t\tcolor: var(--status-info-on-fill);\n\t}\n\n\t&.error {\n\t\t--border-1: var(--status-error-text);\n\n\t\tbackground-color: var(--status-error-text);\n\t\tborder-color: var(--status-error-text);\n\t\tcolor: var(--status-error-on-fill);\n\t}\n\n\t&.warning {\n\t\t--border-1: var(--status-warning-text);\n\n\t\tbackground-color: var(--status-warning-text);\n\t\tborder-color: var(--status-warning-text);\n\t\tcolor: var(--status-warning-on-fill);\n\t}\n\n\t&.success {\n\t\t--border-1: var(--status-success-text);\n\n\t\tbackground-color: var(--status-success-text);\n\t\tborder-color: var(--status-success-text);\n\t\tcolor: var(--status-success-on-fill);\n\t}\n}\n\n.tooltip {\n\tz-index: var(--z-tooltip);\n\tpointer-events: none;\n\n\ttext-align: initial;\n\tfont-size: var(--font-size-sm);\n\tfont-style: normal;\n\tfont-weight: 500;\n\tfont-variation-settings: \"wght\" 500;\n\tline-height: var(--line-height);\n\n\t@extend .tooltipPanel;\n}\n","/* eslint-disable react-hooks/refs */\nimport React, { useLayoutEffect, useRef, useState } from \"react\";\n\nimport {\n\tarrow,\n\tautoUpdate,\n\tflip,\n\toffset,\n\tPlacement,\n\tshift,\n\tuseDismiss,\n\tuseFloating,\n\tuseHover,\n\tuseInteractions,\n\tuseRole\n} from \"@floating-ui/react\";\nimport { cn } from \"@ryuzaki13/react-foundation-lib/utils\";\nimport { createPortal } from \"react-dom\";\n\nimport { FloatingArrow } from \"../floating-arrow/FloatingArrow\";\n\nimport styles from \"./Popover.module.scss\";\n\ninterface FloatingPopoverProps {\n\tcontent: React.ReactNode;\n\tchildren: React.ReactNode;\n\topenOnHover?: boolean;\n\tplacement?: Placement;\n\topenDelay?: number;\n\tcloseDelay?: number;\n\tmaxWidth?: number;\n\tstate?: \"information\" | \"error\" | \"warning\" | \"success\" | \"negative\";\n\ttooltip?: true;\n\t/**\n\t * Изменяется вместе с CSS-координатой trigger, когда её изменение не отслеживается `autoUpdate`.\n\t * После commit React выполняется повторный расчёт позиции открытой floating-панели.\n\t */\n\tpositionUpdateKey?: unknown;\n}\n\nexport const FloatingPopover: React.FC<FloatingPopoverProps> = ({\n\tcontent,\n\tchildren,\n\topenOnHover = true,\n\tplacement = \"bottom\",\n\topenDelay = 200,\n\tcloseDelay = 100,\n\tmaxWidth,\n\tstate,\n\ttooltip,\n\tpositionUpdateKey\n}) => {\n\tconst [open, setOpen] = useState(false);\n\tconst arrowRef = useRef<HTMLDivElement>(null);\n\n\tconst {\n\t\trefs,\n\t\tfloatingStyles,\n\t\tmiddlewareData,\n\t\tcontext,\n\t\tplacement: computedPlacement,\n\t\tupdate\n\t} = useFloating({\n\t\topen,\n\t\tonOpenChange: setOpen,\n\t\tplacement,\n\t\tmiddleware: [\n\t\t\toffset(8),\n\t\t\tflip({ fallbackAxisSideDirection: \"end\", fallbackPlacements: [\"top\", \"right\", \"bottom\"] }),\n\t\t\tshift({ padding: 16 }),\n\t\t\tarrow({ element: arrowRef, padding: 8 })\n\t\t],\n\t\twhileElementsMounted: autoUpdate\n\t});\n\n\tuseLayoutEffect(() => {\n\t\tif (open) {\n\t\t\tvoid update();\n\t\t}\n\t}, [open, positionUpdateKey, update]);\n\n\tconst hover = useHover(context, {\n\t\tenabled: openOnHover,\n\t\tmove: false,\n\t\tdelay: {\n\t\t\topen: openDelay,\n\t\t\tclose: closeDelay\n\t\t}\n\t});\n\tconst dismiss = useDismiss(context);\n\tconst role = useRole(context);\n\n\tconst { getReferenceProps, getFloatingProps } = useInteractions([hover, dismiss, role]);\n\n\treturn (\n\t\t<>\n\t\t\t<span ref={refs.setReference} {...getReferenceProps()} style={{ lineHeight: 1 }}>\n\t\t\t\t{children}\n\t\t\t</span>\n\n\t\t\t{open &&\n\t\t\t\tcreatePortal(\n\t\t\t\t\t<div\n\t\t\t\t\t\tref={refs.setFloating}\n\t\t\t\t\t\tstyle={{ ...floatingStyles, zIndex: \"var(--z-tooltip)\", maxWidth: maxWidth ? `${maxWidth}em` : undefined }}\n\t\t\t\t\t\t{...getFloatingProps()}\n\t\t\t\t\t\trole=\"tooltip\"\n\t\t\t\t\t\tclassName={cn(styles.tooltipPanel, tooltip && styles.tooltip, state && styles[state])}>\n\t\t\t\t\t\t{content}\n\n\t\t\t\t\t\t<FloatingArrow ref={arrowRef} placement={computedPlacement} middlewareData={middlewareData} />\n\t\t\t\t\t</div>,\n\t\t\t\t\tdocument.body\n\t\t\t\t)}\n\t\t</>\n\t);\n};\n","import React, { useEffect, useRef } from \"react\";\n\nimport { arrow, flip, offset, shift, useFloating } from \"@floating-ui/react\";\n\nimport { FloatingArrow } from \"../floating-arrow/FloatingArrow\";\n\nimport styles from \"./Popover.module.scss\";\n\nexport const FloatingTooltip: React.FC<{\n\tx: number;\n\ty: number;\n\tchildren: React.ReactNode;\n}> = ({ x, y, children }) => {\n\tconst arrowRef = useRef<HTMLDivElement | null>(null);\n\n\tconst {\n\t\trefs,\n\t\tfloatingStyles,\n\t\tmiddlewareData,\n\t\tplacement: computedPlacement\n\t} = useFloating({\n\t\tstrategy: \"absolute\",\n\t\tplacement: \"top\",\n\t\t// eslint-disable-next-line react-hooks/refs\n\t\tmiddleware: [offset(6), flip(), shift({ padding: 16 }), arrow({ element: arrowRef })]\n\t});\n\n\tuseEffect(() => {\n\t\tif (refs.setReference) {\n\t\t\trefs.setReference({\n\t\t\t\tgetBoundingClientRect: () =>\n\t\t\t\t\t({\n\t\t\t\t\t\tx,\n\t\t\t\t\t\ty,\n\t\t\t\t\t\twidth: 0,\n\t\t\t\t\t\theight: 0,\n\t\t\t\t\t\ttop: y,\n\t\t\t\t\t\tleft: x,\n\t\t\t\t\t\tbottom: y,\n\t\t\t\t\t\tright: x,\n\t\t\t\t\t\ttoJSON: () => {}\n\t\t\t\t\t}) as DOMRect\n\t\t\t});\n\t\t}\n\t}, [x, y, refs]);\n\n\treturn (\n\t\t<div ref={refs.setFloating} style={{ ...floatingStyles, position: \"absolute\", pointerEvents: \"none\" }} className={styles.tooltip}>\n\t\t\t{children}\n\n\t\t\t<FloatingArrow ref={arrowRef} placement={computedPlacement} middlewareData={middlewareData} />\n\t\t</div>\n\t);\n};\n"],"mappings":";;;;;;;;;;;;GCea,IAAiB,EAA0C,IAAI;AAE5E,SAAgB,IAAoB;CACnC,IAAM,IAAU,EAAW,CAAc;CACzC,IAAI,CAAC,GACJ,MAAM,EAA0B;EAC/B,UAAU;EACV,cAAc;CACf,CAAC;CAEF,OAAO;AACR;;;ACHA,IAAa,KAAiD,EAC7D,aACA,YACA,oBAAiB,IACjB,mBAAgB,IAChB,yBAAsB,IACtB,gBAAa,kBACR;CACL,IAAM,EAAE,SAAM,YAAS,SAAM,mBAAgB,mBAAgB,cAAW,gBAAa,EAAkB,GACjG,IAAqB,EAA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AAC;EAChB,GACF,CAAC;CAEH,GAAG;EAAC;EAAG;EAAG;CAAI,CAAC,GAGd,kBAAC,OAAD;EAAK,KAAK,EAAK;EAAa,OAAO;GAAE,GAAG;GAAgB,UAAU;GAAY,eAAe;EAAO;EAAG,WAAW,EAAO;EAAzH,UAAA,CACE,GAED,kBAAC,GAAD;GAAe,KAAK;GAAU,WAAW;GAAmC;EAAiB,CAAA,CACzF;;AAEP"}
|
|
1
|
+
{"version":3,"file":"popover-IztNF45J.js","names":[],"sources":["../../src/popover/components/Popover.module.scss","../../src/popover/components/PopoverContext.tsx","../../src/popover/components/PopoverContent.tsx","../../src/popover/components/PopoverTrigger.tsx","../../src/popover/components/Popover.tsx","../../src/popover/Popover.module.scss","../../src/popover/FloatingPopover.tsx","../../src/popover/FloatingTooltip.tsx"],"sourcesContent":[".popover {\n\tpadding: var(--space-sm);\n\t// background-image: radial-gradient(var(--surface-0) 50%, var(--surface-1) 100%);\n\n\tborder: var(--border-width) solid var(--border-1);\n\tborder-radius: var(--radius-sm);\n\tcolor: var(--content-0);\n\n\tfilter: drop-shadow(var(--shadow-md));\n\n\tz-index: var(--z-popover);\n\n\t&.primary {\n\t\tbackground-color: var(--surface-0);\n\t}\n\n\t&.secondary {\n\t\tbackground-color: var(--surface-1);\n\t}\n}\n","import React, { createContext, useContext } from \"react\";\n\nimport { Placement, useFloating } from \"@floating-ui/react\";\nimport { createMissingContextError } from \"@ryuzaki13/react-foundation-lib/error\";\n\ninterface PopoverContextValue {\n\topen: boolean;\n\tsetOpen: React.Dispatch<React.SetStateAction<boolean>>;\n\trefs: ReturnType<typeof useFloating>[\"refs\"];\n\tfloatingStyles: React.CSSProperties;\n\tplacement: Placement;\n\tmiddlewareData: ReturnType<typeof useFloating>[\"middlewareData\"];\n\tarrowRef: React.RefObject<HTMLDivElement | null>;\n}\n\nexport const PopoverContext = createContext<PopoverContextValue | null>(null);\n\nexport function usePopoverContext() {\n\tconst context = useContext(PopoverContext);\n\tif (!context) {\n\t\tthrow createMissingContextError({\n\t\t\thookName: \"usePopoverContext\",\n\t\t\tproviderName: \"Popover\"\n\t\t});\n\t}\n\treturn context;\n}\n","import React, { useCallback, useRef } from \"react\";\n\nimport { FloatingPortal } from \"@floating-ui/react\";\nimport { useClickOutside, useEscapeDismiss, useOverlayFocus } from \"@ryuzaki13/react-foundation-lib/dom\";\nimport { cn } from \"@ryuzaki13/react-foundation-lib/utils\";\n\nimport { TooltipArrow } from \"../../floating-arrow\";\n\nimport styles from \"./Popover.module.scss\";\nimport { usePopoverContext } from \"./PopoverContext\";\n\nexport interface PopoverContentProps {\n\tchildren: React.ReactNode | ((ctx: { setClose: () => void }) => React.ReactNode);\n\tonClose?: () => void;\n\tcloseOnOutside?: boolean;\n\tcloseOnEscape?: boolean;\n\tdisableOutsideClick?: boolean;\n\tbackground?: \"primary\" | \"secondary\";\n}\n\n/**\n * Содержимое Popover, отображаемое в портале.\n */\nexport const PopoverContent: React.FC<PopoverContentProps> = ({\n\tchildren,\n\tonClose,\n\tcloseOnOutside = true,\n\tcloseOnEscape = true,\n\tdisableOutsideClick = false,\n\tbackground = \"secondary\"\n}) => {\n\tconst { open, setOpen, refs, floatingStyles, middlewareData, placement, arrowRef } = usePopoverContext();\n\tconst floatingElementRef = useRef<HTMLDivElement | null>(null);\n\tconst setFloating = useCallback(\n\t\t(node: HTMLDivElement | null) => {\n\t\t\tfloatingElementRef.current = node;\n\t\t\trefs.setFloating(node);\n\t\t},\n\t\t[refs]\n\t);\n\n\tconst floatingRef = useOverlayFocus<HTMLDivElement>({\n\t\tactive: open,\n\t\tinitialFocus: \"container\",\n\t\trestoreFocus: true,\n\t\tcontainerRef: floatingElementRef\n\t});\n\n\tconst setClose = useCallback(() => {\n\t\tif (!open) return;\n\t\tsetOpen(false);\n\t\tonClose?.();\n\t}, [setOpen, onClose, open]);\n\n\tuseEscapeDismiss({\n\t\tactive: open,\n\t\tenabled: closeOnEscape,\n\t\tonDismiss: setClose,\n\t\tcontainerRef: floatingRef as React.RefObject<HTMLElement | null>\n\t});\n\n\tconst outsideClose = useCallback(() => {\n\t\tif (!open || disableOutsideClick) return;\n\t\tif (closeOnOutside) setClose();\n\t}, [open, disableOutsideClick, closeOnOutside, setClose]);\n\n\tuseClickOutside([refs.floating as React.RefObject<HTMLElement>, refs.reference as React.RefObject<HTMLElement>], outsideClose);\n\n\tif (!open) return null;\n\n\treturn (\n\t\t<FloatingPortal>\n\t\t\t<div\n\t\t\t\tref={setFloating}\n\t\t\t\tstyle={floatingStyles}\n\t\t\t\tclassName={cn(styles.popover, styles[background])}\n\t\t\t\trole=\"dialog\"\n\t\t\t\taria-modal=\"true\"\n\t\t\t\ttabIndex={-1}>\n\t\t\t\t{typeof children === \"function\" ? children({ setClose }) : children}\n\t\t\t\t<TooltipArrow ref={arrowRef} placement={placement} middlewareData={middlewareData} />\n\t\t\t</div>\n\t\t</FloatingPortal>\n\t);\n};\n","import React, { cloneElement, useCallback } from \"react\";\n\nimport { usePopoverContext } from \"./PopoverContext\";\n\nexport interface PopoverTriggerProps {\n\tpassive?: true;\n\tchildren: React.ReactElement<React.HTMLAttributes<Element> & { ref?: React.Ref<Element> }>;\n}\n\nexport const PopoverTrigger: React.FC<PopoverTriggerProps> = ({ passive, children }) => {\n\tconst { open, setOpen, refs } = usePopoverContext();\n\n\tconst handleClick = useCallback(\n\t\t(e: React.MouseEvent) => {\n\t\t\tif (children.props.onClick) {\n\t\t\t\tchildren.props.onClick(e);\n\t\t\t}\n\t\t\tif (e.defaultPrevented) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\te.preventDefault();\n\t\t\te.stopPropagation();\n\n\t\t\tif (passive) return;\n\n\t\t\tsetOpen((v) => !v);\n\t\t},\n\t\t[children, setOpen, passive]\n\t);\n\n\treturn cloneElement(children as React.JSX.Element, {\n\t\tref: refs.setReference,\n\t\t\"aria-expanded\": open,\n\t\tonClick: handleClick\n\t});\n};\n","/* eslint-disable react-refresh/only-export-components */\nimport React, { useCallback, useRef, useState } from \"react\";\n\nimport { arrow, autoUpdate, flip, offset, Placement, shift, useFloating } from \"@floating-ui/react\";\n\nimport { PopoverContent } from \"./PopoverContent\";\nimport { PopoverContext } from \"./PopoverContext\";\nimport { PopoverTrigger } from \"./PopoverTrigger\";\n\nexport interface PopoverProps {\n\tchildren: React.ReactNode;\n\tplacement?: Placement;\n\topen?: boolean;\n\tdefaultOpen?: boolean;\n\tonOpenChange?: (open: boolean) => void;\n}\n\n/**\n * Контролируемый Popover.\n * Используется в связке с Popover.Trigger и Popover.Content.\n */\nconst PopoverRoot: React.FC<PopoverProps> = ({ children, open: controlledOpen, defaultOpen, onOpenChange, placement = \"bottom\" }) => {\n\tconst [uncontrolledOpen, setUncontrolledOpen] = useState(defaultOpen ?? false);\n\n\tconst isControlled = controlledOpen !== undefined;\n\tconst open = isControlled ? controlledOpen : uncontrolledOpen;\n\tconst setOpen = useCallback<React.Dispatch<React.SetStateAction<boolean>>>(\n\t\t(value) => {\n\t\t\tconst next = typeof value === \"function\" ? value(open) : value;\n\t\t\tif (!isControlled) setUncontrolledOpen(next);\n\t\t\tonOpenChange?.(next);\n\t\t},\n\t\t[isControlled, onOpenChange, open]\n\t);\n\n\tconst arrowRef = useRef<HTMLDivElement | null>(null);\n\n\tconst {\n\t\trefs,\n\t\tfloatingStyles,\n\t\tmiddlewareData,\n\t\tplacement: actualPlacement\n\t} = useFloating({\n\t\topen,\n\t\tonOpenChange: setOpen,\n\t\tplacement,\n\t\t// eslint-disable-next-line react-hooks/refs\n\t\tmiddleware: [offset(8), flip(), shift({ padding: 16 }), arrow({ element: arrowRef.current })],\n\t\twhileElementsMounted: autoUpdate\n\t});\n\n\treturn (\n\t\t<PopoverContext.Provider value={{ open, setOpen, refs, floatingStyles, placement: actualPlacement, middlewareData, arrowRef }}>\n\t\t\t{children}\n\t\t</PopoverContext.Provider>\n\t);\n};\n\n/**\n * Композиционное API:\n * <Popover>\n * <Popover.Trigger />\n * <Popover.Content />\n * </Popover>\n */\nexport const Popover = Object.assign(PopoverRoot, {\n\tTrigger: PopoverTrigger,\n\tContent: PopoverContent\n});\n",".tooltipPanel {\n\tpadding: var(--space-sm);\n\t// background-image: radial-gradient(var(--surface-0) 50%, var(--surface-1) 100%);\n\tbackground-color: var(--surface-1);\n\tborder: var(--border-width) solid var(--border-2);\n\tborder-radius: var(--radius-sm);\n\tcolor: var(--content-0);\n\n\tfilter: drop-shadow(var(--shadow-sm));\n\n\t&.negative {\n\t\t--border-1: var(--content-0);\n\n\t\tbackground-color: var(--content-0);\n\t\tborder-color: var(--border-1);\n\t\tcolor: var(--surface-1);\n\t}\n\n\t&.information {\n\t\t--border-1: var(--status-info-text);\n\n\t\tbackground-color: var(--status-info-text);\n\t\tborder-color: var(--status-info-text);\n\t\tcolor: var(--status-info-on-fill);\n\t}\n\n\t&.error {\n\t\t--border-1: var(--status-error-text);\n\n\t\tbackground-color: var(--status-error-text);\n\t\tborder-color: var(--status-error-text);\n\t\tcolor: var(--status-error-on-fill);\n\t}\n\n\t&.warning {\n\t\t--border-1: var(--status-warning-text);\n\n\t\tbackground-color: var(--status-warning-text);\n\t\tborder-color: var(--status-warning-text);\n\t\tcolor: var(--status-warning-on-fill);\n\t}\n\n\t&.success {\n\t\t--border-1: var(--status-success-text);\n\n\t\tbackground-color: var(--status-success-text);\n\t\tborder-color: var(--status-success-text);\n\t\tcolor: var(--status-success-on-fill);\n\t}\n}\n\n.tooltip {\n\tz-index: var(--z-tooltip);\n\tpointer-events: none;\n\n\ttext-align: initial;\n\tfont-size: var(--font-size-sm);\n\tfont-style: normal;\n\tfont-weight: 500;\n\tfont-variation-settings: \"wght\" 500;\n\tline-height: var(--line-height);\n\n\t@extend .tooltipPanel;\n}\n","/* eslint-disable react-hooks/refs */\nimport React, { useLayoutEffect, useRef, useState } from \"react\";\n\nimport {\n\tarrow,\n\tautoUpdate,\n\tflip,\n\toffset,\n\tPlacement,\n\tshift,\n\tuseDismiss,\n\tuseFloating,\n\tuseHover,\n\tuseInteractions,\n\tuseRole\n} from \"@floating-ui/react\";\nimport { cn } from \"@ryuzaki13/react-foundation-lib/utils\";\nimport { createPortal } from \"react-dom\";\n\nimport { FloatingArrow } from \"../floating-arrow/FloatingArrow\";\n\nimport styles from \"./Popover.module.scss\";\n\ninterface FloatingPopoverProps {\n\tcontent: React.ReactNode;\n\tchildren: React.ReactNode;\n\topenOnHover?: boolean;\n\tplacement?: Placement;\n\topenDelay?: number;\n\tcloseDelay?: number;\n\tmaxWidth?: number;\n\tstate?: \"information\" | \"error\" | \"warning\" | \"success\" | \"negative\";\n\ttooltip?: true;\n\t/**\n\t * Изменяется вместе с CSS-координатой trigger, когда её изменение не отслеживается `autoUpdate`.\n\t * После commit React выполняется повторный расчёт позиции открытой floating-панели.\n\t */\n\tpositionUpdateKey?: unknown;\n}\n\nexport const FloatingPopover: React.FC<FloatingPopoverProps> = ({\n\tcontent,\n\tchildren,\n\topenOnHover = true,\n\tplacement = \"bottom\",\n\topenDelay = 200,\n\tcloseDelay = 100,\n\tmaxWidth,\n\tstate,\n\ttooltip,\n\tpositionUpdateKey\n}) => {\n\tconst [open, setOpen] = useState(false);\n\tconst arrowRef = useRef<HTMLDivElement>(null);\n\n\tconst {\n\t\trefs,\n\t\tfloatingStyles,\n\t\tmiddlewareData,\n\t\tcontext,\n\t\tplacement: computedPlacement,\n\t\tupdate\n\t} = useFloating({\n\t\topen,\n\t\tonOpenChange: setOpen,\n\t\tplacement,\n\t\tmiddleware: [\n\t\t\toffset(8),\n\t\t\tflip({ fallbackAxisSideDirection: \"end\", fallbackPlacements: [\"top\", \"right\", \"bottom\"] }),\n\t\t\tshift({ padding: 8 }),\n\t\t\tarrow({ element: arrowRef, padding: 8 })\n\t\t],\n\t\twhileElementsMounted: autoUpdate\n\t});\n\n\tuseLayoutEffect(() => {\n\t\tif (open) {\n\t\t\tvoid update();\n\t\t}\n\t}, [open, positionUpdateKey, update]);\n\n\tconst hover = useHover(context, {\n\t\tenabled: openOnHover,\n\t\tmove: false,\n\t\tdelay: {\n\t\t\topen: openDelay,\n\t\t\tclose: closeDelay\n\t\t}\n\t});\n\tconst dismiss = useDismiss(context);\n\tconst role = useRole(context);\n\n\tconst { getReferenceProps, getFloatingProps } = useInteractions([hover, dismiss, role]);\n\n\treturn (\n\t\t<>\n\t\t\t<span ref={refs.setReference} {...getReferenceProps()} style={{ lineHeight: 1 }}>\n\t\t\t\t{children}\n\t\t\t</span>\n\n\t\t\t{open &&\n\t\t\t\tcreatePortal(\n\t\t\t\t\t<div\n\t\t\t\t\t\tref={refs.setFloating}\n\t\t\t\t\t\tstyle={{ ...floatingStyles, zIndex: \"var(--z-tooltip)\", maxWidth: maxWidth ? `${maxWidth}em` : undefined }}\n\t\t\t\t\t\t{...getFloatingProps()}\n\t\t\t\t\t\trole=\"tooltip\"\n\t\t\t\t\t\tclassName={cn(styles.tooltipPanel, tooltip && styles.tooltip, state && styles[state])}>\n\t\t\t\t\t\t{content}\n\n\t\t\t\t\t\t<FloatingArrow ref={arrowRef} placement={computedPlacement} middlewareData={middlewareData} />\n\t\t\t\t\t</div>,\n\t\t\t\t\tdocument.body\n\t\t\t\t)}\n\t\t</>\n\t);\n};\n","import React, { useEffect, useRef } from \"react\";\n\nimport { arrow, flip, offset, shift, useFloating } from \"@floating-ui/react\";\n\nimport { FloatingArrow } from \"../floating-arrow/FloatingArrow\";\n\nimport styles from \"./Popover.module.scss\";\n\nexport const FloatingTooltip: React.FC<{\n\tx: number;\n\ty: number;\n\tchildren: React.ReactNode;\n}> = ({ x, y, children }) => {\n\tconst arrowRef = useRef<HTMLDivElement | null>(null);\n\n\tconst {\n\t\trefs,\n\t\tfloatingStyles,\n\t\tmiddlewareData,\n\t\tplacement: computedPlacement\n\t} = useFloating({\n\t\tstrategy: \"absolute\",\n\t\tplacement: \"top\",\n\t\t// eslint-disable-next-line react-hooks/refs\n\t\tmiddleware: [offset(6), flip(), shift({ padding: 16 }), arrow({ element: arrowRef })]\n\t});\n\n\tuseEffect(() => {\n\t\tif (refs.setReference) {\n\t\t\trefs.setReference({\n\t\t\t\tgetBoundingClientRect: () =>\n\t\t\t\t\t({\n\t\t\t\t\t\tx,\n\t\t\t\t\t\ty,\n\t\t\t\t\t\twidth: 0,\n\t\t\t\t\t\theight: 0,\n\t\t\t\t\t\ttop: y,\n\t\t\t\t\t\tleft: x,\n\t\t\t\t\t\tbottom: y,\n\t\t\t\t\t\tright: x,\n\t\t\t\t\t\ttoJSON: () => {}\n\t\t\t\t\t}) as DOMRect\n\t\t\t});\n\t\t}\n\t}, [x, y, refs]);\n\n\treturn (\n\t\t<div ref={refs.setFloating} style={{ ...floatingStyles, position: \"absolute\", pointerEvents: \"none\" }} className={styles.tooltip}>\n\t\t\t{children}\n\n\t\t\t<FloatingArrow ref={arrowRef} placement={computedPlacement} middlewareData={middlewareData} />\n\t\t</div>\n\t);\n};\n"],"mappings":";;;;;;;;;;;;GCea,IAAiB,EAA0C,IAAI;AAE5E,SAAgB,IAAoB;CACnC,IAAM,IAAU,EAAW,CAAc;CACzC,IAAI,CAAC,GACJ,MAAM,EAA0B;EAC/B,UAAU;EACV,cAAc;CACf,CAAC;CAEF,OAAO;AACR;;;ACHA,IAAa,KAAiD,EAC7D,aACA,YACA,oBAAiB,IACjB,mBAAgB,IAChB,yBAAsB,IACtB,gBAAa,kBACR;CACL,IAAM,EAAE,SAAM,YAAS,SAAM,mBAAgB,mBAAgB,cAAW,gBAAa,EAAkB,GACjG,IAAqB,EAA8B,IAAI,GACvD,IAAc,GAClB,MAAgC;EAEhC,AADA,EAAmB,UAAU,GAC7B,EAAK,YAAY,CAAI;CACtB,GACA,CAAC,CAAI,CACN,GAEM,IAAc,EAAgC;EACnD,QAAQ;EACR,cAAc;EACd,cAAc;EACd,cAAc;CACf,CAAC,GAEK,IAAW,QAAkB;EAC7B,MACL,EAAQ,EAAK,GACb,IAAU;CACX,GAAG;EAAC;EAAS;EAAS;CAAI,CAAC;CAE3B,EAAiB;EAChB,QAAQ;EACR,SAAS;EACT,WAAW;EAC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as a, o as ee, r as te, s as ne, t as re } from "./base-table-
|
|
1
|
+
import { a as e, c as t, d as n, i as r, m as i, n as a, o as ee, r as te, s as ne, t as re } from "./base-table-CTafaxo2.js";
|
|
2
2
|
import { useEffect as ie, useEffectEvent as ae, useMemo as o, useRef as s } from "react";
|
|
3
3
|
import { jsx as c } from "react/jsx-runtime";
|
|
4
4
|
import { formatPipelineDisplayValue as l } from "@ryuzaki13/react-foundation-lib/formatters";
|
|
@@ -138,4 +138,4 @@ function m({ title: m, isLoading: h, isFetching: se, data: g, columns: _, select
|
|
|
138
138
|
//#endregion
|
|
139
139
|
export { m as t };
|
|
140
140
|
|
|
141
|
-
//# sourceMappingURL=table-
|
|
141
|
+
//# sourceMappingURL=table-DOwANXnt.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"table-CIWdAcPY.js","names":[],"sources":["../../src/table/Table.module.scss","../../src/table/Table.tsx"],"sourcesContent":[".selectedIndicatorCell {\n\tbox-shadow: inset 0.1875rem 0 0 var(--content-accent);\n}\n\n.sentinel {\n\theight: 1px;\n}\n","/* eslint-disable react-hooks/incompatible-library */\nimport { useEffect, useEffectEvent, useMemo, useRef } from \"react\";\n\nimport { formatPipelineDisplayValue } from \"@ryuzaki13/react-foundation-lib/formatters\";\nimport { TableFormulaRowData } from \"@ryuzaki13/react-foundation-lib/formulas\";\nimport {\n\ttype TableColumnDef,\n\ttype TableColumnOrderState,\n\ttype TableColumnSizingState,\n\ttype TableSelectionMode,\n\tuseTableRowSelection\n} from \"@ryuzaki13/react-foundation-lib/table\";\nimport { getCoreRowModel, useReactTable, type Row, type VisibilityState } from \"@tanstack/react-table\";\n\nimport {\n\tBaseTable,\n\tbuildBaseTableMergedCellsLayout,\n\tbuildTableFormattingSnapshot,\n\tFormattedTableCell,\n\tgetOrderedVisibleLeafColumns,\n\tshouldUseTableFormatting,\n\tuseTableColumnOrder,\n\tuseTableColumnPinning,\n\tuseTableColumnSizing,\n\tuseTableColumnVisibility,\n\ttype BaseTableColumnState,\n\ttype BaseTableProps,\n\ttype TableColumnPinningState\n} from \"../base-table\";\n\nimport styles from \"./Table.module.scss\";\n\n/**\n * Возвращает индекс как строковый id, если внешний id не передан.\n */\nfunction defaultGetRowId<TData>(_row: TData, index: number): string {\n\treturn String(index);\n}\n\n/**\n * Пропсы компонента Table.\n *\n * Компонент предназначен для плоских данных и по API осознанно сближен с TreeTable.\n */\nexport interface TableProps<TData extends object> {\n\t/**\n\t * Необязательный заголовок над таблицей.\n\t */\n\ttitle?: string;\n\t/**\n\t * Признак первичной загрузки.\n\t */\n\tisLoading?: boolean;\n\t/**\n\t * Признак фоновой догрузки или обновления данных.\n\t */\n\tisFetching?: boolean;\n\t/**\n\t * Плоский источник строк.\n\t */\n\tdata: readonly TData[] | undefined | null;\n\t/**\n\t * Описание колонок таблицы.\n\t */\n\tcolumns: readonly TableColumnDef<TData>[];\n\t/**\n\t * Режим выбора строк.\n\t */\n\tselectionMode?: TableSelectionMode;\n\t/**\n\t * Внешний список выбранных строк.\n\t *\n\t * Если передан, таблица синхронизирует визуальное выделение с этим набором id.\n\t */\n\tselectedRowIds?: readonly string[];\n\t/**\n\t * Стабильный идентификатор строки.\n\t *\n\t * Если не задан, используется индекс строки.\n\t */\n\tgetRowId?: (row: TData, index: number) => string;\n\t/**\n\t * Дополнительный CSS-класс корневого контейнера.\n\t */\n\tclassName?: string;\n\tminHeight?: `${number}em` | `${number}%`;\n\t/**\n\t * Дополнительный CSS-класс тега `table`.\n\t */\n\ttableClassName?: string;\n\t/**\n\t * Внешнее controlled-состояние видимости колонок.\n\t */\n\tcolumnVisibility?: VisibilityState;\n\t/**\n\t * Стартовое uncontrolled-состояние видимости колонок.\n\t */\n\tdefaultColumnVisibility?: VisibilityState;\n\t/**\n\t * Внешнее controlled-состояние порядка колонок.\n\t */\n\tcolumnOrder?: readonly string[];\n\t/**\n\t * Стартовое uncontrolled-состояние порядка колонок.\n\t */\n\tdefaultColumnOrder?: readonly string[];\n\t/**\n\t * Внешнее controlled-состояние ширин колонок в px.\n\t */\n\tcolumnSizing?: TableColumnSizingState;\n\t/**\n\t * Стартовое uncontrolled-состояние ширин колонок в px.\n\t */\n\tdefaultColumnSizing?: TableColumnSizingState;\n\t/**\n\t * Внешнее controlled-состояние left-pinning для колонок.\n\t */\n\tcolumnPinning?: TableColumnPinningState;\n\t/**\n\t * Стартовое uncontrolled-состояние left-pinning для колонок.\n\t */\n\tdefaultColumnPinning?: TableColumnPinningState;\n\t/**\n\t * Включает изменение ширины колонок через header-handle.\n\t */\n\tenableColumnResizing?: boolean;\n\t/**\n\t * Включает изменение порядка колонок через drag&drop заголовков.\n\t */\n\tenableColumnReordering?: boolean;\n\t/**\n\t * Минимальная ширина колонки при resize в px.\n\t */\n\tcolumnResizeMinWidth?: number;\n\t/**\n\t * Вызывается после изменения видимости колонок.\n\t */\n\tonColumnVisibilityChange?: (state: VisibilityState) => void;\n\t/**\n\t * Вызывается после изменения порядка колонок.\n\t */\n\tonColumnOrderChange?: (state: TableColumnOrderState) => void;\n\t/**\n\t * Вызывается после изменения ширины колонок.\n\t */\n\tonColumnSizingChange?: (state: TableColumnSizingState) => void;\n\t/**\n\t * Вызывается после изменения left-pinning state.\n\t */\n\tonColumnPinningChange?: (state: TableColumnPinningState) => void;\n\t/**\n\t * Вызывается при активации строки кликом или клавиатурой.\n\t */\n\tonRowClick?: (row: TData) => void;\n\t/**\n\t * Вызывается после изменения выбранных строк.\n\t */\n\tonRowSelectionChange?: (rows: TData[]) => void;\n\t/**\n\t * Вызывается при достижении конца таблицы внутри scroll-контейнера.\n\t */\n\tonReachEnd?: () => void;\n\t/**\n\t * Позволяет запретить выбор отдельных строк.\n\t */\n\tgetRowCanSelect?: (row: TData) => boolean;\n\t/**\n\t * Позволяет добавить CSS-класс для конкретной строки.\n\t */\n\tgetRowClassName?: (row: TData) => string | undefined;\n\t/**\n\t * Контекстное меню заголовка колонки. Используется для общих runtime-действий\n\t * вроде server sorting без встраивания доменной логики в shared-таблицу.\n\t */\n\trenderHeaderContextMenu?: BaseTableProps<TData>[\"renderHeaderContextMenu\"];\n\t/**\n\t * Тонкая точка расширения содержимого ячейки поверх стандартного форматирования.\n\t *\n\t * В отличие от `column.cell`, этот слот не отключает общий formatting-runtime:\n\t * `defaultContent` уже содержит отформатированное значение, если оно применимо.\n\t */\n\trenderCellContent?: BaseTableProps<TData>[\"renderCellContent\"];\n}\n\n/**\n * Плоская таблица на базе TanStack Table как React-альтернатива `sap.m.Table`.\n */\nexport function Table<TData extends object>({\n\ttitle,\n\tisLoading,\n\tisFetching,\n\tdata,\n\tcolumns,\n\tselectionMode = \"none\",\n\tselectedRowIds,\n\tgetRowId,\n\tclassName,\n\tminHeight,\n\ttableClassName,\n\tcolumnVisibility,\n\tdefaultColumnVisibility,\n\tcolumnOrder,\n\tdefaultColumnOrder,\n\tcolumnSizing,\n\tdefaultColumnSizing,\n\tcolumnPinning,\n\tdefaultColumnPinning,\n\tenableColumnResizing = false,\n\tenableColumnReordering = false,\n\tcolumnResizeMinWidth,\n\tonColumnVisibilityChange,\n\tonColumnOrderChange,\n\tonColumnSizingChange,\n\tonColumnPinningChange,\n\tonRowClick,\n\tonRowSelectionChange,\n\tonReachEnd,\n\tgetRowCanSelect,\n\tgetRowClassName,\n\trenderHeaderContextMenu,\n\trenderCellContent\n}: TableProps<TData>) {\n\tconst tableData = useMemo(() => data ?? [], [data]);\n\tconst formattingSnapshot = useMemo(() => buildTableFormattingSnapshot(columns), [columns]);\n\tconst resolveRowId = getRowId ?? defaultGetRowId<TData>;\n\tconst rowById = useMemo(() => new Map(tableData.map((row, index) => [resolveRowId(row, index), row])), [resolveRowId, tableData]);\n\tconst availableRowIds = useMemo(() => Array.from(rowById.keys()), [rowById]);\n\tconst scrollableRef = useRef<HTMLDivElement | null>(null);\n\tconst sentinelRef = useRef<HTMLDivElement | null>(null);\n\n\tconst { rowSelection, activateRowSelection } = useTableRowSelection({\n\t\tavailableRowIds,\n\t\trowById,\n\t\tselectionMode,\n\t\tselectedRowIds,\n\t\tonRowSelectionChange\n\t});\n\tconst { columnVisibility: resolvedColumnVisibility, onColumnVisibilityChange: handleColumnVisibilityChange } = useTableColumnVisibility(\n\t\t{\n\t\t\tcolumnVisibility,\n\t\t\tdefaultColumnVisibility,\n\t\t\tonColumnVisibilityChange\n\t\t}\n\t);\n\tconst { columnOrder: resolvedColumnOrder, onColumnOrderChange: handleColumnOrderChange } = useTableColumnOrder({\n\t\tcolumnOrder,\n\t\tdefaultColumnOrder,\n\t\tonColumnOrderChange\n\t});\n\tconst { columnSizing: resolvedColumnSizing, onColumnSizingChange: handleColumnSizingChange } = useTableColumnSizing({\n\t\tcolumnSizing,\n\t\tdefaultColumnSizing,\n\t\tcolumnResizeMinWidth,\n\t\tonColumnSizingChange\n\t});\n\tconst { columnPinning: resolvedColumnPinning, onColumnPinningChange: handleColumnPinningChange } = useTableColumnPinning({\n\t\tcolumnPinning,\n\t\tdefaultColumnPinning,\n\t\tonColumnPinningChange\n\t});\n\tconst baseTableColumnState = useMemo<BaseTableColumnState>(\n\t\t() => ({\n\t\t\tcolumnOrder: resolvedColumnOrder,\n\t\t\tcolumnPinning: resolvedColumnPinning,\n\t\t\tcolumnSizing: resolvedColumnSizing,\n\t\t\tcolumnVisibility: resolvedColumnVisibility\n\t\t}),\n\t\t[resolvedColumnOrder, resolvedColumnPinning, resolvedColumnSizing, resolvedColumnVisibility]\n\t);\n\n\tconst emitReachEnd = useEffectEvent(() => {\n\t\tonReachEnd?.();\n\t});\n\n\tuseEffect(() => {\n\t\tif (!onReachEnd || !scrollableRef.current || !sentinelRef.current || isLoading) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst observer = new IntersectionObserver(\n\t\t\t(entries) => {\n\t\t\t\tconst entry = entries[0];\n\n\t\t\t\tif (entry?.isIntersecting) {\n\t\t\t\t\temitReachEnd();\n\t\t\t\t}\n\t\t\t},\n\t\t\t{\n\t\t\t\troot: scrollableRef.current,\n\t\t\t\tthreshold: 0.1\n\t\t\t}\n\t\t);\n\n\t\tobserver.observe(sentinelRef.current);\n\n\t\treturn () => observer.disconnect();\n\t}, [isLoading, onReachEnd, tableData.length]);\n\n\tconst table = useReactTable<TData>({\n\t\tdata: tableData as TData[],\n\t\tcolumns: columns as TableColumnDef<TData>[],\n\t\tstate: {\n\t\t\tcolumnOrder: resolvedColumnOrder,\n\t\t\tcolumnPinning: resolvedColumnPinning,\n\t\t\tcolumnSizing: resolvedColumnSizing,\n\t\t\tcolumnVisibility: resolvedColumnVisibility,\n\t\t\trowSelection\n\t\t},\n\t\tonColumnOrderChange: handleColumnOrderChange,\n\t\tonColumnPinningChange: handleColumnPinningChange,\n\t\tonColumnSizingChange: handleColumnSizingChange,\n\t\tonColumnVisibilityChange: handleColumnVisibilityChange,\n\t\tgetRowId: (row, index) => resolveRowId(row, index),\n\t\tgetCoreRowModel: getCoreRowModel(),\n\t\tenableMultiRowSelection: selectionMode === \"multi\",\n\t\tenableRowSelection: (row) => {\n\t\t\tif (selectionMode === \"none\") {\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\treturn getRowCanSelect ? getRowCanSelect(row.original) : true;\n\t\t}\n\t});\n\n\tconst visibleLeafColumns = getOrderedVisibleLeafColumns(table, baseTableColumnState);\n\tconst rowModelRows = table.getRowModel().rows;\n\tconst mergedCellLayout = useMemo(\n\t\t() =>\n\t\t\tbuildBaseTableMergedCellsLayout({\n\t\t\t\trows: rowModelRows,\n\t\t\t\tcolumns: visibleLeafColumns\n\t\t\t}),\n\t\t[rowModelRows, visibleLeafColumns]\n\t);\n\tconst leadingColumnId = visibleLeafColumns[0]?.id;\n\n\t/**\n\t * Активирует строку: обновляет выбор в соответствии с режимом и вызывает внешний callback.\n\t */\n\tconst activateRow = (row: Row<TData>) => {\n\t\tactivateRowSelection(row.id, row.getCanSelect());\n\t\tonRowClick?.(row.original);\n\t};\n\n\treturn (\n\t\t<BaseTable\n\t\t\ttable={table}\n\t\t\tcolumnState={baseTableColumnState}\n\t\t\ttitle={title}\n\t\t\tisLoading={isLoading}\n\t\t\tisFetching={isFetching}\n\t\t\tclassName={className}\n\t\t\tminHeight={minHeight}\n\t\t\ttableClassName={tableClassName}\n\t\t\tselectionMode={selectionMode}\n\t\t\tscrollableRef={scrollableRef}\n\t\t\tonActivateRow={selectionMode !== \"none\" || onRowClick ? activateRow : undefined}\n\t\t\tisRowInteractive={(row) => Boolean(onRowClick || (selectionMode !== \"none\" && row.getCanSelect()))}\n\t\t\tgetRowClassName={(row) => getRowClassName?.(row.original)}\n\t\t\tgetCellClassName={({ row, cell }) =>\n\t\t\t\tcell.column.id === leadingColumnId && row.getIsSelected() ? styles.selectedIndicatorCell : undefined\n\t\t\t}\n\t\t\tgetCellLayout={({ cell }) => mergedCellLayout.get(cell.id)}\n\t\t\trenderHeaderContextMenu={renderHeaderContextMenu}\n\t\t\tenableColumnResizing={enableColumnResizing}\n\t\t\tenableColumnReordering={enableColumnReordering}\n\t\t\tcolumnResizeMinWidth={columnResizeMinWidth}\n\t\t\trenderCellContent={(args) => {\n\t\t\t\tconst displayValue = formatPipelineDisplayValue({\n\t\t\t\t\tfield: formattingSnapshot.runtimeByColumnId[args.cell.column.id],\n\t\t\t\t\trawValue: args.cell.getValue(),\n\t\t\t\t\trowData: args.row.original as TableFormulaRowData,\n\t\t\t\t\trowKind: \"plain\"\n\t\t\t\t});\n\t\t\t\tconst defaultContent = !shouldUseTableFormatting({\n\t\t\t\t\tcolumnId: args.cell.column.id,\n\t\t\t\t\truntimeByColumnId: formattingSnapshot.runtimeByColumnId,\n\t\t\t\t\tcustomCellColumnIds: formattingSnapshot.customCellColumnIds\n\t\t\t\t}) ? (\n\t\t\t\t\targs.defaultContent\n\t\t\t\t) : (\n\t\t\t\t\t<FormattedTableCell displayValue={displayValue} align={args.columnMeta?.align} />\n\t\t\t\t);\n\n\t\t\t\tif (renderCellContent) {\n\t\t\t\t\treturn renderCellContent({\n\t\t\t\t\t\t...args,\n\t\t\t\t\t\tdefaultContent,\n\t\t\t\t\t\tdisplayValue\n\t\t\t\t\t});\n\t\t\t\t}\n\n\t\t\t\treturn defaultContent;\n\t\t\t}}\n\t\t\tafterTableContent={onReachEnd ? <div ref={sentinelRef} className={styles.sentinel} aria-hidden=\"true\" /> : null}\n\t\t/>\n\t);\n}\n"],"mappings":";;;;;;;;;;;;ACmCA,SAAS,GAAuB,GAAa,GAAuB;CACnE,OAAO,OAAO,CAAK;AACpB;AAsJA,SAAgB,EAA4B,EAC3C,UACA,cACA,gBACA,SACA,YACA,mBAAgB,QAChB,oBACA,cACA,eACA,eACA,oBACA,qBACA,4BACA,gBACA,uBACA,iBACA,wBACA,kBACA,yBACA,0BAAuB,IACvB,4BAAyB,IACzB,yBACA,6BACA,wBACA,yBACA,0BACA,eACA,yBACA,eACA,oBACA,oBACA,6BACA,wBACqB;CACrB,IAAM,IAAY,QAAc,KAAQ,CAAC,GAAG,CAAC,CAAI,CAAC,GAC5C,IAAqB,QAAc,EAA6B,CAAO,GAAG,CAAC,CAAO,CAAC,GACnF,IAAe,MAAY,IAC3B,IAAU,QAAc,IAAI,IAAI,EAAU,KAAK,GAAK,MAAU,CAAC,EAAa,GAAK,CAAK,GAAG,CAAG,CAAC,CAAC,GAAG,CAAC,GAAc,CAAS,CAAC,GAC1H,KAAkB,QAAc,MAAM,KAAK,EAAQ,KAAK,CAAC,GAAG,CAAC,CAAO,CAAC,GACrE,IAAgB,EAA8B,IAAI,GAClD,IAAc,EAA8B,IAAI,GAEhD,EAAE,kBAAc,6BAAyB,EAAqB;EACnE;EACA;EACA;EACA;EACA;CACD,CAAC,GACK,EAAE,kBAAkB,GAA0B,0BAA0B,OAAiC,GAC9G;EACC;EACA;EACA;CACD,CACD,GACM,EAAE,aAAa,GAAqB,qBAAqB,OAA4B,GAAoB;EAC9G;EACA;EACA;CACD,CAAC,GACK,EAAE,cAAc,GAAsB,sBAAsB,OAA6B,EAAqB;EACnH;EACA;EACA;EACA;CACD,CAAC,GACK,EAAE,eAAe,GAAuB,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a,EAAI,QAAQ;EAC1B,IAcwE,KAAA;EACtE,mBAAmB,MAAQ,GAAQ,KAAe,MAAkB,UAAU,EAAI,aAAa;EAC/F,kBAAkB,MAAQ,IAAkB,EAAI,QAAQ;EACxD,mBAAmB,EAAE,QAAK,cACzB,EAAK,OAAO,OAAO,MAAmB,EAAI,cAAc,IAAI,EAAO,wBAAwB,KAAA;EAE5F,gBAAgB,EAAE,cAAW,GAAiB,IAAI,EAAK,EAAE;EAChC;EACH;EACE;EACF;EACtB,oBAAoB,MAAS;GAC5B,IAAM,IAAe,EAA2B;IAC/C,OAAO,EAAmB,kBAAkB,EAAK,KAAK,OAAO;IAC7D,UAAU,EAAK,KAAK,SAAS;IAC7B,SAAS,EAAK,IAAI;IAClB,SAAS;GACV,CAAC,GACK,IAAkB,EAAyB;IAChD,UAAU,EAAK,KAAK,OAAO;IAC3B,mBAAmB,EAAmB;IACtC,qBAAqB,EAAmB;GACzC,CAAC,IAGA,kBAAC,IAAD;IAAkC;IAAc,OAAO,EAAK,YAAY;GAAQ,CAAA,IAFhF,EAAK;GAaN,OARI,IACI,EAAkB;IACxB,GAAG;IACH;IACA;GACD,CAAC,IAGK;EACR;EACA,mBAAmB,IAAa,kBAAC,OAAD;GAAK,KAAK;GAAa,WAAW,EAAO;GAAU,eAAY;EAAQ,CAAA,IAAI;CAC3G,CAAA;AAEH"}
|
|
1
|
+
{"version":3,"file":"table-DOwANXnt.js","names":[],"sources":["../../src/table/Table.module.scss","../../src/table/Table.tsx"],"sourcesContent":[".selectedIndicatorCell {\n\tbox-shadow: inset 0.1875rem 0 0 var(--content-accent);\n}\n\n.sentinel {\n\theight: 1px;\n}\n","/* eslint-disable react-hooks/incompatible-library */\nimport { useEffect, useEffectEvent, useMemo, useRef } from \"react\";\n\nimport { formatPipelineDisplayValue } from \"@ryuzaki13/react-foundation-lib/formatters\";\nimport { TableFormulaRowData } from \"@ryuzaki13/react-foundation-lib/formulas\";\nimport {\n\ttype TableColumnDef,\n\ttype TableColumnOrderState,\n\ttype TableColumnSizingState,\n\ttype TableSelectionMode,\n\tuseTableRowSelection\n} from \"@ryuzaki13/react-foundation-lib/table\";\nimport { getCoreRowModel, useReactTable, type Row, type VisibilityState } from \"@tanstack/react-table\";\n\nimport {\n\tBaseTable,\n\tbuildBaseTableMergedCellsLayout,\n\tbuildTableFormattingSnapshot,\n\tFormattedTableCell,\n\tgetOrderedVisibleLeafColumns,\n\tshouldUseTableFormatting,\n\tuseTableColumnOrder,\n\tuseTableColumnPinning,\n\tuseTableColumnSizing,\n\tuseTableColumnVisibility,\n\ttype BaseTableColumnState,\n\ttype BaseTableProps,\n\ttype TableColumnPinningState\n} from \"../base-table\";\n\nimport styles from \"./Table.module.scss\";\n\n/**\n * Возвращает индекс как строковый id, если внешний id не передан.\n */\nfunction defaultGetRowId<TData>(_row: TData, index: number): string {\n\treturn String(index);\n}\n\n/**\n * Пропсы компонента Table.\n *\n * Компонент предназначен для плоских данных и по API осознанно сближен с TreeTable.\n */\nexport interface TableProps<TData extends object> {\n\t/**\n\t * Необязательный заголовок над таблицей.\n\t */\n\ttitle?: string;\n\t/**\n\t * Признак первичной загрузки.\n\t */\n\tisLoading?: boolean;\n\t/**\n\t * Признак фоновой догрузки или обновления данных.\n\t */\n\tisFetching?: boolean;\n\t/**\n\t * Плоский источник строк.\n\t */\n\tdata: readonly TData[] | undefined | null;\n\t/**\n\t * Описание колонок таблицы.\n\t */\n\tcolumns: readonly TableColumnDef<TData>[];\n\t/**\n\t * Режим выбора строк.\n\t */\n\tselectionMode?: TableSelectionMode;\n\t/**\n\t * Внешний список выбранных строк.\n\t *\n\t * Если передан, таблица синхронизирует визуальное выделение с этим набором id.\n\t */\n\tselectedRowIds?: readonly string[];\n\t/**\n\t * Стабильный идентификатор строки.\n\t *\n\t * Если не задан, используется индекс строки.\n\t */\n\tgetRowId?: (row: TData, index: number) => string;\n\t/**\n\t * Дополнительный CSS-класс корневого контейнера.\n\t */\n\tclassName?: string;\n\tminHeight?: `${number}em` | `${number}%`;\n\t/**\n\t * Дополнительный CSS-класс тега `table`.\n\t */\n\ttableClassName?: string;\n\t/**\n\t * Внешнее controlled-состояние видимости колонок.\n\t */\n\tcolumnVisibility?: VisibilityState;\n\t/**\n\t * Стартовое uncontrolled-состояние видимости колонок.\n\t */\n\tdefaultColumnVisibility?: VisibilityState;\n\t/**\n\t * Внешнее controlled-состояние порядка колонок.\n\t */\n\tcolumnOrder?: readonly string[];\n\t/**\n\t * Стартовое uncontrolled-состояние порядка колонок.\n\t */\n\tdefaultColumnOrder?: readonly string[];\n\t/**\n\t * Внешнее controlled-состояние ширин колонок в px.\n\t */\n\tcolumnSizing?: TableColumnSizingState;\n\t/**\n\t * Стартовое uncontrolled-состояние ширин колонок в px.\n\t */\n\tdefaultColumnSizing?: TableColumnSizingState;\n\t/**\n\t * Внешнее controlled-состояние left-pinning для колонок.\n\t */\n\tcolumnPinning?: TableColumnPinningState;\n\t/**\n\t * Стартовое uncontrolled-состояние left-pinning для колонок.\n\t */\n\tdefaultColumnPinning?: TableColumnPinningState;\n\t/**\n\t * Включает изменение ширины колонок через header-handle.\n\t */\n\tenableColumnResizing?: boolean;\n\t/**\n\t * Включает изменение порядка колонок через drag&drop заголовков.\n\t */\n\tenableColumnReordering?: boolean;\n\t/**\n\t * Минимальная ширина колонки при resize в px.\n\t */\n\tcolumnResizeMinWidth?: number;\n\t/**\n\t * Вызывается после изменения видимости колонок.\n\t */\n\tonColumnVisibilityChange?: (state: VisibilityState) => void;\n\t/**\n\t * Вызывается после изменения порядка колонок.\n\t */\n\tonColumnOrderChange?: (state: TableColumnOrderState) => void;\n\t/**\n\t * Вызывается после изменения ширины колонок.\n\t */\n\tonColumnSizingChange?: (state: TableColumnSizingState) => void;\n\t/**\n\t * Вызывается после изменения left-pinning state.\n\t */\n\tonColumnPinningChange?: (state: TableColumnPinningState) => void;\n\t/**\n\t * Вызывается при активации строки кликом или клавиатурой.\n\t */\n\tonRowClick?: (row: TData) => void;\n\t/**\n\t * Вызывается после изменения выбранных строк.\n\t */\n\tonRowSelectionChange?: (rows: TData[]) => void;\n\t/**\n\t * Вызывается при достижении конца таблицы внутри scroll-контейнера.\n\t */\n\tonReachEnd?: () => void;\n\t/**\n\t * Позволяет запретить выбор отдельных строк.\n\t */\n\tgetRowCanSelect?: (row: TData) => boolean;\n\t/**\n\t * Позволяет добавить CSS-класс для конкретной строки.\n\t */\n\tgetRowClassName?: (row: TData) => string | undefined;\n\t/**\n\t * Контекстное меню заголовка колонки. Используется для общих runtime-действий\n\t * вроде server sorting без встраивания доменной логики в shared-таблицу.\n\t */\n\trenderHeaderContextMenu?: BaseTableProps<TData>[\"renderHeaderContextMenu\"];\n\t/**\n\t * Тонкая точка расширения содержимого ячейки поверх стандартного форматирования.\n\t *\n\t * В отличие от `column.cell`, этот слот не отключает общий formatting-runtime:\n\t * `defaultContent` уже содержит отформатированное значение, если оно применимо.\n\t */\n\trenderCellContent?: BaseTableProps<TData>[\"renderCellContent\"];\n}\n\n/**\n * Плоская таблица на базе TanStack Table как React-альтернатива `sap.m.Table`.\n */\nexport function Table<TData extends object>({\n\ttitle,\n\tisLoading,\n\tisFetching,\n\tdata,\n\tcolumns,\n\tselectionMode = \"none\",\n\tselectedRowIds,\n\tgetRowId,\n\tclassName,\n\tminHeight,\n\ttableClassName,\n\tcolumnVisibility,\n\tdefaultColumnVisibility,\n\tcolumnOrder,\n\tdefaultColumnOrder,\n\tcolumnSizing,\n\tdefaultColumnSizing,\n\tcolumnPinning,\n\tdefaultColumnPinning,\n\tenableColumnResizing = false,\n\tenableColumnReordering = false,\n\tcolumnResizeMinWidth,\n\tonColumnVisibilityChange,\n\tonColumnOrderChange,\n\tonColumnSizingChange,\n\tonColumnPinningChange,\n\tonRowClick,\n\tonRowSelectionChange,\n\tonReachEnd,\n\tgetRowCanSelect,\n\tgetRowClassName,\n\trenderHeaderContextMenu,\n\trenderCellContent\n}: TableProps<TData>) {\n\tconst tableData = useMemo(() => data ?? [], [data]);\n\tconst formattingSnapshot = useMemo(() => buildTableFormattingSnapshot(columns), [columns]);\n\tconst resolveRowId = getRowId ?? defaultGetRowId<TData>;\n\tconst rowById = useMemo(() => new Map(tableData.map((row, index) => [resolveRowId(row, index), row])), [resolveRowId, tableData]);\n\tconst availableRowIds = useMemo(() => Array.from(rowById.keys()), [rowById]);\n\tconst scrollableRef = useRef<HTMLDivElement | null>(null);\n\tconst sentinelRef = useRef<HTMLDivElement | null>(null);\n\n\tconst { rowSelection, activateRowSelection } = useTableRowSelection({\n\t\tavailableRowIds,\n\t\trowById,\n\t\tselectionMode,\n\t\tselectedRowIds,\n\t\tonRowSelectionChange\n\t});\n\tconst { columnVisibility: resolvedColumnVisibility, onColumnVisibilityChange: handleColumnVisibilityChange } = useTableColumnVisibility(\n\t\t{\n\t\t\tcolumnVisibility,\n\t\t\tdefaultColumnVisibility,\n\t\t\tonColumnVisibilityChange\n\t\t}\n\t);\n\tconst { columnOrder: resolvedColumnOrder, onColumnOrderChange: handleColumnOrderChange } = useTableColumnOrder({\n\t\tcolumnOrder,\n\t\tdefaultColumnOrder,\n\t\tonColumnOrderChange\n\t});\n\tconst { columnSizing: resolvedColumnSizing, onColumnSizingChange: handleColumnSizingChange } = useTableColumnSizing({\n\t\tcolumnSizing,\n\t\tdefaultColumnSizing,\n\t\tcolumnResizeMinWidth,\n\t\tonColumnSizingChange\n\t});\n\tconst { columnPinning: resolvedColumnPinning, onColumnPinningChange: handleColumnPinningChange } = useTableColumnPinning({\n\t\tcolumnPinning,\n\t\tdefaultColumnPinning,\n\t\tonColumnPinningChange\n\t});\n\tconst baseTableColumnState = useMemo<BaseTableColumnState>(\n\t\t() => ({\n\t\t\tcolumnOrder: resolvedColumnOrder,\n\t\t\tcolumnPinning: resolvedColumnPinning,\n\t\t\tcolumnSizing: resolvedColumnSizing,\n\t\t\tcolumnVisibility: resolvedColumnVisibility\n\t\t}),\n\t\t[resolvedColumnOrder, resolvedColumnPinning, resolvedColumnSizing, resolvedColumnVisibility]\n\t);\n\n\tconst emitReachEnd = useEffectEvent(() => {\n\t\tonReachEnd?.();\n\t});\n\n\tuseEffect(() => {\n\t\tif (!onReachEnd || !scrollableRef.current || !sentinelRef.current || isLoading) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst observer = new IntersectionObserver(\n\t\t\t(entries) => {\n\t\t\t\tconst entry = entries[0];\n\n\t\t\t\tif (entry?.isIntersecting) {\n\t\t\t\t\temitReachEnd();\n\t\t\t\t}\n\t\t\t},\n\t\t\t{\n\t\t\t\troot: scrollableRef.current,\n\t\t\t\tthreshold: 0.1\n\t\t\t}\n\t\t);\n\n\t\tobserver.observe(sentinelRef.current);\n\n\t\treturn () => observer.disconnect();\n\t}, [isLoading, onReachEnd, tableData.length]);\n\n\tconst table = useReactTable<TData>({\n\t\tdata: tableData as TData[],\n\t\tcolumns: columns as TableColumnDef<TData>[],\n\t\tstate: {\n\t\t\tcolumnOrder: resolvedColumnOrder,\n\t\t\tcolumnPinning: resolvedColumnPinning,\n\t\t\tcolumnSizing: resolvedColumnSizing,\n\t\t\tcolumnVisibility: resolvedColumnVisibility,\n\t\t\trowSelection\n\t\t},\n\t\tonColumnOrderChange: handleColumnOrderChange,\n\t\tonColumnPinningChange: handleColumnPinningChange,\n\t\tonColumnSizingChange: handleColumnSizingChange,\n\t\tonColumnVisibilityChange: handleColumnVisibilityChange,\n\t\tgetRowId: (row, index) => resolveRowId(row, index),\n\t\tgetCoreRowModel: getCoreRowModel(),\n\t\tenableMultiRowSelection: selectionMode === \"multi\",\n\t\tenableRowSelection: (row) => {\n\t\t\tif (selectionMode === \"none\") {\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\treturn getRowCanSelect ? getRowCanSelect(row.original) : true;\n\t\t}\n\t});\n\n\tconst visibleLeafColumns = getOrderedVisibleLeafColumns(table, baseTableColumnState);\n\tconst rowModelRows = table.getRowModel().rows;\n\tconst mergedCellLayout = useMemo(\n\t\t() =>\n\t\t\tbuildBaseTableMergedCellsLayout({\n\t\t\t\trows: rowModelRows,\n\t\t\t\tcolumns: visibleLeafColumns\n\t\t\t}),\n\t\t[rowModelRows, visibleLeafColumns]\n\t);\n\tconst leadingColumnId = visibleLeafColumns[0]?.id;\n\n\t/**\n\t * Активирует строку: обновляет выбор в соответствии с режимом и вызывает внешний callback.\n\t */\n\tconst activateRow = (row: Row<TData>) => {\n\t\tactivateRowSelection(row.id, row.getCanSelect());\n\t\tonRowClick?.(row.original);\n\t};\n\n\treturn (\n\t\t<BaseTable\n\t\t\ttable={table}\n\t\t\tcolumnState={baseTableColumnState}\n\t\t\ttitle={title}\n\t\t\tisLoading={isLoading}\n\t\t\tisFetching={isFetching}\n\t\t\tclassName={className}\n\t\t\tminHeight={minHeight}\n\t\t\ttableClassName={tableClassName}\n\t\t\tselectionMode={selectionMode}\n\t\t\tscrollableRef={scrollableRef}\n\t\t\tonActivateRow={selectionMode !== \"none\" || onRowClick ? activateRow : undefined}\n\t\t\tisRowInteractive={(row) => Boolean(onRowClick || (selectionMode !== \"none\" && row.getCanSelect()))}\n\t\t\tgetRowClassName={(row) => getRowClassName?.(row.original)}\n\t\t\tgetCellClassName={({ row, cell }) =>\n\t\t\t\tcell.column.id === leadingColumnId && row.getIsSelected() ? styles.selectedIndicatorCell : undefined\n\t\t\t}\n\t\t\tgetCellLayout={({ cell }) => mergedCellLayout.get(cell.id)}\n\t\t\trenderHeaderContextMenu={renderHeaderContextMenu}\n\t\t\tenableColumnResizing={enableColumnResizing}\n\t\t\tenableColumnReordering={enableColumnReordering}\n\t\t\tcolumnResizeMinWidth={columnResizeMinWidth}\n\t\t\trenderCellContent={(args) => {\n\t\t\t\tconst displayValue = formatPipelineDisplayValue({\n\t\t\t\t\tfield: formattingSnapshot.runtimeByColumnId[args.cell.column.id],\n\t\t\t\t\trawValue: args.cell.getValue(),\n\t\t\t\t\trowData: args.row.original as TableFormulaRowData,\n\t\t\t\t\trowKind: \"plain\"\n\t\t\t\t});\n\t\t\t\tconst defaultContent = !shouldUseTableFormatting({\n\t\t\t\t\tcolumnId: args.cell.column.id,\n\t\t\t\t\truntimeByColumnId: formattingSnapshot.runtimeByColumnId,\n\t\t\t\t\tcustomCellColumnIds: formattingSnapshot.customCellColumnIds\n\t\t\t\t}) ? (\n\t\t\t\t\targs.defaultContent\n\t\t\t\t) : (\n\t\t\t\t\t<FormattedTableCell displayValue={displayValue} align={args.columnMeta?.align} />\n\t\t\t\t);\n\n\t\t\t\tif (renderCellContent) {\n\t\t\t\t\treturn renderCellContent({\n\t\t\t\t\t\t...args,\n\t\t\t\t\t\tdefaultContent,\n\t\t\t\t\t\tdisplayValue\n\t\t\t\t\t});\n\t\t\t\t}\n\n\t\t\t\treturn defaultContent;\n\t\t\t}}\n\t\t\tafterTableContent={onReachEnd ? <div ref={sentinelRef} className={styles.sentinel} aria-hidden=\"true\" /> : null}\n\t\t/>\n\t);\n}\n"],"mappings":";;;;;;;;;;;;ACmCA,SAAS,GAAuB,GAAa,GAAuB;CACnE,OAAO,OAAO,CAAK;AACpB;AAsJA,SAAgB,EAA4B,EAC3C,UACA,cACA,gBACA,SACA,YACA,mBAAgB,QAChB,oBACA,cACA,eACA,eACA,oBACA,qBACA,4BACA,gBACA,uBACA,iBACA,wBACA,kBACA,yBACA,0BAAuB,IACvB,4BAAyB,IACzB,yBACA,6BACA,wBACA,yBACA,0BACA,eACA,yBACA,eACA,oBACA,oBACA,6BACA,wBACqB;CACrB,IAAM,IAAY,QAAc,KAAQ,CAAC,GAAG,CAAC,CAAI,CAAC,GAC5C,IAAqB,QAAc,EAA6B,CAAO,GAAG,CAAC,CAAO,CAAC,GACnF,IAAe,MAAY,IAC3B,IAAU,QAAc,IAAI,IAAI,EAAU,KAAK,GAAK,MAAU,CAAC,EAAa,GAAK,CAAK,GAAG,CAAG,CAAC,CAAC,GAAG,CAAC,GAAc,CAAS,CAAC,GAC1H,KAAkB,QAAc,MAAM,KAAK,EAAQ,KAAK,CAAC,GAAG,CAAC,CAAO,CAAC,GACrE,IAAgB,EAA8B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 -1,3 +1,3 @@
|
|
|
1
|
-
import { a as e, c as t, i as n, n as r, o as i, r as a, s as o, t as s } from "../chunks/CalendarView-
|
|
2
|
-
import { a as c, c as l, d as u, f as d, h as f, i as p, l as m, m as h, n as g, o as _, p as v, r as y, s as b, t as x, u as S } from "../chunks/date-input-
|
|
1
|
+
import { a as e, c as t, i as n, n as r, o as i, r as a, s as o, t as s } from "../chunks/CalendarView-DGElHRTJ.js";
|
|
2
|
+
import { a as c, c as l, d as u, f as d, h as f, i as p, l as m, m as h, n as g, o as _, p as v, r as y, s as b, t as x, u as S } from "../chunks/date-input-BbsvnayB.js";
|
|
3
3
|
export { s as CalendarView, r as DATE_INPUT_SELECTION_MODES, a as DATE_INPUT_WEEK_END_DAYS, n as DATE_PICKER_LEVELS, y as DEFAULT_DATE_INPUT_FORMAT, p as DEFAULT_DATE_INPUT_PRESET, x as RangeDateInput, g as SingleDateInput, c as areRangeDateValuesEqual, _ as areSingleDateValuesEqual, b as formatDateInputValue, l as formatRangeDateValue, m as formatSingleDateValue, e as getDatePickerLevelForSelectionMode, i as isDatePickerLevelAvailable, S as normalizeRangeDateValue, u as normalizeRangeEndDateValue, d as normalizeSingleDateValue, v as parseRangeDateValue, h as parseRangeEndDateValue, f as parseSingleDateValue, o as resolveAvailableDatePickerLevel, t as resolveDateInputPeriodRangeState };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { r as e } from "../chunks/popover-
|
|
1
|
+
import { r as e } from "../chunks/popover-IztNF45J.js";
|
|
2
2
|
import { t } from "../chunks/ui.module-DHVTOqZ0.js";
|
|
3
3
|
import { c as n, i as r, u as i } from "../chunks/input-D3u9BYWD.js";
|
|
4
|
-
import { t as a } from "../chunks/CalendarView-
|
|
4
|
+
import { t as a } from "../chunks/CalendarView-DGElHRTJ.js";
|
|
5
5
|
import { t as o } from "../chunks/wheel-picker-FS58cRsQ.js";
|
|
6
6
|
import { useCallback as s, useMemo as c, useRef as l, useState as u } from "react";
|
|
7
7
|
import { cn as d } from "@ryuzaki13/react-foundation-lib/utils";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { n as e } from "../chunks/button-
|
|
2
|
-
import { l as t } from "../chunks/misc-
|
|
1
|
+
import { n as e } from "../chunks/button-BsvHGWPc.js";
|
|
2
|
+
import { l as t } from "../chunks/misc-aGQBhywJ.js";
|
|
3
3
|
import { useCallback as n, useId as r, useState as i } from "react";
|
|
4
4
|
import { cn as a } from "@ryuzaki13/react-foundation-lib/utils";
|
|
5
5
|
import { jsx as o, jsxs as s } from "react/jsx-runtime";
|
package/dist/image/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { n as e } from "../chunks/button-
|
|
1
|
+
import { n as e } from "../chunks/button-BsvHGWPc.js";
|
|
2
2
|
import { r as t } from "../chunks/grid-dI94AAbi.js";
|
|
3
|
-
import { i as n, n as r, r as i } from "../chunks/modal-
|
|
3
|
+
import { i as n, n as r, r as i } from "../chunks/modal-DLRYn-Lr.js";
|
|
4
4
|
import { s as a } from "../chunks/input-D3u9BYWD.js";
|
|
5
5
|
import { t as o } from "../chunks/input-files-D7iu_1n5.js";
|
|
6
6
|
import { Suspense as s, lazy as c, useCallback as l, useEffect as u, useMemo as d, useRef as f, useState as p } from "react";
|
package/dist/list/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { c as e, h as t } from "../chunks/misc-
|
|
1
|
+
import { c as e, h as t } from "../chunks/misc-aGQBhywJ.js";
|
|
2
2
|
import { t as n } from "../chunks/grid-dI94AAbi.js";
|
|
3
3
|
import r, { Children as i, useLayoutEffect as a, useReducer as o, useRef as s, useState as c } from "react";
|
|
4
4
|
import { cn as l } from "@ryuzaki13/react-foundation-lib/utils";
|
package/dist/misc/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { _ as e, a as t, b as n, c as r, d as i, f as a, g as o, h as s, i as c, l, m as u, n as d, o as f, p, r as m, s as h, t as g, u as _, v, y } from "../chunks/misc-
|
|
1
|
+
import { _ as e, a as t, b as n, c as r, d as i, f as a, g as o, h as s, i as c, l, m as u, n as d, o as f, p, r as m, s as h, t as g, u as _, v, y } from "../chunks/misc-aGQBhywJ.js";
|
|
2
2
|
export { n as AnimatedLogo, y as AnimatedLogoSegment, v as CopyTextWrapper, d as ErrorIcon, e as IconWrapper, m as InformationIcon, u as LazyDynamicComponent, a as LazyValue, s as LoadingMessage, o as Message, i as NoData, _ as Notice, l as OneStepScroller, c as RenderStateIcon, r as Scrollable, p as SkeletonLine, t as StateIcon, g as StateWrapper, f as SuccessIcon, h as WarningIcon };
|
package/dist/modal/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { a as e, i as t, n, o as r, r as i, s as a, t as o } from "../chunks/modal-
|
|
1
|
+
import { a as e, i as t, n, o as r, r as i, s as a, t as o } from "../chunks/modal-DLRYn-Lr.js";
|
|
2
2
|
export { n as Modal, i as ModalContent, t as ModalFooter, r as ModalManagerContext, o as ModalManagerProvider, e as ModalToolbar, a as useModalManager };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { n as e } from "../chunks/button-
|
|
1
|
+
import { n as e } from "../chunks/button-BsvHGWPc.js";
|
|
2
2
|
import { o as t } from "../chunks/flex-C7njxZ74.js";
|
|
3
3
|
import { createContext as n, useContext as r, useEffect as i, useMemo as a } from "react";
|
|
4
4
|
import { cn as o } from "@ryuzaki13/react-foundation-lib/utils";
|
package/dist/popover/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { a as e, i as t, n, o as r, r as i, t as a } from "../chunks/popover-
|
|
1
|
+
import { a as e, i as t, n, o as r, r as i, t as a } from "../chunks/popover-IztNF45J.js";
|
|
2
2
|
export { n as FloatingPopover, a as FloatingTooltip, i as Popover, e as PopoverContent, t as PopoverTrigger, r as usePopoverContext };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { o as e } from "../chunks/flex-C7njxZ74.js";
|
|
2
|
-
import { t } from "../chunks/date-input-
|
|
2
|
+
import { t } from "../chunks/date-input-BbsvnayB.js";
|
|
3
3
|
import { c as n, l as r, r as i, s as a, t as o, u as s } from "../chunks/date-range-preset-select-BLnY47cv.js";
|
|
4
4
|
import { useCallback as c, useMemo as l, useRef as u, useState as d } from "react";
|
|
5
5
|
import { jsx as f, jsxs as p } from "react/jsx-runtime";
|
package/dist/slider/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { n as e, r as t } from "../chunks/popover-
|
|
1
|
+
import { n as e, r as t } from "../chunks/popover-IztNF45J.js";
|
|
2
2
|
import { t as n } from "../chunks/ui.module-DHVTOqZ0.js";
|
|
3
3
|
import { c as r, i, s as a, u as o } from "../chunks/input-D3u9BYWD.js";
|
|
4
4
|
import { l as s } from "../chunks/picker-lpH_xp14.js";
|