@ryuzaki13/react-foundation-ui 1.8.6 → 1.8.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/chunks/date-input-g6l1iDmf.js.map +1 -1
- package/package.json +4 -4
- package/storybook-static/assets/{Badge-CV8uR5lW.js → Badge-C4U4sxtF.js} +1 -1
- package/storybook-static/assets/{Badge.stories-DqTFDEB6.js → Badge.stories-DHmJTpdf.js} +1 -1
- package/storybook-static/assets/{BadgeList-CVWvhSS7.js → BadgeList-BOs5ycWn.js} +1 -1
- package/storybook-static/assets/{Button-C5Z6nJ9s.js → Button-BTtYeCS_.js} +1 -1
- package/storybook-static/assets/{Button-DtySOeyD.js → Button-Bkb3wQw6.js} +1 -1
- package/storybook-static/assets/{Button.stories--Wr67DaY.js → Button.stories-DgFLAdcg.js} +1 -1
- package/storybook-static/assets/{CalendarView-ZzqQ8UIe.js → CalendarView-BIFHbOTr.js} +1 -1
- package/storybook-static/assets/{CheckBox-BfNP6vO6.js → CheckBox-76M-N56J.js} +1 -1
- package/storybook-static/assets/{CheckBox-BBNTe4u8.js → CheckBox-D4u-58g8.js} +1 -1
- package/storybook-static/assets/{CheckBox.module-CoYygdZx.js → CheckBox.module-BOAVN-Ny.js} +1 -1
- package/storybook-static/assets/{CheckBox.stories-B4Sv2TXp.js → CheckBox.stories-Caw6-hSQ.js} +1 -1
- package/storybook-static/assets/{Color-6AOWCN3U-Ce5w8Y2l.js → Color-6AOWCN3U-CPYGaU3y.js} +1 -1
- package/storybook-static/assets/{ContextMenu-D-lV53Zc.js → ContextMenu-CUWt-eg1.js} +1 -1
- package/storybook-static/assets/{ContextMenu-Boi0R7-s.js → ContextMenu-gfYYiVdR.js} +1 -1
- package/storybook-static/assets/{ContextMenu.stories-D_rxDbLk.js → ContextMenu.stories-BuQS57wW.js} +1 -1
- package/storybook-static/assets/{CustomOptionButton-VYfjUfhW.js → CustomOptionButton-Be7sd0Lb.js} +1 -1
- package/storybook-static/assets/{DateInput-f-RcBdOb.js → DateInput-B4oviF7J.js} +1 -1
- package/storybook-static/assets/{DateInput-q2hPsJcH.js → DateInput-BQGUMYsW.js} +1 -1
- package/storybook-static/assets/{DateInput.stories-zQzjIsfx.js → DateInput.stories-D6q7J1C4.js} +1 -1
- package/storybook-static/assets/{DateRangePresetSelect-DQBOF8f5.js → DateRangePresetSelect-BAxaG0HP.js} +1 -1
- package/storybook-static/assets/{DateRangePresetSelect-Ciikik1_.js → DateRangePresetSelect-Cq6pOZPu.js} +1 -1
- package/storybook-static/assets/{DateRangePresetSelect.stories-BF8IP5Ep.js → DateRangePresetSelect.stories-d4HFbao6.js} +1 -1
- package/storybook-static/assets/{Detail-CEl8URNQ.js → Detail-DlETcWVp.js} +1 -1
- package/storybook-static/assets/{Detail.stories-Mr3ypLAA.js → Detail.stories-BEwFXEZH.js} +1 -1
- package/storybook-static/assets/{Dialog-Dj2y3EO1.js → Dialog-Bk8aoiOf.js} +1 -1
- package/storybook-static/assets/{Dialog-BydPFV17.js → Dialog-D63TJr1M.js} +1 -1
- package/storybook-static/assets/{Dialog.stories-C1WlZdyp.js → Dialog.stories-BR7NqeZj.js} +1 -1
- package/storybook-static/assets/{Disclosure-DH77E5hY.js → Disclosure-zQK54WKU.js} +1 -1
- package/storybook-static/assets/{Disclosure.stories-B9ZVczUX.js → Disclosure.stories-CNLpB5YJ.js} +1 -1
- package/storybook-static/assets/{DisclosureGroup-CIoFeosY.js → DisclosureGroup-C_nZSLZw.js} +1 -1
- package/storybook-static/assets/{DocsRenderer-JROSPFPF-CbJN3X6f.js → DocsRenderer-JROSPFPF-CoU8mWAw.js} +2 -2
- package/storybook-static/assets/{DropZone-CR7xRn_b.js → DropZone-CUz1Q4bA.js} +1 -1
- package/storybook-static/assets/{DropZone-DTBV-X-J.js → DropZone-Y5hvED_x.js} +1 -1
- package/storybook-static/assets/{DropZone.stories-Cw_og1Cs.js → DropZone.stories-BH4FSM4P.js} +1 -1
- package/storybook-static/assets/{DropdownMenu-CVIeHT8N.js → DropdownMenu-Bi6-5Gqf.js} +1 -1
- package/storybook-static/assets/{ExpandableActionPanel-D8U6v8X7.js → ExpandableActionPanel-BfWj887r.js} +1 -1
- package/storybook-static/assets/{ExpandableActionPanel.stories-D42CZyOc.js → ExpandableActionPanel.stories-CGxcwRMU.js} +1 -1
- package/storybook-static/assets/{Flex-Bcsl0U5O.js → Flex-Dm-Qfvzk.js} +1 -1
- package/storybook-static/assets/{Flex.stories-C0vSa3mh.js → Flex.stories-B3zMz03s.js} +1 -1
- package/storybook-static/assets/{FlexContainer-LmZIdhq2.js → FlexContainer-BWyPlTMB.js} +1 -1
- package/storybook-static/assets/{FlexItem-vkDYa5tA.js → FlexItem-pu3E11Sf.js} +1 -1
- package/storybook-static/assets/{FloatingPopover-DvU3oc_q.js → FloatingPopover-NMRTnqfo.js} +1 -1
- package/storybook-static/assets/FormattedTableCell-BISjHrBJ.js +15 -0
- package/storybook-static/assets/{Grid-BCzygAqy.js → Grid-CzO0Ae1r.js} +1 -1
- package/storybook-static/assets/{Grid-Wl0Y0YAh.js → Grid-vZyA-712.js} +1 -1
- package/storybook-static/assets/{Grid.stories-G6gMmKCP.js → Grid.stories-BQqK0zom.js} +1 -1
- package/storybook-static/assets/{GridContainer-qDguE1HS.js → GridContainer-fKYgDsLl.js} +1 -1
- package/storybook-static/assets/{ImageCropper.stories-u6rOvDbd.js → ImageCropper.stories-Ca4MZWOW.js} +3 -3
- package/storybook-static/assets/{ImageRenderer-BYIRHN5G.js → ImageRenderer-BWIk_76e.js} +1 -1
- package/storybook-static/assets/{ImageRenderer.stories-BMEHEIVH.js → ImageRenderer.stories-C1FfOcFD.js} +1 -1
- package/storybook-static/assets/{ImageView.stories-DiEA93Yz.js → ImageView.stories-DyuR7kdq.js} +1 -1
- package/storybook-static/assets/{ImageViewer.stories-DyxctGxM.js → ImageViewer.stories-PcvOFYqC.js} +2 -2
- package/storybook-static/assets/{ImageViewerRuntime--h_3C2s0.js → ImageViewerRuntime-BiI7Xukq.js} +2 -2
- package/storybook-static/assets/{Input-CViRQ_rj.js → Input-CsD-x1BQ.js} +1 -1
- package/storybook-static/assets/{Input-B2kOwWOU.js → Input-D_4GoCLl.js} +1 -1
- package/storybook-static/assets/{Input.stories-D9eo9MWc.js → Input.stories-D-1urO1N.js} +1 -1
- package/storybook-static/assets/{InputDateTime-T9_iyG4G.js → InputDateTime-CFQanHxB.js} +1 -1
- package/storybook-static/assets/{InputDateTime.stories-DzegljaN.js → InputDateTime.stories-Q4Ao5Tat.js} +1 -1
- package/storybook-static/assets/{InputFile-CA3YpXnm.js → InputFile-Bj8PXGY3.js} +1 -1
- package/storybook-static/assets/{InputFile-Cvdj6RfC.js → InputFile-DM6fBXUx.js} +1 -1
- package/storybook-static/assets/{InputFile.stories-C18UaXPS.js → InputFile.stories-DC27BYoQ.js} +1 -1
- package/storybook-static/assets/{InputFiles-nS_qsXY7.js → InputFiles-D59MGS0Z.js} +1 -1
- package/storybook-static/assets/{InputFiles-C4OkTG9M.js → InputFiles-teFj6f6X.js} +1 -1
- package/storybook-static/assets/{InputFiles.stories-BYd0Pe0R.js → InputFiles.stories-DX5UEvYR.js} +1 -1
- package/storybook-static/assets/{InputFilesList-CXPf7Ui_.js → InputFilesList-BD4Y0gN-.js} +1 -1
- package/storybook-static/assets/{InputImage-kd50L1Gf.js → InputImage-DmsFGNLJ.js} +1 -1
- package/storybook-static/assets/{InputImage-jDVIxP7S.js → InputImage-Du6jGDmY.js} +1 -1
- package/storybook-static/assets/{InputImage.stories-D-xmS4Qj.js → InputImage.stories-u0hrr-Da.js} +1 -1
- package/storybook-static/assets/{InteractiveComponents-D13nzSK7.js → InteractiveComponents-BLQiSO3p.js} +1 -1
- package/storybook-static/assets/{InteractiveComponents.stories-yITzDh-Y.js → InteractiveComponents.stories-BxIVvRz5.js} +1 -1
- package/storybook-static/assets/{LayoutPicker-BfYXGIKb.js → LayoutPicker-TecE4x6w.js} +1 -1
- package/storybook-static/assets/{LayoutPicker-9FVo0bF3.js → LayoutPicker-xUooYcbS.js} +1 -1
- package/storybook-static/assets/{LayoutPicker.stories-B-UnuGFM.js → LayoutPicker.stories-YDMnmhJ4.js} +1 -1
- package/storybook-static/assets/{Listbox-9LVlsDzw.js → Listbox-D2k8QfTs.js} +1 -1
- package/storybook-static/assets/{Listbox-C53-i-L6.js → Listbox-DplAn6ND.js} +1 -1
- package/storybook-static/assets/{Listbox.stories-CCN72ABE.js → Listbox.stories-Bg3_UQD4.js} +1 -1
- package/storybook-static/assets/{Modal-CoXpuByh.js → Modal-4OdkCwCv.js} +1 -1
- package/storybook-static/assets/{Modal.stories-DAj_oPSt.js → Modal.stories-BwawDSGR.js} +1 -1
- package/storybook-static/assets/{ModalManagerProvider-C7pGT0B3.js → ModalManagerProvider-CYR_xbpx.js} +1 -1
- package/storybook-static/assets/{MultiSelect-DqeGNK15.js → MultiSelect-CXn1CY9G.js} +1 -1
- package/storybook-static/assets/{MultiSelect-DZ2krz-D.js → MultiSelect-iwbCRD9H.js} +1 -1
- package/storybook-static/assets/{MultiSelect.stories-BoVHXMbn.js → MultiSelect.stories-BSjAL2ua.js} +1 -1
- package/storybook-static/assets/{NoData-N6Pbu0LD.js → NoData-6Scjk2OD.js} +1 -1
- package/storybook-static/assets/{NotificationsHost--uPz1G3j.js → NotificationsHost-DK3A-iq7.js} +1 -1
- package/storybook-static/assets/{NotificationsHost.stories-B-X-Ljxs.js → NotificationsHost.stories-BRmPf9Q7.js} +1 -1
- package/storybook-static/assets/{ODataMultiSelect-7U6nJdqB.js → ODataMultiSelect-CuNGV1QU.js} +1 -1
- package/storybook-static/assets/{ODataMultiSelect.stories-B-t6MsOr.js → ODataMultiSelect.stories-CyAonfZC.js} +1 -1
- package/storybook-static/assets/{ODataSelect-Dy-fSgE6.js → ODataSelect-vhh4NJS_.js} +1 -1
- package/storybook-static/assets/{ODataSelect.stories-DhqHtcmD.js → ODataSelect.stories-aJBFF45H.js} +1 -1
- package/storybook-static/assets/{ODataTreeMultiSelect-Ol0nuytU.js → ODataTreeMultiSelect-vPtlTloF.js} +1 -1
- package/storybook-static/assets/{ODataTreeMultiSelect.stories-BupVzhbY.js → ODataTreeMultiSelect.stories-DTBAF628.js} +1 -1
- package/storybook-static/assets/{ODataTreeSelect-EkpDmDyk.js → ODataTreeSelect-BCVVLB9M.js} +1 -1
- package/storybook-static/assets/{ODataTreeSelect.stories-CFdbwyEg.js → ODataTreeSelect.stories-CptC0p6O.js} +1 -1
- package/storybook-static/assets/{OneStepScroller-rmyPl9f5.js → OneStepScroller-DerjCiL3.js} +1 -1
- package/storybook-static/assets/{Option-72PrSDkj.js → Option-DkAw9S3l.js} +1 -1
- package/storybook-static/assets/{OptionButton-Br8QoJL7.js → OptionButton-CGurT23Z.js} +1 -1
- package/storybook-static/assets/{PeriodSelect-C5Xk-g4Y.js → PeriodSelect-DOO139ke.js} +1 -1
- package/storybook-static/assets/{PeriodSelect-DEZVGWGR.js → PeriodSelect-TrGTMIid.js} +1 -1
- package/storybook-static/assets/{PeriodSelect.stories-BVBP97HW.js → PeriodSelect.stories-B3GEgBZ1.js} +1 -1
- package/storybook-static/assets/{PickerTriggerActions-DSmRHX1I.js → PickerTriggerActions-CKVPuKEC.js} +1 -1
- package/storybook-static/assets/{Popover-BpbeIq6-.js → Popover-BNItmUQ9.js} +1 -1
- package/storybook-static/assets/{Popover-1KQwBxEJ.js → Popover-DgXqO0PN.js} +1 -1
- package/storybook-static/assets/{Popover.stories-6RDZ0TND.js → Popover.stories-bX5S41pH.js} +1 -1
- package/storybook-static/assets/{PresetRangeDateInput-BdkKzY69.js → PresetRangeDateInput-B4FYPy8g.js} +1 -1
- package/storybook-static/assets/{PresetRangeDateInput-CDhgmyFs.js → PresetRangeDateInput-GSnnpZzy.js} +1 -1
- package/storybook-static/assets/{PresetRangeDateInput.stories-BoE41IUK.js → PresetRangeDateInput.stories-Ca0mIo33.js} +1 -1
- package/storybook-static/assets/{PresetSelect-CA5AyOOy.js → PresetSelect-B_KRl4SQ.js} +1 -1
- package/storybook-static/assets/README-1RIcD7RV.js +694 -0
- package/storybook-static/assets/README-B1XUsXZj.js +334 -0
- package/storybook-static/assets/README-BH78sIZ_.js +288 -0
- package/storybook-static/assets/README-BgeYwR6t.js +347 -0
- package/storybook-static/assets/README-BhsUMTSk.js +860 -0
- package/storybook-static/assets/README-Bj88Ecb7.js +876 -0
- package/storybook-static/assets/README-C9saKIyr.js +417 -0
- package/storybook-static/assets/README-CP1S4LYF.js +1309 -0
- package/storybook-static/assets/README-Cc-guFb0.js +1487 -0
- package/storybook-static/assets/README-CheO0E1A.js +282 -0
- package/storybook-static/assets/README-CiuVVUgE.js +420 -0
- package/storybook-static/assets/README-CvRg9lqh.js +273 -0
- package/storybook-static/assets/README-DCdV2RQL.js +1093 -0
- package/storybook-static/assets/README-DyNQqotW.js +338 -0
- package/storybook-static/assets/README-W1rhe8Sk.js +648 -0
- package/storybook-static/assets/{RadioButton-IDzSzftl.js → RadioButton-CA9DN5bY.js} +1 -1
- package/storybook-static/assets/{RadioButton-DCoo55ld.js → RadioButton-DcXbcFW1.js} +1 -1
- package/storybook-static/assets/{RadioButton.stories-BEk1uc2x.js → RadioButton.stories-1_kzxnXY.js} +1 -1
- package/storybook-static/assets/{RadioGroup-CbBmuFtC.js → RadioGroup-bEwTHCyS.js} +1 -1
- package/storybook-static/assets/{RadioGroup-VSiqFUI1.js → RadioGroup-mfYgdfXM.js} +1 -1
- package/storybook-static/assets/{RadioGroup.stories-DR7Vskyy.js → RadioGroup.stories-CecdqPms.js} +1 -1
- package/storybook-static/assets/{Scrollable-CDZ18AWy.js → Scrollable-1fdTDJHK.js} +1 -1
- package/storybook-static/assets/{Select-IWQpo0LQ.js → Select-CvQZGS1G.js} +1 -1
- package/storybook-static/assets/{Select-YjugVUKX.js → Select-Df5Md2Cm.js} +1 -1
- package/storybook-static/assets/{Select.stories-4JpnXfaB.js → Select.stories-M4M80KTq.js} +1 -1
- package/storybook-static/assets/{SerializableSelect-oxnbV26a.js → SerializableSelect-CnsGo9Ep.js} +1 -1
- package/storybook-static/assets/{SerializableSelect.stories-CjVcuU4t.js → SerializableSelect.stories-BJ6MlNDx.js} +1 -1
- package/storybook-static/assets/{SingleDateTimeInput-DFPke7bv.js → SingleDateTimeInput-BCV0gfB9.js} +1 -1
- package/storybook-static/assets/{SingleDateTimeInput-CQ1_ABKA.js → SingleDateTimeInput-DJH7zSIz.js} +1 -1
- package/storybook-static/assets/{SingleDateTimeInput.stories--Nky_yBh.js → SingleDateTimeInput.stories-DgEwAFe8.js} +1 -1
- package/storybook-static/assets/{Slider-DGVl0dbV.js → Slider-D504FPH3.js} +1 -1
- package/storybook-static/assets/{Slider-L7pqW7xG.js → Slider-cLRAHPLi.js} +1 -1
- package/storybook-static/assets/{Slider.stories-DkqUavTk.js → Slider.stories-EI314Iff.js} +1 -1
- package/storybook-static/assets/{SliderInput-B7U8M2UN.js → SliderInput-Bt0H8rgN.js} +1 -1
- package/storybook-static/assets/{SliderInput-Dn5-Dt4w.js → SliderInput-E5p3n3VY.js} +1 -1
- package/storybook-static/assets/{SliderInput.stories-B9WBQOiA.js → SliderInput.stories-CDYPq7fP.js} +1 -1
- package/storybook-static/assets/{Sortable-DxdXjG1a.js → Sortable-Bzd7JK4E.js} +1 -1
- package/storybook-static/assets/{Sortable.stories-D1rp2l9M.js → Sortable.stories-DNGbmn2a.js} +1 -1
- package/storybook-static/assets/{Splitter-yZpkev96.js → Splitter-DSf48AOW.js} +1 -1
- package/storybook-static/assets/{Splitter.stories-C3TCKNhu.js → Splitter.stories-DUKsOqNN.js} +1 -1
- package/storybook-static/assets/{StateSelect-DZjPblfU.js → StateSelect-BxuKIsLa.js} +1 -1
- package/storybook-static/assets/{StateSelect-CaAFL9Jr.js → StateSelect-HKOT6kq9.js} +1 -1
- package/storybook-static/assets/{StateSelect.stories-D7EwT0sO.js → StateSelect.stories-CbLvq7ou.js} +1 -1
- package/storybook-static/assets/{StringToggle.stories-DuaWy2LK.js → StringToggle.stories-DOKL-aWy.js} +1 -1
- package/storybook-static/assets/{Switch-C0GQ2oXw.js → Switch-CLAfhk73.js} +1 -1
- package/storybook-static/assets/{Switch-DCNQT47U.js → Switch-CVTjSEq1.js} +1 -1
- package/storybook-static/assets/{Switch.stories-CAIEfQb6.js → Switch.stories-CL5Xe_HQ.js} +1 -1
- package/storybook-static/assets/{Table-Be1uta4G.js → Table-DKc19RME.js} +1 -1
- package/storybook-static/assets/Table.stories-CJ9DR1S-.js +207 -0
- package/storybook-static/assets/{Tabs-Co7Z92UK.js → Tabs-De_4F0H3.js} +1 -1
- package/storybook-static/assets/{Tabs.stories-D84U8aJM.js → Tabs.stories-DPAvvkh9.js} +2 -2
- package/storybook-static/assets/{TabsBox-CUpOXGdh.js → TabsBox-Cy5CICcb.js} +1 -1
- package/storybook-static/assets/{TagInput-BbLK6uxZ.js → TagInput-7n98ftvD.js} +1 -1
- package/storybook-static/assets/{TagInput.stories-D34JCfyM.js → TagInput.stories-B6JAb3XA.js} +1 -1
- package/storybook-static/assets/{Text-DtJw3wMU.js → Text-CjSG8mvD.js} +1 -1
- package/storybook-static/assets/{Textarea-Cz6RWJdh.js → Textarea-CQqwaJ0Q.js} +1 -1
- package/storybook-static/assets/{Textarea-C9MWeqLC.js → Textarea-Dea29_yQ.js} +1 -1
- package/storybook-static/assets/{Textarea.stories-DqK16XGS.js → Textarea.stories-BZf3Cu4S.js} +1 -1
- package/storybook-static/assets/{TimePanel-DcZ-UUgO.js → TimePanel-CPZ4jOw2.js} +1 -1
- package/storybook-static/assets/{TimePanel.stories-BafOmX3I.js → TimePanel.stories-y5Lp9sMG.js} +1 -1
- package/storybook-static/assets/{Toggle-CgU6o7qM.js → Toggle-CJHzo9mB.js} +1 -1
- package/storybook-static/assets/{Toggle-oYTkCbEJ.js → Toggle-s7SzQ11W.js} +1 -1
- package/storybook-static/assets/{Toggle.stories-CbmOBWIu.js → Toggle.stories-Dk3C5Le5.js} +1 -1
- package/storybook-static/assets/{TreeMultiSelect-B4WfXc4Z.js → TreeMultiSelect-CxXF7pQE.js} +1 -1
- package/storybook-static/assets/{TreeMultiSelect-DN_CYg-F.js → TreeMultiSelect-DfeggvLr.js} +1 -1
- package/storybook-static/assets/{TreeMultiSelect.stories-DYVj6Rm6.js → TreeMultiSelect.stories-DKiHT_6L.js} +1 -1
- package/storybook-static/assets/{TreePickerBase-8gA_hIXn.js → TreePickerBase-DKJJDVC_.js} +1 -1
- package/storybook-static/assets/{TreeSelect-CTtmHF-B.js → TreeSelect-2E1KhJMi.js} +1 -1
- package/storybook-static/assets/{TreeSelect-2bjYl5ox.js → TreeSelect-h23orAoA.js} +1 -1
- package/storybook-static/assets/{TreeSelect.stories-BEAY61pJ.js → TreeSelect.stories-DO06yaS0.js} +1 -1
- package/storybook-static/assets/{TreeTable-B4BaHybr.js → TreeTable-ByV2_E0S.js} +1 -1
- package/storybook-static/assets/{TreeTable.stories-lLwH2Gzl.js → TreeTable.stories-D4gbQx59.js} +2 -2
- package/storybook-static/assets/{WithTooltip-7X4HQR7L-Cakt_JaX.js → WithTooltip-7X4HQR7L-DQ4Qthn2.js} +1 -1
- package/storybook-static/assets/{array-D-_yMMUK-CIRmlF93.js → array-D-_yMMUK-BQ0uu1hZ.js} +1 -1
- package/storybook-static/assets/{async-DFALSYBD.js → async-BI7SlYp0.js} +1 -1
- package/storybook-static/assets/axe-_9eNhXQJ.js +20 -0
- package/storybook-static/assets/{blocks-Dr191OF5.js → blocks-B8F5vBhs.js} +6 -6
- package/storybook-static/assets/check-mlY_aVEI.js +1 -0
- package/storybook-static/assets/chevron-down-C7c-TcEc.js +1 -0
- package/storybook-static/assets/chevron-left-2LrGBhDY.js +1 -0
- package/storybook-static/assets/chevron-right-D6NN1_UQ.js +1 -0
- package/storybook-static/assets/{chunk-242VQQM5-BMWWiybC.js → chunk-242VQQM5-bHL6qIJq.js} +1 -1
- package/storybook-static/assets/{chunk-DRQKCCAG-CqE-Zrl9.js → chunk-DRQKCCAG-DvsmU7ha.js} +1 -1
- package/storybook-static/assets/{chunk-IMSF75WX-yvVUwIQZ.js → chunk-IMSF75WX-CGYlPTyG.js} +1 -1
- package/storybook-static/assets/{chunk-KJHJLCBK-D-yQfkOi.js → chunk-KJHJLCBK-yRlRMfNs.js} +1 -1
- package/storybook-static/assets/{chunk-QQBDHPVZ-B98qboss.js → chunk-QQBDHPVZ-DC5n6Pix.js} +1 -1
- package/storybook-static/assets/{chunk-W22LQPXL-BR_vFDlt.js → chunk-W22LQPXL-5sD3hVeE.js} +1 -1
- package/storybook-static/assets/{circle-alert-Is-jAV5H.js → circle-alert-H_7GSXFp.js} +1 -1
- package/storybook-static/assets/circle-check-B0voRIBT.js +1 -0
- package/storybook-static/assets/{components-DqFIc_sf.js → components-Bw-2TeQP.js} +12 -12
- package/storybook-static/assets/{contextMenu-CWKJO78E.js → contextMenu-B8JusItT.js} +1 -1
- package/storybook-static/assets/{createControlledStoryRender-DHsyXc1B.js → createControlledStoryRender-BouhvX-R.js} +1 -1
- package/storybook-static/assets/{date-segments-D3HouZ37.js → date-segments-DeoMkKv9.js} +1 -1
- package/storybook-static/assets/{defaultRenderers-V5HI39JH.js → defaultRenderers-BHXboKuy.js} +1 -1
- package/storybook-static/assets/{dom-B3G_GtJw.js → dom-DBd_DWF8.js} +1 -1
- package/storybook-static/assets/{download-B61X2hm8.js → download-CSY7aIz0.js} +1 -1
- package/storybook-static/assets/{error-BZrNlEUO.js → error-De9R4E_F.js} +1 -1
- package/storybook-static/assets/{file-vPGnhPr-.js → file-CwRoWxeB.js} +1 -1
- package/storybook-static/assets/floating-ui.react-D7RwPYeO.js +1 -0
- package/storybook-static/assets/formatter-L2YTDE3Q-CRGuSxAF.js +1 -0
- package/storybook-static/assets/{formatters-CBgrBeSA-DY6OIAc8.js → formatters-CBgrBeSA-CqB1pZxS.js} +1 -1
- package/storybook-static/assets/{foundationLib-10USAmEi.js → foundationLib-BoYGVeXe.js} +1 -1
- package/storybook-static/assets/{hooks-C8GJ9Cvf.js → hooks-DQXvhAPr.js} +2 -2
- package/storybook-static/assets/iframe-B8PAuhnL.js +1 -0
- package/storybook-static/assets/{iframe-Bu7ux79g.js → iframe-CViB2sFm.js} +23 -23
- package/storybook-static/assets/{info-CnuHFdaB.js → info-MrQcS8jn.js} +1 -1
- package/storybook-static/assets/{matchers-JIUQ3HVY-DvR2XErZ.js → matchers-JIUQ3HVY-C789_MAK.js} +1 -1
- package/storybook-static/assets/{media-BycWpjAl.js → media-D9cE2tzi.js} +1 -1
- package/storybook-static/assets/odata-CBGaUmRT.js +1 -0
- package/storybook-static/assets/{odata-service-B6TxBSLm-BW9QLSrS.js → odata-service-B6TxBSLm-Bq8Ya67E.js} +1 -1
- package/storybook-static/assets/{odataFetchFn-CAzdQ6ar.js → odataFetchFn-CPO8XIYX.js} +1 -1
- package/storybook-static/assets/{odataStoryFixtures-CX6euJaD.js → odataStoryFixtures--SWu2yC_.js} +2 -2
- package/storybook-static/assets/{persisted-BKBboERB.js → persisted-B2dfNRCz.js} +1 -1
- package/storybook-static/assets/{preload-helper-BHmFeTtP.js → preload-helper-wdlQj8DP.js} +1 -1
- package/storybook-static/assets/react-18-D4o7zN8K.js +9 -0
- package/storybook-static/assets/{react-C21x__mS.js → react-BZJXY1be.js} +1 -1
- package/storybook-static/assets/{react-qN2cStNd.js → react-Bl2r1tuC.js} +1 -1
- package/storybook-static/assets/{react-CvkUhHUq.js → react-GkniIHEK.js} +1 -1
- package/storybook-static/assets/{react-dom-2o2phaJG.js → react-dom-BzEl8usk.js} +1 -1
- package/storybook-static/assets/react-iQQwtFPL.js +9 -0
- package/storybook-static/assets/{refresh-cw-ByNiehPJ.js → refresh-cw-_wTFfhR2.js} +1 -1
- package/storybook-static/assets/{rolldown-runtime-C0FnF6B9.js → rolldown-runtime-DkW27tQK.js} +1 -1
- package/storybook-static/assets/{settings-2-BGG8WBgX.js → settings-2-BqduNJjJ.js} +1 -1
- package/storybook-static/assets/{shim-BUMlC1GG.js → shim-DlYORV19.js} +1 -1
- package/storybook-static/assets/{sortable-6C6S-hq-.js → sortable-D-m6SEp7.js} +1 -1
- package/storybook-static/assets/syntaxhighlighter-QEQV7K2Y-CEo9I1qZ.js +6 -0
- package/storybook-static/assets/{theming-mTWhffkp.js → theming-Cvtrnj7n.js} +1 -1
- package/storybook-static/assets/{trash-2-EYPGQg68.js → trash-2-65ZF92zp.js} +1 -1
- package/storybook-static/assets/{treeStoryFixtures-Ci7STpiz.js → treeStoryFixtures-DXHh9GL3.js} +1 -1
- package/storybook-static/assets/{triangle-alert-qcSLqRkW.js → triangle-alert-k_CRNi0k.js} +1 -1
- package/storybook-static/assets/{ui.module-D4CuGr8r.js → ui.module-Cat84Nza.js} +1 -1
- package/storybook-static/assets/{uiClasses-CVGbL980.js → uiClasses-B9c6dZuu.js} +1 -1
- package/storybook-static/assets/{useFlexClasses-Gn9spXEB.js → useFlexClasses-SgVG37Bb.js} +1 -1
- package/storybook-static/assets/{useODataSelectBase-LQU24QnI.js → useODataSelectBase-Ck_hduYv.js} +1 -1
- package/storybook-static/assets/{useODataTreeData-0I485gNf.js → useODataTreeData-DTrxPY_k.js} +1 -1
- package/storybook-static/assets/usePickerDefaultFilter-5Q1pAV4d.js +1 -0
- package/storybook-static/assets/{usePickerQuery-B0a5nSeM.js → usePickerQuery-DdeWtJWc.js} +1 -1
- package/storybook-static/assets/{usePickerTriggerController-DMRm063p.js → usePickerTriggerController-D8hxWmGo.js} +1 -1
- package/storybook-static/assets/{utils-DUM89eIj.js → utils-tg3ibbzi.js} +1 -1
- package/storybook-static/assets/x-C5XG0bD4.js +1 -0
- package/storybook-static/iframe.html +7 -7
- package/storybook-static/index.json +1 -1
- package/storybook-static/project.json +1 -1
- package/storybook-static/sb-addons/chromatic-com-storybook-1/manager-bundle.js +35 -33
- package/storybook-static/sb-manager/globals-runtime.js +7 -7
- package/storybook-static/sb-manager/globals.js +1 -1
- package/storybook-static/sb-manager/runtime.js +88 -89
- package/storybook-static/vite-inject-mocker-entry.js +2 -2
- package/storybook-static/assets/FormattedTableCell-CGREP0wz.js +0 -15
- package/storybook-static/assets/Table.stories-ByUJbaZl.js +0 -207
- package/storybook-static/assets/axe-Bq-2xuso.js +0 -20
- package/storybook-static/assets/browserAndReact-BDUP5jYY.js +0 -70
- package/storybook-static/assets/check-D56EYchd.js +0 -1
- package/storybook-static/assets/chevron-down-CzEzTRkp.js +0 -1
- package/storybook-static/assets/chevron-left-Dl69q13G.js +0 -1
- package/storybook-static/assets/chevron-right-CJNjsAmt.js +0 -1
- package/storybook-static/assets/circle-check-6tyIZ3Kl.js +0 -1
- package/storybook-static/assets/filesAndExcel-Bs3kqlsI.js +0 -92
- package/storybook-static/assets/floating-ui.react-bhmHzD7p.js +0 -1
- package/storybook-static/assets/formatter-L2YTDE3Q-x0raBH34.js +0 -1
- package/storybook-static/assets/formatters-NGPd1d-h.js +0 -202
- package/storybook-static/assets/formatters-runtime-CCfGWt-f.js +0 -329
- package/storybook-static/assets/iframe-BEvUkaBB.js +0 -1
- package/storybook-static/assets/odata-BslPtJet.js +0 -1
- package/storybook-static/assets/odataAndTables-Cyl3UJOz.js +0 -77
- package/storybook-static/assets/pureUtilities-Bj6GraNW.js +0 -30
- package/storybook-static/assets/react-18-CgkwBzTo.js +0 -9
- package/storybook-static/assets/react-CjYyitxm.js +0 -9
- package/storybook-static/assets/runtimeAndState-mq-BaPyx.js +0 -93
- package/storybook-static/assets/syntaxhighlighter-T5IQBZDB-B5rzfkHU.js +0 -6
- package/storybook-static/assets/usePickerDefaultFilter-Be420WNF.js +0 -1
- package/storybook-static/assets/x-FZLq51ZK.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"date-input-g6l1iDmf.js","names":[],"sources":["../../src/date-input/lib/dateInputValue.ts","../../src/date-input/model/useDateInput.ts","../../src/date-input/ui/DateInput.module.scss","../../src/date-input/ui/DateInput.tsx"],"sourcesContent":["import {\n\tDEFAULT_DATE_PRESET_NAMES,\n\tformatDate,\n\tformatDateRange,\n\tgetCalendarPeriod,\n\tgetDatePreset,\n\tisDateRangeTuple,\n\tparseDateByFormat,\n\tresolveDateFormatName,\n\ttype CalendarPeriodOptions,\n\ttype DateFormatPrecision,\n\ttype DateRangeInput,\n\ttype NullableDateRange\n} from \"@ryuzaki13/react-foundation-lib/formatters\";\n\n/**\n * Пресет даты по умолчанию для текстового поля.\n */\nexport const DEFAULT_DATE_INPUT_PRESET = DEFAULT_DATE_PRESET_NAMES.date;\n\n/**\n * @deprecated Используйте `DEFAULT_DATE_INPUT_PRESET`.\n */\nexport const DEFAULT_DATE_INPUT_FORMAT = \"dd.MM.yyyy\";\n\nconst RANGE_SEPARATOR = \" - \";\n\nexport type DateInputValueOptions = {\n\t/**\n\t * Имя пресета форматирования даты.\n\t */\n\tdatePreset?: string;\n\t/**\n\t * Точность календарного значения.\n\t */\n\tdatePickerLevel?: DateFormatPrecision;\n\t/**\n\t * Размер периода, который выбирается и нормализуется полем.\n\t */\n\tselectionMode?: CalendarPeriodOptions[\"selectionMode\"];\n\t/**\n\t * Последний включённый день недели для режима выбора недели.\n\t */\n\tweekEndDay?: CalendarPeriodOptions[\"weekEndDay\"];\n\t/**\n\t * Опорная дата для пресетов без года, например `month-long`.\n\t */\n\treferenceDate?: Date;\n};\n\nexport type DateInputValueOptionsInput = string | DateInputValueOptions | undefined;\n\n/**\n * Возвращает точность форматирования поля даты.\n */\nfunction resolveDateInputPrecision(options: DateInputValueOptions): DateFormatPrecision {\n\tif (options.selectionMode === \"day\" || options.selectionMode === \"week\") {\n\t\treturn \"day\";\n\t}\n\n\tif (options.selectionMode === \"month\" || options.selectionMode === \"year\") {\n\t\treturn options.selectionMode;\n\t}\n\n\treturn options.datePickerLevel ?? \"day\";\n}\n\nfunction resolveCalendarPeriodOptions(options?: DateInputValueOptions): CalendarPeriodOptions {\n\treturn {\n\t\tselectionMode: options?.selectionMode,\n\t\tweekEndDay: options?.weekEndDay\n\t};\n}\n\n/**\n * Нормализует объектные опции и позиционный вызов с именем пресета.\n */\nfunction normalizeDateInputValueOptions(\n\toptionsOrPreset?: DateInputValueOptionsInput,\n\tdatePickerLevel?: DateFormatPrecision\n): DateInputValueOptions {\n\tif (typeof optionsOrPreset === \"string\" || optionsOrPreset === undefined) {\n\t\treturn {\n\t\t\tdatePreset: optionsOrPreset,\n\t\t\tdatePickerLevel\n\t\t};\n\t}\n\n\tif (datePickerLevel && optionsOrPreset.datePickerLevel === undefined) {\n\t\treturn {\n\t\t\t...optionsOrPreset,\n\t\t\tdatePickerLevel\n\t\t};\n\t}\n\n\treturn optionsOrPreset;\n}\n\n/**\n * Проверяет новый `datePreset` и возвращает только зарегистрированное имя пресета.\n */\nfunction resolveDateInputPresetName(datePreset?: string): string {\n\tconst resolvedPresetName = resolveDateFormatName(datePreset, DEFAULT_DATE_INPUT_PRESET);\n\treturn getDatePreset(resolvedPresetName) ? resolvedPresetName : DEFAULT_DATE_INPUT_PRESET;\n}\n\n/**\n * Приводит результат универсального парсинга к календарной дате.\n */\nfunction parseDateTimeValue(value: string, options: DateInputValueOptions): Date | null {\n\treturn (\n\t\tparseDateByFormat(value, resolveDateInputPresetName(options.datePreset), {\n\t\t\tdefaultFormat: DEFAULT_DATE_INPUT_PRESET,\n\t\t\tprecision: resolveDateInputPrecision(options),\n\t\t\treferenceDate: options.referenceDate\n\t\t})?.date ?? null\n\t);\n}\n\n/**\n * Приводит одиночную дату к началу выбранного календарного периода.\n */\nexport function normalizeSingleDateValue(date: Date | null, options?: DateInputValueOptions): Date | null {\n\treturn getCalendarPeriod(date, resolveCalendarPeriodOptions(options))?.start ?? null;\n}\n\n/**\n * Приводит диапазон дат к границам выбранных календарных периодов.\n */\nexport function normalizeRangeDateValue(range: NullableDateRange | null, options?: DateInputValueOptions): NullableDateRange | null {\n\tif (!isDateRangeTuple(range)) return null;\n\n\tconst [startDate, endDate] = range;\n\treturn [normalizeSingleDateValue(startDate, options), normalizeRangeEndDateValue(endDate, options)];\n}\n\n/**\n * Приводит конечную дату диапазона к концу выбранного календарного периода.\n */\nexport function normalizeRangeEndDateValue(date: Date | null, options?: DateInputValueOptions): Date | null {\n\treturn getCalendarPeriod(date, resolveCalendarPeriodOptions(options))?.end ?? null;\n}\n\nfunction getDateTime(date: Date | null): number | null {\n\treturn date?.getTime() ?? null;\n}\n\n/**\n * Сравнивает одиночные даты после нормализации к точности поля ввода.\n */\nexport function areSingleDateValuesEqual(left: Date | null, right: Date | null, options?: DateInputValueOptions): boolean {\n\treturn getDateTime(normalizeSingleDateValue(left, options)) === getDateTime(normalizeSingleDateValue(right, options));\n}\n\n/**\n * Сравнивает диапазоны дат после нормализации к границам выбранных периодов.\n */\nexport function areRangeDateValuesEqual(\n\tleft: NullableDateRange | null,\n\tright: NullableDateRange | null,\n\toptions?: DateInputValueOptions\n): boolean {\n\tconst normalizedLeft = normalizeRangeDateValue(left, options);\n\tconst normalizedRight = normalizeRangeDateValue(right, options);\n\n\treturn (\n\t\tgetDateTime(normalizedLeft?.[0] ?? null) === getDateTime(normalizedRight?.[0] ?? null) &&\n\t\tgetDateTime(normalizedLeft?.[1] ?? null) === getDateTime(normalizedRight?.[1] ?? null)\n\t);\n}\n\n/**\n * Форматирует одиночную дату для текстового поля.\n */\nexport function formatSingleDateValue(\n\tdate: Date | null,\n\toptionsOrPreset?: DateInputValueOptionsInput,\n\tdatePickerLevel?: DateFormatPrecision\n): string {\n\tif (!date) return \"\";\n\n\tconst options = normalizeDateInputValueOptions(optionsOrPreset, datePickerLevel);\n\tconst period = getCalendarPeriod(date, resolveCalendarPeriodOptions(options));\n\n\t// Single-поле хранит начало недели, но показывает обе включительные границы выбранного периода.\n\tif (options.selectionMode === \"week\" && period) {\n\t\treturn formatDateRange(period.start, period.end, resolveDateInputPresetName(options.datePreset), {\n\t\t\tprecision: resolveDateInputPrecision(options)\n\t\t});\n\t}\n\n\treturn formatDate(date, resolveDateInputPresetName(options.datePreset), {\n\t\tprecision: resolveDateInputPrecision(options)\n\t});\n}\n\n/**\n * Форматирует диапазон дат для текстового поля.\n */\nexport function formatRangeDateValue(\n\trange: NullableDateRange | null,\n\toptionsOrPreset?: DateInputValueOptionsInput,\n\tdatePickerLevel?: DateFormatPrecision\n): string {\n\tif (!isDateRangeTuple(range)) return \"\";\n\n\tconst options = normalizeDateInputValueOptions(optionsOrPreset, datePickerLevel);\n\tconst [startDate, endDate] = range;\n\tif (startDate && endDate) {\n\t\treturn formatDateRange(startDate, endDate, resolveDateInputPresetName(options.datePreset), {\n\t\t\tprecision: resolveDateInputPrecision(options)\n\t\t});\n\t}\n\n\tif (startDate) {\n\t\treturn `${formatDate(startDate, resolveDateInputPresetName(options.datePreset), {\n\t\t\tprecision: resolveDateInputPrecision(options)\n\t\t})}${RANGE_SEPARATOR}`;\n\t}\n\n\treturn \"\";\n}\n\n/**\n * Унифицирует форматирование значения поля даты.\n */\nexport function formatDateInputValue(\n\tvalue: DateRangeInput,\n\toptionsOrPreset?: DateInputValueOptionsInput,\n\tdatePickerLevel?: DateFormatPrecision\n): string {\n\tif (isDateRangeTuple(value)) {\n\t\treturn formatRangeDateValue(value, optionsOrPreset, datePickerLevel);\n\t}\n\n\treturn formatSingleDateValue(value, optionsOrPreset, datePickerLevel);\n}\n\n/**\n * Парсит строку одиночной даты по заданному пресету.\n */\nexport function parseSingleDateValue(\n\tvalue: string,\n\toptionsOrPreset?: DateInputValueOptionsInput,\n\tdatePickerLevel?: DateFormatPrecision\n): Date | null {\n\tconst options = normalizeDateInputValueOptions(optionsOrPreset, datePickerLevel);\n\t// Для отображаемого диапазона single-week источником значения остаётся его первая граница.\n\tconst singleValue = options.selectionMode === \"week\" ? (value.split(RANGE_SEPARATOR)[0] ?? \"\") : value;\n\n\treturn normalizeSingleDateValue(parseDateTimeValue(singleValue, options), options);\n}\n\n/**\n * Парсит строку диапазона дат по заданному пресету.\n */\nexport function parseRangeDateValue(\n\tvalue: string,\n\toptionsOrPreset?: DateInputValueOptionsInput,\n\tdatePickerLevel?: DateFormatPrecision\n): NullableDateRange {\n\tconst options = normalizeDateInputValueOptions(optionsOrPreset, datePickerLevel);\n\tconst [startPart = \"\", endPart = \"\"] = value.split(RANGE_SEPARATOR);\n\n\treturn [parseSingleDateValue(startPart, options), parseRangeEndDateValue(endPart, options)];\n}\n\n/**\n * Парсит конечную дату диапазона и нормализует её к концу суток.\n */\nexport function parseRangeEndDateValue(\n\tvalue: string,\n\toptionsOrPreset?: DateInputValueOptionsInput,\n\tdatePickerLevel?: DateFormatPrecision\n): Date | null {\n\tconst options = normalizeDateInputValueOptions(optionsOrPreset, datePickerLevel);\n\treturn normalizeRangeEndDateValue(parseDateTimeValue(value, options), options);\n}\n","import { useMemo, useState } from \"react\";\n\nimport { isDateRangeTuple, type NullableDateRange } from \"@ryuzaki13/react-foundation-lib/formatters\";\n\nimport {\n\tDateInputValueOptions,\n\tformatDateInputValue,\n\tnormalizeRangeDateValue,\n\tnormalizeRangeEndDateValue,\n\tnormalizeSingleDateValue,\n\tparseRangeDateValue,\n\tparseSingleDateValue,\n\ttype DateInputOptions\n} from \"../lib\";\n\nfunction resolveReferenceDate(value: Date | NullableDateRange | null): Date | undefined {\n\tif (isDateRangeTuple(value)) {\n\t\treturn value[0] ?? value[1] ?? undefined;\n\t}\n\n\treturn value ?? undefined;\n}\n\n/**\n * Хук управляет текстовым представлением и выбранным значением поля даты.\n */\nexport const useDateInput = (options: DateInputOptions) => {\n\tconst externalSelectedDate = useMemo(() => {\n\t\tconst selectionOptions: DateInputValueOptions = {\n\t\t\tselectionMode: options.selectionMode,\n\t\t\tweekEndDay: options.weekEndDay\n\t\t};\n\n\t\tif (options.selectsRange) {\n\t\t\treturn normalizeRangeDateValue(options.value as NullableDateRange | null, selectionOptions);\n\t\t}\n\n\t\treturn normalizeSingleDateValue(options.value as Date | null, selectionOptions);\n\t}, [options.selectsRange, options.selectionMode, options.value, options.weekEndDay]);\n\tconst formatOptions = useMemo<DateInputValueOptions>(\n\t\t() => ({\n\t\t\tdatePreset: options.datePreset,\n\t\t\tdatePickerLevel: options.datePickerLevel,\n\t\t\tselectionMode: options.selectionMode,\n\t\t\tweekEndDay: options.weekEndDay\n\t\t}),\n\t\t[options.datePickerLevel, options.datePreset, options.selectionMode, options.weekEndDay]\n\t);\n\tconst externalInputValue = formatDateInputValue(externalSelectedDate, formatOptions);\n\tconst externalStateSignature = JSON.stringify([\n\t\toptions.selectsRange,\n\t\toptions.datePreset ?? null,\n\t\toptions.datePickerLevel ?? null,\n\t\toptions.selectionMode ?? null,\n\t\toptions.weekEndDay ?? null,\n\t\tisDateRangeTuple(externalSelectedDate)\n\t\t\t? [externalSelectedDate[0]?.getTime() ?? null, externalSelectedDate[1]?.getTime() ?? null]\n\t\t\t: (externalSelectedDate?.getTime() ?? null)\n\t]);\n\tconst [draftState, setDraftState] = useState(() => ({\n\t\tsourceSignature: externalStateSignature,\n\t\tselectedDate: externalSelectedDate,\n\t\tinputValue: externalInputValue\n\t}));\n\tconst hasCurrentDraft = draftState.sourceSignature === externalStateSignature;\n\tconst selectedDate = hasCurrentDraft ? draftState.selectedDate : externalSelectedDate;\n\tconst inputValue = hasCurrentDraft ? draftState.inputValue : externalInputValue;\n\n\t/**\n\t * Сохраняет пользовательский текст только относительно текущего controlled-снимка.\n\t * При внешней смене value или формата отображение сразу выводится из новых props.\n\t */\n\tconst setInputValue = (nextInputValue: string) => {\n\t\tsetDraftState((currentState) => {\n\t\t\tconst currentSelectedDate =\n\t\t\t\tcurrentState.sourceSignature === externalStateSignature ? currentState.selectedDate : externalSelectedDate;\n\n\t\t\treturn {\n\t\t\t\tsourceSignature: externalStateSignature,\n\t\t\t\tselectedDate: currentSelectedDate,\n\t\t\t\tinputValue: nextInputValue\n\t\t\t};\n\t\t});\n\t};\n\n\t/**\n\t * Обновляет локальный незавершённый выбор, не зеркаля controlled value через effect.\n\t */\n\tconst setSelectedDate = (nextSelectedDate: Date | NullableDateRange | null) => {\n\t\tsetDraftState((currentState) => {\n\t\t\tconst currentInputValue =\n\t\t\t\tcurrentState.sourceSignature === externalStateSignature ? currentState.inputValue : externalInputValue;\n\n\t\t\treturn {\n\t\t\t\tsourceSignature: externalStateSignature,\n\t\t\t\tselectedDate: nextSelectedDate,\n\t\t\t\tinputValue: currentInputValue\n\t\t\t};\n\t\t});\n\t};\n\n\t/**\n\t * Форматирует значение поля даты согласно текущему пресету.\n\t */\n\tconst formatValue = (value: Date | NullableDateRange | null): string => formatDateInputValue(value, formatOptions);\n\n\t/**\n\t * Парсит строковое значение поля в дату или диапазон дат.\n\t */\n\tconst parseDate = (dateString: string): Date | NullableDateRange | null => {\n\t\tconst parseOptions: DateInputValueOptions = {\n\t\t\t...formatOptions,\n\t\t\treferenceDate: resolveReferenceDate(selectedDate)\n\t\t};\n\n\t\tif (options.selectsRange) {\n\t\t\treturn parseRangeDateValue(dateString, parseOptions);\n\t\t}\n\n\t\treturn parseSingleDateValue(dateString, parseOptions);\n\t};\n\n\t/**\n\t * Обрабатывает выбор даты из календаря.\n\t */\n\tconst handleSelect = (date: Date | NullableDateRange) => {\n\t\tconst [selectedStartDate, selectedEndDate] = (Array.isArray(date) ? date : [date, null]) as NullableDateRange;\n\n\t\tif (options.selectsRange) {\n\t\t\tconst normalizedStartDate = normalizeSingleDateValue(selectedStartDate, formatOptions);\n\t\t\tconst normalizedEndDate = normalizeRangeEndDateValue(selectedEndDate, formatOptions);\n\n\t\t\tif (normalizedStartDate && normalizedEndDate) {\n\t\t\t\tif (normalizedEndDate < normalizedStartDate) {\n\t\t\t\t\tconst swappedRange: NullableDateRange = [\n\t\t\t\t\t\tnormalizeSingleDateValue(selectedEndDate, formatOptions),\n\t\t\t\t\t\tnormalizeRangeEndDateValue(selectedStartDate, formatOptions)\n\t\t\t\t\t];\n\t\t\t\t\tsetDraftState({\n\t\t\t\t\t\tsourceSignature: externalStateSignature,\n\t\t\t\t\t\tselectedDate: swappedRange,\n\t\t\t\t\t\tinputValue: formatValue(swappedRange)\n\t\t\t\t\t});\n\t\t\t\t\toptions.onChange(swappedRange);\n\t\t\t\t} else {\n\t\t\t\t\tconst nextRange: NullableDateRange = [normalizedStartDate, normalizedEndDate];\n\t\t\t\t\tsetDraftState({\n\t\t\t\t\t\tsourceSignature: externalStateSignature,\n\t\t\t\t\t\tselectedDate: nextRange,\n\t\t\t\t\t\tinputValue: formatValue(nextRange)\n\t\t\t\t\t});\n\t\t\t\t\toptions.onChange(nextRange);\n\t\t\t\t}\n\n\t\t\t\treturn true;\n\t\t\t}\n\n\t\t\tconst nextRange: NullableDateRange = [normalizedStartDate, null];\n\t\t\tsetDraftState({\n\t\t\t\tsourceSignature: externalStateSignature,\n\t\t\t\tselectedDate: nextRange,\n\t\t\t\tinputValue: formatValue(nextRange)\n\t\t\t});\n\t\t\treturn false;\n\t\t}\n\n\t\tconst normalizedDate = normalizeSingleDateValue(selectedStartDate, formatOptions);\n\t\tsetDraftState({\n\t\t\tsourceSignature: externalStateSignature,\n\t\t\tselectedDate: normalizedDate,\n\t\t\tinputValue: formatValue(normalizedDate)\n\t\t});\n\t\toptions.onChange(normalizedDate);\n\n\t\treturn true;\n\t};\n\n\treturn {\n\t\tinputValue,\n\t\tsetInputValue,\n\t\tselectedDate,\n\t\tsetSelectedDate,\n\t\thandleSelect,\n\t\tformatDate: formatValue,\n\t\tparseDate\n\t};\n};\n",".selectionModeControl {\n\tmargin-top: var(--space-sm);\n\tpadding-top: var(--space-sm);\n\tborder-top: var(--border);\n}\n","import { JSX, useCallback, useEffect, useRef, useState } from \"react\";\n\nimport { isDateRangeTuple, type NullableDateRange } from \"@ryuzaki13/react-foundation-lib/formatters\";\nimport { CalendarDaysIcon } from \"lucide-react\";\n\nimport { InputText } from \"../../input\";\nimport { Popover } from \"../../popover\";\nimport { RadioGroup } from \"../../radio-group\";\nimport { UiBaseProps } from \"../../types\";\nimport uiStyles from \"../../ui.module.scss\";\nimport {\n\tareRangeDateValuesEqual,\n\tareSingleDateValuesEqual,\n\tDATE_INPUT_SELECTION_MODES,\n\tisDatePickerLevelAvailable,\n\tresolveAvailableDatePickerLevel,\n\ttype DateInputSelectionMode,\n\ttype DateInputWeekEndDay,\n\ttype DatePickerLevel\n} from \"../lib\";\nimport { useDateInput } from \"../model\";\n\nimport { CalendarView } from \"./CalendarView\";\nimport styles from \"./DateInput.module.scss\";\n\ninterface BaseDateInputProps {\n\terror?: string;\n\tonClearError?: () => void;\n\n\tminDate?: Date;\n\tmaxDate?: Date;\n\n\tdatePreset?: string;\n\n\t/**\n\t * Минимальный уровень календарной навигации. Размер выбранного периода задаёт `selectionMode`.\n\t */\n\tdatePickerLevel?: DatePickerLevel;\n\t/**\n\t * Размер периода, который выбирает поле: день, неделя, месяц или год.\n\t */\n\tselectionMode?: DateInputSelectionMode;\n\t/**\n\t * Последний включённый день недели для `selectionMode=\"week\"`.\n\t */\n\tweekEndDay?: DateInputWeekEndDay;\n\t/**\n\t * Показывает переключатель `selectionMode` под календарём.\n\t */\n\tallowSelectionModeChange?: boolean;\n\t/**\n\t * Ограничивает набор режимов в runtime-переключателе.\n\t */\n\tselectionModeOptions?: readonly DateInputSelectionMode[];\n\t/**\n\t * Сообщает наружу о runtime-смене режима выбора.\n\t */\n\tonSelectionModeChange?: (selectionMode: DateInputSelectionMode) => void;\n}\n\nexport interface DateSingleInputProps extends BaseDateInputProps, UiBaseProps<Date | null> {\n\tselectsRange?: false;\n}\nexport interface DateRangeInputProps extends BaseDateInputProps, UiBaseProps<NullableDateRange | null> {\n\tselectsRange: true;\n}\n\ntype DateInputProps = DateSingleInputProps | DateRangeInputProps;\n\ninterface CalendarTypeState {\n\treadonly view: DatePickerLevel;\n\treadonly selectionMode: DateInputSelectionMode;\n\treadonly minDatePickerLevel: DatePickerLevel;\n}\n\nconst selectionModeLabels: Record<DateInputSelectionMode, string> = {\n\tday: \"День\",\n\tweek: \"Неделя\",\n\tmonth: \"Месяц\",\n\tyear: \"Год\"\n};\n\nfunction resolveSelectionModeOptions(\n\tselectionModeOptions: readonly DateInputSelectionMode[] | undefined,\n\tselectionMode: DateInputSelectionMode\n): readonly DateInputSelectionMode[] {\n\tconst enabledModes = new Set(selectionModeOptions?.length ? selectionModeOptions : DATE_INPUT_SELECTION_MODES);\n\tenabledModes.add(selectionMode);\n\n\treturn DATE_INPUT_SELECTION_MODES.filter((mode) => enabledModes.has(mode));\n}\n\nfunction DateInput(props: DateSingleInputProps): JSX.Element;\nfunction DateInput(props: DateRangeInputProps): JSX.Element;\nfunction DateInput({\n\tplaceholder,\n\tdisabled,\n\terror,\n\tonClearError,\n\tminDate,\n\tmaxDate,\n\tdatePickerLevel,\n\tselectionMode: controlledSelectionMode,\n\tweekEndDay = \"sunday\",\n\tallowSelectionModeChange,\n\tselectionModeOptions,\n\tonSelectionModeChange,\n\t...props\n}: DateInputProps) {\n\tconst [open, setOpen] = useState(false);\n\tconst [uncontrolledSelectionMode, setUncontrolledSelectionMode] = useState<DateInputSelectionMode>(controlledSelectionMode ?? \"day\");\n\tconst selectionMode = controlledSelectionMode ?? uncontrolledSelectionMode;\n\tconst minDatePickerLevel = datePickerLevel ?? \"day\";\n\tconst preferredCalendarType = resolveAvailableDatePickerLevel(selectionMode, minDatePickerLevel);\n\tconst [calendarTypeState, setCalendarTypeState] = useState<CalendarTypeState>(() => ({\n\t\tview: preferredCalendarType,\n\t\tselectionMode,\n\t\tminDatePickerLevel\n\t}));\n\tconst calendarType =\n\t\tcalendarTypeState.selectionMode === selectionMode &&\n\t\tcalendarTypeState.minDatePickerLevel === minDatePickerLevel &&\n\t\tisDatePickerLevelAvailable(calendarTypeState.view, minDatePickerLevel)\n\t\t\t? calendarTypeState.view\n\t\t\t: preferredCalendarType;\n\n\tconst initialDateRef = useRef(props.value);\n\tconst dateInputValueOptions = {\n\t\tselectionMode,\n\t\tweekEndDay\n\t};\n\n\tconst { inputValue, setInputValue, selectedDate, setSelectedDate, handleSelect, formatDate, parseDate } = useDateInput({\n\t\t...props,\n\t\tdatePickerLevel: minDatePickerLevel,\n\t\tselectionMode,\n\t\tweekEndDay\n\t});\n\tconst rangeOnChange = props.selectsRange ? props.onChange : undefined;\n\n\tconst updateCalendarType = useCallback(\n\t\t(calendarType: DatePickerLevel) => {\n\t\t\tif (isDatePickerLevelAvailable(calendarType, minDatePickerLevel)) {\n\t\t\t\tsetCalendarTypeState({\n\t\t\t\t\tview: calendarType,\n\t\t\t\t\tselectionMode,\n\t\t\t\t\tminDatePickerLevel\n\t\t\t\t});\n\t\t\t}\n\t\t},\n\t\t[minDatePickerLevel, selectionMode]\n\t);\n\n\tuseEffect(() => {\n\t\tinitialDateRef.current = props.value;\n\t}, [props.value]);\n\n\tconst handleInputBlur = () => {\n\t\tif (inputValue) {\n\t\t\tconst parsedDate = parseDate(inputValue);\n\t\t\tif (parsedDate) {\n\t\t\t\tsetInputValue(formatDate(parsedDate));\n\n\t\t\t\tif (props.selectsRange && isDateRangeTuple(parsedDate)) {\n\t\t\t\t\tconst selectedRange = isDateRangeTuple(selectedDate) ? selectedDate : null;\n\n\t\t\t\t\tif (areRangeDateValuesEqual(parsedDate, selectedRange, dateInputValueOptions)) return;\n\n\t\t\t\t\tsetSelectedDate(parsedDate);\n\t\t\t\t\tprops.onChange(parsedDate);\n\t\t\t\t} else if (!props.selectsRange && parsedDate instanceof Date) {\n\t\t\t\t\tconst selectedSingleDate = selectedDate instanceof Date ? selectedDate : null;\n\n\t\t\t\t\tif (areSingleDateValuesEqual(parsedDate, selectedSingleDate, dateInputValueOptions)) return;\n\n\t\t\t\t\tsetSelectedDate(parsedDate);\n\t\t\t\t\tprops.onChange(parsedDate);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t};\n\n\tconst handleKeyDown = (event: React.KeyboardEvent<HTMLInputElement>) => {\n\t\tif (event.key === \"Enter\") {\n\t\t\tevent.preventDefault();\n\t\t\thandleInputBlur();\n\t\t}\n\t};\n\n\tconst handleCalendarDateSelect = useCallback(\n\t\t(value: Date | NullableDateRange) => {\n\t\t\tif (handleSelect(value)) {\n\t\t\t\tsetOpen(false);\n\t\t\t}\n\t\t},\n\t\t[handleSelect]\n\t);\n\n\tconst handleSelectionModeChange = useCallback(\n\t\t(nextSelectionMode: DateInputSelectionMode) => {\n\t\t\tif (controlledSelectionMode === undefined) {\n\t\t\t\tsetUncontrolledSelectionMode(nextSelectionMode);\n\t\t\t}\n\n\t\t\tonSelectionModeChange?.(nextSelectionMode);\n\t\t\tsetCalendarTypeState({\n\t\t\t\tview: resolveAvailableDatePickerLevel(nextSelectionMode, minDatePickerLevel),\n\t\t\t\tselectionMode: nextSelectionMode,\n\t\t\t\tminDatePickerLevel\n\t\t\t});\n\t\t},\n\t\t[controlledSelectionMode, minDatePickerLevel, onSelectionModeChange]\n\t);\n\n\tconst handleCancel = useCallback(() => {\n\t\t// Восстановить исходное состояние при отмене\n\t\tif (rangeOnChange) {\n\t\t\tconst [, selectedEndDate] = isDateRangeTuple(selectedDate) ? selectedDate : [null, null];\n\n\t\t\tif (!selectedEndDate) {\n\t\t\t\t// Восстановить исходное состояние диапазона\n\t\t\t\tconst initialValue = initialDateRef.current;\n\t\t\t\tconst initialRange = Array.isArray(initialValue) ? initialValue : null;\n\t\t\t\tconst initialStart = initialRange?.[0] ?? null;\n\t\t\t\tconst initialEnd = initialRange?.[1] ?? null;\n\n\t\t\t\tif (initialStart && initialEnd) {\n\t\t\t\t\tconst initialSelectedDate: NullableDateRange = [initialStart, initialEnd];\n\t\t\t\t\tsetSelectedDate(initialSelectedDate);\n\t\t\t\t\tsetInputValue(formatDate(initialSelectedDate));\n\n\t\t\t\t\trangeOnChange(initialSelectedDate);\n\t\t\t\t} else {\n\t\t\t\t\t// Если начального диапазона нет, очистить всё\n\t\t\t\t\tsetSelectedDate([null, null]);\n\t\t\t\t\tsetInputValue(\"\");\n\n\t\t\t\t\trangeOnChange([null, null]);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}, [rangeOnChange, selectedDate, setSelectedDate, setInputValue, formatDate]);\n\n\tconst availableSelectionModes = resolveSelectionModeOptions(selectionModeOptions, selectionMode);\n\tconst showSelectionModeControl = allowSelectionModeChange && availableSelectionModes.length > 1;\n\n\treturn (\n\t\t<Popover\n\t\t\topen={open}\n\t\t\tonOpenChange={(value) => {\n\t\t\t\tsetOpen(value);\n\t\t\t\tif (!value) {\n\t\t\t\t\thandleCancel();\n\t\t\t\t}\n\t\t\t}}>\n\t\t\t<InputText\n\t\t\t\tlabel={props.label}\n\t\t\t\tdescription={props.description}\n\t\t\t\tsize={props.size}\n\t\t\t\tvalue={inputValue}\n\t\t\t\tonChange={setInputValue}\n\t\t\t\tonBlur={handleInputBlur}\n\t\t\t\tonKeyUp={handleKeyDown}\n\t\t\t\tplaceholder={placeholder}\n\t\t\t\tdisabled={disabled}\n\t\t\t\terror={error}\n\t\t\t\tonClearError={onClearError}\n\t\t\t\tendAdornmentWidth=\"var(--control-height)\"\n\t\t\t\tendAdornment={\n\t\t\t\t\t<Popover.Trigger>\n\t\t\t\t\t\t<div className={uiStyles.uiToggleButtonContainer}>\n\t\t\t\t\t\t\t<button type=\"button\" disabled={disabled} aria-label=\"Открыть календарь\" className={uiStyles.uiToggleButton}>\n\t\t\t\t\t\t\t\t<CalendarDaysIcon />\n\t\t\t\t\t\t\t</button>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t</Popover.Trigger>\n\t\t\t\t}\n\t\t\t/>\n\n\t\t\t<Popover.Content background=\"primary\">\n\t\t\t\t<CalendarView\n\t\t\t\t\tview={calendarType}\n\t\t\t\t\tdatePickerLevel={minDatePickerLevel}\n\t\t\t\t\tselectionMode={selectionMode}\n\t\t\t\t\tweekEndDay={weekEndDay}\n\t\t\t\t\tonViewChange={updateCalendarType}\n\t\t\t\t\tvalue={selectedDate ?? null}\n\t\t\t\t\tonChange={handleCalendarDateSelect}\n\t\t\t\t\tminDate={minDate}\n\t\t\t\t\tmaxDate={maxDate}\n\t\t\t\t\tselectsRange={!!props.selectsRange}\n\t\t\t\t/>\n\t\t\t\t{showSelectionModeControl && (\n\t\t\t\t\t<div className={styles.selectionModeControl}>\n\t\t\t\t\t\t<RadioGroup<DateInputSelectionMode>\n\t\t\t\t\t\t\tvalue={selectionMode}\n\t\t\t\t\t\t\tonChange={handleSelectionModeChange}\n\t\t\t\t\t\t\tnoWrap\n\t\t\t\t\t\t\taria-label=\"Режим выбора даты\">\n\t\t\t\t\t\t\t{availableSelectionModes.map((mode) => (\n\t\t\t\t\t\t\t\t<RadioGroup.Option key={mode} value={mode} label={selectionModeLabels[mode]} />\n\t\t\t\t\t\t\t))}\n\t\t\t\t\t\t</RadioGroup>\n\t\t\t\t\t</div>\n\t\t\t\t)}\n\t\t\t</Popover.Content>\n\t\t</Popover>\n\t);\n}\n\nexport function SingleDateInput(props: Omit<DateSingleInputProps, \"selectsRange\">) {\n\treturn <DateInput {...props} />;\n}\n\nexport function RangeDateInput(props: Omit<DateRangeInputProps, \"selectsRange\">) {\n\treturn <DateInput {...props} selectsRange={true} />;\n}\n"],"mappings":";;;;;;;;;;AAkBA,IAAa,IAA4B,EAA0B,MAKtD,IAA4B,cAEnC,IAAkB;AA8BxB,SAAS,EAA0B,GAAqD;CASvF,OARI,EAAQ,kBAAkB,SAAS,EAAQ,kBAAkB,SACzD,QAGJ,EAAQ,kBAAkB,WAAW,EAAQ,kBAAkB,SAC3D,EAAQ,gBAGT,EAAQ,mBAAmB;AACnC;AAEA,SAAS,EAA6B,GAAwD;CAC7F,OAAO;EACN,eAAe,GAAS;EACxB,YAAY,GAAS;CACtB;AACD;AAKA,SAAS,EACR,GACA,GACwB;CAexB,OAdI,OAAO,KAAoB,YAAY,MAAoB,KAAA,IACvD;EACN,YAAY;EACZ;CACD,IAGG,KAAmB,EAAgB,oBAAoB,KAAA,IACnD;EACN,GAAG;EACH;CACD,IAGM;AACR;AAKA,SAAS,EAA2B,GAA6B;CAChE,IAAM,IAAqB,EAAsB,GAAY,CAAyB;CACtF,OAAO,EAAc,CAAkB,IAAI,IAAqB;AACjE;AAKA,SAAS,EAAmB,GAAe,GAA6C;CACvF,OACC,EAAkB,GAAO,EAA2B,EAAQ,UAAU,GAAG;EAC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6l1iDmf.js","names":[],"sources":["../../src/date-input/lib/dateInputValue.ts","../../src/date-input/model/useDateInput.ts","../../src/date-input/ui/DateInput.module.scss","../../src/date-input/ui/DateInput.tsx"],"sourcesContent":["import {\n\tDEFAULT_DATE_PRESET_NAMES,\n\tformatDate,\n\tformatDateRange,\n\tgetCalendarPeriod,\n\tgetDatePreset,\n\tisDateRangeTuple,\n\tparseDateByFormat,\n\tresolveDateFormatName,\n\ttype CalendarPeriodOptions,\n\ttype DateFormatPrecision,\n\ttype DateRangeInput,\n\ttype NullableDateRange\n} from \"@ryuzaki13/react-foundation-lib/formatters\";\n\n/**\n * Пресет даты по умолчанию для текстового поля.\n */\nexport const DEFAULT_DATE_INPUT_PRESET = DEFAULT_DATE_PRESET_NAMES.date;\n\n/**\n * @deprecated Используйте `DEFAULT_DATE_INPUT_PRESET`.\n */\nexport const DEFAULT_DATE_INPUT_FORMAT = \"dd.MM.yyyy\";\n\nconst RANGE_SEPARATOR = \" - \";\n\nexport type DateInputValueOptions = {\n\t/**\n\t * Имя пресета форматирования даты.\n\t */\n\tdatePreset?: string;\n\t/**\n\t * Точность календарного значения.\n\t */\n\tdatePickerLevel?: DateFormatPrecision;\n\t/**\n\t * Размер периода, который выбирается и нормализуется полем.\n\t */\n\tselectionMode?: CalendarPeriodOptions[\"selectionMode\"];\n\t/**\n\t * Последний включённый день недели для режима выбора недели.\n\t */\n\tweekEndDay?: CalendarPeriodOptions[\"weekEndDay\"];\n\t/**\n\t * Опорная дата для пресетов без года, например `month-long`.\n\t */\n\treferenceDate?: Date;\n};\n\nexport type DateInputValueOptionsInput = string | DateInputValueOptions | undefined;\n\n/**\n * Возвращает точность форматирования поля даты.\n */\nfunction resolveDateInputPrecision(options: DateInputValueOptions): DateFormatPrecision {\n\tif (options.selectionMode === \"day\" || options.selectionMode === \"week\") {\n\t\treturn \"day\";\n\t}\n\n\tif (options.selectionMode === \"month\" || options.selectionMode === \"year\") {\n\t\treturn options.selectionMode;\n\t}\n\n\treturn options.datePickerLevel ?? \"day\";\n}\n\nfunction resolveCalendarPeriodOptions(options?: DateInputValueOptions): CalendarPeriodOptions {\n\treturn {\n\t\tselectionMode: options?.selectionMode,\n\t\tweekEndDay: options?.weekEndDay\n\t};\n}\n\n/**\n * Нормализует объектные опции и позиционный вызов с именем пресета.\n */\nfunction normalizeDateInputValueOptions(\n\toptionsOrPreset?: DateInputValueOptionsInput,\n\tdatePickerLevel?: DateFormatPrecision\n): DateInputValueOptions {\n\tif (typeof optionsOrPreset === \"string\" || optionsOrPreset === undefined) {\n\t\treturn {\n\t\t\tdatePreset: optionsOrPreset,\n\t\t\tdatePickerLevel\n\t\t};\n\t}\n\n\tif (datePickerLevel && optionsOrPreset.datePickerLevel === undefined) {\n\t\treturn {\n\t\t\t...optionsOrPreset,\n\t\t\tdatePickerLevel\n\t\t};\n\t}\n\n\treturn optionsOrPreset;\n}\n\n/**\n * Проверяет новый `datePreset` и возвращает только зарегистрированное имя пресета.\n */\nfunction resolveDateInputPresetName(datePreset?: string): string {\n\tconst resolvedPresetName = resolveDateFormatName(datePreset, DEFAULT_DATE_INPUT_PRESET);\n\treturn getDatePreset(resolvedPresetName) ? resolvedPresetName : DEFAULT_DATE_INPUT_PRESET;\n}\n\n/**\n * Приводит результат универсального парсинга к календарной дате.\n */\nfunction parseDateTimeValue(value: string, options: DateInputValueOptions): Date | null {\n\treturn (\n\t\tparseDateByFormat(value, resolveDateInputPresetName(options.datePreset), {\n\t\t\tdefaultFormat: DEFAULT_DATE_INPUT_PRESET,\n\t\t\tprecision: resolveDateInputPrecision(options),\n\t\t\treferenceDate: options.referenceDate\n\t\t})?.date ?? null\n\t);\n}\n\n/**\n * Приводит одиночную дату к началу выбранного календарного периода.\n */\nexport function normalizeSingleDateValue(date: Date | null, options?: DateInputValueOptions): Date | null {\n\treturn getCalendarPeriod(date, resolveCalendarPeriodOptions(options))?.start ?? null;\n}\n\n/**\n * Приводит диапазон дат к границам выбранных календарных периодов.\n */\nexport function normalizeRangeDateValue(range: NullableDateRange | null, options?: DateInputValueOptions): NullableDateRange | null {\n\tif (!isDateRangeTuple(range)) return null;\n\n\tconst [startDate, endDate] = range;\n\treturn [normalizeSingleDateValue(startDate, options), normalizeRangeEndDateValue(endDate, options)];\n}\n\n/**\n * Приводит конечную дату диапазона к концу выбранного календарного периода.\n */\nexport function normalizeRangeEndDateValue(date: Date | null, options?: DateInputValueOptions): Date | null {\n\treturn getCalendarPeriod(date, resolveCalendarPeriodOptions(options))?.end ?? null;\n}\n\nfunction getDateTime(date: Date | null): number | null {\n\treturn date?.getTime() ?? null;\n}\n\n/**\n * Сравнивает одиночные даты после нормализации к точности поля ввода.\n */\nexport function areSingleDateValuesEqual(left: Date | null, right: Date | null, options?: DateInputValueOptions): boolean {\n\treturn getDateTime(normalizeSingleDateValue(left, options)) === getDateTime(normalizeSingleDateValue(right, options));\n}\n\n/**\n * Сравнивает диапазоны дат после нормализации к границам выбранных периодов.\n */\nexport function areRangeDateValuesEqual(\n\tleft: NullableDateRange | null,\n\tright: NullableDateRange | null,\n\toptions?: DateInputValueOptions\n): boolean {\n\tconst normalizedLeft = normalizeRangeDateValue(left, options);\n\tconst normalizedRight = normalizeRangeDateValue(right, options);\n\n\treturn (\n\t\tgetDateTime(normalizedLeft?.[0] ?? null) === getDateTime(normalizedRight?.[0] ?? null) &&\n\t\tgetDateTime(normalizedLeft?.[1] ?? null) === getDateTime(normalizedRight?.[1] ?? null)\n\t);\n}\n\n/**\n * Форматирует одиночную дату для текстового поля.\n */\nexport function formatSingleDateValue(\n\tdate: Date | null,\n\toptionsOrPreset?: DateInputValueOptionsInput,\n\tdatePickerLevel?: DateFormatPrecision\n): string {\n\tif (!date) return \"\";\n\n\tconst options = normalizeDateInputValueOptions(optionsOrPreset, datePickerLevel);\n\tconst period = getCalendarPeriod(date, resolveCalendarPeriodOptions(options));\n\n\t// Single-поле хранит начало недели, но показывает обе включительные границы выбранного периода.\n\tif (options.selectionMode === \"week\" && period) {\n\t\treturn formatDateRange(period.start, period.end, resolveDateInputPresetName(options.datePreset), {\n\t\t\tprecision: resolveDateInputPrecision(options)\n\t\t});\n\t}\n\n\treturn formatDate(date, resolveDateInputPresetName(options.datePreset), {\n\t\tprecision: resolveDateInputPrecision(options)\n\t});\n}\n\n/**\n * Форматирует диапазон дат для текстового поля.\n */\nexport function formatRangeDateValue(\n\trange: NullableDateRange | null,\n\toptionsOrPreset?: DateInputValueOptionsInput,\n\tdatePickerLevel?: DateFormatPrecision\n): string {\n\tif (!isDateRangeTuple(range)) return \"\";\n\n\tconst options = normalizeDateInputValueOptions(optionsOrPreset, datePickerLevel);\n\tconst [startDate, endDate] = range;\n\tif (startDate && endDate) {\n\t\treturn formatDateRange(startDate, endDate, resolveDateInputPresetName(options.datePreset), {\n\t\t\tprecision: resolveDateInputPrecision(options)\n\t\t});\n\t}\n\n\tif (startDate) {\n\t\treturn `${formatDate(startDate, resolveDateInputPresetName(options.datePreset), {\n\t\t\tprecision: resolveDateInputPrecision(options)\n\t\t})}${RANGE_SEPARATOR}`;\n\t}\n\n\treturn \"\";\n}\n\n/**\n * Унифицирует форматирование значения поля даты.\n */\nexport function formatDateInputValue(\n\tvalue: DateRangeInput,\n\toptionsOrPreset?: DateInputValueOptionsInput,\n\tdatePickerLevel?: DateFormatPrecision\n): string {\n\tif (isDateRangeTuple(value)) {\n\t\treturn formatRangeDateValue(value, optionsOrPreset, datePickerLevel);\n\t}\n\n\treturn formatSingleDateValue(value, optionsOrPreset, datePickerLevel);\n}\n\n/**\n * Парсит строку одиночной даты по заданному пресету.\n */\nexport function parseSingleDateValue(\n\tvalue: string,\n\toptionsOrPreset?: DateInputValueOptionsInput,\n\tdatePickerLevel?: DateFormatPrecision\n): Date | null {\n\tconst options = normalizeDateInputValueOptions(optionsOrPreset, datePickerLevel);\n\t// Для отображаемого диапазона single-week источником значения остаётся его первая граница.\n\tconst singleValue = options.selectionMode === \"week\" ? (value.split(RANGE_SEPARATOR)[0] ?? \"\") : value;\n\n\treturn normalizeSingleDateValue(parseDateTimeValue(singleValue, options), options);\n}\n\n/**\n * Парсит строку диапазона дат по заданному пресету.\n */\nexport function parseRangeDateValue(\n\tvalue: string,\n\toptionsOrPreset?: DateInputValueOptionsInput,\n\tdatePickerLevel?: DateFormatPrecision\n): NullableDateRange {\n\tconst options = normalizeDateInputValueOptions(optionsOrPreset, datePickerLevel);\n\tconst [startPart = \"\", endPart = \"\"] = value.split(RANGE_SEPARATOR);\n\n\treturn [parseSingleDateValue(startPart, options), parseRangeEndDateValue(endPart, options)];\n}\n\n/**\n * Парсит конечную дату диапазона и нормализует её к концу суток.\n */\nexport function parseRangeEndDateValue(\n\tvalue: string,\n\toptionsOrPreset?: DateInputValueOptionsInput,\n\tdatePickerLevel?: DateFormatPrecision\n): Date | null {\n\tconst options = normalizeDateInputValueOptions(optionsOrPreset, datePickerLevel);\n\treturn normalizeRangeEndDateValue(parseDateTimeValue(value, options), options);\n}\n","import { useMemo, useState } from \"react\";\n\nimport { isDateRangeTuple, type NullableDateRange } from \"@ryuzaki13/react-foundation-lib/formatters\";\n\nimport {\n\tDateInputValueOptions,\n\tformatDateInputValue,\n\tnormalizeRangeDateValue,\n\tnormalizeRangeEndDateValue,\n\tnormalizeSingleDateValue,\n\tparseRangeDateValue,\n\tparseSingleDateValue,\n\ttype DateInputOptions\n} from \"../lib\";\n\nfunction resolveReferenceDate(value: Date | NullableDateRange | null): Date | undefined {\n\tif (isDateRangeTuple(value)) {\n\t\treturn value[0] ?? value[1] ?? undefined;\n\t}\n\n\treturn value ?? undefined;\n}\n\n/**\n * Хук управляет текстовым представлением и выбранным значением поля даты.\n */\nexport const useDateInput = (options: DateInputOptions) => {\n\tconst externalSelectedDate = useMemo(() => {\n\t\tconst selectionOptions: DateInputValueOptions = {\n\t\t\tselectionMode: options.selectionMode,\n\t\t\tweekEndDay: options.weekEndDay\n\t\t};\n\n\t\tif (options.selectsRange) {\n\t\t\treturn normalizeRangeDateValue(options.value as NullableDateRange | null, selectionOptions);\n\t\t}\n\n\t\treturn normalizeSingleDateValue(options.value as Date | null, selectionOptions);\n\t}, [options.selectsRange, options.selectionMode, options.value, options.weekEndDay]);\n\tconst formatOptions = useMemo<DateInputValueOptions>(\n\t\t() => ({\n\t\t\tdatePreset: options.datePreset,\n\t\t\tdatePickerLevel: options.datePickerLevel,\n\t\t\tselectionMode: options.selectionMode,\n\t\t\tweekEndDay: options.weekEndDay\n\t\t}),\n\t\t[options.datePickerLevel, options.datePreset, options.selectionMode, options.weekEndDay]\n\t);\n\tconst externalInputValue = formatDateInputValue(externalSelectedDate, formatOptions);\n\tconst externalStateSignature = JSON.stringify([\n\t\toptions.selectsRange,\n\t\toptions.datePreset ?? null,\n\t\toptions.datePickerLevel ?? null,\n\t\toptions.selectionMode ?? null,\n\t\toptions.weekEndDay ?? null,\n\t\tisDateRangeTuple(externalSelectedDate)\n\t\t\t? [externalSelectedDate[0]?.getTime() ?? null, externalSelectedDate[1]?.getTime() ?? null]\n\t\t\t: (externalSelectedDate?.getTime() ?? null)\n\t]);\n\tconst [draftState, setDraftState] = useState(() => ({\n\t\tsourceSignature: externalStateSignature,\n\t\tselectedDate: externalSelectedDate,\n\t\tinputValue: externalInputValue\n\t}));\n\tconst hasCurrentDraft = draftState.sourceSignature === externalStateSignature;\n\tconst selectedDate = hasCurrentDraft ? draftState.selectedDate : externalSelectedDate;\n\tconst inputValue = hasCurrentDraft ? draftState.inputValue : externalInputValue;\n\n\t/**\n\t * Сохраняет пользовательский текст только относительно текущего controlled-снимка.\n\t * При внешней смене value или формата отображение сразу выводится из новых props.\n\t */\n\tconst setInputValue = (nextInputValue: string) => {\n\t\tsetDraftState((currentState) => {\n\t\t\tconst currentSelectedDate =\n\t\t\t\tcurrentState.sourceSignature === externalStateSignature ? currentState.selectedDate : externalSelectedDate;\n\n\t\t\treturn {\n\t\t\t\tsourceSignature: externalStateSignature,\n\t\t\t\tselectedDate: currentSelectedDate,\n\t\t\t\tinputValue: nextInputValue\n\t\t\t};\n\t\t});\n\t};\n\n\t/**\n\t * Обновляет локальный незавершённый выбор, не зеркаля controlled value через effect.\n\t */\n\tconst setSelectedDate = (nextSelectedDate: Date | NullableDateRange | null) => {\n\t\tsetDraftState((currentState) => {\n\t\t\tconst currentInputValue =\n\t\t\t\tcurrentState.sourceSignature === externalStateSignature ? currentState.inputValue : externalInputValue;\n\n\t\t\treturn {\n\t\t\t\tsourceSignature: externalStateSignature,\n\t\t\t\tselectedDate: nextSelectedDate,\n\t\t\t\tinputValue: currentInputValue\n\t\t\t};\n\t\t});\n\t};\n\n\t/**\n\t * Форматирует значение поля даты согласно текущему пресету.\n\t */\n\tconst formatValue = (value: Date | NullableDateRange | null): string => formatDateInputValue(value, formatOptions);\n\n\t/**\n\t * Парсит строковое значение поля в дату или диапазон дат.\n\t */\n\tconst parseDate = (dateString: string): Date | NullableDateRange | null => {\n\t\tconst parseOptions: DateInputValueOptions = {\n\t\t\t...formatOptions,\n\t\t\treferenceDate: resolveReferenceDate(selectedDate)\n\t\t};\n\n\t\tif (options.selectsRange) {\n\t\t\treturn parseRangeDateValue(dateString, parseOptions);\n\t\t}\n\n\t\treturn parseSingleDateValue(dateString, parseOptions);\n\t};\n\n\t/**\n\t * Обрабатывает выбор даты из календаря.\n\t */\n\tconst handleSelect = (date: Date | NullableDateRange) => {\n\t\tconst [selectedStartDate, selectedEndDate] = (Array.isArray(date) ? date : [date, null]) as NullableDateRange;\n\n\t\tif (options.selectsRange) {\n\t\t\tconst normalizedStartDate = normalizeSingleDateValue(selectedStartDate, formatOptions);\n\t\t\tconst normalizedEndDate = normalizeRangeEndDateValue(selectedEndDate, formatOptions);\n\n\t\t\tif (normalizedStartDate && normalizedEndDate) {\n\t\t\t\tif (normalizedEndDate < normalizedStartDate) {\n\t\t\t\t\tconst swappedRange: NullableDateRange = [\n\t\t\t\t\t\tnormalizeSingleDateValue(selectedEndDate, formatOptions),\n\t\t\t\t\t\tnormalizeRangeEndDateValue(selectedStartDate, formatOptions)\n\t\t\t\t\t];\n\t\t\t\t\tsetDraftState({\n\t\t\t\t\t\tsourceSignature: externalStateSignature,\n\t\t\t\t\t\tselectedDate: swappedRange,\n\t\t\t\t\t\tinputValue: formatValue(swappedRange)\n\t\t\t\t\t});\n\t\t\t\t\toptions.onChange(swappedRange);\n\t\t\t\t} else {\n\t\t\t\t\tconst nextRange: NullableDateRange = [normalizedStartDate, normalizedEndDate];\n\t\t\t\t\tsetDraftState({\n\t\t\t\t\t\tsourceSignature: externalStateSignature,\n\t\t\t\t\t\tselectedDate: nextRange,\n\t\t\t\t\t\tinputValue: formatValue(nextRange)\n\t\t\t\t\t});\n\t\t\t\t\toptions.onChange(nextRange);\n\t\t\t\t}\n\n\t\t\t\treturn true;\n\t\t\t}\n\n\t\t\tconst nextRange: NullableDateRange = [normalizedStartDate, null];\n\t\t\tsetDraftState({\n\t\t\t\tsourceSignature: externalStateSignature,\n\t\t\t\tselectedDate: nextRange,\n\t\t\t\tinputValue: formatValue(nextRange)\n\t\t\t});\n\t\t\treturn false;\n\t\t}\n\n\t\tconst normalizedDate = normalizeSingleDateValue(selectedStartDate, formatOptions);\n\t\tsetDraftState({\n\t\t\tsourceSignature: externalStateSignature,\n\t\t\tselectedDate: normalizedDate,\n\t\t\tinputValue: formatValue(normalizedDate)\n\t\t});\n\t\toptions.onChange(normalizedDate);\n\n\t\treturn true;\n\t};\n\n\treturn {\n\t\tinputValue,\n\t\tsetInputValue,\n\t\tselectedDate,\n\t\tsetSelectedDate,\n\t\thandleSelect,\n\t\tformatDate: formatValue,\n\t\tparseDate\n\t};\n};\n",".selectionModeControl {\n\tmargin-top: var(--space-sm);\n\tpadding-top: var(--space-sm);\n\tborder-top: var(--border);\n}\n","import { JSX, useCallback, useEffect, useRef, useState } from \"react\";\n\nimport { isDateRangeTuple, type NullableDateRange } from \"@ryuzaki13/react-foundation-lib/formatters\";\nimport { CalendarDaysIcon } from \"lucide-react\";\n\nimport { InputText } from \"../../input\";\nimport { Popover } from \"../../popover\";\nimport { RadioGroup } from \"../../radio-group\";\nimport { UiBaseProps } from \"../../types\";\nimport uiStyles from \"../../ui.module.scss\";\nimport {\n\tareRangeDateValuesEqual,\n\tareSingleDateValuesEqual,\n\tDATE_INPUT_SELECTION_MODES,\n\tisDatePickerLevelAvailable,\n\tresolveAvailableDatePickerLevel,\n\ttype DateInputSelectionMode,\n\ttype DateInputWeekEndDay,\n\ttype DatePickerLevel\n} from \"../lib\";\nimport { useDateInput } from \"../model\";\n\nimport { CalendarView } from \"./CalendarView\";\nimport styles from \"./DateInput.module.scss\";\n\ninterface BaseDateInputProps {\n\terror?: string;\n\tonClearError?: () => void;\n\n\tminDate?: Date;\n\tmaxDate?: Date;\n\n\tdatePreset?: string;\n\n\t/**\n\t * Минимальный уровень календарной навигации. Размер выбранного периода задаёт `selectionMode`.\n\t */\n\tdatePickerLevel?: DatePickerLevel;\n\t/**\n\t * Размер периода, который выбирает поле: день, неделя, месяц или год.\n\t */\n\tselectionMode?: DateInputSelectionMode;\n\t/**\n\t * Последний включённый день недели для `selectionMode=\"week\"`.\n\t */\n\tweekEndDay?: DateInputWeekEndDay;\n\t/**\n\t * Показывает переключатель `selectionMode` под календарём.\n\t */\n\tallowSelectionModeChange?: boolean;\n\t/**\n\t * Ограничивает набор режимов в runtime-переключателе.\n\t */\n\tselectionModeOptions?: readonly DateInputSelectionMode[];\n\t/**\n\t * Сообщает наружу о runtime-смене режима выбора.\n\t */\n\tonSelectionModeChange?: (selectionMode: DateInputSelectionMode) => void;\n}\n\nexport interface DateSingleInputProps extends BaseDateInputProps, UiBaseProps<Date | null> {\n\tselectsRange?: false;\n}\nexport interface DateRangeInputProps extends BaseDateInputProps, UiBaseProps<NullableDateRange | null> {\n\tselectsRange: true;\n}\n\ntype DateInputProps = DateSingleInputProps | DateRangeInputProps;\n\ninterface CalendarTypeState {\n\treadonly view: DatePickerLevel;\n\treadonly selectionMode: DateInputSelectionMode;\n\treadonly minDatePickerLevel: DatePickerLevel;\n}\n\nconst selectionModeLabels: Record<DateInputSelectionMode, string> = {\n\tday: \"День\",\n\tweek: \"Неделя\",\n\tmonth: \"Месяц\",\n\tyear: \"Год\"\n};\n\nfunction resolveSelectionModeOptions(\n\tselectionModeOptions: readonly DateInputSelectionMode[] | undefined,\n\tselectionMode: DateInputSelectionMode\n): readonly DateInputSelectionMode[] {\n\tconst enabledModes = new Set(selectionModeOptions?.length ? selectionModeOptions : DATE_INPUT_SELECTION_MODES);\n\tenabledModes.add(selectionMode);\n\n\treturn DATE_INPUT_SELECTION_MODES.filter((mode) => enabledModes.has(mode));\n}\n\nfunction DateInput(props: DateSingleInputProps): JSX.Element;\nfunction DateInput(props: DateRangeInputProps): JSX.Element;\nfunction DateInput({\n\tplaceholder,\n\tdisabled,\n\terror,\n\tonClearError,\n\tminDate,\n\tmaxDate,\n\tdatePickerLevel,\n\tselectionMode: controlledSelectionMode,\n\tweekEndDay = \"sunday\",\n\tallowSelectionModeChange,\n\tselectionModeOptions,\n\tonSelectionModeChange,\n\t...props\n}: DateInputProps) {\n\tconst [open, setOpen] = useState(false);\n\tconst [uncontrolledSelectionMode, setUncontrolledSelectionMode] = useState<DateInputSelectionMode>(controlledSelectionMode ?? \"day\");\n\tconst selectionMode = controlledSelectionMode ?? uncontrolledSelectionMode;\n\tconst minDatePickerLevel = datePickerLevel ?? \"day\";\n\tconst preferredCalendarType = resolveAvailableDatePickerLevel(selectionMode, minDatePickerLevel);\n\tconst [calendarTypeState, setCalendarTypeState] = useState<CalendarTypeState>(() => ({\n\t\tview: preferredCalendarType,\n\t\tselectionMode,\n\t\tminDatePickerLevel\n\t}));\n\tconst calendarType =\n\t\tcalendarTypeState.selectionMode === selectionMode &&\n\t\tcalendarTypeState.minDatePickerLevel === minDatePickerLevel &&\n\t\tisDatePickerLevelAvailable(calendarTypeState.view, minDatePickerLevel)\n\t\t\t? calendarTypeState.view\n\t\t\t: preferredCalendarType;\n\n\tconst initialDateRef = useRef(props.value);\n\tconst dateInputValueOptions = {\n\t\tselectionMode,\n\t\tweekEndDay\n\t};\n\n\tconst { inputValue, setInputValue, selectedDate, setSelectedDate, handleSelect, formatDate, parseDate } = useDateInput({\n\t\t...props,\n\t\tdatePickerLevel: minDatePickerLevel,\n\t\tselectionMode,\n\t\tweekEndDay\n\t});\n\tconst rangeOnChange = props.selectsRange ? props.onChange : undefined;\n\n\tconst updateCalendarType = useCallback(\n\t\t(calendarType: DatePickerLevel) => {\n\t\t\tif (isDatePickerLevelAvailable(calendarType, minDatePickerLevel)) {\n\t\t\t\tsetCalendarTypeState({\n\t\t\t\t\tview: calendarType,\n\t\t\t\t\tselectionMode,\n\t\t\t\t\tminDatePickerLevel\n\t\t\t\t});\n\t\t\t}\n\t\t},\n\t\t[minDatePickerLevel, selectionMode]\n\t);\n\n\tuseEffect(() => {\n\t\tinitialDateRef.current = props.value;\n\t}, [props.value]);\n\n\tconst handleInputBlur = () => {\n\t\tif (inputValue) {\n\t\t\tconst parsedDate = parseDate(inputValue);\n\t\t\tif (parsedDate) {\n\t\t\t\tsetInputValue(formatDate(parsedDate));\n\n\t\t\t\tif (props.selectsRange && isDateRangeTuple(parsedDate)) {\n\t\t\t\t\tconst selectedRange = isDateRangeTuple(selectedDate) ? selectedDate : null;\n\n\t\t\t\t\tif (areRangeDateValuesEqual(parsedDate, selectedRange, dateInputValueOptions)) return;\n\n\t\t\t\t\tsetSelectedDate(parsedDate);\n\t\t\t\t\tprops.onChange(parsedDate);\n\t\t\t\t} else if (!props.selectsRange && parsedDate instanceof Date) {\n\t\t\t\t\tconst selectedSingleDate = selectedDate instanceof Date ? selectedDate : null;\n\n\t\t\t\t\tif (areSingleDateValuesEqual(parsedDate, selectedSingleDate, dateInputValueOptions)) return;\n\n\t\t\t\t\tsetSelectedDate(parsedDate);\n\t\t\t\t\tprops.onChange(parsedDate);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t};\n\n\tconst handleKeyDown = (event: React.KeyboardEvent<HTMLInputElement>) => {\n\t\tif (event.key === \"Enter\") {\n\t\t\tevent.preventDefault();\n\t\t\thandleInputBlur();\n\t\t}\n\t};\n\n\tconst handleCalendarDateSelect = useCallback(\n\t\t(value: Date | NullableDateRange) => {\n\t\t\tif (handleSelect(value)) {\n\t\t\t\tsetOpen(false);\n\t\t\t}\n\t\t},\n\t\t[handleSelect]\n\t);\n\n\tconst handleSelectionModeChange = useCallback(\n\t\t(nextSelectionMode: DateInputSelectionMode) => {\n\t\t\tif (controlledSelectionMode === undefined) {\n\t\t\t\tsetUncontrolledSelectionMode(nextSelectionMode);\n\t\t\t}\n\n\t\t\tonSelectionModeChange?.(nextSelectionMode);\n\t\t\tsetCalendarTypeState({\n\t\t\t\tview: resolveAvailableDatePickerLevel(nextSelectionMode, minDatePickerLevel),\n\t\t\t\tselectionMode: nextSelectionMode,\n\t\t\t\tminDatePickerLevel\n\t\t\t});\n\t\t},\n\t\t[controlledSelectionMode, minDatePickerLevel, onSelectionModeChange]\n\t);\n\n\tconst handleCancel = useCallback(() => {\n\t\t// Восстановить исходное состояние при отмене\n\t\tif (rangeOnChange) {\n\t\t\tconst [, selectedEndDate] = isDateRangeTuple(selectedDate) ? selectedDate : [null, null];\n\n\t\t\tif (!selectedEndDate) {\n\t\t\t\t// Восстановить исходное состояние диапазона\n\t\t\t\tconst initialValue = initialDateRef.current;\n\t\t\t\tconst initialRange = Array.isArray(initialValue) ? initialValue : null;\n\t\t\t\tconst initialStart = initialRange?.[0] ?? null;\n\t\t\t\tconst initialEnd = initialRange?.[1] ?? null;\n\n\t\t\t\tif (initialStart && initialEnd) {\n\t\t\t\t\tconst initialSelectedDate: NullableDateRange = [initialStart, initialEnd];\n\t\t\t\t\tsetSelectedDate(initialSelectedDate);\n\t\t\t\t\tsetInputValue(formatDate(initialSelectedDate));\n\n\t\t\t\t\trangeOnChange(initialSelectedDate);\n\t\t\t\t} else {\n\t\t\t\t\t// Если начального диапазона нет, очистить всё\n\t\t\t\t\tsetSelectedDate([null, null]);\n\t\t\t\t\tsetInputValue(\"\");\n\n\t\t\t\t\trangeOnChange([null, null]);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}, [rangeOnChange, selectedDate, setSelectedDate, setInputValue, formatDate]);\n\n\tconst availableSelectionModes = resolveSelectionModeOptions(selectionModeOptions, selectionMode);\n\tconst showSelectionModeControl = allowSelectionModeChange && availableSelectionModes.length > 1;\n\n\treturn (\n\t\t<Popover\n\t\t\topen={open}\n\t\t\tonOpenChange={(value) => {\n\t\t\t\tsetOpen(value);\n\t\t\t\tif (!value) {\n\t\t\t\t\thandleCancel();\n\t\t\t\t}\n\t\t\t}}>\n\t\t\t<InputText\n\t\t\t\tlabel={props.label}\n\t\t\t\tdescription={props.description}\n\t\t\t\tsize={props.size}\n\t\t\t\tvalue={inputValue}\n\t\t\t\tonChange={setInputValue}\n\t\t\t\tonBlur={handleInputBlur}\n\t\t\t\tonKeyUp={handleKeyDown}\n\t\t\t\tplaceholder={placeholder}\n\t\t\t\tdisabled={disabled}\n\t\t\t\terror={error}\n\t\t\t\tonClearError={onClearError}\n\t\t\t\tendAdornmentWidth=\"var(--control-height)\"\n\t\t\t\tendAdornment={\n\t\t\t\t\t<Popover.Trigger>\n\t\t\t\t\t\t<div className={uiStyles.uiToggleButtonContainer}>\n\t\t\t\t\t\t\t<button type=\"button\" disabled={disabled} aria-label=\"Открыть календарь\" className={uiStyles.uiToggleButton}>\n\t\t\t\t\t\t\t\t<CalendarDaysIcon />\n\t\t\t\t\t\t\t</button>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t</Popover.Trigger>\n\t\t\t\t}\n\t\t\t/>\n\n\t\t\t<Popover.Content background=\"primary\">\n\t\t\t\t<CalendarView\n\t\t\t\t\tview={calendarType}\n\t\t\t\t\tdatePickerLevel={minDatePickerLevel}\n\t\t\t\t\tselectionMode={selectionMode}\n\t\t\t\t\tweekEndDay={weekEndDay}\n\t\t\t\t\tonViewChange={updateCalendarType}\n\t\t\t\t\tvalue={selectedDate ?? null}\n\t\t\t\t\tonChange={handleCalendarDateSelect}\n\t\t\t\t\tminDate={minDate}\n\t\t\t\t\tmaxDate={maxDate}\n\t\t\t\t\tselectsRange={!!props.selectsRange}\n\t\t\t\t/>\n\t\t\t\t{showSelectionModeControl && (\n\t\t\t\t\t<div className={styles.selectionModeControl}>\n\t\t\t\t\t\t<RadioGroup<DateInputSelectionMode>\n\t\t\t\t\t\t\tvalue={selectionMode}\n\t\t\t\t\t\t\tonChange={handleSelectionModeChange}\n\t\t\t\t\t\t\tnoWrap\n\t\t\t\t\t\t\taria-label=\"Режим выбора даты\">\n\t\t\t\t\t\t\t{availableSelectionModes.map((mode) => (\n\t\t\t\t\t\t\t\t<RadioGroup.Option key={mode} value={mode} label={selectionModeLabels[mode]} />\n\t\t\t\t\t\t\t))}\n\t\t\t\t\t\t</RadioGroup>\n\t\t\t\t\t</div>\n\t\t\t\t)}\n\t\t\t</Popover.Content>\n\t\t</Popover>\n\t);\n}\n\nexport function SingleDateInput(props: Omit<DateSingleInputProps, \"selectsRange\">) {\n\treturn <DateInput {...props} />;\n}\n\nexport function RangeDateInput(props: Omit<DateRangeInputProps, \"selectsRange\">) {\n\treturn <DateInput {...props} selectsRange={true} />;\n}\n"],"mappings":";;;;;;;;;;AAkBA,IAAa,IAA4B,EAA0B,MAKtD,IAA4B,cAEnC,IAAkB;AA8BxB,SAAS,EAA0B,GAAqD;CASvF,OARI,EAAQ,kBAAkB,SAAS,EAAQ,kBAAkB,SACzD,QAGJ,EAAQ,kBAAkB,WAAW,EAAQ,kBAAkB,SAC3D,EAAQ,gBAGT,EAAQ,mBAAmB;AACnC;AAEA,SAAS,EAA6B,GAAwD;CAC7F,OAAO;EACN,eAAe,GAAS;EACxB,YAAY,GAAS;CACtB;AACD;AAKA,SAAS,EACR,GACA,GACwB;CAexB,OAdI,OAAO,KAAoB,YAAY,MAAoB,KAAA,IACvD;EACN,YAAY;EACZ;CACD,IAGG,KAAmB,EAAgB,oBAAoB,KAAA,IACnD;EACN,GAAG;EACH;CACD,IAGM;AACR;AAKA,SAA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gB,GAAmD;CAClF,OAAO,kBAAC,GAAD,EAAW,GAAI,EAAQ,CAAA;AAC/B;AAEA,SAAgB,EAAe,GAAkD;CAChF,OAAO,kBAAC,GAAD;EAAW,GAAI;EAAO,cAAc;CAAO,CAAA;AACnD"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ryuzaki13/react-foundation-ui",
|
|
3
|
-
"version": "1.8.
|
|
3
|
+
"version": "1.8.7",
|
|
4
4
|
"description": "Reusable React foundation UI primitives and Storybook stories.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "Ryuzaki13",
|
|
@@ -383,7 +383,7 @@
|
|
|
383
383
|
"@tanstack/react-virtual": ">=3.14.9 <4.0.0",
|
|
384
384
|
"lexical": ">=0.46.0 <1.0.0",
|
|
385
385
|
"lucide-react": ">=1.21.0 <2.0.0",
|
|
386
|
-
"motion": ">=
|
|
386
|
+
"motion": ">=13.0.0 <14.0.0",
|
|
387
387
|
"react": ">=19.2.0 <20.0.0",
|
|
388
388
|
"react-dom": ">=19.2.0 <20.0.0",
|
|
389
389
|
"react-easy-crop": ">=6.0.0 <7.0.0",
|
|
@@ -473,7 +473,7 @@
|
|
|
473
473
|
"@lexical/selection": "^0.49.0",
|
|
474
474
|
"@lexical/utils": "^0.49.0",
|
|
475
475
|
"@ryuzaki13/react-foundation-api": "^1.1.16",
|
|
476
|
-
"@ryuzaki13/react-foundation-lib": "^1.4.
|
|
476
|
+
"@ryuzaki13/react-foundation-lib": "^1.4.1",
|
|
477
477
|
"@storybook/addon-a11y": "^10.5.5",
|
|
478
478
|
"@storybook/addon-docs": "^10.5.5",
|
|
479
479
|
"@storybook/addon-vitest": "^10.5.5",
|
|
@@ -504,7 +504,7 @@
|
|
|
504
504
|
"jsdom": "^29.1.1",
|
|
505
505
|
"lexical": "^0.49.0",
|
|
506
506
|
"lucide-react": "^1.28.0",
|
|
507
|
-
"motion": "^
|
|
507
|
+
"motion": "^13.1.0",
|
|
508
508
|
"playwright": "^1.62.1",
|
|
509
509
|
"react": "^19.2.8",
|
|
510
510
|
"react-dom": "^19.2.8",
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{n as e}from"./rolldown-runtime-
|
|
1
|
+
import{n as e}from"./rolldown-runtime-DkW27tQK.js";import{n as t}from"./iframe-CViB2sFm.js";import{i as n,r}from"./react-Bl2r1tuC.js";import{a as i,d as a,f as o,l as s,m as c,n as l,p as u,r as d,u as f}from"./blocks-B8F5vBhs.js";import{a as p,i as m,n as h,o as g,r as _,s as v,t as y}from"./Badge.stories-DHmJTpdf.js";function b(e){let t={code:`code`,h2:`h2`,h3:`h3`,li:`li`,p:`p`,pre:`pre`,ul:`ul`,...n(),...e.components};return(0,S.jsxs)(S.Fragment,{children:[(0,S.jsx)(s,{of:h,parameters:{atomicCanvas:!0,layout:`padded`,docs:{toc:!0}}}),`
|
|
2
2
|
`,(0,S.jsx)(u,{children:`Badge`}),`
|
|
3
3
|
`,(0,S.jsx)(o,{children:`Компактная текстовая метка для статусов, категорий, фильтров и коротких служебных пометок`}),`
|
|
4
4
|
`,(0,S.jsx)(t.p,{children:`Badge подходит для коротких подписей, которые должны быстро читаться и не перегружать интерфейс:`}),`
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{n as e,r as t}from"./rolldown-runtime-
|
|
1
|
+
import{n as e,r as t}from"./rolldown-runtime-DkW27tQK.js";import{t as n}from"./react-BZJXY1be.js";import{n as r}from"./iframe-CViB2sFm.js";import{i,n as a,r as o,t as s}from"./BadgeList-BOs5ycWn.js";var c=t({Appearances:()=>h,Basic:()=>p,RemovableList:()=>_,Sizes:()=>g,Tones:()=>m,__namedExportsOrder:()=>v,default:()=>f}),l,u,d,f,p,m,h,g,_,v;function y(){return(y=e((()=>{l=n(),i(),a(),u=r(),{useArgs:d}=__STORYBOOK_MODULE_PREVIEW_API__,f={title:`Shared/UI/Badge`,component:o,args:{children:`Новый`,size:`md`,tone:`info`,appearance:`solid`},parameters:{atomicCanvas:!0,layout:`padded`},argTypes:{children:{description:`Текст внутри бейджа.`,control:`text`},size:{description:`Размер бейджа.`,control:`inline-radio`,options:[`xs`,`sm`,`md`,`lg`,`xl`]},tone:{description:`Цветовой тон бейджа.`,control:`inline-radio`,options:[`neutral`,`brand`,`success`,`warning`,`error`,`info`]},appearance:{description:`Форма бейджа.`,control:`inline-radio`,options:[`solid`,`outline`,`ghost`,`transparent`]},onRemove:{description:`Показывает кнопку удаления и вызывает обработчик по клику.`,control:!1}}},p={render:function(){let[e]=d();return(0,u.jsx)(o,{...e})}},m={render:()=>(0,u.jsxs)(s,{children:[(0,u.jsx)(o,{tone:`neutral`,appearance:`outline`,children:`Neutral`}),(0,u.jsx)(o,{tone:`success`,appearance:`solid`,children:`Успешно`}),(0,u.jsx)(o,{tone:`warning`,appearance:`solid`,children:`Внимание`}),(0,u.jsx)(o,{tone:`error`,appearance:`solid`,children:`Ошибка`}),(0,u.jsx)(o,{tone:`info`,appearance:`solid`,children:`Информация`})]})},h={render:()=>(0,u.jsxs)(s,{children:[(0,u.jsx)(o,{tone:`neutral`,appearance:`solid`,children:`Solid`}),(0,u.jsx)(o,{tone:`neutral`,appearance:`outline`,children:`Outline`}),(0,u.jsx)(o,{tone:`info`,appearance:`ghost`,children:`Ghost`}),(0,u.jsx)(o,{tone:`warning`,appearance:`transparent`,children:`Transparent`})]})},g={render:()=>(0,u.jsxs)(s,{children:[(0,u.jsx)(o,{size:`xs`,children:`Extra Small`}),(0,u.jsx)(o,{size:`sm`,children:`Small`}),(0,u.jsx)(o,{size:`md`,children:`Medium`}),(0,u.jsx)(o,{size:`lg`,children:`Large`}),(0,u.jsx)(o,{size:`xl`,children:`Extra Large`})]})},_={render:()=>{let[e,t]=(0,l.useState)([`Фильтр A`,`Фильтр B`,`Фильтр C`]);return(0,u.jsx)(s,{children:e.map(e=>(0,u.jsx)(o,{tone:`info`,appearance:`outline`,onRemove:()=>t(t=>t.filter(t=>t!==e)),children:e},e))})}},p.parameters={...p.parameters,docs:{...p.parameters?.docs,source:{originalSource:`{
|
|
2
2
|
render: function Render() {
|
|
3
3
|
const [args] = useArgs<BadgeStoryArgs>();
|
|
4
4
|
return <Badge {...args} />;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{n as e}from"./rolldown-runtime-
|
|
1
|
+
import{n as e}from"./rolldown-runtime-DkW27tQK.js";import{t}from"./react-BZJXY1be.js";import{n,t as r}from"./x-C5XG0bD4.js";import{n as i}from"./iframe-CViB2sFm.js";import{a,i as o}from"./utils-tg3ibbzi.js";import{a as s,l as c}from"./array-D-_yMMUK-BQ0uu1hZ.js";import{n as l,t as u}from"./FloatingPopover-NMRTnqfo.js";import{a as d,i as f,r as p,t as m}from"./uiClasses-B9c6dZuu.js";import{n as h,t as g}from"./FlexContainer-BWyPlTMB.js";function _({maxChar:e,placement:t=`left`,closeDelay:n=0,maxWidth:r,children:i,block:a,state:o,textWrap:s,textWrapProps:l}){let d=c(i);if(!d.length||e&&d.length<e)return(0,v.jsx)(`span`,{children:d});let f=s??`div`,p={style:{display:a?`block`:`inline-block`,width:e?`${e-3}ch`:`auto`},className:`textOverflow`},m={...l,...p,style:{...l?.style,...p.style},className:[l?.className,p.className].filter(Boolean).join(` `)};return(0,v.jsx)(u,{state:o,placement:t,openOnHover:!0,content:d,closeDelay:n,maxWidth:r,children:(0,v.jsx)(f,{...m,children:d})})}var v;function y(){return(y=e((()=>{s(),l(),v=i(),_.__docgenInfo={description:``,methods:[],displayName:`TextOverflow`,props:{children:{required:!0,tsType:{name:`string`},description:``},maxChar:{required:!1,tsType:{name:`number`},description:``},maxWidth:{required:!1,tsType:{name:`number`},description:`Максимальная ширина тултипа в em.`},placement:{required:!1,tsType:{name:`Placement`},description:``,defaultValue:{value:`"left"`,computed:!1}},closeDelay:{required:!1,tsType:{name:`number`},description:``,defaultValue:{value:`0`,computed:!1}},block:{required:!1,tsType:{name:`literal`,value:`true`},description:`Для работы text-overflow элемент обязан быть блочным или inline-block.
|
|
2
2
|
Если в качестве обёртки передается инлайновый компонент, то он будет
|
|
3
3
|
перезаписан через стили на display: block или inline-block в зависимости
|
|
4
4
|
от установки данного пропса.`},state:{required:!1,tsType:{name:`union`,raw:`"information" | "error" | "warning" | "success" | "negative"`,elements:[{name:`literal`,value:`"information"`},{name:`literal`,value:`"error"`},{name:`literal`,value:`"warning"`},{name:`literal`,value:`"success"`},{name:`literal`,value:`"negative"`}]},description:``},textWrap:{required:!1,tsType:{name:`T`},description:``},textWrapProps:{required:!1,tsType:{name:`Omit`,elements:[{name:`ComponentProps`,elements:[{name:`T`}],raw:`ComponentProps<T>`},{name:`literal`,value:`"children"`}],raw:`Omit<ComponentProps<T>, "children">`},description:``}}}})))()}var b,x,S,C,w,T,E,D,O,k;function A(){return(A=e((()=>{b=`qBtmnH`,x=`p-HsHY`,S=`u9tQAE`,C=`FRScRz`,w=`W13uQO`,T=`_3IRcM9`,E=`R3ybI7`,D=`DdWAaC`,O=`_5cXBQF`,k={badge:b,passive:x,sizeXs:S,sizeSm:C,sizeMd:w,sizeLg:T,sizeXl:E,content:D,removeButton:O}})))()}function j({children:e,size:t=`sm`,tone:n,appearance:i,className:o,onRemove:s}){let c=n??`neutral`,l=d({tone:n,appearance:i,fallbackTone:c,fallbackAppearance:c===`neutral`?`outline`:`solid`});return(0,M.jsxs)(`div`,{className:a(k.badge,N[t],p(l.tone),m(l.appearance),!s&&k.passive,o),children:[(0,M.jsx)(_,{maxChar:25,placement:`top`,block:!0,textWrapProps:{className:k.content},children:String(e)}),s&&(0,M.jsx)(`button`,{type:`button`,onClick:s,className:k.removeButton,"aria-label":`Удалить бейдж`,"data-ui":`badge-remove-button`,"data-action":`remove-badge`,children:(0,M.jsx)(r,{})})]})}var M,N;function P(){return(P=e((()=>{o(),n(),y(),f(),A(),M=i(),N={xs:k.sizeXs,sm:k.sizeSm,md:k.sizeMd,lg:k.sizeLg,xl:k.sizeXl},j.__docgenInfo={description:`Компактный индикатор для статусов, категорий и коротких служебных меток.`,methods:[],displayName:`Badge`,props:{children:{required:!0,tsType:{name:`union`,raw:`string | number`,elements:[{name:`string`},{name:`number`}]},description:``},size:{required:!1,tsType:{name:`union`,raw:`"xs" | "sm" | "md" | "lg" | "xl"`,elements:[{name:`literal`,value:`"xs"`},{name:`literal`,value:`"sm"`},{name:`literal`,value:`"md"`},{name:`literal`,value:`"lg"`},{name:`literal`,value:`"xl"`}]},description:``,defaultValue:{value:`"sm"`,computed:!1}},tone:{required:!1,tsType:{name:`union`,raw:`"neutral" | "brand" | "error" | "warning" | "success" | "info"`,elements:[{name:`literal`,value:`"neutral"`},{name:`literal`,value:`"brand"`},{name:`literal`,value:`"error"`},{name:`literal`,value:`"warning"`},{name:`literal`,value:`"success"`},{name:`literal`,value:`"info"`}]},description:``},appearance:{required:!1,tsType:{name:`union`,raw:`"solid" | "outline" | "ghost" | "transparent"`,elements:[{name:`literal`,value:`"solid"`},{name:`literal`,value:`"outline"`},{name:`literal`,value:`"ghost"`},{name:`literal`,value:`"transparent"`}]},description:``},className:{required:!1,tsType:{name:`string`},description:``},onRemove:{required:!1,tsType:{name:`signature`,type:`function`,raw:`() => void`,signature:{arguments:[],return:{name:`void`}}},description:``}}}})))()}function F({children:e}){return(0,L.jsx)(g,{inline:!0,wrap:!0,gap:`sm`,align:`baseline`,children:I.Children.map(e,(e,t)=>(0,L.jsx)(I.Fragment,{children:e},t))})}var I,L;function R(){return(R=e((()=>{I=t(),h(),L=i(),F.__docgenInfo={description:"Контейнер для группы `Badge`, который выстраивает элементы в единый список с предсказуемыми отступами. Используется для компактного вывода набора меток или фильтров.",methods:[],displayName:`BadgeList`,props:{children:{required:!0,tsType:{name:`Array`,elements:[{name:`ReactElement`,elements:[{name:`union`,raw:`typeof Badge | null | undefined | false`,elements:[{name:`Badge`},{name:`null`},{name:`undefined`},{name:`literal`,value:`false`}]}],raw:`ReactElement<typeof Badge | null | undefined | false>`}],raw:`ReactElement<typeof Badge | null | undefined | false>[]`},description:``}}}})))()}export{P as i,R as n,j as r,F as t};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{a as e,n as t}from"./rolldown-runtime-DkW27tQK.js";import{t as n}from"./react-BZJXY1be.js";import{n as r}from"./iframe-CViB2sFm.js";import{a as i,i as a}from"./utils-tg3ibbzi.js";import{n as o,t as s}from"./FloatingPopover-NMRTnqfo.js";import{n as c,t as l}from"./ui.module-Cat84Nza.js";import{a as u,i as d,r as f,t as p}from"./uiClasses-B9c6dZuu.js";var m,h,g,_,v;function y(){return(y=t((()=>{m=`wLOHwj`,h=`lFsM-Y`,g=`LPob63`,_=`tsaGtv`,v={button:m,iconOnly:h,buttonInner:g,buttonIcon:_}})))()}var b,x,S;function C(){return(C=t((()=>{b=e(n(),1),a(),o(),l(),d(),y(),x=r(),S=(0,b.forwardRef)(function({children:e,disabled:t,className:n,icon:r,iconEnd:a,title:o,variant:l,tone:d,appearance:m,type:h=`button`,"aria-label":g,..._},y){let S=b.Children.count(e)>0,C=!!r&&!S,w=u({variant:l,tone:d,appearance:m,fallbackAppearance:d&&d!==`neutral`?`solid`:`outline`}),T=C?g??o:g,E=(0,x.jsx)(`button`,{..._,ref:y,type:h,disabled:t,"aria-label":T,className:i(c.uiElement,c.uiInputControl,v.button,f(w.tone),p(w.appearance),C?v.iconOnly:``,`textNoWrap`,n??``),children:(0,x.jsxs)(`span`,{className:v.buttonInner,children:[r&&!a&&(0,x.jsx)(`span`,{"aria-hidden":`true`,className:v.buttonIcon,children:r}),S&&(0,x.jsx)(`span`,{className:`flexEllipsis`,children:e}),r&&a&&(0,x.jsx)(`span`,{"aria-hidden":`true`,className:v.buttonIcon,children:r})]})});return o?(0,x.jsx)(s,{placement:`bottom`,tooltip:!0,content:(0,x.jsx)(x.Fragment,{children:o}),children:E}):E}),S.__docgenInfo={description:'Базовая кнопка дизайн-системы для пользовательских действий.\nПоддерживает состояния, tone + appearance, иконки и безопасный `type="button"` по умолчанию.',methods:[],displayName:`Button`,props:{variant:{required:!1,tsType:{name:`union`,raw:`| "transparent"
|
|
2
2
|
| "ghost"
|
|
3
3
|
| "neutral"
|
|
4
4
|
| "brand"
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{n as e}from"./rolldown-runtime-
|
|
1
|
+
import{n as e}from"./rolldown-runtime-DkW27tQK.js";import{n as t}from"./iframe-CViB2sFm.js";import{i as n,r}from"./react-Bl2r1tuC.js";import{a as i,d as a,f as o,l as s,m as c,n as l,p as u,r as d,u as f}from"./blocks-B8F5vBhs.js";import{a as p,i as m,n as h,o as g,r as _,t as v}from"./Button.stories-DgFLAdcg.js";function y(e){let t={code:`code`,h2:`h2`,h3:`h3`,li:`li`,p:`p`,pre:`pre`,ul:`ul`,...n(),...e.components};return(0,x.jsxs)(x.Fragment,{children:[(0,x.jsx)(s,{of:h,parameters:{atomicCanvas:!0,layout:`padded`,docs:{toc:!0}}}),`
|
|
2
2
|
`,(0,x.jsx)(u,{children:`Button`}),`
|
|
3
3
|
`,(0,x.jsx)(o,{children:`Базовая action-кнопка дизайн-системы для пользовательских действий, подтверждений и быстрых операций`}),`
|
|
4
4
|
`,(0,x.jsxs)(t.p,{children:[(0,x.jsx)(t.code,{children:`Button`}),` используется как универсальная кнопка интерфейса: в формах, тулбарах, модальных окнах, карточках, таблицах и компактных icon-only сценариях.`]}),`
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{n as e,r as t}from"./rolldown-runtime-
|
|
1
|
+
import{n as e,r as t}from"./rolldown-runtime-DkW27tQK.js";import{n,t as r}from"./check-mlY_aVEI.js";import{n as i,t as a}from"./download-CSY7aIz0.js";import{i as o,n as s,r as c}from"./iframe-CViB2sFm.js";import{n as l,t as u}from"./Button-BTtYeCS_.js";var d,f;function p(){return(p=e((()=>{o(),d=[[`path`,{d:`M10.268 21a2 2 0 0 0 3.464 0`,key:`vwvbt9`}],[`path`,{d:`M3.262 15.326A1 1 0 0 0 4 17h16a1 1 0 0 0 .74-1.673C19.41 13.956 18 12.499 18 8A6 6 0 0 0 6 8c0 4.499-1.411 5.956-2.738 7.326`,key:`11g9vi`}]],f=c(`bell`,d)})))()}var m,h;function g(){return(g=e((()=>{o(),m=[[`path`,{d:`M5 12h14`,key:`1ays0h`}],[`path`,{d:`M12 5v14`,key:`s699le`}]],h=c(`plus`,m)})))()}var _=t({Basic:()=>x,ComposableScheme:()=>C,Variants:()=>S,WithIcons:()=>w,__namedExportsOrder:()=>T,default:()=>b}),v,y,b,x,S,C,w,T;function E(){return(E=e((()=>{p(),n(),i(),g(),l(),v=s(),{useArgs:y}=__STORYBOOK_MODULE_PREVIEW_API__,b={title:`Shared/UI/Button`,component:u,args:{children:`Действие`,variant:`neutralOutline`,disabled:!1,iconEnd:!1},parameters:{atomicCanvas:!0,layout:`padded`},argTypes:{children:{description:`Текстовое содержимое кнопки.`,control:`text`},variant:{description:"Готовая схема для обратной совместимости. Если заданы `tone` или `appearance`, они имеют приоритет.",control:`select`,options:[`neutral`,`neutralOutline`,`ghost`,`brand`,`error`,`warning`,`success`,`info`,`brandOutline`,`errorOutline`,`warningOutline`,`successOutline`,`infoOutline`,`transparent`]},tone:{description:`Цветовой тон кнопки.`,control:`inline-radio`,options:[`neutral`,`brand`,`error`,`warning`,`success`,`info`]},appearance:{description:`Визуальная форма кнопки.`,control:`inline-radio`,options:[`solid`,`outline`,`ghost`,`transparent`]},icon:{description:`Иконка слева или справа от текста.`,control:!1},iconEnd:{description:`Перемещает иконку в конец кнопки.`,control:`boolean`},type:{description:"Тип нативной кнопки; по умолчанию безопасный `button`.",control:`select`,options:[`button`,`submit`,`reset`]},disabled:{description:`Блокирует нажатие.`,control:`boolean`}}},x={render:function(){let[e]=y();return(0,v.jsx)(u,{...e})}},S={render:()=>(0,v.jsxs)(`div`,{style:{display:`grid`,gap:12,gridTemplateColumns:`repeat(auto-fit, minmax(180px, 1fr))`},children:[(0,v.jsx)(u,{variant:`neutral`,children:`Neutral Solid`}),(0,v.jsx)(u,{variant:`neutralOutline`,children:`Neutral Outline`}),(0,v.jsx)(u,{variant:`ghost`,children:`Ghost`}),(0,v.jsx)(u,{variant:`brand`,children:`Brand Solid`}),(0,v.jsx)(u,{variant:`brandOutline`,children:`Brand Outline`}),(0,v.jsx)(u,{variant:`info`,children:`Info Solid`}),(0,v.jsx)(u,{variant:`success`,children:`Success Solid`}),(0,v.jsx)(u,{variant:`warning`,children:`Warning Solid`}),(0,v.jsx)(u,{variant:`error`,children:`Error Solid`}),(0,v.jsx)(u,{variant:`infoOutline`,children:`Info Outline`}),(0,v.jsx)(u,{variant:`successOutline`,children:`Success Outline`}),(0,v.jsx)(u,{variant:`warningOutline`,children:`Warning Outline`}),(0,v.jsx)(u,{variant:`errorOutline`,children:`Error Outline`}),(0,v.jsx)(u,{variant:`transparent`,children:`Transparent`})]}),args:{children:`Действие`}},C={render:()=>(0,v.jsxs)(`div`,{style:{display:`grid`,gap:12,gridTemplateColumns:`repeat(auto-fit, minmax(180px, 1fr))`},children:[(0,v.jsx)(u,{tone:`neutral`,appearance:`solid`,children:`Neutral Solid`}),(0,v.jsx)(u,{tone:`neutral`,appearance:`outline`,children:`Neutral Outline`}),(0,v.jsx)(u,{tone:`neutral`,appearance:`ghost`,children:`Neutral Ghost`}),(0,v.jsx)(u,{tone:`brand`,appearance:`solid`,children:`Brand Solid`}),(0,v.jsx)(u,{tone:`brand`,appearance:`outline`,children:`Brand Outline`}),(0,v.jsx)(u,{tone:`brand`,appearance:`ghost`,children:`Brand Ghost`}),(0,v.jsx)(u,{tone:`brand`,appearance:`transparent`,children:`Brand Transparent`}),(0,v.jsx)(u,{tone:`info`,appearance:`outline`,children:`Info Outline`}),(0,v.jsx)(u,{tone:`success`,appearance:`solid`,children:`Success Solid`}),(0,v.jsx)(u,{tone:`error`,appearance:`transparent`,children:`Error Transparent`})]})},w={render:()=>(0,v.jsxs)(`div`,{style:{display:`flex`,gap:12,flexWrap:`wrap`},children:[(0,v.jsx)(u,{icon:(0,v.jsx)(a,{}),children:`Скачать`}),(0,v.jsx)(u,{icon:(0,v.jsx)(h,{}),tone:`info`,appearance:`solid`,children:`Создать`}),(0,v.jsx)(u,{icon:(0,v.jsx)(r,{}),iconEnd:!0,tone:`success`,appearance:`solid`,children:`Подтвердить`}),(0,v.jsx)(u,{icon:(0,v.jsx)(f,{}),title:`Уведомления`})]}),args:{children:`Действие`}},x.parameters={...x.parameters,docs:{...x.parameters?.docs,source:{originalSource:`{
|
|
2
2
|
render: function Render() {
|
|
3
3
|
const [args] = useArgs<ButtonProps>();
|
|
4
4
|
return <Button {...args} />;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{n as e}from"./rolldown-runtime-C0FnF6B9.js";import{t}from"./react-C21x__mS.js";import{n,t as r}from"./chevron-left-Dl69q13G.js";import{n as i,t as a}from"./chevron-right-CJNjsAmt.js";import{i as o,n as s,r as c}from"./iframe-Bu7ux79g.js";import{a as l,i as u}from"./utils-DUM89eIj.js";import{C as d,b as f,c as p,h as m,m as h,n as g,o as _,w as v,x as y,y as b}from"./formatters-CBgrBeSA-DY6OIAc8.js";import{n as x,t as S}from"./Button-C5Z6nJ9s.js";var C,w;function T(){return(T=e((()=>{o(),C=[[`path`,{d:`M8 2v3`,key:`1ioesn`}],[`path`,{d:`M16 2v3`,key:`otl347`}],[`rect`,{x:`3`,y:`3`,width:`18`,height:`18`,rx:`2`,key:`h1oib`}],[`path`,{d:`M3 9h18`,key:`1pudct`}],[`path`,{d:`M8 13h.01`,key:`1sbv64`}],[`path`,{d:`M12 13h.01`,key:`y0uutt`}],[`path`,{d:`M16 13h.01`,key:`wip0gl`}],[`path`,{d:`M8 17h.01`,key:`p3bg7i`}],[`path`,{d:`M12 17h.01`,key:`p32p05`}],[`path`,{d:`M16 17h.01`,key:`ql8jdd`}]],w=c(`calendar-days`,C)})))()}function ee(e){return e===`month`?`month`:e===`year`?`year`:`day`}function E(e,t){return k.indexOf(e)>=k.indexOf(t)}function te(e,t){let n=ee(e);return E(n,t)?n:t}function D(e,t){return!e||!t?!1:e.start.getTime()===t.start.getTime()&&e.end.getTime()===t.end.getTime()}function ne(e,t,n){if(!e||!t||!n)return!1;let r=Math.min(t.start.getTime(),n.start.getTime()),i=Math.max(t.end.getTime(),n.end.getTime());return e.start.getTime()>=r&&e.end.getTime()<=i}function O({date:e,value:t,hoveredDate:n,selectsRange:r,selectionOptions:i}){let a=g(e,i),o=!r&&t instanceof Date?t:null,s=g(o,i);if(!r||!Array.isArray(t))return{selected:_(e,s),range:!1,rangeStart:!1,rangeEnd:!1};let[c,l]=t,u=g(c,i),d=g(l??(c?n:null),i),f=D(a,u),p=D(a,d);return{selected:!1,range:ne(a,u,d)&&!f&&!p,rangeStart:f,rangeEnd:p}}var k,re,ie;function A(){return(A=e((()=>{b(),k=[`day`,`month`,`year`],re=[`day`,`week`,`month`,`year`],ie=[`friday`,`saturday`,`sunday`]})))()}var ae,oe,se,ce,le,ue,de,fe,j,M,N,P,F,I,L,R,z;function B(){return(B=e((()=>{ae=`Dshr-j`,oe=`esetVt`,se=`i-LJYe`,ce=`XZsnCH`,le=`_2KDjTS`,ue=`o-freG`,de=`GcV08-`,fe=`UCrE-I`,j=`L2V3uq`,M=`Te9oCq`,N=`cUF2pQ`,P=`d1L5uw`,F=`LU0M9Y`,I=`MR3y5p`,L=`VDqDpm`,R=`CLR-7m`,z={dayView:ae,weekdays:oe,weekday:se,daysGrid:ce,week:le,day:ue,disabled:de,outsideMonth:fe,periodSelection:j,periodPreview:M,selected:N,range:P,rangeStart:F,rangeEnd:I,weekend:L,now:R}})))()}var V,H,pe,me,U;function he(){return(he=e((()=>{V=t(),b(),u(),B(),H=s(),pe=[`Пн`,`Вт`,`Ср`,`Чт`,`Пт`,`Сб`,`Вс`],me=new Intl.DateTimeFormat(`ru-RU`,{weekday:`long`,year:`numeric`,month:`long`,day:`numeric`}),U=({now:e,currentDate:t,value:n,onChange:r,minDate:i,maxDate:a,selectsRange:o,selectionMode:s=`day`,weekEndDay:c=`sunday`})=>{let[u,f]=(0,V.useState)(null),m={selectionMode:s,weekEndDay:c},v=(()=>{let e=t.getFullYear(),n=t.getMonth(),r=h(e,n,1),i=h(e,n+1,0),a=r.getDay()===0?6:r.getDay()-1,o=42-(a+i.getDate()),s=[],c=h(e,n,0).getDate();for(let t=a;t>0;--t)s.push(h(e,n-1,c-t+1));for(let t=1;t<=i.getDate();t+=1)s.push(h(e,n,t));for(let t=1;t<=o;t+=1)s.push(h(e,n+1,t));let l=[];for(let e=0;e<s.length;e+=7)l.push(s.slice(e,e+7));return l})(),b=o&&Array.isArray(n)?n[0]:null,x=o&&Array.isArray(n)?n[1]:null,S=g(o?null:n,m),C=g(u,m),w=x??(b?C?.end??null:null),T=s===`week`,ee=T&&(!o||!b),E=e=>{if(!o||!b||!w)return!1;let t=d(e).getTime(),n=b.getTime(),r=w.getTime();return t>=Math.min(n,r)&&t<=Math.max(n,r)},te=e=>!y(g(e,m),{minDate:i,maxDate:a}),D=(e,t)=>{t||(T&&f(e),!(!o||!b||x)&&(T||f(e)))};return(0,H.jsxs)(`div`,{className:z.dayView,children:[(0,H.jsx)(`div`,{className:z.weekdays,children:pe.map(e=>(0,H.jsx)(`div`,{className:z.weekday,children:e},e))}),(0,H.jsx)(`div`,{className:z.daysGrid,onMouseLeave:()=>{(T||!x)&&f(null)},children:v.map((n,i)=>(0,H.jsx)(`div`,{className:z.week,children:n.map((n,a)=>{let o=n.getMonth()===t.getMonth(),c=_(n,S),u=ee&&_(n,C),d=E(n),f=p(n,b),m=p(n,w),h=p(n,e),g=te(n);return(0,H.jsx)(`button`,{type:`button`,onClick:()=>!g&&r(n),onMouseEnter:()=>D(n,g),disabled:g,"data-ui":`calendar-day-button`,"data-action":`select-calendar-day`,className:l(z.day,{[z.outsideMonth]:!o,[z.periodSelection]:s===`week`,[z.periodPreview]:u&&!c,[z.selected]:c,[z.range]:d&&!f&&!m,[z.rangeStart]:f,[z.rangeEnd]:m,[z.disabled]:g,[z.weekend]:a>4,[z.now]:h}),"aria-label":me.format(n),"aria-pressed":c||d||f||m,children:n.getDate()},`${i}-${a}`)})},i))})]})},U.__docgenInfo={description:`Отображает сетку дней месяца в календарной семантике без timezone-сдвига.`,methods:[],displayName:`CalendarDayView`,props:{selectionMode:{defaultValue:{value:`"day"`,computed:!1},required:!1},weekEndDay:{defaultValue:{value:`"sunday"`,computed:!1},required:!1}}}})))()}var ge,_e,ve,ye,be,xe,W,Se,G;function Ce(){return(Ce=e((()=>{ge=`p5pRGW`,_e=`pUHpxD`,ve=`lwWv-z`,ye=`_8gn-3z`,be=`b57d-c`,xe=`nGc5FO`,W=`JLqjri`,Se=`UQMYwg`,G={monthView:ge,monthsGrid:_e,month:ve,disabled:ye,range:be,selected:xe,rangeStart:W,rangeEnd:Se}})))()}var we,K,Te,Ee,q;function De(){return(De=e((()=>{we=t(),b(),u(),A(),Ce(),K=s(),Te=new Intl.DateTimeFormat(`ru-RU`,{month:`short`}),Ee=new Intl.DateTimeFormat(`ru-RU`,{month:`long`,year:`numeric`}),q=({currentDate:e,value:t,onChange:n,minDate:r,maxDate:i,selectsRange:a,selectsPeriod:o,selectionMode:s=`day`,weekEndDay:c=`sunday`})=>{let[u,d]=(0,we.useState)(null),f=Array.from({length:12},(e,t)=>t),p=e.getFullYear(),m={selectionMode:s,weekEndDay:c},_=a&&Array.isArray(t)?t[0]:null,v=a&&Array.isArray(t)?t[1]:null,b=e=>Te.format(h(p,e,1)),x=e=>{if(!r&&!i)return!1;let t=h(p,e,1),n=h(p,e+1,0,23,59,59);return o?!y(g(t,m),{minDate:r,maxDate:i}):!!(r&&n<r||i&&t>i)},S=(e,t)=>{!a||!_||v||t||d(e)};return(0,K.jsx)(`div`,{className:G.monthView,children:(0,K.jsx)(`div`,{className:G.monthsGrid,onMouseLeave:()=>{v||d(null)},children:f.map(e=>{let r=x(e),i=h(p,e,1),o=O({date:i,value:t,hoveredDate:u,selectsRange:a,selectionOptions:m});return(0,K.jsx)(`button`,{type:`button`,onClick:()=>!r&&n(i),onMouseEnter:()=>S(i,r),disabled:r,"data-ui":`calendar-month-button`,"data-action":`select-calendar-month`,className:l(G.month,{[G.selected]:o.selected,[G.range]:o.range,[G.rangeStart]:o.rangeStart,[G.rangeEnd]:o.rangeEnd,[G.disabled]:r}),"aria-label":Ee.format(i),"aria-pressed":o.selected||o.range||o.rangeStart||o.rangeEnd,children:b(e)},e)})})})},q.__docgenInfo={description:`Отображает выбор месяца в календарной семантике без timezone-сдвига.`,methods:[],displayName:`CalendarMonthView`,props:{selectionMode:{defaultValue:{value:`"day"`,computed:!1},required:!1},weekEndDay:{defaultValue:{value:`"sunday"`,computed:!1},required:!1}}}})))()}var Oe,ke,J;function Ae(){return(Ae=e((()=>{Oe=`E35KE6`,ke=`L14Qef`,J={calendarView:Oe,calendarHeader:ke}})))()}var je,Me,Ne,Pe,Fe,Ie,Le,Re,Y;function ze(){return(ze=e((()=>{je=`_--xW7O`,Me=`-N-5Jk`,Ne=`hhY92S`,Pe=`IhX7jj`,Fe=`NWNpWj`,Ie=`d1SfcV`,Le=`Gkui4r`,Re=`_0dVZLW`,Y={yearView:je,yearsGrid:Me,year:Ne,disabled:Pe,range:Fe,selected:Ie,rangeStart:Le,rangeEnd:Re}})))()}var Be,X,Z;function Ve(){return(Ve=e((()=>{Be=t(),b(),u(),A(),ze(),X=s(),Z=({currentDate:e,value:t,onChange:n,minDate:r,maxDate:i,selectsRange:a,selectsPeriod:o,selectionMode:s=`day`,weekEndDay:c=`sunday`})=>{let[u,d]=(0,Be.useState)(null),f=Math.floor(e.getFullYear()/12)*12,p=Array.from({length:12},(e,t)=>f+t),m={selectionMode:s,weekEndDay:c},_=a&&Array.isArray(t)?t[0]:null,v=a&&Array.isArray(t)?t[1]:null,b=e=>{if(!r&&!i)return!1;let t=h(e,0,1),n=h(e,11,31,23,59,59);return o?!y(g(t,m),{minDate:r,maxDate:i}):!!(r&&n<r||i&&t>i)},x=(e,t)=>{!a||!_||v||t||d(e)};return(0,X.jsx)(`div`,{className:Y.yearView,children:(0,X.jsx)(`div`,{className:Y.yearsGrid,onMouseLeave:()=>{v||d(null)},children:p.map(e=>{let r=b(e),i=h(e,0,1),o=O({date:i,value:t,hoveredDate:u,selectsRange:a,selectionOptions:m});return(0,X.jsx)(`button`,{type:`button`,onClick:()=>!r&&n(i),onMouseEnter:()=>x(i,r),disabled:r,"data-ui":`calendar-year-button`,"data-action":`select-calendar-year`,className:l(Y.year,{[Y.selected]:o.selected,[Y.range]:o.range,[Y.rangeStart]:o.rangeStart,[Y.rangeEnd]:o.rangeEnd,[Y.disabled]:r}),"aria-label":e.toString(),"aria-pressed":o.selected||o.range||o.rangeStart||o.rangeEnd,children:e},e)})})})},Z.__docgenInfo={description:`Отображает выбор года в календарной семантике без timezone-сдвига.`,methods:[],displayName:`CalendarYearView`,props:{selectionMode:{defaultValue:{value:`"day"`,computed:!1},required:!1},weekEndDay:{defaultValue:{value:`"sunday"`,computed:!1},required:!1}}}})))()}function He(e,t){if(t&&f(e)&&e[0]instanceof Date)return e[0];if(!t&&e instanceof Date)return e}function Ue({view:e,datePickerLevel:t,selectionMode:n=`day`,weekEndDay:i=`sunday`,onViewChange:o,...s}){let[c]=(0,Q.useState)(()=>d(new Date)),l=He(s.value,s.selectsRange),u=l?.getTime()??null,[f,p]=(0,Q.useState)(()=>({sourceValueTime:u,currentDate:l??d(new Date)})),h=l&&f.sourceValueTime!==u?l:f.currentDate,_=s.currentDate??h,b={selectionMode:n,weekEndDay:i},x=e=>{let t=typeof e==`function`?e(_):e;s.currentDate===void 0&&p({sourceValueTime:u,currentDate:t}),s.onCurrentDateChange?.(t)},C=()=>{if(e===`day`){x(e=>m(e,-1));return}if(e===`month`){x(e=>v(e,-1));return}x(e=>v(e,-12))},w=()=>{if(e===`day`){x(e=>m(e,1));return}if(e===`month`){x(e=>v(e,1));return}x(e=>v(e,12))};return(0,$.jsxs)(`div`,{className:J.calendarView,children:[(()=>{let t=``;if(e===`day`)t=_.toLocaleDateString(`ru-RU`,{month:`long`,year:`numeric`});else if(e===`month`)t=_.getFullYear().toString();else{let e=Math.floor(_.getFullYear()/12)*12;t=`${e} - ${e+11}`}return(0,$.jsxs)(`div`,{className:J.calendarHeader,children:[(0,$.jsx)(S,{icon:(0,$.jsx)(r,{}),onClick:C,variant:`ghost`,"aria-label":`Предыдущий`,"data-action":`calendar-previous`}),(0,$.jsx)(S,{onClick:()=>{e===`day`?o(`month`):e===`month`&&o(`year`)},variant:`ghost`,className:`flex1`,"data-ui":`calendar-view-switch-button`,"data-action":`calendar-switch-view`,children:t}),(0,$.jsx)(S,{icon:(0,$.jsx)(a,{}),onClick:w,variant:`ghost`,"aria-label":`Следующий`,"data-ui":`calendar-next-button`,"data-action":`calendar-next`})]})})(),(()=>{let r=e=>{let t=g(e,b);if(!(!t||!y(t,{minDate:s.minDate,maxDate:s.maxDate}))){if(s.selectsRange){let e=null,n=null;if(Array.isArray(s.value)&&([e,n]=s.value),!e||n){s.onChange([t.start,null]);return}let r=g(e,b);if(!r)return;if(t.start<r.start){s.onChange([t.start,r.end]);return}s.onChange([r.start,t.end]);return}s.onChange(t.start)}},a=e=>{if(x(e),n===`month`||!E(`day`,t)){r(e);return}o(`day`)},l=e=>{if(x(e),n===`year`||!E(`month`,t)){r(e);return}o(`month`)};switch(e){case`day`:return(0,$.jsx)(U,{now:c,currentDate:_,value:s.value,onChange:r,minDate:s.minDate,maxDate:s.maxDate,selectsRange:s.selectsRange,selectionMode:n,weekEndDay:i});case`month`:return(0,$.jsx)(q,{currentDate:_,value:s.value,onChange:a,minDate:s.minDate,maxDate:s.maxDate,selectsRange:s.selectsRange,selectsPeriod:n===`month`||!E(`day`,t),selectionMode:n,weekEndDay:i});case`year`:return(0,$.jsx)(Z,{currentDate:_,value:s.value,onChange:l,minDate:s.minDate,maxDate:s.maxDate,selectsRange:s.selectsRange,selectsPeriod:n===`year`||!E(`month`,t),selectionMode:n,weekEndDay:i});default:return null}})()]})}var Q,$;function We(){return(We=e((()=>{Q=t(),b(),n(),i(),x(),A(),he(),De(),Ae(),Ve(),$=s(),Ue.__docgenInfo={description:`Отображает календарь выбора даты в календарной семантике без timezone-сдвига.`,methods:[],displayName:`CalendarView`,props:{view:{required:!0,tsType:{name:`union`,raw:`"day" | "month" | "year"`,elements:[{name:`literal`,value:`"day"`},{name:`literal`,value:`"month"`},{name:`literal`,value:`"year"`}]},description:``},datePickerLevel:{required:!0,tsType:{name:`union`,raw:`"day" | "month" | "year"`,elements:[{name:`literal`,value:`"day"`},{name:`literal`,value:`"month"`},{name:`literal`,value:`"year"`}]},description:``},selectionMode:{required:!1,tsType:{name:`CalendarPeriodSelectionMode`},description:``,defaultValue:{value:`"day"`,computed:!1}},weekEndDay:{required:!1,tsType:{name:`CalendarWeekEndDay`},description:``,defaultValue:{value:`"sunday"`,computed:!1}},onViewChange:{required:!0,tsType:{name:`signature`,type:`function`,raw:`(view: CalendarType) => void`,signature:{arguments:[{type:{name:`union`,raw:`"day" | "month" | "year"`,elements:[{name:`literal`,value:`"day"`},{name:`literal`,value:`"month"`},{name:`literal`,value:`"year"`}]},name:`view`}],return:{name:`void`}}},description:``},selectsRange:{required:!1,tsType:{name:`boolean`},description:``},value:{required:!0,tsType:{name:`union`,raw:`Date | NullableDateRange | null`,elements:[{name:`Date`},{name:`NullableDateRange`},{name:`null`}]},description:``},onChange:{required:!0,tsType:{name:`signature`,type:`function`,raw:`(date: Date | NullableDateRange) => void`,signature:{arguments:[{type:{name:`union`,raw:`Date | NullableDateRange`,elements:[{name:`Date`},{name:`NullableDateRange`}]},name:`date`}],return:{name:`void`}}},description:``},minDate:{required:!1,tsType:{name:`Date`},description:``},maxDate:{required:!1,tsType:{name:`Date`},description:``},currentDate:{required:!1,tsType:{name:`Date`},description:``},onCurrentDateChange:{required:!1,tsType:{name:`signature`,type:`function`,raw:`(date: Date) => void`,signature:{arguments:[{type:{name:`Date`},name:`date`}],return:{name:`void`}}},description:``}}}})))()}export{A as a,w as c,ie as i,T as l,We as n,E as o,re as r,te as s,Ue as t};
|
|
1
|
+
import{n as e}from"./rolldown-runtime-DkW27tQK.js";import{t}from"./react-BZJXY1be.js";import{n,t as r}from"./chevron-left-2LrGBhDY.js";import{n as i,t as a}from"./chevron-right-D6NN1_UQ.js";import{i as o,n as s,r as c}from"./iframe-CViB2sFm.js";import{a as l,i as u}from"./utils-tg3ibbzi.js";import{C as d,b as f,c as p,h as m,m as h,n as g,o as _,w as v,x as y,y as b}from"./formatters-CBgrBeSA-CqB1pZxS.js";import{n as x,t as S}from"./Button-BTtYeCS_.js";var C,w;function T(){return(T=e((()=>{o(),C=[[`path`,{d:`M8 2v3`,key:`1ioesn`}],[`path`,{d:`M16 2v3`,key:`otl347`}],[`rect`,{x:`3`,y:`3`,width:`18`,height:`18`,rx:`2`,key:`h1oib`}],[`path`,{d:`M3 9h18`,key:`1pudct`}],[`path`,{d:`M8 13h.01`,key:`1sbv64`}],[`path`,{d:`M12 13h.01`,key:`y0uutt`}],[`path`,{d:`M16 13h.01`,key:`wip0gl`}],[`path`,{d:`M8 17h.01`,key:`p3bg7i`}],[`path`,{d:`M12 17h.01`,key:`p32p05`}],[`path`,{d:`M16 17h.01`,key:`ql8jdd`}]],w=c(`calendar-days`,C)})))()}function ee(e){return e===`month`?`month`:e===`year`?`year`:`day`}function E(e,t){return k.indexOf(e)>=k.indexOf(t)}function te(e,t){let n=ee(e);return E(n,t)?n:t}function D(e,t){return!e||!t?!1:e.start.getTime()===t.start.getTime()&&e.end.getTime()===t.end.getTime()}function ne(e,t,n){if(!e||!t||!n)return!1;let r=Math.min(t.start.getTime(),n.start.getTime()),i=Math.max(t.end.getTime(),n.end.getTime());return e.start.getTime()>=r&&e.end.getTime()<=i}function O({date:e,value:t,hoveredDate:n,selectsRange:r,selectionOptions:i}){let a=g(e,i),o=!r&&t instanceof Date?t:null,s=g(o,i);if(!r||!Array.isArray(t))return{selected:_(e,s),range:!1,rangeStart:!1,rangeEnd:!1};let[c,l]=t,u=g(c,i),d=g(l??(c?n:null),i),f=D(a,u),p=D(a,d);return{selected:!1,range:ne(a,u,d)&&!f&&!p,rangeStart:f,rangeEnd:p}}var k,re,ie;function A(){return(A=e((()=>{b(),k=[`day`,`month`,`year`],re=[`day`,`week`,`month`,`year`],ie=[`friday`,`saturday`,`sunday`]})))()}var ae,oe,se,ce,le,ue,de,fe,j,M,N,P,F,I,L,R,z;function B(){return(B=e((()=>{ae=`Dshr-j`,oe=`esetVt`,se=`i-LJYe`,ce=`XZsnCH`,le=`_2KDjTS`,ue=`o-freG`,de=`GcV08-`,fe=`UCrE-I`,j=`L2V3uq`,M=`Te9oCq`,N=`cUF2pQ`,P=`d1L5uw`,F=`LU0M9Y`,I=`MR3y5p`,L=`VDqDpm`,R=`CLR-7m`,z={dayView:ae,weekdays:oe,weekday:se,daysGrid:ce,week:le,day:ue,disabled:de,outsideMonth:fe,periodSelection:j,periodPreview:M,selected:N,range:P,rangeStart:F,rangeEnd:I,weekend:L,now:R}})))()}var V,H,pe,me,U;function he(){return(he=e((()=>{V=t(),b(),u(),B(),H=s(),pe=[`Пн`,`Вт`,`Ср`,`Чт`,`Пт`,`Сб`,`Вс`],me=new Intl.DateTimeFormat(`ru-RU`,{weekday:`long`,year:`numeric`,month:`long`,day:`numeric`}),U=({now:e,currentDate:t,value:n,onChange:r,minDate:i,maxDate:a,selectsRange:o,selectionMode:s=`day`,weekEndDay:c=`sunday`})=>{let[u,f]=(0,V.useState)(null),m={selectionMode:s,weekEndDay:c},v=(()=>{let e=t.getFullYear(),n=t.getMonth(),r=h(e,n,1),i=h(e,n+1,0),a=r.getDay()===0?6:r.getDay()-1,o=42-(a+i.getDate()),s=[],c=h(e,n,0).getDate();for(let t=a;t>0;--t)s.push(h(e,n-1,c-t+1));for(let t=1;t<=i.getDate();t+=1)s.push(h(e,n,t));for(let t=1;t<=o;t+=1)s.push(h(e,n+1,t));let l=[];for(let e=0;e<s.length;e+=7)l.push(s.slice(e,e+7));return l})(),b=o&&Array.isArray(n)?n[0]:null,x=o&&Array.isArray(n)?n[1]:null,S=g(o?null:n,m),C=g(u,m),w=x??(b?C?.end??null:null),T=s===`week`,ee=T&&(!o||!b),E=e=>{if(!o||!b||!w)return!1;let t=d(e).getTime(),n=b.getTime(),r=w.getTime();return t>=Math.min(n,r)&&t<=Math.max(n,r)},te=e=>!y(g(e,m),{minDate:i,maxDate:a}),D=(e,t)=>{t||(T&&f(e),!(!o||!b||x)&&(T||f(e)))};return(0,H.jsxs)(`div`,{className:z.dayView,children:[(0,H.jsx)(`div`,{className:z.weekdays,children:pe.map(e=>(0,H.jsx)(`div`,{className:z.weekday,children:e},e))}),(0,H.jsx)(`div`,{className:z.daysGrid,onMouseLeave:()=>{(T||!x)&&f(null)},children:v.map((n,i)=>(0,H.jsx)(`div`,{className:z.week,children:n.map((n,a)=>{let o=n.getMonth()===t.getMonth(),c=_(n,S),u=ee&&_(n,C),d=E(n),f=p(n,b),m=p(n,w),h=p(n,e),g=te(n);return(0,H.jsx)(`button`,{type:`button`,onClick:()=>!g&&r(n),onMouseEnter:()=>D(n,g),disabled:g,"data-ui":`calendar-day-button`,"data-action":`select-calendar-day`,className:l(z.day,{[z.outsideMonth]:!o,[z.periodSelection]:s===`week`,[z.periodPreview]:u&&!c,[z.selected]:c,[z.range]:d&&!f&&!m,[z.rangeStart]:f,[z.rangeEnd]:m,[z.disabled]:g,[z.weekend]:a>4,[z.now]:h}),"aria-label":me.format(n),"aria-pressed":c||d||f||m,children:n.getDate()},`${i}-${a}`)})},i))})]})},U.__docgenInfo={description:`Отображает сетку дней месяца в календарной семантике без timezone-сдвига.`,methods:[],displayName:`CalendarDayView`,props:{selectionMode:{defaultValue:{value:`"day"`,computed:!1},required:!1},weekEndDay:{defaultValue:{value:`"sunday"`,computed:!1},required:!1}}}})))()}var ge,_e,ve,ye,be,xe,W,Se,G;function Ce(){return(Ce=e((()=>{ge=`p5pRGW`,_e=`pUHpxD`,ve=`lwWv-z`,ye=`_8gn-3z`,be=`b57d-c`,xe=`nGc5FO`,W=`JLqjri`,Se=`UQMYwg`,G={monthView:ge,monthsGrid:_e,month:ve,disabled:ye,range:be,selected:xe,rangeStart:W,rangeEnd:Se}})))()}var we,K,Te,Ee,q;function De(){return(De=e((()=>{we=t(),b(),u(),A(),Ce(),K=s(),Te=new Intl.DateTimeFormat(`ru-RU`,{month:`short`}),Ee=new Intl.DateTimeFormat(`ru-RU`,{month:`long`,year:`numeric`}),q=({currentDate:e,value:t,onChange:n,minDate:r,maxDate:i,selectsRange:a,selectsPeriod:o,selectionMode:s=`day`,weekEndDay:c=`sunday`})=>{let[u,d]=(0,we.useState)(null),f=Array.from({length:12},(e,t)=>t),p=e.getFullYear(),m={selectionMode:s,weekEndDay:c},_=a&&Array.isArray(t)?t[0]:null,v=a&&Array.isArray(t)?t[1]:null,b=e=>Te.format(h(p,e,1)),x=e=>{if(!r&&!i)return!1;let t=h(p,e,1),n=h(p,e+1,0,23,59,59);return o?!y(g(t,m),{minDate:r,maxDate:i}):!!(r&&n<r||i&&t>i)},S=(e,t)=>{!a||!_||v||t||d(e)};return(0,K.jsx)(`div`,{className:G.monthView,children:(0,K.jsx)(`div`,{className:G.monthsGrid,onMouseLeave:()=>{v||d(null)},children:f.map(e=>{let r=x(e),i=h(p,e,1),o=O({date:i,value:t,hoveredDate:u,selectsRange:a,selectionOptions:m});return(0,K.jsx)(`button`,{type:`button`,onClick:()=>!r&&n(i),onMouseEnter:()=>S(i,r),disabled:r,"data-ui":`calendar-month-button`,"data-action":`select-calendar-month`,className:l(G.month,{[G.selected]:o.selected,[G.range]:o.range,[G.rangeStart]:o.rangeStart,[G.rangeEnd]:o.rangeEnd,[G.disabled]:r}),"aria-label":Ee.format(i),"aria-pressed":o.selected||o.range||o.rangeStart||o.rangeEnd,children:b(e)},e)})})})},q.__docgenInfo={description:`Отображает выбор месяца в календарной семантике без timezone-сдвига.`,methods:[],displayName:`CalendarMonthView`,props:{selectionMode:{defaultValue:{value:`"day"`,computed:!1},required:!1},weekEndDay:{defaultValue:{value:`"sunday"`,computed:!1},required:!1}}}})))()}var Oe,ke,J;function Ae(){return(Ae=e((()=>{Oe=`E35KE6`,ke=`L14Qef`,J={calendarView:Oe,calendarHeader:ke}})))()}var je,Me,Ne,Pe,Fe,Ie,Le,Re,Y;function ze(){return(ze=e((()=>{je=`_--xW7O`,Me=`-N-5Jk`,Ne=`hhY92S`,Pe=`IhX7jj`,Fe=`NWNpWj`,Ie=`d1SfcV`,Le=`Gkui4r`,Re=`_0dVZLW`,Y={yearView:je,yearsGrid:Me,year:Ne,disabled:Pe,range:Fe,selected:Ie,rangeStart:Le,rangeEnd:Re}})))()}var Be,X,Z;function Ve(){return(Ve=e((()=>{Be=t(),b(),u(),A(),ze(),X=s(),Z=({currentDate:e,value:t,onChange:n,minDate:r,maxDate:i,selectsRange:a,selectsPeriod:o,selectionMode:s=`day`,weekEndDay:c=`sunday`})=>{let[u,d]=(0,Be.useState)(null),f=Math.floor(e.getFullYear()/12)*12,p=Array.from({length:12},(e,t)=>f+t),m={selectionMode:s,weekEndDay:c},_=a&&Array.isArray(t)?t[0]:null,v=a&&Array.isArray(t)?t[1]:null,b=e=>{if(!r&&!i)return!1;let t=h(e,0,1),n=h(e,11,31,23,59,59);return o?!y(g(t,m),{minDate:r,maxDate:i}):!!(r&&n<r||i&&t>i)},x=(e,t)=>{!a||!_||v||t||d(e)};return(0,X.jsx)(`div`,{className:Y.yearView,children:(0,X.jsx)(`div`,{className:Y.yearsGrid,onMouseLeave:()=>{v||d(null)},children:p.map(e=>{let r=b(e),i=h(e,0,1),o=O({date:i,value:t,hoveredDate:u,selectsRange:a,selectionOptions:m});return(0,X.jsx)(`button`,{type:`button`,onClick:()=>!r&&n(i),onMouseEnter:()=>x(i,r),disabled:r,"data-ui":`calendar-year-button`,"data-action":`select-calendar-year`,className:l(Y.year,{[Y.selected]:o.selected,[Y.range]:o.range,[Y.rangeStart]:o.rangeStart,[Y.rangeEnd]:o.rangeEnd,[Y.disabled]:r}),"aria-label":e.toString(),"aria-pressed":o.selected||o.range||o.rangeStart||o.rangeEnd,children:e},e)})})})},Z.__docgenInfo={description:`Отображает выбор года в календарной семантике без timezone-сдвига.`,methods:[],displayName:`CalendarYearView`,props:{selectionMode:{defaultValue:{value:`"day"`,computed:!1},required:!1},weekEndDay:{defaultValue:{value:`"sunday"`,computed:!1},required:!1}}}})))()}function He(e,t){if(t&&f(e)&&e[0]instanceof Date)return e[0];if(!t&&e instanceof Date)return e}function Ue({view:e,datePickerLevel:t,selectionMode:n=`day`,weekEndDay:i=`sunday`,onViewChange:o,...s}){let[c]=(0,Q.useState)(()=>d(new Date)),l=He(s.value,s.selectsRange),u=l?.getTime()??null,[f,p]=(0,Q.useState)(()=>({sourceValueTime:u,currentDate:l??d(new Date)})),h=l&&f.sourceValueTime!==u?l:f.currentDate,_=s.currentDate??h,b={selectionMode:n,weekEndDay:i},x=e=>{let t=typeof e==`function`?e(_):e;s.currentDate===void 0&&p({sourceValueTime:u,currentDate:t}),s.onCurrentDateChange?.(t)},C=()=>{if(e===`day`){x(e=>m(e,-1));return}if(e===`month`){x(e=>v(e,-1));return}x(e=>v(e,-12))},w=()=>{if(e===`day`){x(e=>m(e,1));return}if(e===`month`){x(e=>v(e,1));return}x(e=>v(e,12))};return(0,$.jsxs)(`div`,{className:J.calendarView,children:[(()=>{let t=``;if(e===`day`)t=_.toLocaleDateString(`ru-RU`,{month:`long`,year:`numeric`});else if(e===`month`)t=_.getFullYear().toString();else{let e=Math.floor(_.getFullYear()/12)*12;t=`${e} - ${e+11}`}return(0,$.jsxs)(`div`,{className:J.calendarHeader,children:[(0,$.jsx)(S,{icon:(0,$.jsx)(r,{}),onClick:C,variant:`ghost`,"aria-label":`Предыдущий`,"data-action":`calendar-previous`}),(0,$.jsx)(S,{onClick:()=>{e===`day`?o(`month`):e===`month`&&o(`year`)},variant:`ghost`,className:`flex1`,"data-ui":`calendar-view-switch-button`,"data-action":`calendar-switch-view`,children:t}),(0,$.jsx)(S,{icon:(0,$.jsx)(a,{}),onClick:w,variant:`ghost`,"aria-label":`Следующий`,"data-ui":`calendar-next-button`,"data-action":`calendar-next`})]})})(),(()=>{let r=e=>{let t=g(e,b);if(!(!t||!y(t,{minDate:s.minDate,maxDate:s.maxDate}))){if(s.selectsRange){let e=null,n=null;if(Array.isArray(s.value)&&([e,n]=s.value),!e||n){s.onChange([t.start,null]);return}let r=g(e,b);if(!r)return;if(t.start<r.start){s.onChange([t.start,r.end]);return}s.onChange([r.start,t.end]);return}s.onChange(t.start)}},a=e=>{if(x(e),n===`month`||!E(`day`,t)){r(e);return}o(`day`)},l=e=>{if(x(e),n===`year`||!E(`month`,t)){r(e);return}o(`month`)};switch(e){case`day`:return(0,$.jsx)(U,{now:c,currentDate:_,value:s.value,onChange:r,minDate:s.minDate,maxDate:s.maxDate,selectsRange:s.selectsRange,selectionMode:n,weekEndDay:i});case`month`:return(0,$.jsx)(q,{currentDate:_,value:s.value,onChange:a,minDate:s.minDate,maxDate:s.maxDate,selectsRange:s.selectsRange,selectsPeriod:n===`month`||!E(`day`,t),selectionMode:n,weekEndDay:i});case`year`:return(0,$.jsx)(Z,{currentDate:_,value:s.value,onChange:l,minDate:s.minDate,maxDate:s.maxDate,selectsRange:s.selectsRange,selectsPeriod:n===`year`||!E(`month`,t),selectionMode:n,weekEndDay:i});default:return null}})()]})}var Q,$;function We(){return(We=e((()=>{Q=t(),b(),n(),i(),x(),A(),he(),De(),Ae(),Ve(),$=s(),Ue.__docgenInfo={description:`Отображает календарь выбора даты в календарной семантике без timezone-сдвига.`,methods:[],displayName:`CalendarView`,props:{view:{required:!0,tsType:{name:`union`,raw:`"day" | "month" | "year"`,elements:[{name:`literal`,value:`"day"`},{name:`literal`,value:`"month"`},{name:`literal`,value:`"year"`}]},description:``},datePickerLevel:{required:!0,tsType:{name:`union`,raw:`"day" | "month" | "year"`,elements:[{name:`literal`,value:`"day"`},{name:`literal`,value:`"month"`},{name:`literal`,value:`"year"`}]},description:``},selectionMode:{required:!1,tsType:{name:`CalendarPeriodSelectionMode`},description:``,defaultValue:{value:`"day"`,computed:!1}},weekEndDay:{required:!1,tsType:{name:`CalendarWeekEndDay`},description:``,defaultValue:{value:`"sunday"`,computed:!1}},onViewChange:{required:!0,tsType:{name:`signature`,type:`function`,raw:`(view: CalendarType) => void`,signature:{arguments:[{type:{name:`union`,raw:`"day" | "month" | "year"`,elements:[{name:`literal`,value:`"day"`},{name:`literal`,value:`"month"`},{name:`literal`,value:`"year"`}]},name:`view`}],return:{name:`void`}}},description:``},selectsRange:{required:!1,tsType:{name:`boolean`},description:``},value:{required:!0,tsType:{name:`union`,raw:`Date | NullableDateRange | null`,elements:[{name:`Date`},{name:`NullableDateRange`},{name:`null`}]},description:``},onChange:{required:!0,tsType:{name:`signature`,type:`function`,raw:`(date: Date | NullableDateRange) => void`,signature:{arguments:[{type:{name:`union`,raw:`Date | NullableDateRange`,elements:[{name:`Date`},{name:`NullableDateRange`}]},name:`date`}],return:{name:`void`}}},description:``},minDate:{required:!1,tsType:{name:`Date`},description:``},maxDate:{required:!1,tsType:{name:`Date`},description:``},currentDate:{required:!1,tsType:{name:`Date`},description:``},onCurrentDateChange:{required:!1,tsType:{name:`signature`,type:`function`,raw:`(date: Date) => void`,signature:{arguments:[{type:{name:`Date`},name:`date`}],return:{name:`void`}}},description:``}}}})))()}export{A as a,w as c,ie as i,T as l,We as n,E as o,re as r,te as s,Ue as t};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{n as e}from"./rolldown-runtime-
|
|
1
|
+
import{n as e}from"./rolldown-runtime-DkW27tQK.js";import{n as t}from"./iframe-CViB2sFm.js";import{i as n,r}from"./react-Bl2r1tuC.js";import{a as i,d as a,f as o,l as s,m as c,n as l,p as u,r as d,u as f}from"./blocks-B8F5vBhs.js";import{a as p,i as m,n as h,o as g,r as _,t as v}from"./CheckBox.stories-Caw6-hSQ.js";function y(e){let t={code:`code`,h2:`h2`,h3:`h3`,li:`li`,p:`p`,pre:`pre`,ul:`ul`,...n(),...e.components};return(0,x.jsxs)(x.Fragment,{children:[(0,x.jsx)(s,{of:v,parameters:{docs:{toc:!0}}}),`
|
|
2
2
|
`,(0,x.jsx)(u,{children:`CheckBox`}),`
|
|
3
3
|
`,(0,x.jsx)(o,{children:`Флажок для булевых полей с общими UI-схемами tone и appearance`}),`
|
|
4
4
|
`,(0,x.jsx)(t.p,{children:`CheckBox уже имеет живые stories, а эта страница собирает их в структурированную документацию с краткими рекомендациями, примерами подключения и API.
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{a as e,n as t}from"./rolldown-runtime-DkW27tQK.js";import{t as n}from"./react-BZJXY1be.js";import{n as r,t as i}from"./check-mlY_aVEI.js";import{i as a,n as o,r as s}from"./iframe-CViB2sFm.js";import{a as c,i as l}from"./utils-tg3ibbzi.js";import{n as u,t as d}from"./ui.module-Cat84Nza.js";import{i as f,r as p}from"./uiClasses-B9c6dZuu.js";import{n as m,t as h}from"./CheckBox.module-BOAVN-Ny.js";var g,_;function v(){return(v=t((()=>{a(),g=[[`path`,{d:`M5 12h14`,key:`1ays0h`}]],_=s(`minus`,g)})))()}function y({label:e,description:t,placeholder:n,disabled:r,size:a,className:o,onChange:s,value:l,noWrap:d,id:f,tone:m=`neutral`,indeterminate:g=!1,...v}){let y=(0,b.useId)(),S=f??y,C=t?`${S}-description`:void 0,w=e??n,T=l??!1,E=e=>{e&&(e.indeterminate=g)};return(0,x.jsxs)(`div`,{className:c(u.uiElement,a&&u.uiSizable,a&&u[a],r&&u.disabled,o),"aria-disabled":r||void 0,children:[(0,x.jsxs)(`div`,{className:h.row,children:[(0,x.jsxs)(`div`,{className:c(h.wrapper,p(m)),children:[(0,x.jsx)(`input`,{...v,ref:E,id:S,type:`checkbox`,checked:T,disabled:r,"aria-checked":g?`mixed`:T,"aria-describedby":C,className:c(u.uiSelectionControl,h.input,g&&h.inputIndeterminate),onChange:()=>s?.(!T)}),(0,x.jsx)(`div`,{className:c(u.uiSelectionIcon,h.icon),"aria-hidden":`true`,children:g?(0,x.jsx)(_,{}):(0,x.jsx)(i,{})})]}),w&&(0,x.jsx)(`label`,{htmlFor:S,className:c(u.uiLabelBase,d&&`textNoWrap`),children:w})]}),t&&(0,x.jsx)(`p`,{id:C,className:u.uiDescription,children:t})]})}var b,x;function S(){return(S=t((()=>{b=e(n(),1),l(),r(),v(),d(),f(),m(),x=o(),y.__docgenInfo={description:`Компонент флажка для выбора булевого значения в формах и списках.
|
|
2
2
|
Поддерживает tone + appearance и использует общие selection utility-классы из ui.module.scss.`,methods:[],displayName:`CheckBox`,props:{label:{required:!1,tsType:{name:`ReactNode`},description:``},description:{required:!1,tsType:{name:`string`},description:``},placeholder:{required:!1,tsType:{name:`string`},description:``},disabled:{required:!1,tsType:{name:`boolean`},description:``},size:{required:!1,tsType:{name:`union`,raw:`"xs" | "sm" | "md" | "lg" | "xl"`,elements:[{name:`literal`,value:`"xs"`},{name:`literal`,value:`"sm"`},{name:`literal`,value:`"md"`},{name:`literal`,value:`"lg"`},{name:`literal`,value:`"xl"`}]},description:``},value:{required:!0,tsType:{name:`V`},description:"Если начальное состояние может быть `null | undefined`\nзначит `onChange` тоже должен ументь сбрасывать.\nПоэтому такой контрол явно должен передавать `UiBaseProps<AnyType | undefined>`"},onChange:{required:!0,tsType:{name:`signature`,type:`function`,raw:`(value: T) => void`,signature:{arguments:[{type:{name:`C`},name:`value`}],return:{name:`void`}}},description:``},tone:{required:!1,tsType:{name:`union`,raw:`"neutral" | "brand" | "error" | "warning" | "success" | "info"`,elements:[{name:`literal`,value:`"neutral"`},{name:`literal`,value:`"brand"`},{name:`literal`,value:`"error"`},{name:`literal`,value:`"warning"`},{name:`literal`,value:`"success"`},{name:`literal`,value:`"info"`}]},description:``,defaultValue:{value:`"neutral"`,computed:!1}},noWrap:{required:!1,tsType:{name:`boolean`},description:``},indeterminate:{required:!1,tsType:{name:`boolean`},description:'Показывает частично выбранную группу и публикует `aria-checked="mixed"`.',defaultValue:{value:`false`,computed:!1}}},composes:[`Omit`]}})))()}export{S as n,y as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{n as e}from"./rolldown-runtime-
|
|
1
|
+
import{n as e}from"./rolldown-runtime-DkW27tQK.js";var t,n,r,i,a,o;function s(){return(s=e((()=>{t=`cgozWT`,n=`_1evcXl`,r=`lU3P-V`,i=`uVSbSw`,a=`PhkI5X`,o={row:t,wrapper:n,input:r,inputIndeterminate:i,icon:a}})))()}export{s as n,o as t};
|
package/storybook-static/assets/{CheckBox.stories-B4Sv2TXp.js → CheckBox.stories-Caw6-hSQ.js}
RENAMED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{n as e,r as t}from"./rolldown-runtime-
|
|
1
|
+
import{n as e,r as t}from"./rolldown-runtime-DkW27tQK.js";import{t as n}from"./react-BZJXY1be.js";import{n as r,t as i}from"./CheckBox-D4u-58g8.js";import{n as a}from"./iframe-CViB2sFm.js";import{n as o,t as s}from"./createControlledStoryRender-BouhvX-R.js";var c=t({Controlled:()=>p,Disabled:()=>g,Sizes:()=>h,Tones:()=>m,__namedExportsOrder:()=>_,default:()=>f}),l,u,d,f,p,m,h,g,_;function v(){return(v=e((()=>{l=n(),o(),r(),u=a(),d=s((e,t)=>(0,u.jsx)(i,{...e,value:e.value??!1,onChange:n=>{e.onChange?.(n),t({value:n})}})),f={title:`Shared/UI/CheckBox`,component:i,args:{value:!1,onChange:()=>{}},parameters:{atomicCanvas:!0,layout:`padded`},argTypes:{label:{description:`Текст основной подписи чекбокса.`,control:`text`},description:{description:`Дополнительное описание под элементом.`,control:`text`},placeholder:{description:"Текст подписи, если `label` не задан.",control:`text`},value:{description:`Текущее состояние чекбокса.`,control:`boolean`},onChange:{description:`Вызывается при изменении состояния.`,control:!1},disabled:{description:`Блокирует взаимодействие с элементом.`,control:`boolean`},size:{description:`Размер визуального контрола и текста.`,control:`select`,options:[`xs`,`sm`,`md`,`lg`,`xl`]},tone:{description:`Цветовой тон чекбокса.`,control:`inline-radio`,options:[`neutral`,`brand`,`error`,`warning`,`success`,`info`]},noWrap:{description:`Не переносит текст подписи на новую строку.`,control:`boolean`},indeterminate:{description:'Показывает частично выбранное состояние с `aria-checked="mixed"`.',control:`boolean`}}},p={render:d,args:{label:`Принимать условия`,description:`Подтверждение условий использования сервиса.`,value:!1,size:`md`,disabled:!1,tone:`neutral`}},m={render:()=>{let[e,t]=(0,l.useState)({neutral:!0,info:!0,success:!0,warning:!0,error:!0});return(0,u.jsx)(`div`,{style:{display:`grid`,gap:12},children:[`neutral`,`info`,`success`,`warning`,`error`].map(n=>(0,u.jsx)(i,{tone:n,label:`Тон ${n}`,value:e[n],onChange:e=>t(t=>({...t,[n]:e}))},n))})}},h={render:()=>{let[e,t]=(0,l.useState)({xs:!1,sm:!0,md:!1,lg:!0,xl:!1});return(0,u.jsx)(`div`,{style:{display:`grid`,gap:12},children:[`xs`,`sm`,`md`,`lg`,`xl`].map(n=>(0,u.jsx)(i,{size:n,label:`Размер ${n}`,value:e[n],onChange:e=>t(t=>({...t,[n]:e}))},n))})}},g={render:d,args:{label:`Недоступный чекбокс`,description:`Изменение недоступно из-за прав доступа.`,value:!0,disabled:!0,tone:`neutral`}},p.parameters={...p.parameters,docs:{...p.parameters?.docs,source:{originalSource:`{
|
|
2
2
|
render: renderCheckBoxStory,
|
|
3
3
|
args: {
|
|
4
4
|
label: "Принимать условия",
|