@baseline-ui/core 3.9.1 → 3.10.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/Accordion.mjs +1 -1
- package/dist/ActionButton.mjs +1 -1
- package/dist/ActionGroup.mjs +1 -1
- package/dist/ActionIconButton.mjs +1 -1
- package/dist/Actionable.mjs +1 -1
- package/dist/AlertDialog.mjs +1 -1
- package/dist/AudioPlayer.mjs +1 -1
- package/dist/Breadcrumbs.mjs +1 -1
- package/dist/ButtonSelect.mjs +1 -1
- package/dist/Calendar.mjs +1 -1
- package/dist/Checkbox.mjs +1 -1
- package/dist/ColorInput.mjs +1 -1
- package/dist/ColorSwatch.mjs +1 -1
- package/dist/ColorSwatchPicker.mjs +1 -1
- package/dist/ComboBox.mjs +1 -1
- package/dist/DateField.mjs +1 -1
- package/dist/Dialog.mjs +1 -1
- package/dist/Disclosure.mjs +1 -1
- package/dist/DomNodeRenderer.mjs +1 -1
- package/dist/Drawer.mjs +1 -1
- package/dist/Editor.mjs +1 -1
- package/dist/FileInput.mjs +1 -1
- package/dist/FileList.css +1 -1
- package/dist/FileList.mjs +1 -1
- package/dist/FileUploader.mjs +1 -1
- package/dist/FrameProvider.mjs +1 -1
- package/dist/FreehandCanvas.mjs +1 -1
- package/dist/GridList.mjs +1 -1
- package/dist/Group.mjs +1 -1
- package/dist/Icon.mjs +1 -1
- package/dist/Image.mjs +1 -1
- package/dist/ImageDropZone.mjs +1 -1
- package/dist/ImageGallery.mjs +1 -1
- package/dist/InlineAlert.mjs +1 -1
- package/dist/InlineToolbar.mjs +2 -2
- package/dist/Kbd.mjs +1 -1
- package/dist/Link.mjs +1 -1
- package/dist/ListBox.mjs +1 -1
- package/dist/Markdown.css +1 -1
- package/dist/Markdown.mjs +1 -1
- package/dist/Menu.mjs +1 -1
- package/dist/MessageFormat.mjs +1 -1
- package/dist/Modal.mjs +1 -1
- package/dist/NumberInput.mjs +1 -1
- package/dist/Pagination.mjs +1 -1
- package/dist/Panel.mjs +1 -1
- package/dist/PointPicker.mjs +1 -1
- package/dist/Popover.mjs +1 -1
- package/dist/Portal.mjs +1 -1
- package/dist/Preview.mjs +1 -1
- package/dist/ProgressBar.mjs +1 -1
- package/dist/ProgressSpinner.mjs +1 -1
- package/dist/RadioGroup.css +1 -1
- package/dist/RadioGroup.mjs +1 -1
- package/dist/Reaction.mjs +1 -1
- package/dist/ScrollControlButton.css +1 -1
- package/dist/ScrollControlButton.mjs +1 -1
- package/dist/SearchInput.mjs +1 -1
- package/dist/Select.mjs +1 -1
- package/dist/Slider.mjs +1 -1
- package/dist/Stepper.mjs +1 -1
- package/dist/Switch.mjs +1 -1
- package/dist/Table.mjs +1 -1
- package/dist/Tabs.mjs +1 -1
- package/dist/Tag.mjs +1 -1
- package/dist/TagGroup.mjs +1 -1
- package/dist/TaggedPagination.mjs +1 -1
- package/dist/Text.mjs +1 -1
- package/dist/TextInput.mjs +1 -1
- package/dist/ThemeProvider.mjs +1 -1
- package/dist/TimeField.mjs +1 -1
- package/dist/Toast.mjs +1 -1
- package/dist/ToggleButton.mjs +1 -1
- package/dist/ToggleIconButton.mjs +1 -1
- package/dist/Toolbar.mjs +1 -1
- package/dist/Tooltip.mjs +1 -1
- package/dist/TreeView.mjs +1 -1
- package/dist/UNSAFE_ListBox.mjs +1 -1
- package/dist/Virtualizer.mjs +1 -1
- package/dist/{chunk-E3TD3EJQ.mjs → chunk-23OLSA2X.mjs} +2 -2
- package/dist/{chunk-X6K4M542.mjs → chunk-24WOG72O.mjs} +2 -2
- package/dist/{chunk-GLIN7JAI.mjs → chunk-2CE6LGIB.mjs} +1 -1
- package/dist/{chunk-YK3KAPIK.mjs → chunk-2CFMM7MZ.mjs} +2 -2
- package/dist/{chunk-WSRXTVYB.mjs → chunk-2KRVQJDA.mjs} +2 -2
- package/dist/{chunk-SCJ3RG7B.mjs → chunk-2MNK24YJ.mjs} +1 -1
- package/dist/{chunk-3PBFSDMT.mjs → chunk-2PTLJDIT.mjs} +1 -1
- package/dist/{chunk-YSQ3YHJN.mjs → chunk-2TMQUHHU.mjs} +1 -1
- package/dist/chunk-3A7ZISTE.mjs +10 -0
- package/dist/{chunk-DOFT4BQH.mjs → chunk-3EFE2WAJ.mjs} +1 -1
- package/dist/{chunk-CKUHFL5G.mjs → chunk-3HJAQJWA.mjs} +1 -1
- package/dist/chunk-3IHIKAT4.mjs +10 -0
- package/dist/chunk-3JHXI33A.mjs +10 -0
- package/dist/chunk-3K6XNSYE.mjs +10 -0
- package/dist/chunk-3LS73XVI.mjs +10 -0
- package/dist/chunk-3P25UGHE.mjs +10 -0
- package/dist/{chunk-BFW26T6V.mjs → chunk-43U6RZ5C.mjs} +2 -2
- package/dist/{chunk-54MWEZUP.mjs → chunk-46UWKP7W.mjs} +1 -1
- package/dist/chunk-4CMATAQ2.mjs +10 -0
- package/dist/{chunk-F3EOLTFM.mjs → chunk-4FN6UAXD.mjs} +1 -1
- package/dist/{chunk-NWYRVUTX.mjs → chunk-4Y5IKZSW.mjs} +1 -1
- package/dist/{chunk-26YOMQXV.mjs → chunk-5B6263RO.mjs} +13 -13
- package/dist/{chunk-WAPBLICF.mjs → chunk-5NVCSLXT.mjs} +1 -1
- package/dist/{chunk-VWSTMBQK.mjs → chunk-64Y62MDR.mjs} +2 -2
- package/dist/{chunk-IVM5IBQS.mjs → chunk-6DVKR25T.mjs} +1 -1
- package/dist/{chunk-ADEALCJB.mjs → chunk-6IK2TDLH.mjs} +2 -2
- package/dist/{chunk-ES3IQZSH.mjs → chunk-6V7S5IG5.mjs} +2 -2
- package/dist/chunk-6VKIT2PF.mjs +10 -0
- package/dist/{chunk-OGIKNHLU.mjs → chunk-7EOAYPSZ.mjs} +2 -2
- package/dist/{chunk-LZEZW5RE.mjs → chunk-7LQTLZJ5.mjs} +2 -2
- package/dist/{chunk-IOHULFEP.mjs → chunk-A4PXU7GU.mjs} +2 -2
- package/dist/chunk-A52PIXOO.mjs +10 -0
- package/dist/chunk-AANAI2XF.mjs +10 -0
- package/dist/{chunk-UQJB6AGO.mjs → chunk-AB7LDKP2.mjs} +1 -1
- package/dist/{chunk-BPLTQDXX.mjs → chunk-ACHYZYVA.mjs} +2 -2
- package/dist/{chunk-JB3UIJ3I.mjs → chunk-AFJ3QV2Q.mjs} +2 -2
- package/dist/{chunk-NQVTVL24.mjs → chunk-AIG23SN5.mjs} +2 -2
- package/dist/chunk-ASIKCQC6.mjs +10 -0
- package/dist/{chunk-WGZUNJGH.mjs → chunk-AU3GNNEG.mjs} +2 -2
- package/dist/{chunk-45EAFDOZ.mjs → chunk-AYBI4SQV.mjs} +1 -1
- package/dist/chunk-BJHDL2HH.mjs +10 -0
- package/dist/chunk-BNWDQ4KX.mjs +10 -0
- package/dist/{chunk-QSFRMY47.mjs → chunk-BPXZ6J5G.mjs} +1 -1
- package/dist/{chunk-2UDXAKWA.mjs → chunk-C6TD53KY.mjs} +2 -2
- package/dist/chunk-CBQO7JUC.mjs +11 -0
- package/dist/{chunk-LN2NT32E.mjs → chunk-CE2W5D44.mjs} +1 -1
- package/dist/{chunk-UR42GQO4.mjs → chunk-CEUVH4UZ.mjs} +1 -1
- package/dist/chunk-CGBI7OB5.mjs +10 -0
- package/dist/chunk-CMM5JW7L.mjs +10 -0
- package/dist/chunk-CPX5CB4L.mjs +10 -0
- package/dist/{chunk-HMAVZPRE.mjs → chunk-CRNJAQPI.mjs} +1 -1
- package/dist/chunk-DIMNDTFC.mjs +10 -0
- package/dist/{chunk-KADD66HZ.mjs → chunk-DNZMQ7EA.mjs} +2 -2
- package/dist/{chunk-RFCTQQMD.mjs → chunk-DP76DMVO.mjs} +1 -1
- package/dist/{chunk-DZFNVFYT.mjs → chunk-EGSNIMDP.mjs} +1 -1
- package/dist/chunk-EHIGJYGW.mjs +10 -0
- package/dist/{chunk-U6M2GCPD.mjs → chunk-EJGGWOY5.mjs} +1 -1
- package/dist/chunk-EKRT3PPK.mjs +10 -0
- package/dist/{chunk-FDDB7QNQ.mjs → chunk-ELW6SXDM.mjs} +1 -1
- package/dist/{chunk-YQFS4UHL.mjs → chunk-EPWWEFTP.mjs} +1 -1
- package/dist/{chunk-VDUFLHKK.mjs → chunk-EYKQGC4O.mjs} +2 -2
- package/dist/{chunk-PLRUMLNB.mjs → chunk-FFPJBDWH.mjs} +1 -1
- package/dist/{chunk-KFJE5ZBK.mjs → chunk-G2IYZES5.mjs} +1 -1
- package/dist/chunk-G2RVM2KB.mjs +10 -0
- package/dist/{chunk-AALXW5AP.mjs → chunk-GAKWWL3Y.mjs} +1 -1
- package/dist/chunk-GHKMHXQ3.mjs +10 -0
- package/dist/{chunk-VYBJ36ZR.mjs → chunk-GJVQMTGA.mjs} +1 -1
- package/dist/chunk-GKPZBTRE.mjs +10 -0
- package/dist/{chunk-TN7FPPGM.mjs → chunk-GZTF5YE3.mjs} +1 -1
- package/dist/{chunk-RXADOJLS.mjs → chunk-HI56YXPJ.mjs} +2 -2
- package/dist/{chunk-R7Y36JCO.mjs → chunk-HOG4QRLG.mjs} +1 -1
- package/dist/chunk-HOV7MM7M.mjs +10 -0
- package/dist/{chunk-XKNL5LSL.mjs → chunk-HOZPCWCF.mjs} +2 -2
- package/dist/{chunk-IBBDZQPO.mjs → chunk-HVSDXCZP.mjs} +2 -2
- package/dist/{chunk-64ZD4EKW.mjs → chunk-I4F5NJUI.mjs} +1 -1
- package/dist/{chunk-DLJHL4V7.mjs → chunk-I5YPTKMM.mjs} +2 -2
- package/dist/chunk-IHCKLMWD.mjs +10 -0
- package/dist/chunk-IIYP5UE7.mjs +10 -0
- package/dist/{chunk-A2B2LTRA.mjs → chunk-IQ3Z6ZO2.mjs} +1 -1
- package/dist/{chunk-3COKCTB2.mjs → chunk-J4T6TE7V.mjs} +2 -2
- package/dist/{chunk-OS6PVCFX.mjs → chunk-JANI446W.mjs} +1 -1
- package/dist/{chunk-KSWXLIZH.mjs → chunk-JGKBJHX2.mjs} +1 -1
- package/dist/chunk-JQSZFPWJ.mjs +10 -0
- package/dist/{chunk-IDIZSV2Y.mjs → chunk-JYWJE6L5.mjs} +2 -2
- package/dist/{chunk-ARMWQYH2.mjs → chunk-KDNT54DP.mjs} +2 -2
- package/dist/{chunk-KMSNBINF.mjs → chunk-L42WN3AP.mjs} +2 -2
- package/dist/{chunk-SY24O432.mjs → chunk-L4MQCPRT.mjs} +3 -3
- package/dist/chunk-L7GYT3MC.mjs +10 -0
- package/dist/{chunk-6CSP66NI.mjs → chunk-LGE4377M.mjs} +1 -1
- package/dist/chunk-LJAVEZ2H.mjs +10 -0
- package/dist/{chunk-JDDA4R2D.mjs → chunk-LJM26E7W.mjs} +1 -1
- package/dist/chunk-LNEOOIXS.mjs +10 -0
- package/dist/{chunk-VSGVHATE.mjs → chunk-LPHX7UMQ.mjs} +1 -1
- package/dist/{chunk-L6ISOTLH.mjs → chunk-LZOXWIAS.mjs} +2 -2
- package/dist/{chunk-W3YUV7IF.mjs → chunk-M3NJURGR.mjs} +1 -1
- package/dist/chunk-MENRPRHW.mjs +10 -0
- package/dist/{chunk-IIBBR266.mjs → chunk-MMLAKHLR.mjs} +3 -3
- package/dist/{chunk-Z7JRM3NW.mjs → chunk-MQCTOCK2.mjs} +2 -2
- package/dist/{chunk-X34RHNLT.mjs → chunk-NIAMDJYU.mjs} +2 -2
- package/dist/{chunk-WD2TPSZV.mjs → chunk-NIGOM3FD.mjs} +1 -1
- package/dist/{chunk-6NUHEJGL.mjs → chunk-NOTKA3RL.mjs} +1 -1
- package/dist/chunk-NYH6JQMA.mjs +10 -0
- package/dist/{chunk-SZNDCHMJ.mjs → chunk-OFEX3RHY.mjs} +1 -1
- package/dist/chunk-OWXMAVXI.mjs +10 -0
- package/dist/chunk-OY57K37D.mjs +10 -0
- package/dist/{chunk-OO3ZVB2T.mjs → chunk-OYE6VSTU.mjs} +2 -2
- package/dist/{chunk-GIUNLLWW.mjs → chunk-P3RRGPNM.mjs} +2 -2
- package/dist/{chunk-GPT4DR4P.mjs → chunk-PGDGNOYE.mjs} +1 -1
- package/dist/{chunk-DPFX25HC.mjs → chunk-PITIJLE3.mjs} +1 -1
- package/dist/{chunk-RSKKEGJZ.mjs → chunk-PPGEEMZ2.mjs} +2 -2
- package/dist/{chunk-UKBBSYRC.mjs → chunk-PTL6NSYA.mjs} +2 -2
- package/dist/chunk-PV4E7XDP.mjs +10 -0
- package/dist/chunk-PZBJGZ57.mjs +10 -0
- package/dist/chunk-Q5SN5AQT.mjs +10 -0
- package/dist/{chunk-EISLHUT5.mjs → chunk-Q7BJGV4I.mjs} +1 -1
- package/dist/{chunk-R5JHN4X6.mjs → chunk-QDMG3P5Z.mjs} +1 -1
- package/dist/{chunk-RE7ZGPOY.mjs → chunk-QMFL5BMI.mjs} +1 -1
- package/dist/{chunk-JTGVIAOK.mjs → chunk-QMP72J5L.mjs} +1 -1
- package/dist/chunk-QMSBDXK6.mjs +10 -0
- package/dist/{chunk-JIGOXUY4.mjs → chunk-QPWBJW2X.mjs} +1 -1
- package/dist/{chunk-67QIBKUN.mjs → chunk-QRLUWOGW.mjs} +1 -1
- package/dist/{chunk-FTV6OWMI.mjs → chunk-QSNYILCF.mjs} +2 -2
- package/dist/chunk-QVXIFV7W.mjs +10 -0
- package/dist/{chunk-M7BCIQ2J.mjs → chunk-QYU7CWJD.mjs} +1 -1
- package/dist/{chunk-JC22ELJM.mjs → chunk-RGWXVYDG.mjs} +1 -1
- package/dist/{chunk-N4NDPTX6.mjs → chunk-RKPWFZB4.mjs} +1 -1
- package/dist/chunk-RM64ROGL.mjs +10 -0
- package/dist/{chunk-CIOPWCOS.mjs → chunk-RPV3UUIN.mjs} +2 -2
- package/dist/chunk-RS7TRDRM.mjs +10 -0
- package/dist/{chunk-CHBF3XQ6.mjs → chunk-S2MA4MRM.mjs} +1 -1
- package/dist/chunk-S3LWWMMQ.mjs +10 -0
- package/dist/{chunk-WID7IWNC.mjs → chunk-SL5Q4NLV.mjs} +1 -1
- package/dist/{chunk-A63HMTSM.mjs → chunk-SMPF53W4.mjs} +1 -1
- package/dist/{chunk-5MR5L5JZ.mjs → chunk-SQPWV3OX.mjs} +2 -2
- package/dist/chunk-ST3TDAOP.mjs +10 -0
- package/dist/{chunk-ENUU2IVX.mjs → chunk-SUJD4QFW.mjs} +1 -1
- package/dist/{chunk-OKEXEU3C.mjs → chunk-T7K4WI76.mjs} +1 -1
- package/dist/{chunk-DFMPVQM3.mjs → chunk-TJDL7HT5.mjs} +2 -2
- package/dist/{chunk-SI7LO2L4.mjs → chunk-TK33MBDB.mjs} +1 -1
- package/dist/{chunk-BK3RBPST.mjs → chunk-TLUB6FCT.mjs} +1 -1
- package/dist/{chunk-UBC32WQB.mjs → chunk-TMGB4HZ7.mjs} +1 -1
- package/dist/{chunk-ALMW6S4I.mjs → chunk-TQMBJFQC.mjs} +2 -2
- package/dist/{chunk-E6DZSC2G.mjs → chunk-TUSG5ZRW.mjs} +2 -2
- package/dist/{chunk-D2NVLRIU.mjs → chunk-TZSRU3GG.mjs} +1 -1
- package/dist/{chunk-WXILHRBE.mjs → chunk-U5XI3CZD.mjs} +1 -1
- package/dist/chunk-U6W7D7TT.mjs +10 -0
- package/dist/chunk-UC6WAEPH.mjs +10 -0
- package/dist/{chunk-TGLVJRZE.mjs → chunk-UXAMVDQ4.mjs} +1 -1
- package/dist/chunk-V2C4UDOC.mjs +10 -0
- package/dist/{chunk-5LGYS5CZ.mjs → chunk-V3DTS6FF.mjs} +1 -1
- package/dist/{chunk-AC44TKUI.mjs → chunk-V6ZIMZ53.mjs} +1 -1
- package/dist/{chunk-B5NICAFU.mjs → chunk-VGBHKFW7.mjs} +1 -1
- package/dist/{chunk-BSFG32AL.mjs → chunk-VOWLLVPD.mjs} +2 -2
- package/dist/chunk-W4DOEGYH.mjs +10 -0
- package/dist/chunk-WJBURR7M.mjs +10 -0
- package/dist/{chunk-MUQR2YER.mjs → chunk-WN4QRMX6.mjs} +2 -2
- package/dist/chunk-WSDEMATI.mjs +10 -0
- package/dist/{chunk-UPOQXYUI.mjs → chunk-XDORZSJQ.mjs} +1 -1
- package/dist/{chunk-6HTOSJOJ.mjs → chunk-Y5LEKSMM.mjs} +1 -1
- package/dist/{chunk-3JOOFCEF.mjs → chunk-YI5VNFT4.mjs} +2 -2
- package/dist/{chunk-PQIDCA7P.mjs → chunk-YYOOJMQZ.mjs} +1 -1
- package/dist/chunk-ZNZBHN2V.mjs +10 -0
- package/dist/chunk-ZOCNDYUQ.mjs +10 -0
- package/dist/{chunk-E2VXJPSE.mjs → chunk-ZRPR4V5U.mjs} +1 -1
- package/dist/chunk-ZY3ZKJVD.mjs +10 -0
- package/dist/{chunk-4PZGQTXE.mjs → chunk-ZZGRLSEK.mjs} +2 -2
- package/dist/hooks/useCommitEffect.mjs +1 -0
- package/dist/hooks/useDevice.mjs +1 -1
- package/dist/hooks/useI18n.mjs +1 -1
- package/dist/hooks/useIntersectionObserver.mjs +1 -1
- package/dist/hooks/useLiveInteractionModality.mjs +1 -1
- package/dist/hooks/useLocalStorage.mjs +1 -1
- package/dist/hooks/useMedia.mjs +1 -1
- package/dist/hooks/useMutationObserver.mjs +1 -1
- package/dist/hooks/usePortalContainer.mjs +1 -1
- package/dist/hooks/usePreventFocus.mjs +1 -1
- package/dist/hooks/useResizeObserver.mjs +1 -1
- package/dist/hooks/useTextSelection.mjs +1 -1
- package/dist/hooks/useUndoRedo.mjs +1 -1
- package/dist/index.css +1 -1
- package/dist/index.d.ts +114 -38
- package/dist/index.js +22 -22
- package/dist/index.mjs +1 -1
- package/dist/react-aria.mjs +1 -1
- package/dist/utils/dom.mjs +1 -1
- package/dist/utils/isInShadowDOM.mjs +1 -1
- package/dist/utils/keyboards.mjs +1 -1
- package/dist/utils/objects.mjs +1 -1
- package/package.json +4 -4
- package/sbom.json +6 -6
- package/dist/chunk-2SKD7TKS.mjs +0 -10
- package/dist/chunk-35AM4QEA.mjs +0 -10
- package/dist/chunk-3V4W6OGG.mjs +0 -10
- package/dist/chunk-4HOAPQDQ.mjs +0 -10
- package/dist/chunk-5GZAORDK.mjs +0 -10
- package/dist/chunk-6PBBHYCA.mjs +0 -10
- package/dist/chunk-B3W7VMJR.mjs +0 -10
- package/dist/chunk-C4XJOYAW.mjs +0 -10
- package/dist/chunk-CR66GYHT.mjs +0 -10
- package/dist/chunk-D6AOHRAV.mjs +0 -10
- package/dist/chunk-DHZKZ3AV.mjs +0 -10
- package/dist/chunk-DRQHSYY3.mjs +0 -10
- package/dist/chunk-DZJTPX2G.mjs +0 -10
- package/dist/chunk-F4YBUGLD.mjs +0 -10
- package/dist/chunk-G76NJ3IU.mjs +0 -10
- package/dist/chunk-H2SJLW7T.mjs +0 -10
- package/dist/chunk-HNKEI45D.mjs +0 -10
- package/dist/chunk-INHZHYOF.mjs +0 -10
- package/dist/chunk-J7BCMF23.mjs +0 -10
- package/dist/chunk-JXJZIKEY.mjs +0 -10
- package/dist/chunk-K276BGP2.mjs +0 -10
- package/dist/chunk-KBLJ34QI.mjs +0 -10
- package/dist/chunk-KMZ3YVPE.mjs +0 -10
- package/dist/chunk-L5H5GE3H.mjs +0 -10
- package/dist/chunk-LHLY432N.mjs +0 -10
- package/dist/chunk-LXZOYBTL.mjs +0 -10
- package/dist/chunk-MPJXTZ6L.mjs +0 -10
- package/dist/chunk-MZIQ27JP.mjs +0 -10
- package/dist/chunk-NN6HKMC4.mjs +0 -10
- package/dist/chunk-NYNS3UDR.mjs +0 -10
- package/dist/chunk-OAOIUNNG.mjs +0 -10
- package/dist/chunk-OBEPT4LR.mjs +0 -10
- package/dist/chunk-OMCGORTH.mjs +0 -10
- package/dist/chunk-PJINRIA6.mjs +0 -10
- package/dist/chunk-PSUZMSD3.mjs +0 -10
- package/dist/chunk-Q3FYMLAA.mjs +0 -10
- package/dist/chunk-QKNNMY2Q.mjs +0 -10
- package/dist/chunk-QVFGEXDU.mjs +0 -10
- package/dist/chunk-SJRYJGTL.mjs +0 -10
- package/dist/chunk-SYA6LAFU.mjs +0 -10
- package/dist/chunk-TEQHGF4G.mjs +0 -10
- package/dist/chunk-UCRJ3AR5.mjs +0 -10
- package/dist/chunk-UI4SJCQU.mjs +0 -10
- package/dist/chunk-V6DZG4PM.mjs +0 -11
- package/dist/chunk-VKWXATZ3.mjs +0 -10
- package/dist/chunk-VNJDCKLQ.mjs +0 -10
- package/dist/chunk-VQ45RUYJ.mjs +0 -10
- package/dist/chunk-VQHI3ZCW.mjs +0 -10
- package/dist/chunk-XC5H4EVW.mjs +0 -10
- package/dist/chunk-Z2PHVVX4.mjs +0 -10
- package/dist/chunk-Z7UPVYL5.mjs +0 -10
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import {a as a$k}from'./chunk-SUJD4QFW.mjs';import {a as a$m}from'./chunk-HOG4QRLG.mjs';import {c as c$1}from'./chunk-U6W7D7TT.mjs';import {c as c$3}from'./chunk-7EOAYPSZ.mjs';import {I,j,f as f$1,e,p,F,A,H,i,B,s,C,G,z,h,g as g$1,m,q,D,E,t,l,v,y,u,a as a$n,w,d,c as c$5,x,k,b as b$7,o,n,r}from'./chunk-W4DOEGYH.mjs';import {a as a$7,b as b$6,c as c$4,d as d$1}from'./chunk-FCKJCFMD.mjs';import {a as a$p}from'./chunk-HVSDXCZP.mjs';import {a as a$i}from'./chunk-LGE4377M.mjs';import {a as a$c}from'./chunk-C6TD53KY.mjs';import {a as a$d}from'./chunk-UC6WAEPH.mjs';import {b as b$4,e as e$1}from'./chunk-G2RVM2KB.mjs';import {a as a$e}from'./chunk-JZXLV6JU.mjs';import {b as b$1,c as c$2}from'./chunk-JYWJE6L5.mjs';import {b as b$3}from'./chunk-P3RRGPNM.mjs';import {a as a$h}from'./chunk-DIL5HL6K.mjs';import {a as a$l}from'./chunk-L7GYT3MC.mjs';import {a as a$g}from'./chunk-WSDEMATI.mjs';import {a as a$a}from'./chunk-V3DTS6FF.mjs';import {a as a$o}from'./chunk-4EAXDHSV.mjs';import {a as a$j}from'./chunk-JOK6I52O.mjs';import {b as b$2}from'./chunk-N2XGJKZG.mjs';import {b}from'./chunk-I5YPTKMM.mjs';import {b as b$5,j as j$1}from'./chunk-QDMG3P5Z.mjs';import {a as a$9}from'./chunk-AB7LDKP2.mjs';import {a as a$f}from'./chunk-EYKQGC4O.mjs';import {a as a$8}from'./chunk-22VRCVTH.mjs';import {a as a$6}from'./chunk-66CUIXA6.mjs';import {a as a$b}from'./chunk-FPM5UJRF.mjs';import {a as a$5}from'./chunk-HPUUQKKH.mjs';import {a as a$1}from'./chunk-TQMBJFQC.mjs';import {a as a$3}from'./chunk-3K6XNSYE.mjs';import {a as a$2}from'./chunk-ELW6SXDM.mjs';import {a}from'./chunk-LRFFL765.mjs';import {c,f,g}from'./chunk-V2C4UDOC.mjs';import {j as j$2}from'./chunk-TYOEGCPS.mjs';import {a as a$4}from'./chunk-4QEH5CGK.mjs';import io,{useCallback,useMemo,useEffect}from'react';import {jsxs,jsx,Fragment}from'react/jsx-runtime';import {TextIcon,PlusIcon,MinusIcon}from'@baseline-ui/icons/20';import {sprinkles}from'@baseline-ui/tokens';/**
|
|
2
|
+
* Copyright (c) 2023-2024 PSPDFKit GmbH. All rights reserved.
|
|
3
|
+
*
|
|
4
|
+
* THIS SOURCE CODE AND ANY ACCOMPANYING DOCUMENTATION ARE PROTECTED BY INTERNATIONAL COPYRIGHT LAW
|
|
5
|
+
* AND MAY NOT BE RESOLD OR REDISTRIBUTED. USAGE IS BOUND TO THE PSPDFKIT LICENSE AGREEMENT.
|
|
6
|
+
* UNAUTHORIZED REPRODUCTION OR DISTRIBUTION IS SUBJECT TO CIVIL AND CRIMINAL PENALTIES.
|
|
7
|
+
* This notice may not be removed from this file.
|
|
8
|
+
*
|
|
9
|
+
*/
|
|
10
|
+
var no=io.forwardRef(({color:o,colorLabel:e,colorName:l,isIndeterminate:r,indeterminateIcon:t,noneLabel:s,...a$5},n)=>{let i=io.useRef(null),{hoverProps:c$1,isHovered:m}=a({isDisabled:a$5.isDisabled}),{buttonProps:d,isPressed:g$1}=a$1(a$5,i),{isFocused:f$2,isFocusVisible:b$1,focusProps:B}=a$2(),S=a$3({"data-block-id":a$5["data-block-id"],"data-focused":f$2,"data-focus-visible":b$1,"data-disabled":a$5.isDisabled,"data-hovered":m,"data-pressed":g$1}),F=c(),I$1=c(),h=!!e||typeof l=="string";return jsxs("button",{...g(d,c$1,B,S),style:a$5.style,className:a$4(f$1({isHovered:m,isFocusVisible:b$1||a$5.isOpen,isDisabled:a$5.isDisabled,labelPosition:a$5.labelPosition}),"BaselineUI-ColorInputButton",a$5.className),ref:f(n,i),id:F,"aria-labelledby":[a$5["aria-labelledby"]||F,h&&I$1].filter(Boolean).join(" "),children:[jsx(I,{color:o?.toString("hexa"),isIndeterminate:r,indeterminateIcon:t,noneLabel:s}),e?jsx("div",{className:j,id:I$1,"aria-hidden":"true",children:l}):h&&jsx(b,{id:I$1,"aria-hidden":"true",children:l})]})});no.displayName="ColorInputButton";var Fo=io.forwardRef(({className:o,style:e$1,icon:l,elementType:r="button",...t},s)=>{let a$6=io.useRef(null),{hoverProps:n,isHovered:i}=a({isDisabled:t.isDisabled}),{buttonProps:c,isPressed:m}=a$1({...t,elementType:r},a$6),{isFocusVisible:d,focusProps:g$1}=a$2(),f$1=a$3({"data-block-id":t["data-block-id"],"data-focused":d,"data-focus-visible":d,"data-disabled":t.isDisabled,"data-hovered":i,"data-pressed":m});return jsxs(r,{...g(a$5(r,t.isDisabled),c,n,g$1,f$1),ref:f(s,a$6),style:e$1,className:a$4(p({isHovered:i||m||t.isOpen,isFocusVisible:d,isDisabled:t.isDisabled}),"BaselineUI-IconColorInputButton","BaselineUI-IconColorInput-Button",o),children:[jsx(l,{size:16}),jsx("div",{className:e,style:{backgroundColor:t.color||void 0}})]})});Fo.displayName="IconColorInputButton";var Wo=io.forwardRef(({setColor:o,color:e,triggerRef:l,autoFocus:r,presets:t,state:s$1,isIndeterminate:a,colorPresetsLabel:n},i$1)=>{let{formatMessage:c}=b$1(),m=useCallback(d=>{if(d instanceof Set&&d.size){let g=[...d][0],f=t.find(b=>b.id===g);a$6(f,"Preset not found"),o(f.id===F?null:a$7(f.id).toFormat(A)),s$1.close();}},[s$1,t,o]);return jsx("div",{className:a$4(s,"BaselineUI-ColorInput-Presets"),style:{minWidth:l.current?.offsetWidth},ref:i$1,children:jsx(c$1,{autoFocus:r,items:t,layout:"grid","aria-label":n??c(ft.colorPresets),className:i,renderOption:H,selectionMode:"single",selectedKeys:a?[]:[e?.toString(B)||F],onSelectionChange:m,shouldSelectOnPressUp:true,escapeKeyBehavior:"none"})})});Wo.displayName="ColorPresetList";var ft=c$2({colorPresets:{defaultMessage:"Color Presets",id:"bui.colorInput.colorPresets"}});var Xe=({value:o,...e})=>{let l=io.useRef(null),r=io.useRef(null),t=io.useRef(null),s=b$6({...e,value:o}),{colorAreaProps:a,xInputProps:n,yInputProps:i,thumbProps:c}=a$n({...e,value:o,inputXRef:l,inputYRef:r,containerRef:t},s);useEffect(()=>{l.current?.focus();},[]);let{focusProps:m,isFocusVisible:d$1}=a$2();return jsx("div",{ref:t,...a,className:a$4(d,"BaselineUI-ColorInput-ColorArea"),children:jsxs("div",{...c,className:a$4(w({isFocusVisible:d$1}),"BaselineUI-ColorInput-ColorAreaThumb"),style:{...c.style,transform:"translate(-50%, -50%)",backgroundColor:C(o)?.withChannelValue("alpha",1).toString("css")},children:[jsx("input",{ref:l,...n,...m}),jsx("input",{ref:r,...i,...m})]})})};var Ye=({color:o$1,setColor:e,allowAlpha:l,...r})=>{let t=d$1({value:o$1,onChange:d=>{e(C(d)?.toFormat(A).withChannelValue("alpha",o$1.getChannelValue("alpha")??1)||z);}}),s=io.useRef(null),{inputProps:a$1}=b$7({...r,"aria-label":"Hex"},t,s),{focusProps:n$1,isFocused:i}=a$2({isTextInput:true}),{hoverProps:c,isHovered:m}=a({});return jsxs("div",{className:a$4(n,"BaselineUI-ColorInput-FieldInput"),"data-color-mode":l?"hexa":"hex",children:[jsx("input",{...g(a$1,n$1,c),ref:s,className:o({isFocused:i,isHovered:m,allowAlpha:l})}),l?jsx($e,{color:o$1,setColor:e}):null]})},qe=({color:o,setColor:e,allowAlpha:l})=>{let r$1=o.toFormat("rgba"),{locale:t}=b$2();return jsxs("div",{className:a$4(n,"BaselineUI-ColorInput-FieldInput"),"data-color-mode":l?"rgba":"rgb",children:[jsx(a$p,{"aria-label":o.getChannelName("red",t),value:r$1.getChannelValue("red"),showStepper:false,className:r,onChange:s=>{e(r$1.withChannelValue("red",s).toFormat(A));},step:1,minValue:0,maxValue:255}),jsx(a$p,{"aria-label":o.getChannelName("green",t),value:r$1.getChannelValue("green"),showStepper:false,className:r,onChange:s=>{e(r$1.withChannelValue("green",s).toFormat(A));},step:1,minValue:0,maxValue:255}),jsx(a$p,{"aria-label":o.getChannelName("blue",t),value:r$1.getChannelValue("blue"),showStepper:false,className:r,onChange:s=>{e(r$1.withChannelValue("blue",s).toFormat(A));},step:1,minValue:0,maxValue:255}),l?jsx($e,{color:o,setColor:e}):null]})},yt={style:"percent",maximumFractionDigits:0},$e=({color:o,setColor:e})=>{let{locale:l}=b$2(),r$1=useCallback(t=>{e(o.withChannelValue("alpha",t));},[o,e]);return jsx(a$p,{"aria-label":o.getChannelName("alpha",l),value:o.getChannelValue("alpha"),formatOptions:yt,className:r,showStepper:false,onChange:r$1,minValue:0,maxValue:1})};var qo=({channel:o,...e})=>{let{locale:l}=b$2(),r=c$4({...e,channel:o,locale:l}),t=io.useRef(null),s=io.useRef(null),{trackProps:a,thumbProps:n,inputProps:i}=c$5({...e,channel:o,trackRef:t,inputRef:s,"aria-label":r.value.getChannelName(o,l)},r),{focusProps:c,isFocusVisible:m}=a$2();return jsxs("div",{className:a$4(k,{[a$o({size:"xs"})]:o==="alpha"},"BaselineUI-ColorInput-ColorSlider"),"data-channel":o,...a,ref:t,children:[o==="alpha"&&jsx("div",{className:x}),jsx("div",{className:k,style:a.style}),jsxs("div",{className:a$4(w({isFocusVisible:m}),"BaselineUI-ColorInput-ColorSliderThumb"),...n,children:[jsx("div",{className:x,style:{backgroundColor:"#ffffff"}}),jsx("div",{style:{backgroundColor:r.getDisplayColor().toString("css"),height:8},className:k}),jsx(b,{children:jsx("input",{ref:s,...i,...c})})]})]})};var xo=({color:o,setColor:e,allowAlpha:l,colorFormatLabel:r,onChangeEnd:t})=>{let[s,a]=io.useState("hex"),{formatMessage:n}=b$1();return jsxs(Fragment,{children:[jsx(Xe,{value:o,xChannel:"saturation",yChannel:"lightness",onChange:e,onChangeEnd:t}),jsxs("div",{className:v,children:[jsx(qo,{channel:"hue",value:o,onChange:e,onChangeEnd:t}),l?jsx(qo,{channel:"alpha",value:o,onChange:e,onChangeEnd:t}):null]}),jsxs("div",{className:a$4(v,sprinkles.variants({paddingTop:"none",gap:"sm"})),children:[jsx(c$3,{label:r??n(Pt.colorFormat),labelPosition:"start",variant:"ghost",items:y,selectedKey:s,onSelectionChange:i=>{a(i);}}),s==="hex"&&jsx(Ye,{color:o,setColor:i=>{e(i),t?.(i);},allowAlpha:l}),s==="rgb"&&jsx(qe,{color:o,setColor:i=>{e(i),t?.(i);},allowAlpha:l})]})]})},Pt=c$2({colorFormat:{defaultMessage:"Color Format",id:"bui.colorInput.colorFormat"}});var Ze=({color:o,setColor:e,storePickedColorKey:l$1,addColorButtonLabel:r,removeColorButtonLabel:t$1,customColorsLabel:s$1,addLabel:a,cancelLabel:n,newColorLabel:i$1,colorFormatLabel:c$2,pickerMode:m$1,allowAlpha:d,isIndeterminate:g,state:f})=>{let{locale:b}=b$2(),{formatMessage:B$1}=b$1(),S=io.useRef(null),F=a$j(S.current),[I,h]=a$k(l$1,[]),v=io.useMemo(()=>Array.isArray(I)?I.filter(p=>Ft(p)):[],[I]),O=io.useRef(null),[K,Mo]=io.useState(o),uo=io.useMemo(()=>v.map(p=>({id:p,label:a$7(p).getColorName(b),description:p})),[v,b]),W=useCallback(()=>{let p=m$1==="active"?o:K;if(v.includes(p.toString(B))){O.current?.querySelector(`[data-key='${p.toString(B)}']`)?.classList.add(t);return}h([...v,p.toString(B)]);},[v,o,h,K,m$1]);useEffect(()=>{let p=O.current;function y(Q){Q.animationName===u&&j$2(Q)?.classList.remove(t);}return p?.addEventListener("animationend",y),()=>{p?.removeEventListener("animationend",y);}},[]);let w=c(),J=jsx(a$l,{ref:S,variant:"secondary",size:"md","aria-label":r,icon:PlusIcon,onPress:m$1==="active"?W:void 0}),co=useCallback(p=>jsxs(a$d,{size:"content",className:m({includesCustomColorPicker:true}),style:{paddingBlockEnd:0},"aria-label":i$1??B$1(Jo.newColor),children:[jsx(xo,{color:K,setColor:Mo,allowAlpha:d,colorFormatLabel:c$2}),jsx(a$e,{}),jsx(a$h,{padding:"lg",display:"flex",flexDirection:"row-reverse",children:jsxs(a$h,{display:"inline-flex",gap:"lg",children:[jsx(b$3,{label:n??B$1(Jo.cancel),size:"sm",variant:"secondary",onPress:p}),jsx(b$3,{label:a??B$1(Jo.add),variant:"primary",onPress:()=>{W(),p();},size:"sm"})]})})]}),[K,W,B$1,d,i$1,c$2,n,a]),Oo=useCallback(p=>{a$6(p instanceof Set,"Key must be a set");let y=[...p][0];y&&(e(a$7(y).toFormat(A)),m$1==="lazy"&&f.close());},[e,m$1,f]);return jsxs(Fragment,{children:[jsx(a$e,{}),jsxs("div",{className:a$4(l,"BaselineUI-ColorInput-CustomColors"),children:[jsx("span",{id:w,children:s$1}),jsxs(a$h,{display:"flex",children:[!!v.length&&v.includes(o.toString(B))&&jsx(a$l,{variant:"secondary",size:"md",elementType:"div",icon:MinusIcon,"aria-label":t$1,onPress:()=>{h(v.filter(p=>p!==o.toString(B)));}}),m$1==="active"&&J,m$1==="lazy"&&(F==="mobile"?jsxs(b$4,{children:[jsx(a$m,{children:J}),jsx(e$1,{style:{zIndex:1e5},children:({close:p})=>co(p)})]}):jsxs(b$5,{type:"dialog",children:[jsx(j$1,{children:J}),jsx(a$c,{placement:"right top",className:q,offset:6,children:({close:p})=>co(p)})]}))]})]}),!!v.length&&jsx(c$1,{items:uo,layout:"grid","aria-labelledby":w,className:a$4(i,s,sprinkles.variants({paddingTop:"xs"}),"BaselineUI-ColorInput-CustomColorsListBox"),renderOption:H,ref:O,autoFocus:false,selectionMode:"single",selectedKeys:g?[]:[o.toString(B)],onSelectionChange:Oo,shouldSelectOnPressUp:true})]})},Jo=c$2({newColor:{defaultMessage:"New Custom Color",id:"bui.colorInput.newColor"},cancel:{defaultMessage:"Cancel",id:"bui.colorInput.cancel"},add:{defaultMessage:"Add",id:"bui.colorInput.add"}});function Ft(o){if(typeof o!="string")return false;try{return a$7(o),!0}catch{return false}}function ot({colorLabel:o,color:e,presets:l,isIndeterminate:r,indeterminateLabel:t,transparentLabel:s}){let{formatMessage:a}=b$1(),{locale:n}=b$2(),i=useMemo(()=>r?{id:"indeterminate",label:t??a(je.indeterminate)}:l.find(d=>d.id===F?!e:e?D(e,a$7(d.id)):false),[l,e,r,a,t]),c=useMemo(()=>{if(typeof o=="function")return o?.(e,{isIndeterminate:!!r});if(typeof o=="boolean")return E(e,i,s??a(je.transparent));throw new TypeError("`colorLabel` must be a function or a boolean")},[e,o,a,i,r,s]),m=useMemo(()=>{if(i?.label)return i.label;e?.getColorName(n);},[e,n,i?.label]);return {colorName:c,humanReadableName:m}}var je=c$2({transparent:{defaultMessage:"Transparent",id:"bui.colorInput.transparent"},indeterminate:{defaultMessage:"Indeterminate",id:"bui.colorInput.indeterminate"}});var Ao=io.forwardRef(({className:o,style:e,allowRemoval:l,allowAlpha:r=true,presets:t,labelPosition:s="top",colorLabel:a=true,includePicker:n=true,onChange:i,onChangeEnd:c$1,defaultValue:m$1,storePickedColorKey:d="baselinePickedColor",value:g$2,addColorButtonLabel:f,removeColorButtonLabel:b,customColorsLabel:B,addLabel:S,cancelLabel:F$1,newColorLabel:I,colorFormatLabel:h$1,colorPresetsLabel:v,noColorLabel:O,indeterminateLabel:K,transparentLabel:Mo,onTriggerPress:uo,renderTriggerButton:W,pickerMode:w="active",offset:J=2,placement:co=s==="start"?"bottom end":"bottom start","data-block-id":Oo,"data-block-class":p,isIndeterminate:y,indeterminateIcon:Q,...N},lt)=>{let Z=io.useRef(null),at=io.useRef(null),X=a$8(N),{triggerProps:oe,overlayProps:st}=a$9({type:"listbox"},X,Z),nt=a$a(N.portalContainer),[Y,wo]=a$b(g$2===void 0?void 0:C(g$2),C(m$1),P=>i?.(P?.toFormat("rgba")||null)),{formatMessage:j}=b$1(),Do=useMemo(()=>G(O??j(To.noColor),t),[t,j,O]),fo=c(),{colorName:ee}=ot({colorLabel:a||true,color:Y,presets:Do,isIndeterminate:y,indeterminateLabel:K,transparentLabel:Mo}),it=a?ee:false,te=useMemo(()=>Do.filter(P=>l||P.id!==F),[Do,l]),mt=f||j(To.addColor),pt=b||j(To.removeColor),ut=B||j(To.customColors),re=jsx(Ze,{color:Y||z,setColor:P=>{wo(P),c$1?.(P?.toFormat("rgba")||null);},storePickedColorKey:d,addColorButtonLabel:mt,removeColorButtonLabel:pt,customColorsLabel:ut,addLabel:S,cancelLabel:F$1,newColorLabel:I,colorFormatLabel:h$1,pickerMode:w,allowAlpha:r,isIndeterminate:!!y,state:X});return jsxs(Fragment,{children:[jsxs("div",{className:a$4({[g$1]:s==="start"},"BaselineUI-ColorInput-Trigger",o),"data-block-id":Oo,"data-block-class":p,style:e,ref:lt,children:[N.label?jsx("label",{id:fo,className:h({labelPosition:s}),children:N.label}):null,W?W({isOpen:X.isOpen,color:Y,ref:Z,colorName:it,triggerProps:g(oe,{onPress:uo}),labelId:fo,isIndeterminate:y,indeterminateIcon:Q,noneLabel:O}):jsx(no,{...g(oe,{onPress:uo,...N.label?{"aria-labelledby":fo}:{"aria-label":N["aria-label"]}}),ref:Z,isOpen:X.isOpen,isDisabled:N.isDisabled,labelPosition:s,color:Y,colorLabel:a,colorName:ee,isIndeterminate:y,indeterminateIcon:Q,noneLabel:O})]}),jsx(a$c,{...N,portalContainer:nt,placement:co,state:X,offset:J,className:a$4(q,"BaselineUI-ColorInput-Popover"),triggerRef:Z,overlayProps:st,children:jsxs(a$d,{size:"content",className:m({includesCustomColorPicker:n}),ref:at,"aria-labelledby":N.label?fo:void 0,"aria-label":N["aria-label"],children:[n&&w==="active"?jsxs(Fragment,{children:[jsx(xo,{color:Y||z,setColor:wo,allowAlpha:r,colorFormatLabel:h$1,onChangeEnd:P=>{c$1?.(P?.toFormat("rgba")||null);}}),re]}):null,!!te.length&&jsxs(Fragment,{children:[n&&w==="active"?jsx(a$e,{}):null,jsx(Wo,{autoFocus:n&&w==="active"?false:"first",state:X,triggerRef:Z,presets:te,colorPresetsLabel:v,color:Y,setColor:P=>{wo(P),c$1?.(P?.toFormat("rgba")||null);},isIndeterminate:!!y})]}),n&&w==="lazy"?re:null]})})]})});Ao.displayName="ColorInput";var To=c$2({addColor:{defaultMessage:"Add Color",id:"bui.colorInput.addColor"},removeColor:{defaultMessage:"Remove Color",id:"bui.colorInput.removeColor"},customColors:{defaultMessage:"Custom Colors",id:"bui.colorInput.customColors"},noColor:{defaultMessage:"None",id:"bui.colorInput.noColor"}});var rt=io.forwardRef(({className:o,style:e,icon:l,variant:r="standard","data-block-id":t,tooltip:s=true,iconTooltip:a=true,...n},i)=>{let c=io.useRef(null),{tooltipProps:m}=a$f({label:n["aria-label"],tooltip:s}),d=useCallback(({isOpen:g,color:f,ref:b,colorName:B,triggerProps:S,isIndeterminate:F,indeterminateIcon:I,noneLabel:h})=>jsx(a$g,{...m,children:r==="standard"?jsx(no,{...S,"aria-label":n["aria-label"],ref:b,isOpen:g,isDisabled:n.isDisabled,color:f,colorLabel:false,colorName:B,isIndeterminate:F,indeterminateIcon:I,noneLabel:h}):jsx(Fo,{...S,isOpen:g,icon:TextIcon,color:f?.toString("hexa"),ref:b,isDisabled:n.isDisabled,"aria-label":n["aria-label"],isIndeterminate:F,indeterminateIcon:I})}),[n,m,r]);return jsxs(a$h,{display:"flex",flexDirection:"row",gap:"md",paddingX:r==="standard"?"md":"none",alignItems:"center",className:a$4("BaselineUI-IconColorInput",o),"data-block-id":t,style:e,ref:f(i,c),children:[r==="standard"&&l?jsx(a$i,{icon:l,label:n["aria-label"],tooltip:a,"aria-hidden":"true",size:24,isFocusable:false,className:sprinkles({color:"icon.primary"})}):null,jsx(Ao,{...n,renderTriggerButton:d})]})});rt.displayName="IconColorInput";export{Fo as a,Ao as b,rt as c};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {c}from'./chunk-
|
|
1
|
+
import {c}from'./chunk-6V7S5IG5.mjs';import {a as a$1}from'./chunk-TZSRU3GG.mjs';import {b as b$1}from'./chunk-KG2EHFYA.mjs';import {b as b$2}from'./chunk-I5YPTKMM.mjs';import {a as a$4}from'./chunk-BPXZ6J5G.mjs';import {a as a$2}from'./chunk-PV4E7XDP.mjs';import {a as a$3}from'./chunk-V2C4UDOC.mjs';import {a}from'./chunk-TYOEGCPS.mjs';import {b}from'./chunk-RMUV6NJJ.mjs';import h,{createContext,useState,useMemo,useContext}from'react';import N from'react-dom';import {jsx}from'react/jsx-runtime';/**
|
|
2
2
|
* Copyright (c) 2023-2024 PSPDFKit GmbH. All rights reserved.
|
|
3
3
|
*
|
|
4
4
|
* THIS SOURCE CODE AND ANY ACCOMPANYING DOCUMENTATION ARE PROTECTED BY INTERNATIONAL COPYRIGHT LAW
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {a as a$2}from'./chunk-
|
|
1
|
+
import {a as a$2}from'./chunk-Q7BJGV4I.mjs';import {i}from'./chunk-VPN55UVA.mjs';import {c as c$1,b as b$2,a as a$3}from'./chunk-GZTF5YE3.mjs';import {c,b as b$1}from'./chunk-OY57K37D.mjs';import {d,f as f$1}from'./chunk-24WOG72O.mjs';import {c as c$2}from'./chunk-L3SNGDBH.mjs';import {b}from'./chunk-DF2D7NE6.mjs';import {a as a$4}from'./chunk-66CUIXA6.mjs';import {a as a$1}from'./chunk-RT4LMB6X.mjs';import {g}from'./chunk-V2C4UDOC.mjs';import {a}from'./chunk-JQQGRJ5J.mjs';import {a as a$5}from'./chunk-4QEH5CGK.mjs';import P from'react';import {jsx,jsxs}from'react/jsx-runtime';/**
|
|
2
2
|
* Copyright (c) 2023-2024 PSPDFKit GmbH. All rights reserved.
|
|
3
3
|
*
|
|
4
4
|
* THIS SOURCE CODE AND ANY ACCOMPANYING DOCUMENTATION ARE PROTECTED BY INTERNATIONAL COPYRIGHT LAW
|
|
@@ -7,4 +7,4 @@ import {a as a$2}from'./chunk-EISLHUT5.mjs';import {i}from'./chunk-VPN55UVA.mjs'
|
|
|
7
7
|
* This notice may not be removed from this file.
|
|
8
8
|
*
|
|
9
9
|
*/
|
|
10
|
-
function O(e){return e&&(t=>{(t.key==="Enter"||t.key==="Escape")&&e(t);})}function f(e){return {...e,onKeyDown:O(e.onKeyDown),onKeyDownCapture:O(e.onKeyDownCapture)}}var A=a({defaultClassName:"byycd01 _1yep5z6d6 _1yep5z6j8 _1yep5z6j9 _1yep5z6ja _1yep5z6jz _1yep5z6k0 _1yep5z6k1 _1yep5z6it _1yep5z6iu _1yep5z6iv",variantClassNames:{},defaultVariants:{},compoundVariants:[]});var G=P.forwardRef(({enableReorder:e,...t},r)=>e?jsx(j,{ref:r,...t}):jsx(k,{ref:r,...t}));G.displayName="GridListItem";var k=P.forwardRef(({item:e,state:t,dropState:r,renderGridItem:i,dragHandleProps:s,isEditing:p},u)=>{let a=a$1(u),d=c({node:e},t,a),g=t.selectionManager.selectionMode!=="none"&&t.selectionManager.selectionBehavior==="toggle",{checkboxProps:L}=a$2({key:e.key},t),l={...d,rowProps:p?f(d.rowProps):d.rowProps,checkBoxProps:g?L:void 0,dragHandleProps:s};return jsxs("div",{"data-grid-list-item-key":e.key,children:[r?jsx(c$1,{target:{type:"item",key:e.key,dropPosition:"before"},dropState:r}):null,i?i(e,l,a):null,r&&t.collection.getKeyAfter(e.key)==null?jsx(c$1,{target:{type:"item",key:e.key,dropPosition:"after"},dropState:r}):null]},e.key)});k.displayName="BaseGridListItem";var j=P.forwardRef(({dragState:e,item:t,...r},i)=>{let s=a$1(i),p=d({key:t.key,hasDragButton:true},e,s);return jsx(k,{item:t,dragHandleProps:p,ref:s,...r})});j.displayName="DraggableGridListItem";var V=P.forwardRef(({className:e,style:t,isEditing:r=false,"data-block-id":i$1,"data-block-class":s,gridListHandle:p,onReorder:u,enableReorder:a=false,layout:d="stack",orientation:g="vertical",renderGridItem:L,...l},F)=>{let q=c$2(),o=b({...l,children:q}),w=P.useRef(null),y=a$1(F),{gridProps:J}=b$1(l,o,y);b$2({handle:p,type:"gridlist"},o,y);let{collectionProps:Q,dragState:W,dropState:X}=a$3({...l,onReorder:u,enableReorder:a,layout:d,orientation:g,preview:w,getItems:n=>[...n].map(Z=>{let v=o.collection.getItem(Z);return a$4(v,"Expected item to be defined."),{key:v.key.toString()}})},o,y),D=
|
|
10
|
+
function O(e){return e&&(t=>{(t.key==="Enter"||t.key==="Escape")&&e(t);})}function f(e){return {...e,onKeyDown:O(e.onKeyDown),onKeyDownCapture:O(e.onKeyDownCapture)}}var A=a({defaultClassName:"byycd01 _1yep5z6d6 _1yep5z6j8 _1yep5z6j9 _1yep5z6ja _1yep5z6jz _1yep5z6k0 _1yep5z6k1 _1yep5z6it _1yep5z6iu _1yep5z6iv",variantClassNames:{},defaultVariants:{},compoundVariants:[]});var G=P.forwardRef(({enableReorder:e,...t},r)=>e?jsx(j,{ref:r,...t}):jsx(k,{ref:r,...t}));G.displayName="GridListItem";var k=P.forwardRef(({item:e,state:t,dropState:r,renderGridItem:i,dragHandleProps:s,isEditing:p},u)=>{let a=a$1(u),d=c({node:e},t,a),g=t.selectionManager.selectionMode!=="none"&&t.selectionManager.selectionBehavior==="toggle",{checkboxProps:L}=a$2({key:e.key},t),l={...d,rowProps:p?f(d.rowProps):d.rowProps,checkBoxProps:g?L:void 0,dragHandleProps:s};return jsxs("div",{"data-grid-list-item-key":e.key,children:[r?jsx(c$1,{target:{type:"item",key:e.key,dropPosition:"before"},dropState:r}):null,i?i(e,l,a):null,r&&t.collection.getKeyAfter(e.key)==null?jsx(c$1,{target:{type:"item",key:e.key,dropPosition:"after"},dropState:r}):null]},e.key)});k.displayName="BaseGridListItem";var j=P.forwardRef(({dragState:e,item:t,...r},i)=>{let s=a$1(i),p=d({key:t.key,hasDragButton:true},e,s);return jsx(k,{item:t,dragHandleProps:p,ref:s,...r})});j.displayName="DraggableGridListItem";var V=P.forwardRef(({className:e,style:t,isEditing:r=false,"data-block-id":i$1,"data-block-class":s,gridListHandle:p,onReorder:u,enableReorder:a=false,layout:d="stack",orientation:g$1="vertical",renderGridItem:L,...l},F)=>{let q=c$2(),o=b({...l,children:q}),w=P.useRef(null),y=a$1(F),{gridProps:J}=b$1(l,o,y);b$2({handle:p,type:"gridlist"},o,y);let{collectionProps:Q,dragState:W,dropState:X}=a$3({...l,onReorder:u,enableReorder:a,layout:d,orientation:g$1,preview:w,getItems:n=>[...n].map(Z=>{let v=o.collection.getItem(Z);return a$4(v,"Expected item to be defined."),{key:v.key.toString()}})},o,y),D=g(J,Q),Y={state:o,dragState:W,dropState:X,enableReorder:a,renderGridItem:L,isEditing:r};return jsxs("ul",{...r?f(D):D,className:a$5("BaselineUI-GridList",e),"data-block-id":i$1,"data-block-class":s,style:t,ref:y,"aria-rowcount":o.collection.size,children:[[...o.collection].map(n=>jsx(G,{item:n,...Y},n.key)),a?jsx(f$1,{ref:w,children:n=>jsx(i,{items:n,containerClassName:".BaselineUI-GridList",previewClassName:A(),itemDataAttribute:"data-grid-list-item-key"})}):null]})});V.displayName="GridList";export{V as a};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {a}from'./chunk-JOK6I52O.mjs';import {b as b$1}from'./chunk-OO7BXL2N.mjs';import {a as a$1}from'./chunk-
|
|
1
|
+
import {a}from'./chunk-JOK6I52O.mjs';import {b as b$1}from'./chunk-OO7BXL2N.mjs';import {a as a$1}from'./chunk-AIG23SN5.mjs';import {b}from'./chunk-TYOEGCPS.mjs';import {sprinkles}from'@baseline-ui/tokens';import H,{useState,useEffect,useMemo}from'react';import {jsx,jsxs}from'react/jsx-runtime';/**
|
|
2
2
|
* Copyright (c) 2023-2024 PSPDFKit GmbH. All rights reserved.
|
|
3
3
|
*
|
|
4
4
|
* THIS SOURCE CODE AND ANY ACCOMPANYING DOCUMENTATION ARE PROTECTED BY INTERNATIONAL COPYRIGHT LAW
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import {c,b}from'./chunk-JYWJE6L5.mjs';import {a}from'./chunk-JJG67M2S.mjs';import c$1,{useEffect,useCallback}from'react';/**
|
|
2
|
+
* Copyright (c) 2023-2024 PSPDFKit GmbH. All rights reserved.
|
|
3
|
+
*
|
|
4
|
+
* THIS SOURCE CODE AND ANY ACCOMPANYING DOCUMENTATION ARE PROTECTED BY INTERNATIONAL COPYRIGHT LAW
|
|
5
|
+
* AND MAY NOT BE RESOLD OR REDISTRIBUTED. USAGE IS BOUND TO THE PSPDFKIT LICENSE AGREEMENT.
|
|
6
|
+
* UNAUTHORIZED REPRODUCTION OR DISTRIBUTION IS SUBJECT TO CIVIL AND CRIMINAL PENALTIES.
|
|
7
|
+
* This notice may not be removed from this file.
|
|
8
|
+
*
|
|
9
|
+
*/
|
|
10
|
+
function $(t,i){let{playingLabel:r,pausedLabel:a$1}=i??{},{formatMessage:n,locale:s}=b(),[P,v]=c$1.useState(false),[I,o]=c$1.useState(0),[E,m]=c$1.useState(0),[p,L]=c$1.useState(0),[M,A]=c$1.useState(false);useEffect(()=>{if(!t.current)return;let e=t.current,u=()=>{v(false),o(0),m(0);},y=()=>{m(e.currentTime),!M&&e.duration>0&&o(e.currentTime*100/e.duration);},g=()=>{L(e.duration);},d=()=>{v(!e.paused);},b=()=>{d(),o(0),m(0),L(0);};return e.readyState>=1&&g(),e.addEventListener("playing",d),e.addEventListener("pause",d),e.addEventListener("emptied",b),e.addEventListener("ended",u),e.addEventListener("timeupdate",y),e.addEventListener("loadedmetadata",g),()=>{e.removeEventListener("playing",d),e.removeEventListener("pause",d),e.removeEventListener("emptied",b),e.removeEventListener("ended",u),e.removeEventListener("timeupdate",y),e.removeEventListener("loadedmetadata",g);}},[M,t]);let F=useCallback(()=>{let e=t.current;e&&(e.paused?e.play().then(()=>{a(r??n(D.playing),"polite");},u=>{if(u?.name!=="AbortError")throw u}):(e.pause(),a(a$1??n(D.paused),"polite")));},[n,a$1,r,t]),k=useCallback(e=>{t.current&&Number.isFinite(t.current.duration)&&t.current.duration>0?(t.current.currentTime=e*t.current.duration/100,m(t.current.currentTime),a(x(t.current.currentTime,s.locale),"assertive")):o(0);},[s.locale,t]);return {isPlaying:P,progress:I,duration:p,togglePlay:F,seek:k,setProgress:o,formattedCurrentTime:E?f(E):"00:00",formattedDuration:Number.isFinite(p)&&p>0?f(p):"00:00",setIsSliderDragging:A}}var D=c({playing:{id:"bui.useMedia.playing",defaultMessage:"Playing"},paused:{id:"bui.useMedia.paused",defaultMessage:"Paused"}});function x(t,i){if(!("DurationFormat"in Intl))return f(t);let r=Math.floor(t/3600),a=Math.floor(t%3600/60),n=t%60,s={...r&&{hours:r},...a&&{minutes:a},seconds:Math.floor(n)};return new Intl.DurationFormat(i,{style:"long"}).format(s)}function f(t){let i=Math.floor(t/3600),r=Math.floor(t%3600/60),a=Math.floor(t%60),n=[r,a].map(s=>s.toString().padStart(2,"0")).join(":");return i?`${i}:${n}`:n}export{$ as a,x as b};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {b as b$1,a as a$2,e}from'./chunk-
|
|
1
|
+
import {b as b$1,a as a$2,e}from'./chunk-PITIJLE3.mjs';import {b as b$2}from'./chunk-GOCBU65X.mjs';import {h,j,t,u,n,a as a$3,m,p,e as e$2,v}from'./chunk-2MNK24YJ.mjs';import {g,e as e$1}from'./chunk-V2C4UDOC.mjs';import {a as a$1}from'./chunk-6ZQE5SHE.mjs';import {b,a,h as h$1,j as j$1}from'./chunk-TYOEGCPS.mjs';import {flushSync}from'react-dom';import Me,{useState,useRef,useCallback,useEffect,useMemo,useContext}from'react';/**
|
|
2
2
|
* Copyright (c) 2023-2024 PSPDFKit GmbH. All rights reserved.
|
|
3
3
|
*
|
|
4
4
|
* THIS SOURCE CODE AND ANY ACCOMPANYING DOCUMENTATION ARE PROTECTED BY INTERNATIONAL COPYRIGHT LAW
|
|
@@ -7,10 +7,10 @@ import {b as b$1,a as a$2,e}from'./chunk-DPFX25HC.mjs';import {b as b$2}from'./c
|
|
|
7
7
|
* This notice may not be removed from this file.
|
|
8
8
|
*
|
|
9
9
|
*/
|
|
10
|
-
var R="default",Q="",A=new WeakMap;function Z(r){let s=b(r);if(h()&&j()){if(R==="default"){let i=a(r);Q=i.documentElement.style.webkitUserSelect,i.documentElement.style.webkitUserSelect="none";}R="disabled";}else if(r instanceof s.HTMLElement||r instanceof s.SVGElement){let i="userSelect"in r.style?"userSelect":"webkitUserSelect";A.set(r,r.style[i]),r.style[i]="none";}}function B(r){let s=b(r);if(h()&&j()){if(R!=="disabled")return;R="restoring",setTimeout(()=>{t(()=>{if(R==="restoring"){let i=a(r);i.documentElement.style.webkitUserSelect==="none"&&(i.documentElement.style.webkitUserSelect=Q||""),Q="",R="default";}},r);},300);}else if((r instanceof s.HTMLElement||r instanceof s.SVGElement)&&r&&A.has(r)){let i=A.get(r),a="userSelect"in r.style?"userSelect":"webkitUserSelect";r.style[a]==="none"&&(r.style[a]=i),r.getAttribute("style")===""&&r.removeAttribute("style"),A.delete(r);}}var ee=Me.createContext({register:()=>{}});ee.displayName="PressResponderContext";function Ce(r){let s=useContext(ee);if(s){let{register:i,ref:a,...d}=s;r=c(d,r),i();}return v(s,r.ref),r}var D=class{type;pointerType;target;shiftKey;ctrlKey;metaKey;altKey;x;y;key;#e=true;constructor(s,i,a,d){let P=(d?.target??a.currentTarget)?.getBoundingClientRect(),m,L=0,k,I=null;a.clientX!=null&&a.clientY!=null&&(k=a.clientX,I=a.clientY),P&&(k!=null&&I!=null?(m=k-P.left,L=I-P.top):(m=P.width/2,L=P.height/2)),this.type=s,this.pointerType=i,this.target=a.currentTarget,this.shiftKey=a.shiftKey,this.metaKey=a.metaKey,this.ctrlKey=a.ctrlKey,this.altKey=a.altKey,this.x=m,this.y=L,this.key=a.key;}continuePropagation(){this.#e=false;}get shouldStopPropagation(){return this.#e}},ge=Symbol("linkClicked"),me="react-aria-pressable-style",Pe="data-react-aria-pressable";function ut(r){let{onPress:s,onPressChange:i,onPressStart:a$5,onPressEnd:d,onPressUp:M,onClick:P,isDisabled:m$1,isPressed:L,preventFocusOnPress:k,shouldCancelOnPointerExit:I,allowTextSelectionOnPress:b$3,ref:Y,...be}=Ce(r),[he,se]=useState(false),h=useRef({isPressed:false,ignoreEmulatedMouseEvents:false,didFirePressStart:false,isTriggeringEvent:false,activePointerId:null,target:null,isOverTarget:false,pointerType:null,disposables:[]}),{addGlobalListener:O,removeAllGlobalListeners:F}=a$1(),y=useCallback((e,o)=>{let g=h.current;if(m$1||g.didFirePressStart)return false;let n=true;if(g.isTriggeringEvent=true,a$5){let c=new D("pressstart",o,e);a$5(c),n=c.shouldStopPropagation;}return i&&i(true),g.isTriggeringEvent=false,g.didFirePressStart=true,se(true),n},[m$1,a$5,i]),X=useCallback((e,o,g=true)=>{let n=h.current;if(!n.didFirePressStart)return false;n.didFirePressStart=false,n.isTriggeringEvent=true;let c=true;if(d){let t=new D("pressend",o,e);d(t),c=t.shouldStopPropagation;}if(i&&i(false),se(false),s&&g&&!m$1){let t=new D("press",o,e);s(t),c&&=t.shouldStopPropagation;}return n.isTriggeringEvent=false,c},[m$1,d,i,s]),S=u(X),Se=useCallback((e,o)=>{let g=h.current;if(m$1)return false;if(M){g.isTriggeringEvent=true;let n=new D("pressup",o,e);return M(n),g.isTriggeringEvent=false,n.shouldStopPropagation}return true},[m$1,M]),C=u(Se),N=useCallback(e=>{let o=h.current;if(o.isPressed&&o.target){o.didFirePressStart&&o.pointerType!=null&&X(w(o.target,e),o.pointerType,false),o.isPressed=false,o.isOverTarget=false,o.activePointerId=null,o.pointerType=null,F(),b$3||B(o.target);for(let g of o.disposables)g();o.disposables=[];}},[b$3,F,X]),T=u(N);useEffect(()=>{m$1&&h.current.isPressed&&T({currentTarget:h.current.target,shiftKey:false,ctrlKey:false,metaKey:false,altKey:false});},[m$1]);let U=useCallback(e=>{I&&N(e);},[I,N]),V=useCallback(e=>{m$1||P?.(e);},[m$1,P]),W=useCallback((e,o)=>{if(!m$1&&P){let g=new MouseEvent("click",e);b$1(g,o),P(a$2(g));}},[m$1,P]),Ke=useMemo(()=>{let e$2=h.current,o={onKeyDown(n){if(re(n.nativeEvent,n.currentTarget)&&h$1(n.currentTarget,j$1(n))){ye(j$1(n),n.key)&&n.preventDefault();let c=true;!e$2.isPressed&&!n.repeat&&(e$2.target=n.currentTarget,e$2.isPressed=true,e$2.pointerType="keyboard",c=y(n,"keyboard"));let t=n.currentTarget,l=u=>{re(u,t)&&!u.repeat&&h$1(t,j$1(u))&&e$2.target&&C(w(e$2.target,u),"keyboard");};O(a(n.currentTarget),"keyup",a$4(l,g),true),c&&n.stopPropagation(),n.metaKey&&e$1()&&e$2.metaKeyEvents?.set(n.key,n.nativeEvent);}else n.key==="Meta"&&(e$2.metaKeyEvents=new Map);},onClick(n){if(!(n&&!h$1(n.currentTarget,j$1(n)))&&n&&n.button===0&&!e$2.isTriggeringEvent&&!p.isOpening){let c=true;if(m$1&&n.preventDefault(),!e$2.ignoreEmulatedMouseEvents&&!e$2.isPressed&&(e$2.pointerType==="virtual"||m(n.nativeEvent))){let t=y(n,"virtual"),l=C(n,"virtual"),u=S(n,"virtual");V(n),c=t&&l&&u;}else if(e$2.isPressed&&e$2.pointerType!=="keyboard"){let t=e$2.pointerType||n.nativeEvent.pointerType||"virtual",l=C(w(n.currentTarget,n),t),u=S(w(n.currentTarget,n),t,true);c=l&&u,e$2.isOverTarget=false,V(n),T(n);}e$2.ignoreEmulatedMouseEvents=false,c&&n.stopPropagation();}}},g=n=>{if(e$2.isPressed&&e$2.target&&re(n,e$2.target)){ye(j$1(n),n.key)&&n.preventDefault();let c=j$1(n),t=h$1(e$2.target,c);S(w(e$2.target,n),"keyboard",t),t&&W(n,e$2.target),F(),n.key!=="Enter"&&ne(e$2.target)&&h$1(e$2.target,c)&&!n[ge]&&(n[ge]=true,p(e$2.target,n,false)),e$2.isPressed=false,e$2.metaKeyEvents?.delete(n.key);}else if(n.key==="Meta"&&e$2.metaKeyEvents?.size){let c=e$2.metaKeyEvents;e$2.metaKeyEvents=void 0;for(let t of c.values())e$2.target?.dispatchEvent(new KeyboardEvent("keyup",t));}};if(typeof PointerEvent<"u"){o.onPointerDown=t=>{if(t.button!==0||!h$1(t.currentTarget,j$1(t)))return;if(n(t.nativeEvent)){e$2.pointerType="virtual";return}e$2.pointerType=t.pointerType;let l=true;if(!e$2.isPressed){e$2.isPressed=true,e$2.isOverTarget=true,e$2.activePointerId=t.pointerId,e$2.target=t.currentTarget,b$3||Z(e$2.target),l=y(t,e$2.pointerType);let u=j$1(t);"releasePointerCapture"in u&&("hasPointerCapture"in u?u.hasPointerCapture(t.pointerId)&&u.releasePointerCapture(t.pointerId):u.releasePointerCapture(t.pointerId)),O(a(t.currentTarget),"pointerup",n$1,false),O(a(t.currentTarget),"pointercancel",c,false);}l&&t.stopPropagation();},o.onMouseDown=t=>{if(h$1(t.currentTarget,j$1(t))&&t.button===0){if(k){let l=e(j$1(t));l&&e$2.disposables.push(l);}t.stopPropagation();}},o.onPointerUp=t=>{!h$1(t.currentTarget,j$1(t))||e$2.pointerType==="virtual"||t.button===0&&!e$2.isPressed&&C(t,e$2.pointerType||t.pointerType);},o.onPointerEnter=t=>{t.pointerId===e$2.activePointerId&&e$2.target&&!e$2.isOverTarget&&e$2.pointerType!=null&&(e$2.isOverTarget=true,y(w(e$2.target,t),e$2.pointerType));},o.onPointerLeave=t=>{t.pointerId===e$2.activePointerId&&e$2.target&&e$2.isOverTarget&&e$2.pointerType!=null&&(e$2.isOverTarget=false,S(w(e$2.target,t),e$2.pointerType,false),U(t));};let n$1=t=>{if(t.pointerId===e$2.activePointerId&&e$2.isPressed&&t.button===0&&e$2.target){if(h$1(e$2.target,j$1(t))&&e$2.pointerType!=null){let l=false,u=setTimeout(()=>{e$2.isPressed&&e$2.target instanceof b(e$2.target).HTMLElement&&(l?T(t):(a$3(e$2.target),e$2.target.click()));},80);O(t.currentTarget,"click",()=>l=true,true),e$2.disposables.push(()=>clearTimeout(u));}else T(t);e$2.isOverTarget=false;}},c=t=>{T(t);};o.onDragStart=t=>{h$1(t.currentTarget,j$1(t))&&T(t);};}else if(process.env.NODE_ENV==="test"){o.onMouseDown=t=>{if(t.button!==0||!h$1(t.currentTarget,j$1(t)))return;if(e$2.ignoreEmulatedMouseEvents){t.stopPropagation();return}if(e$2.isPressed=true,e$2.isOverTarget=true,e$2.target=t.currentTarget,e$2.pointerType=m(t.nativeEvent)?"virtual":"mouse",flushSync(()=>y(t,e$2.pointerType))&&t.stopPropagation(),k){let u=e(j$1(t));u&&e$2.disposables.push(u);}O(a(t.currentTarget),"mouseup",n,false);},o.onMouseEnter=t=>{if(!h$1(t.currentTarget,j$1(t)))return;let l=true;e$2.isPressed&&!e$2.ignoreEmulatedMouseEvents&&e$2.pointerType!=null&&(e$2.isOverTarget=true,l=y(t,e$2.pointerType)),l&&t.stopPropagation();},o.onMouseLeave=t=>{if(!h$1(t.currentTarget,j$1(t)))return;let l=true;e$2.isPressed&&!e$2.ignoreEmulatedMouseEvents&&e$2.pointerType!=null&&(e$2.isOverTarget=false,l=S(t,e$2.pointerType,false),U(t)),l&&t.stopPropagation();},o.onMouseUp=t=>{h$1(t.currentTarget,j$1(t))&&!e$2.ignoreEmulatedMouseEvents&&t.button===0&&!e$2.isPressed&&C(t,e$2.pointerType||"mouse");};let n=t=>{if(t.button===0){if(e$2.ignoreEmulatedMouseEvents){e$2.ignoreEmulatedMouseEvents=false;return}e$2.target&&h$1(e$2.target,j$1(t))&&e$2.pointerType!=null||T(t),e$2.isOverTarget=false;}};o.onTouchStart=t=>{if(!h$1(t.currentTarget,j$1(t)))return;let l=Re(t.nativeEvent);if(!l)return;e$2.activePointerId=l.identifier,e$2.ignoreEmulatedMouseEvents=true,e$2.isOverTarget=true,e$2.isPressed=true,e$2.target=t.currentTarget,e$2.pointerType="touch",b$3||Z(e$2.target),y(K(e$2.target,t),e$2.pointerType)&&t.stopPropagation(),O(b(t.currentTarget),"scroll",c,true);},o.onTouchMove=t=>{if(!h$1(t.currentTarget,j$1(t)))return;if(!e$2.isPressed){t.stopPropagation();return}let l=Te(t.nativeEvent,e$2.activePointerId),u=true;l&&Ee(l,t.currentTarget)?!e$2.isOverTarget&&e$2.pointerType!=null&&(e$2.isOverTarget=true,u=y(K(e$2.target,t),e$2.pointerType)):e$2.isOverTarget&&e$2.pointerType!=null&&(e$2.isOverTarget=false,u=S(K(e$2.target,t),e$2.pointerType,false),U(K(e$2.target,t))),u&&t.stopPropagation();},o.onTouchEnd=t=>{if(!h$1(t.currentTarget,j$1(t)))return;if(!e$2.isPressed){t.stopPropagation();return}let l=Te(t.nativeEvent,e$2.activePointerId),u=true;l&&Ee(l,t.currentTarget)&&e$2.pointerType!=null?(C(K(e$2.target,t),e$2.pointerType),u=S(K(e$2.target,t),e$2.pointerType),W(t.nativeEvent,e$2.target)):e$2.isOverTarget&&e$2.pointerType!=null&&(u=S(K(e$2.target,t),e$2.pointerType,false)),u&&t.stopPropagation(),e$2.isPressed=false,e$2.activePointerId=null,e$2.isOverTarget=false,e$2.ignoreEmulatedMouseEvents=true,e$2.target&&!b$3&&B(e$2.target),F();},o.onTouchCancel=t=>{h$1(t.currentTarget,j$1(t))&&(t.stopPropagation(),e$2.isPressed&&T(K(e$2.target,t)));};let c=t=>{e$2.isPressed&&h$1(j$1(t),e$2.target)&&T({currentTarget:e$2.target,shiftKey:false,ctrlKey:false,metaKey:false,altKey:false});};o.onDragStart=t=>{h$1(t.currentTarget,j$1(t))&&T(t);};}return o},[O,m$1,k,F,b$3,U,y,V,W]);return useEffect(()=>{if(!Y||process.env.NODE_ENV==="test")return;let e=a(Y.current);if(!e||!e.head||e.getElementById(me))return;let o=e.createElement("style");o.id=me;let g=b$2(e);g&&(o.nonce=g),o.textContent=`
|
|
10
|
+
var R="default",Q="",A=new WeakMap;function Z(r){let s=b(r);if(h()&&j()){if(R==="default"){let i=a(r);Q=i.documentElement.style.webkitUserSelect,i.documentElement.style.webkitUserSelect="none";}R="disabled";}else if(r instanceof s.HTMLElement||r instanceof s.SVGElement){let i="userSelect"in r.style?"userSelect":"webkitUserSelect";A.set(r,r.style[i]),r.style[i]="none";}}function B(r){let s=b(r);if(h()&&j()){if(R!=="disabled")return;R="restoring",setTimeout(()=>{t(()=>{if(R==="restoring"){let i=a(r);i.documentElement.style.webkitUserSelect==="none"&&(i.documentElement.style.webkitUserSelect=Q||""),Q="",R="default";}},r);},300);}else if((r instanceof s.HTMLElement||r instanceof s.SVGElement)&&r&&A.has(r)){let i=A.get(r),a="userSelect"in r.style?"userSelect":"webkitUserSelect";r.style[a]==="none"&&(r.style[a]=i),r.getAttribute("style")===""&&r.removeAttribute("style"),A.delete(r);}}var ee=Me.createContext({register:()=>{}});ee.displayName="PressResponderContext";function Ce(r){let s=useContext(ee);if(s){let{register:i,ref:a,...d}=s;r=g(d,r),i();}return v(s,r.ref),r}var D=class{type;pointerType;target;shiftKey;ctrlKey;metaKey;altKey;x;y;key;#e=true;constructor(s,i,a,d){let P=(d?.target??a.currentTarget)?.getBoundingClientRect(),m,L=0,k,I=null;a.clientX!=null&&a.clientY!=null&&(k=a.clientX,I=a.clientY),P&&(k!=null&&I!=null?(m=k-P.left,L=I-P.top):(m=P.width/2,L=P.height/2)),this.type=s,this.pointerType=i,this.target=a.currentTarget,this.shiftKey=a.shiftKey,this.metaKey=a.metaKey,this.ctrlKey=a.ctrlKey,this.altKey=a.altKey,this.x=m,this.y=L,this.key=a.key;}continuePropagation(){this.#e=false;}get shouldStopPropagation(){return this.#e}},ge=Symbol("linkClicked"),me="react-aria-pressable-style",Pe="data-react-aria-pressable";function ut(r){let{onPress:s,onPressChange:i,onPressStart:a$4,onPressEnd:d,onPressUp:M,onClick:P,isDisabled:m$1,isPressed:L,preventFocusOnPress:k,shouldCancelOnPointerExit:I,allowTextSelectionOnPress:b$3,ref:Y,...be}=Ce(r),[he,se]=useState(false),h=useRef({isPressed:false,ignoreEmulatedMouseEvents:false,didFirePressStart:false,isTriggeringEvent:false,activePointerId:null,target:null,isOverTarget:false,pointerType:null,disposables:[]}),{addGlobalListener:O,removeAllGlobalListeners:F}=a$1(),y=useCallback((e,o)=>{let g=h.current;if(m$1||g.didFirePressStart)return false;let n=true;if(g.isTriggeringEvent=true,a$4){let c=new D("pressstart",o,e);a$4(c),n=c.shouldStopPropagation;}return i&&i(true),g.isTriggeringEvent=false,g.didFirePressStart=true,se(true),n},[m$1,a$4,i]),X=useCallback((e,o,g=true)=>{let n=h.current;if(!n.didFirePressStart)return false;n.didFirePressStart=false,n.isTriggeringEvent=true;let c=true;if(d){let t=new D("pressend",o,e);d(t),c=t.shouldStopPropagation;}if(i&&i(false),se(false),s&&g&&!m$1){let t=new D("press",o,e);s(t),c&&=t.shouldStopPropagation;}return n.isTriggeringEvent=false,c},[m$1,d,i,s]),S=u(X),Se=useCallback((e,o)=>{let g=h.current;if(m$1)return false;if(M){g.isTriggeringEvent=true;let n=new D("pressup",o,e);return M(n),g.isTriggeringEvent=false,n.shouldStopPropagation}return true},[m$1,M]),C=u(Se),N=useCallback(e=>{let o=h.current;if(o.isPressed&&o.target){o.didFirePressStart&&o.pointerType!=null&&X(w(o.target,e),o.pointerType,false),o.isPressed=false,o.isOverTarget=false,o.activePointerId=null,o.pointerType=null,F(),b$3||B(o.target);for(let g of o.disposables)g();o.disposables=[];}},[b$3,F,X]),T=u(N);useEffect(()=>{m$1&&h.current.isPressed&&T({currentTarget:h.current.target,shiftKey:false,ctrlKey:false,metaKey:false,altKey:false});},[m$1]);let U=useCallback(e=>{I&&N(e);},[I,N]),V=useCallback(e=>{m$1||P?.(e);},[m$1,P]),W=useCallback((e,o)=>{if(!m$1&&P){let g=new MouseEvent("click",e);b$1(g,o),P(a$2(g));}},[m$1,P]),Ke=useMemo(()=>{let e$3=h.current,o={onKeyDown(n){if(re(n.nativeEvent,n.currentTarget)&&h$1(n.currentTarget,j$1(n))){ye(j$1(n),n.key)&&n.preventDefault();let c=true;!e$3.isPressed&&!n.repeat&&(e$3.target=n.currentTarget,e$3.isPressed=true,e$3.pointerType="keyboard",c=y(n,"keyboard"));let t=n.currentTarget,l=u=>{re(u,t)&&!u.repeat&&h$1(t,j$1(u))&&e$3.target&&C(w(e$3.target,u),"keyboard");};O(a(n.currentTarget),"keyup",e$1(l,g),true),c&&n.stopPropagation(),n.metaKey&&e$2()&&e$3.metaKeyEvents?.set(n.key,n.nativeEvent);}else n.key==="Meta"&&(e$3.metaKeyEvents=new Map);},onClick(n){if(!(n&&!h$1(n.currentTarget,j$1(n)))&&n&&n.button===0&&!e$3.isTriggeringEvent&&!p.isOpening){let c=true;if(m$1&&n.preventDefault(),!e$3.ignoreEmulatedMouseEvents&&!e$3.isPressed&&(e$3.pointerType==="virtual"||m(n.nativeEvent))){let t=y(n,"virtual"),l=C(n,"virtual"),u=S(n,"virtual");V(n),c=t&&l&&u;}else if(e$3.isPressed&&e$3.pointerType!=="keyboard"){let t=e$3.pointerType||n.nativeEvent.pointerType||"virtual",l=C(w(n.currentTarget,n),t),u=S(w(n.currentTarget,n),t,true);c=l&&u,e$3.isOverTarget=false,V(n),T(n);}e$3.ignoreEmulatedMouseEvents=false,c&&n.stopPropagation();}}},g=n=>{if(e$3.isPressed&&e$3.target&&re(n,e$3.target)){ye(j$1(n),n.key)&&n.preventDefault();let c=j$1(n),t=h$1(e$3.target,c);S(w(e$3.target,n),"keyboard",t),t&&W(n,e$3.target),F(),n.key!=="Enter"&&ne(e$3.target)&&h$1(e$3.target,c)&&!n[ge]&&(n[ge]=true,p(e$3.target,n,false)),e$3.isPressed=false,e$3.metaKeyEvents?.delete(n.key);}else if(n.key==="Meta"&&e$3.metaKeyEvents?.size){let c=e$3.metaKeyEvents;e$3.metaKeyEvents=void 0;for(let t of c.values())e$3.target?.dispatchEvent(new KeyboardEvent("keyup",t));}};if(typeof PointerEvent<"u"){o.onPointerDown=t=>{if(t.button!==0||!h$1(t.currentTarget,j$1(t)))return;if(n(t.nativeEvent)){e$3.pointerType="virtual";return}e$3.pointerType=t.pointerType;let l=true;if(!e$3.isPressed){e$3.isPressed=true,e$3.isOverTarget=true,e$3.activePointerId=t.pointerId,e$3.target=t.currentTarget,b$3||Z(e$3.target),l=y(t,e$3.pointerType);let u=j$1(t);"releasePointerCapture"in u&&("hasPointerCapture"in u?u.hasPointerCapture(t.pointerId)&&u.releasePointerCapture(t.pointerId):u.releasePointerCapture(t.pointerId)),O(a(t.currentTarget),"pointerup",n$1,false),O(a(t.currentTarget),"pointercancel",c,false);}l&&t.stopPropagation();},o.onMouseDown=t=>{if(h$1(t.currentTarget,j$1(t))&&t.button===0){if(k){let l=e(j$1(t));l&&e$3.disposables.push(l);}t.stopPropagation();}},o.onPointerUp=t=>{!h$1(t.currentTarget,j$1(t))||e$3.pointerType==="virtual"||t.button===0&&!e$3.isPressed&&C(t,e$3.pointerType||t.pointerType);},o.onPointerEnter=t=>{t.pointerId===e$3.activePointerId&&e$3.target&&!e$3.isOverTarget&&e$3.pointerType!=null&&(e$3.isOverTarget=true,y(w(e$3.target,t),e$3.pointerType));},o.onPointerLeave=t=>{t.pointerId===e$3.activePointerId&&e$3.target&&e$3.isOverTarget&&e$3.pointerType!=null&&(e$3.isOverTarget=false,S(w(e$3.target,t),e$3.pointerType,false),U(t));};let n$1=t=>{if(t.pointerId===e$3.activePointerId&&e$3.isPressed&&t.button===0&&e$3.target){if(h$1(e$3.target,j$1(t))&&e$3.pointerType!=null){let l=false,u=setTimeout(()=>{e$3.isPressed&&e$3.target instanceof b(e$3.target).HTMLElement&&(l?T(t):(a$3(e$3.target),e$3.target.click()));},80);O(t.currentTarget,"click",()=>l=true,true),e$3.disposables.push(()=>clearTimeout(u));}else T(t);e$3.isOverTarget=false;}},c=t=>{T(t);};o.onDragStart=t=>{h$1(t.currentTarget,j$1(t))&&T(t);};}else if(process.env.NODE_ENV==="test"){o.onMouseDown=t=>{if(t.button!==0||!h$1(t.currentTarget,j$1(t)))return;if(e$3.ignoreEmulatedMouseEvents){t.stopPropagation();return}if(e$3.isPressed=true,e$3.isOverTarget=true,e$3.target=t.currentTarget,e$3.pointerType=m(t.nativeEvent)?"virtual":"mouse",flushSync(()=>y(t,e$3.pointerType))&&t.stopPropagation(),k){let u=e(j$1(t));u&&e$3.disposables.push(u);}O(a(t.currentTarget),"mouseup",n,false);},o.onMouseEnter=t=>{if(!h$1(t.currentTarget,j$1(t)))return;let l=true;e$3.isPressed&&!e$3.ignoreEmulatedMouseEvents&&e$3.pointerType!=null&&(e$3.isOverTarget=true,l=y(t,e$3.pointerType)),l&&t.stopPropagation();},o.onMouseLeave=t=>{if(!h$1(t.currentTarget,j$1(t)))return;let l=true;e$3.isPressed&&!e$3.ignoreEmulatedMouseEvents&&e$3.pointerType!=null&&(e$3.isOverTarget=false,l=S(t,e$3.pointerType,false),U(t)),l&&t.stopPropagation();},o.onMouseUp=t=>{h$1(t.currentTarget,j$1(t))&&!e$3.ignoreEmulatedMouseEvents&&t.button===0&&!e$3.isPressed&&C(t,e$3.pointerType||"mouse");};let n=t=>{if(t.button===0){if(e$3.ignoreEmulatedMouseEvents){e$3.ignoreEmulatedMouseEvents=false;return}e$3.target&&h$1(e$3.target,j$1(t))&&e$3.pointerType!=null||T(t),e$3.isOverTarget=false;}};o.onTouchStart=t=>{if(!h$1(t.currentTarget,j$1(t)))return;let l=Re(t.nativeEvent);if(!l)return;e$3.activePointerId=l.identifier,e$3.ignoreEmulatedMouseEvents=true,e$3.isOverTarget=true,e$3.isPressed=true,e$3.target=t.currentTarget,e$3.pointerType="touch",b$3||Z(e$3.target),y(K(e$3.target,t),e$3.pointerType)&&t.stopPropagation(),O(b(t.currentTarget),"scroll",c,true);},o.onTouchMove=t=>{if(!h$1(t.currentTarget,j$1(t)))return;if(!e$3.isPressed){t.stopPropagation();return}let l=Te(t.nativeEvent,e$3.activePointerId),u=true;l&&Ee(l,t.currentTarget)?!e$3.isOverTarget&&e$3.pointerType!=null&&(e$3.isOverTarget=true,u=y(K(e$3.target,t),e$3.pointerType)):e$3.isOverTarget&&e$3.pointerType!=null&&(e$3.isOverTarget=false,u=S(K(e$3.target,t),e$3.pointerType,false),U(K(e$3.target,t))),u&&t.stopPropagation();},o.onTouchEnd=t=>{if(!h$1(t.currentTarget,j$1(t)))return;if(!e$3.isPressed){t.stopPropagation();return}let l=Te(t.nativeEvent,e$3.activePointerId),u=true;l&&Ee(l,t.currentTarget)&&e$3.pointerType!=null?(C(K(e$3.target,t),e$3.pointerType),u=S(K(e$3.target,t),e$3.pointerType),W(t.nativeEvent,e$3.target)):e$3.isOverTarget&&e$3.pointerType!=null&&(u=S(K(e$3.target,t),e$3.pointerType,false)),u&&t.stopPropagation(),e$3.isPressed=false,e$3.activePointerId=null,e$3.isOverTarget=false,e$3.ignoreEmulatedMouseEvents=true,e$3.target&&!b$3&&B(e$3.target),F();},o.onTouchCancel=t=>{h$1(t.currentTarget,j$1(t))&&(t.stopPropagation(),e$3.isPressed&&T(K(e$3.target,t)));};let c=t=>{e$3.isPressed&&h$1(j$1(t),e$3.target)&&T({currentTarget:e$3.target,shiftKey:false,ctrlKey:false,metaKey:false,altKey:false});};o.onDragStart=t=>{h$1(t.currentTarget,j$1(t))&&T(t);};}return o},[O,m$1,k,F,b$3,U,y,V,W]);return useEffect(()=>{if(!Y||process.env.NODE_ENV==="test")return;let e=a(Y.current);if(!e||!e.head||e.getElementById(me))return;let o=e.createElement("style");o.id=me;let g=b$2(e);g&&(o.nonce=g),o.textContent=`
|
|
11
11
|
@layer {
|
|
12
12
|
[${Pe}] {
|
|
13
13
|
touch-action: pan-x pan-y pinch-zoom;
|
|
14
14
|
}
|
|
15
15
|
}
|
|
16
|
-
`.trim(),e.head.prepend(o);},[Y]),useEffect(()=>{let e=h.current;return ()=>{b$3||B(e.target??void 0);for(let o of e.disposables)o();e.disposables=[];}},[b$3]),{isPressed:L||he,pressProps:
|
|
16
|
+
`.trim(),e.head.prepend(o);},[Y]),useEffect(()=>{let e=h.current;return ()=>{b$3||B(e.target??void 0);for(let o of e.disposables)o();e.disposables=[];}},[b$3]),{isPressed:L||he,pressProps:g(be,Ke,{[Pe]:true})}}function ne(r){return r.tagName==="A"&&r.hasAttribute("href")}function re(r,s){let{key:i,code:a}=r,d=s,M=d.getAttribute("role");return (i==="Enter"||i===" "||i==="Spacebar"||a==="Space")&&!(d instanceof b(d).HTMLInputElement&&!ve(d,i)||d instanceof b(d).HTMLTextAreaElement||d.isContentEditable)&&!((M==="link"||!M&&ne(d))&&i!=="Enter")}function Re(r){let{targetTouches:s}=r;return s.length>0?s[0]:null}function Te(r,s){let i=r.changedTouches;for(let a=0;a<i.length;a++){let d=i[a];if(d.identifier===s)return d}return null}function K(r,s){let i=0,a=0;return s.targetTouches&&s.targetTouches.length===1&&(i=s.targetTouches[0].clientX,a=s.targetTouches[0].clientY),{currentTarget:r,shiftKey:s.shiftKey,ctrlKey:s.ctrlKey,metaKey:s.metaKey,altKey:s.altKey,clientX:i,clientY:a}}function w(r,s){let i=s.clientX,a=s.clientY;return {currentTarget:r,shiftKey:s.shiftKey,ctrlKey:s.ctrlKey,metaKey:s.metaKey,altKey:s.altKey,clientX:i,clientY:a,key:s.key}}function De(r){let s=0,i=0;return r.width!==void 0?s=r.width/2:r.radiusX!==void 0&&(s=r.radiusX),r.height!==void 0?i=r.height/2:r.radiusY!==void 0&&(i=r.radiusY),{top:r.clientY-i,right:r.clientX+s,bottom:r.clientY+i,left:r.clientX-s}}function Le(r,s){return !(r.left>s.right||s.left>r.right||r.top>s.bottom||s.top>r.bottom)}function Ee(r,s){let i=s.getBoundingClientRect(),a=De(r);return Le(i,a)}function Fe(r){let s=b(r);return r instanceof s.HTMLInputElement?false:r instanceof s.HTMLButtonElement?r.type!=="submit"&&r.type!=="reset":!ne(r)}function ye(r,s){return e$2()&&s==="Enter"?false:r instanceof b(r).HTMLInputElement?s==="Enter"&&(r.type==="checkbox"||r.type==="radio")?false:!ve(r,s):Fe(r)}var Ue=new Set(["checkbox","radio","range","color","file","image","button","submit","reset"]);function ve(r,s){return r.type==="checkbox"||r.type==="radio"?s===" ":Ue.has(r.type)}export{Z as a,B as b,ee as c,ut as d};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {b as b$1}from'./chunk-4EAXDHSV.mjs';import {a as a$2}from'./chunk-2UUKKXBD.mjs';import {a}from'./chunk-JOK6I52O.mjs';import {a as a$1}from'./chunk-5IC46G5J.mjs';import {b}from'./chunk-N2XGJKZG.mjs';import {
|
|
1
|
+
import {b as b$1}from'./chunk-4EAXDHSV.mjs';import {a as a$2}from'./chunk-2UUKKXBD.mjs';import {a}from'./chunk-JOK6I52O.mjs';import {a as a$1}from'./chunk-5IC46G5J.mjs';import {b}from'./chunk-N2XGJKZG.mjs';import {g}from'./chunk-V2C4UDOC.mjs';import {a as a$3}from'./chunk-4QEH5CGK.mjs';import {MotionConfig,MotionGlobalConfig}from'motion/react';export{MotionGlobalConfig as f}from'motion/react';import {lightTheme,themes,themeVars}from'@baseline-ui/tokens';import {assignInlineVars}from'@vanilla-extract/dynamic';import X,{createContext,useMemo,useEffect,useState}from'react';import {jsx}from'react/jsx-runtime';/**
|
|
2
2
|
* Copyright (c) 2023-2024 PSPDFKit GmbH. All rights reserved.
|
|
3
3
|
*
|
|
4
4
|
* THIS SOURCE CODE AND ANY ACCOMPANYING DOCUMENTATION ARE PROTECTED BY INTERNATIONAL COPYRIGHT LAW
|
|
@@ -7,4 +7,4 @@ import {b as b$1}from'./chunk-4EAXDHSV.mjs';import {a as a$2}from'./chunk-2UUKKX
|
|
|
7
7
|
* This notice may not be removed from this file.
|
|
8
8
|
*
|
|
9
9
|
*/
|
|
10
|
-
function v(r=typeof window>"u"?void 0:window){let[u,s]=useState("light"),[i,a]=useState(false),[l,n]=useState(false),[p,m]=useState(false);return useEffect(()=>{if(!r)return;let e=r.matchMedia("(prefers-color-scheme: dark)"),t=o=>{s(o.matches?"dark":"light");};return s(e.matches?"dark":"light"),e.addEventListener("change",t),()=>{e.removeEventListener("change",t);}},[r]),useEffect(()=>{if(!r)return;let e=r.matchMedia("(prefers-contrast: more)"),t=o=>{a(o.matches);};return a(e.matches),e.addEventListener("change",t),()=>{e.removeEventListener("change",t);}},[r]),useEffect(()=>{if(!r)return;let e=r.matchMedia("(prefers-reduced-motion: reduce)"),t=o=>{n(o.matches);};return n(e.matches),e.addEventListener("change",t),()=>{e.removeEventListener("change",t);}},[r]),useEffect(()=>{if(!r)return;let e=r.matchMedia("(prefers-reduced-transparency: reduce)"),t=o=>{m(o.matches);};return m(e.matches),e.addEventListener("change",t),()=>{e.removeEventListener("change",t);}},[r]),{colorScheme:u,highContrast:i,reducedMotion:l,transparency:p}}var A=createContext({theme:lightTheme,setTheme:()=>{},shouldHandleVirtualKeyboard:true,reducedMotion:"user",minTouchTargetSize:24});var I="var(--hj25q10)";var h={LIGHT:themes.base.light,DARK:themes.base.dark},S=X.forwardRef(({theme:r="system",children:u,setTheme:s,onThemeChange:i,className:a$4,style:l,UNSAFE_domProps:n,"data-block-id":p,"data-block-class":m,reducedMotion:e="user",shouldHandleVirtualKeyboard:t=true,minTouchTargetSize:o=24},V)=>{let{direction:P}=b(),{colorScheme:g,reducedMotion:D,highContrast:G,transparency:N}=v(),f=useMemo(()=>{switch(r){case "system":return g==="light"?h.LIGHT:h.DARK;case "light":return h.LIGHT;case "dark":return h.DARK;default:return r}},[g,r]),{name:K,...z}=f,B=a(),q={"data-theme":K,"data-block-id":p,"data-block-class":m,"data-reduced-motion":e==="user"?D:e==="always","data-high-contrast":G,"data-transparency":N,"data-device":B},F=useMemo(()=>({theme:f,setTheme:y=>{s?.(y),i?.(y);},shouldHandleVirtualKeyboard:t,reducedMotion:e,minTouchTargetSize:o}),[f,s,i,t,e,o]);return useEffect(()=>{s&&a$1("ThemeProvider:setTheme","ThemeProvider: The `setTheme` prop is deprecated and will be removed in a future version of Baseline UI. Use the `onThemeChange` prop instead.");},[s]),jsx(A.Provider,{value:F,children:jsx(MotionConfig,{reducedMotion:e,children:jsx("div",{...
|
|
10
|
+
function v(r=typeof window>"u"?void 0:window){let[u,s]=useState("light"),[i,a]=useState(false),[l,n]=useState(false),[p,m]=useState(false);return useEffect(()=>{if(!r)return;let e=r.matchMedia("(prefers-color-scheme: dark)"),t=o=>{s(o.matches?"dark":"light");};return s(e.matches?"dark":"light"),e.addEventListener("change",t),()=>{e.removeEventListener("change",t);}},[r]),useEffect(()=>{if(!r)return;let e=r.matchMedia("(prefers-contrast: more)"),t=o=>{a(o.matches);};return a(e.matches),e.addEventListener("change",t),()=>{e.removeEventListener("change",t);}},[r]),useEffect(()=>{if(!r)return;let e=r.matchMedia("(prefers-reduced-motion: reduce)"),t=o=>{n(o.matches);};return n(e.matches),e.addEventListener("change",t),()=>{e.removeEventListener("change",t);}},[r]),useEffect(()=>{if(!r)return;let e=r.matchMedia("(prefers-reduced-transparency: reduce)"),t=o=>{m(o.matches);};return m(e.matches),e.addEventListener("change",t),()=>{e.removeEventListener("change",t);}},[r]),{colorScheme:u,highContrast:i,reducedMotion:l,transparency:p}}var A=createContext({theme:lightTheme,setTheme:()=>{},shouldHandleVirtualKeyboard:true,reducedMotion:"user",minTouchTargetSize:24});var I="var(--hj25q10)";var h={LIGHT:themes.base.light,DARK:themes.base.dark},S=X.forwardRef(({theme:r="system",children:u,setTheme:s,onThemeChange:i,className:a$4,style:l,UNSAFE_domProps:n,"data-block-id":p,"data-block-class":m,reducedMotion:e="user",shouldHandleVirtualKeyboard:t=true,minTouchTargetSize:o=24},V)=>{let{direction:P}=b(),{colorScheme:g$1,reducedMotion:D,highContrast:G,transparency:N}=v(),f=useMemo(()=>{switch(r){case "system":return g$1==="light"?h.LIGHT:h.DARK;case "light":return h.LIGHT;case "dark":return h.DARK;default:return r}},[g$1,r]),{name:K,...z}=f,B=a(),q={"data-theme":K,"data-block-id":p,"data-block-class":m,"data-reduced-motion":e==="user"?D:e==="always","data-high-contrast":G,"data-transparency":N,"data-device":B},F=useMemo(()=>({theme:f,setTheme:y=>{s?.(y),i?.(y);},shouldHandleVirtualKeyboard:t,reducedMotion:e,minTouchTargetSize:o}),[f,s,i,t,e,o]);return useEffect(()=>{s&&a$1("ThemeProvider:setTheme","ThemeProvider: The `setTheme` prop is deprecated and will be removed in a future version of Baseline UI. Use the `onThemeChange` prop instead.");},[s]),jsx(A.Provider,{value:F,children:jsx(MotionConfig,{reducedMotion:e,children:jsx("div",{...g(n,q),className:a$3(b$1,"BaselineUI-ThemeProvider",a$4),style:{...assignInlineVars(themeVars,z),...assignInlineVars({[a$2]:P==="rtl"?"-1":"1",[I]:`${o}px`}),...l},dir:P,ref:V,children:u})})})});S.displayName="ThemeProvider";function Pe(){MotionGlobalConfig.skipAnimations=true;}function ge(){MotionGlobalConfig.skipAnimations=false;}export{v as a,A as b,S as c,Pe as d,ge as e};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {a}from'./chunk-
|
|
1
|
+
import {a}from'./chunk-PTL6NSYA.mjs';import {u}from'./chunk-2MNK24YJ.mjs';import {g}from'./chunk-V2C4UDOC.mjs';import {j}from'./chunk-TYOEGCPS.mjs';import {useEffect,useRef}from'react';/**
|
|
2
2
|
* Copyright (c) 2023-2024 PSPDFKit GmbH. All rights reserved.
|
|
3
3
|
*
|
|
4
4
|
* THIS SOURCE CODE AND ANY ACCOMPANYING DOCUMENTATION ARE PROTECTED BY INTERNATIONAL COPYRIGHT LAW
|
|
@@ -7,4 +7,4 @@ import {a}from'./chunk-UKBBSYRC.mjs';import {u}from'./chunk-SCJ3RG7B.mjs';import
|
|
|
7
7
|
* This notice may not be removed from this file.
|
|
8
8
|
*
|
|
9
9
|
*/
|
|
10
|
-
function d(){return typeof window<"u"&&window.InputEvent&&typeof InputEvent.prototype.getTargetRanges=="function"}function y(v,r,n){let a$1=u(t=>{let e=n.current;if(!e)return;let l=null;switch(t.inputType){case "historyUndo":case "historyRedo":return;case "insertLineBreak":return;case "deleteContent":case "deleteByCut":case "deleteByDrag":l=e.value.slice(0,e.selectionStart)+e.value.slice(e.selectionEnd);break;case "deleteContentForward":l=e.selectionEnd===e.selectionStart?e.value.slice(0,e.selectionStart)+e.value.slice(e.selectionEnd+1):e.value.slice(0,e.selectionStart)+e.value.slice(e.selectionEnd);break;case "deleteContentBackward":l=e.selectionEnd===e.selectionStart?e.value.slice(0,e.selectionStart-1)+e.value.slice(e.selectionStart):e.value.slice(0,e.selectionStart)+e.value.slice(e.selectionEnd);break;case "deleteSoftLineBackward":case "deleteHardLineBackward":l=e.value.slice(e.selectionStart);break;default:t.data!=null&&(l=e.value.slice(0,e.selectionStart)+t.data+e.value.slice(e.selectionEnd));break}(l==null||!r.validate(l))&&t.preventDefault();});useEffect(()=>{if(!d()||!n.current)return;let t=n.current;return t.addEventListener("beforeinput",a$1,false),()=>{t.removeEventListener("beforeinput",a$1,false);}},[n]);let p=d()?null:t=>{let e=j(t),l=e.value.slice(0,e.selectionStart)+t.data+e.value.slice(e.selectionEnd);r.validate(l)||t.preventDefault();},{labelProps:f,inputProps:E,descriptionProps:m,errorMessageProps:S,...b}=a(v,n),i=useRef(null);return {inputProps:
|
|
10
|
+
function d(){return typeof window<"u"&&window.InputEvent&&typeof InputEvent.prototype.getTargetRanges=="function"}function y(v,r,n){let a$1=u(t=>{let e=n.current;if(!e)return;let l=null;switch(t.inputType){case "historyUndo":case "historyRedo":return;case "insertLineBreak":return;case "deleteContent":case "deleteByCut":case "deleteByDrag":l=e.value.slice(0,e.selectionStart)+e.value.slice(e.selectionEnd);break;case "deleteContentForward":l=e.selectionEnd===e.selectionStart?e.value.slice(0,e.selectionStart)+e.value.slice(e.selectionEnd+1):e.value.slice(0,e.selectionStart)+e.value.slice(e.selectionEnd);break;case "deleteContentBackward":l=e.selectionEnd===e.selectionStart?e.value.slice(0,e.selectionStart-1)+e.value.slice(e.selectionStart):e.value.slice(0,e.selectionStart)+e.value.slice(e.selectionEnd);break;case "deleteSoftLineBackward":case "deleteHardLineBackward":l=e.value.slice(e.selectionStart);break;default:t.data!=null&&(l=e.value.slice(0,e.selectionStart)+t.data+e.value.slice(e.selectionEnd));break}(l==null||!r.validate(l))&&t.preventDefault();});useEffect(()=>{if(!d()||!n.current)return;let t=n.current;return t.addEventListener("beforeinput",a$1,false),()=>{t.removeEventListener("beforeinput",a$1,false);}},[n]);let p=d()?null:t=>{let e=j(t),l=e.value.slice(0,e.selectionStart)+t.data+e.value.slice(e.selectionEnd);r.validate(l)||t.preventDefault();},{labelProps:f,inputProps:E,descriptionProps:m,errorMessageProps:S,...b}=a(v,n),i=useRef(null);return {inputProps:g(E,{onBeforeInput:p,onCompositionStart(){let{value:t,selectionStart:e,selectionEnd:l}=n.current;i.current={value:t,selectionStart:e,selectionEnd:l};},onCompositionEnd(){if(n.current&&!r.validate(n.current.value)){let{value:t,selectionStart:e,selectionEnd:l}=i.current;n.current.value=t,n.current.setSelectionRange(e,l),r.setInputValue(t);}}}),labelProps:f,descriptionProps:m,errorMessageProps:S,...b}}export{y as a};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {u}from'./chunk-
|
|
1
|
+
import {u}from'./chunk-2MNK24YJ.mjs';import {a,j,h}from'./chunk-TYOEGCPS.mjs';import {useRef,useEffect}from'react';/**
|
|
2
2
|
* Copyright (c) 2023-2024 PSPDFKit GmbH. All rights reserved.
|
|
3
3
|
*
|
|
4
4
|
* THIS SOURCE CODE AND ANY ACCOMPANYING DOCUMENTATION ARE PROTECTED BY INTERNATIONAL COPYRIGHT LAW
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {a as a$2}from'./chunk-
|
|
1
|
+
import {a as a$2}from'./chunk-U5XI3CZD.mjs';import {a as a$3}from'./chunk-QMP72J5L.mjs';import {a}from'./chunk-DIL5HL6K.mjs';import {b}from'./chunk-RMUV6NJJ.mjs';import {a as a$1}from'./chunk-4QEH5CGK.mjs';import p from'react';import {jsx,jsxs}from'react/jsx-runtime';/**
|
|
2
2
|
* Copyright (c) 2023-2024 PSPDFKit GmbH. All rights reserved.
|
|
3
3
|
*
|
|
4
4
|
* THIS SOURCE CODE AND ANY ACCOMPANYING DOCUMENTATION ARE PROTECTED BY INTERNATIONAL COPYRIGHT LAW
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import {a as a$1}from'./chunk-3K6XNSYE.mjs';import {d}from'./chunk-MMLAKHLR.mjs';import {f}from'./chunk-V2C4UDOC.mjs';import r from'react';import {jsx}from'react/jsx-runtime';/**
|
|
2
|
+
* Copyright (c) 2023-2024 PSPDFKit GmbH. All rights reserved.
|
|
3
|
+
*
|
|
4
|
+
* THIS SOURCE CODE AND ANY ACCOMPANYING DOCUMENTATION ARE PROTECTED BY INTERNATIONAL COPYRIGHT LAW
|
|
5
|
+
* AND MAY NOT BE RESOLD OR REDISTRIBUTED. USAGE IS BOUND TO THE PSPDFKIT LICENSE AGREEMENT.
|
|
6
|
+
* UNAUTHORIZED REPRODUCTION OR DISTRIBUTION IS SUBJECT TO CIVIL AND CRIMINAL PENALTIES.
|
|
7
|
+
* This notice may not be removed from this file.
|
|
8
|
+
*
|
|
9
|
+
*/
|
|
10
|
+
var a=r.forwardRef(({className:n,style:p,node:e,"data-block-id":f$1,"data-block-class":l,...i},c)=>{let o=r.useRef(null);r.useEffect(()=>{if(!e)return;let t=o.current;return t?.append(e),()=>{t?.contains(e)&&e.remove();}},[e]);let{pressProps:R,isPressed:N}=d(i);return jsx("div",{...R,className:n,style:p,"data-block-id":f$1,"data-block-class":l,...a$1({"data-pressed":N}),"data-testid":"dom-node-renderer",ref:f(c,o)})});a.displayName="DomNodeRenderer";export{a};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {a as a$1}from'./chunk-
|
|
1
|
+
import {a as a$1}from'./chunk-PTL6NSYA.mjs';import {b as b$1}from'./chunk-TZSRU3GG.mjs';import {a as a$2}from'./chunk-TQMBJFQC.mjs';import {b}from'./chunk-2PTLJDIT.mjs';import {a}from'./chunk-XPISSX5R.mjs';/**
|
|
2
2
|
* Copyright (c) 2023-2024 PSPDFKit GmbH. All rights reserved.
|
|
3
3
|
*
|
|
4
4
|
* THIS SOURCE CODE AND ANY ACCOMPANYING DOCUMENTATION ARE PROTECTED BY INTERNATIONAL COPYRIGHT LAW
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import {b,a as a$5}from'./chunk-HOZPCWCF.mjs';import {a as a$1,f as f$1}from'./chunk-V6ZIMZ53.mjs';import {a as a$3}from'./chunk-5BAHJXOI.mjs';import {b as b$2,a as a$f,q}from'./chunk-OYE6VSTU.mjs';import {a as a$9}from'./chunk-2MS356Q7.mjs';import {a as a$e}from'./chunk-C6TD53KY.mjs';import {b as b$1,a as a$6,c as c$1}from'./chunk-6RN7DKRF.mjs';import {a as a$b}from'./chunk-EJGGWOY5.mjs';import {b as b$3}from'./chunk-P3RRGPNM.mjs';import {a as a$d}from'./chunk-WSDEMATI.mjs';import {f}from'./chunk-CFDIUF4H.mjs';import {a as a$4}from'./chunk-NIGOM3FD.mjs';import {a as a$h}from'./chunk-5IC46G5J.mjs';import {a as a$c}from'./chunk-EYKQGC4O.mjs';import {a as a$a}from'./chunk-3K6XNSYE.mjs';import {a as a$8}from'./chunk-ELW6SXDM.mjs';import {a as a$7}from'./chunk-LRFFL765.mjs';import {j as j$1}from'./chunk-AIG23SN5.mjs';import {d}from'./chunk-MMLAKHLR.mjs';import {a as a$2}from'./chunk-RT4LMB6X.mjs';import {e,c,g,f as f$2}from'./chunk-V2C4UDOC.mjs';import {j,h}from'./chunk-TYOEGCPS.mjs';import {a}from'./chunk-JQQGRJ5J.mjs';import {a as a$g}from'./chunk-4QEH5CGK.mjs';import x,{useMemo,useState,useRef,useEffect}from'react';import {useGranularEffect}from'granular-hooks';import {jsx,jsxs,Fragment}from'react/jsx-runtime';/**
|
|
2
|
+
* Copyright (c) 2023-2024 PSPDFKit GmbH. All rights reserved.
|
|
3
|
+
*
|
|
4
|
+
* THIS SOURCE CODE AND ANY ACCOMPANYING DOCUMENTATION ARE PROTECTED BY INTERNATIONAL COPYRIGHT LAW
|
|
5
|
+
* AND MAY NOT BE RESOLD OR REDISTRIBUTED. USAGE IS BOUND TO THE PSPDFKIT LICENSE AGREEMENT.
|
|
6
|
+
* UNAUTHORIZED REPRODUCTION OR DISTRIBUTION IS SUBJECT TO CIVIL AND CRIMINAL PENALTIES.
|
|
7
|
+
* This notice may not be removed from this file.
|
|
8
|
+
*
|
|
9
|
+
*/
|
|
10
|
+
var De=a({defaultClassName:"_18v88n10 _1yep5z6j8 _1yep5z6j9 _1yep5z6ja _1yep5z6m3",variantClassNames:{labelPosition:{top:"_1yep5z6163 _1yep5z6164 _1yep5z6165",start:"_1yep5z6160 _1yep5z6161 _1yep5z6162 _1yep5z617i _1yep5z617j _1yep5z617k _1yep5z6w1 _1yep5z6w2 _1yep5z6w3"}},defaultVariants:{},compoundVariants:[]}),Oe=a({defaultClassName:"_18v88n1n _1yep5z66 _1yep5z67 _1yep5z68 _1yep5z62i _1yep5z62j _1yep5z62k _1yep5z63o _1yep5z63p _1yep5z63q _1yep5z61c _1yep5z61d _1yep5z61e _1yep5z6ey _1yep5z6m3 _1yep5z6me _1yep5z6m6 _1yep5z6dy",variantClassNames:{isDisabled:{true:"_18v88n1o _1yep5z611l"},labelPosition:{top:"_18v88n1p",start:"_18v88n1q"}},defaultVariants:{},compoundVariants:[]}),Te=a({defaultClassName:"_18v88n1r _1yep5z660 _1yep5z661 _1yep5z662 _1yep5z6jb _1yep5z6jc _1yep5z6jd _1yep5z6m0",variantClassNames:{validationState:{valid:"_18v88n1s",error:"_1yep5z610x",warning:"_1yep5z6117"},isReadOnly:{true:"_1yep5z611s"}},defaultVariants:{},compoundVariants:[]}),He=a({defaultClassName:"_18v88n1b _1yep5z6ai _1yep5z6aj _1yep5z6ak _1yep5z6b6 _1yep5z6b7 _1yep5z6b8 _1yep5z6bu _1yep5z6bv _1yep5z6bw _1yep5z6ci _1yep5z6cj _1yep5z6ck _1yep5z6j8 _1yep5z6j9 _1yep5z6ja _1yep5z6jh _1yep5z6ji _1yep5z6jj _1yep5z6mh _1yep5z6mf _1yep5z6hg _1yep5z6jz _1yep5z6k0 _1yep5z6k1",variantClassNames:{validationState:{valid:"_18v88n1c",error:"_1yep5z613e",warning:"_18v88n1e"},isHovered:{true:"_18v88n1f"},isFocused:{true:"_1yep5z6x1 _1yep5z6x2 _1yep5z6x3 _1yep5z6xp _1yep5z6xq _1yep5z6xr _1yep5z6yd _1yep5z6ye _1yep5z6yf _1yep5z6z1 _1yep5z6z2 _1yep5z6z3 _1yep5z6190 _1yep5z618y _1yep5z613w _1yep5z618r _1yep5z618q _1yep5z614w _1yep5z618t"},isDisabled:{true:"_18v88n1h"},variant:{primary:"_18v88n1i",ghost:"_18v88n1j"},isReadOnly:{true:"_1yep5z614w"}},defaultVariants:{},compoundVariants:[[{variant:"ghost",isHovered:true,isFocused:false,validationState:"valid"},"_1yep5z61vj _1yep5z61vh _1yep5z61qi"],[{variant:"ghost",isFocused:false,isHovered:false,validationState:"valid"},"_18v88n1l"],[{isHovered:true,validationState:"valid",isDisabled:false,isReadOnly:false,isFocused:false,variant:"primary"},"_1yep5z61qj"],[{isHovered:true,validationState:"warning",isDisabled:false,isReadOnly:false,isFocused:false},"_1yep5z61qj"],[{isReadOnly:true,variant:"primary",isFocused:false},"_18v88n1m"]]}),Fe="_1yep5z6dy _1yep5z6ez",Se=a({defaultClassName:"_18v88n17 _1yep5z6jb _1yep5z6jc _1yep5z6jd",variantClassNames:{labelPosition:{top:"_1yep5z6tp _1yep5z6tq _1yep5z6tr",start:"_1yep5z6nm _1yep5z6nn _1yep5z6no _1yep5z6163 _1yep5z6164 _1yep5z6165"},hasMessage:{true:"_18v88n1a"}},defaultVariants:{},compoundVariants:[[{labelPosition:"start",hasMessage:false},"_1yep5z61tv _1yep5z61tw _1yep5z61tx"]]}),Ke="_18v88n1w",Ae=a({defaultClassName:"_18v88n13 _1yep5z699 _1yep5z69a _1yep5z69b _1yep5z6m6",variantClassNames:{isFocusVisible:{true:"_1yep5z612v _1yep5z615b _1yep5z618p"},isHovered:{true:"_1yep5z612v _1yep5z615b _1yep5z618p"},isOpen:{true:"_1yep5z615b _1yep5z618p"}},defaultVariants:{},compoundVariants:[]});function K(a,s,d,p){if(s!=="number"||a===void 0||a==="")return a;let u=Number.parseFloat(a);if(Number.isNaN(u))return a;let e=u;return d!==void 0&&(e=Math.max(e,d)),p!==void 0&&(e=Math.min(e,p)),e===u?a:String(e)}function We(a,s){return a.selectedKey==null||s!==a.selectedItem?.textValue}function Ge({allowsCustomValue:a,onValueChange:s,inputType:d,minValue:p,maxValue:u},e,g,b){let[V,c]=useState(null),n=useRef(false),C=useRef(null),P=!We(e,e.inputValue),w=(t,r)=>{C.current=r==null?null:{key:r,value:t},s?.({value:t,key:r});},I=t=>{!n.current||!We(e,t)||(w(t,null),n.current=false);};useEffect(()=>{if(!s)return;let t=g.current,r=y=>{c(j(y));};return t?.addEventListener("focusin",r),()=>{t?.removeEventListener("focusin",r);}},[s,g,e.selectedKey]),useGranularEffect(()=>{if(e.selectedKey==null||e.selectedItem==null){e.selectionManager.isEmpty&&(C.current=null);return}let t=e.selectedKey,r=e.selectedItem.textValue,y=C.current?.key!==t;!y&&(C.current?.value===r||n.current&&!P)||(w(r,t),y&&(n.current=false));},[e.selectedKey,e.selectedItem?.textValue,P],[s,e.selectedItem]);let k=()=>{V===b.current&&a&&n.current&&(n.current=false);};useEffect(()=>{if(!s)return;let t=b.current,r=()=>{n.current=true;};return t?.addEventListener("input",r),()=>{t?.removeEventListener("input",r);}},[b,s]);let{keyboardProps:D}=j$1({isDisabled:!s,onKeyDown:t=>{if(a&&t.key==="Enter"&&n.current){let r=K(b.current?.value,d,p,u);I(r??""),n.current=false;}else t.key==="Escape"&&(e.selectedKey!=null&&(n.current=false),e.close());t.continuePropagation();}});return {inputProps:D,commitCustomValue:I,disarmPendingEdit:k}}var Je=x.forwardRef(({renderOption:a,optionStyle:s,optionClassName:d,...p},u)=>jsx(a$1,{items:p.items,listBoxProps:{renderOption:a,optionStyle:s,optionClassName:d},children:e=>jsx(Qe,{...p,collection:e,ref:u})}));Je.displayName="ComboBox";var Qe=x.forwardRef(({className:a,style:s,inputStyle:d$1,inputClassName:p,"data-block-id":u,"data-block-class":e$1,label:g$1,items:b$4,isInvalid:V=false,labelPosition:c$2="top",validationState:n="valid",variant:C="primary",toggleLabel:P,showIcon:w=true,filter:I,filterItems:k,readOnly:D,minValue:t,maxValue:r,inputType:y="text",onInputSubmit:A,onValueChange:q$1,tooltip:Xe,collection:Ye,onTriggerPress:U,...o},Ze)=>{let O=a$2(Ze),{contains:$e}=a$3({sensitivity:"base"}),f$3=o.isReadOnly??D,W=V||n==="error"||!!o.errorMessage,_=b({...o,isReadOnly:f$3,defaultFilter:k===false?void 0:I||$e,defaultItems:b$4,collection:Ye,children:void 0,validationState:W?"invalid":"valid"}),G=x.useRef(null),v=x.useRef(null),J=x.useRef(null),T=x.useRef(null),Q=x.useRef(null),{inputProps:eo,commitCustomValue:oo,disarmPendingEdit:to}=Ge({onValueChange:q$1,allowsCustomValue:o.allowsCustomValue,inputType:y,minValue:t,maxValue:r},_,O,v),X=i=>{let m=K(i,y,t,r)??"";return m!==i&&!A&&!q$1&&a$h("bui.comboBox.clampNoCallback","ComboBox: minValue/maxValue clamped a value but no onInputSubmit or onValueChange callback is provided. The constraint cannot be enforced without a callback to notify the consumer."),A?.(m),m},Y=()=>{let i=v.current?.value??"";!o.allowsCustomValue||!i||oo(X(i));};a$4({ref:v,onInteractOutside:i=>{let m=j(i);if(h(O.current,m)||h(T.current,m))return;let h$1=v.current;if(!h$1||f(h$1)!==h$1){to();return}_.isOpen&&(Y(),_.close());}});let{buttonProps:L,inputProps:Z,listBoxProps:$,labelProps:ro,errorMessageProps:no,descriptionProps:ao,validationErrors:so}=a$5({...o,description:b$1(o),onBlur:e(o.onBlur,Y),inputRef:v,defaultItems:b$4,buttonRef:G,listBoxRef:J,popoverRef:T,isReadOnly:f$3,validationState:W?"invalid":"valid"},_),H=o.errorMessage||so.join(" "),ee=c(),io=a$6({...o,errorMessage:H})==="warningMessage",R=c$1({...o,errorMessage:H,descriptionProps:ao,errorMessageProps:no,warningMessageProps:{id:ee},labelPosition:c$2});H&&(n="error");let{hoverProps:lo,isHovered:oe}=a$7({isDisabled:o.isDisabled}),{isFocused:te,focusProps:po,isFocusVisible:re}=a$8(),ne=a$9({isReadOnly:f$3,validationState:n}),uo=a$a({"data-read-only":f$3,"data-disabled":o.isDisabled,"data-validation-state":n,"data-focused":te,"data-focus-visible":re}),{labelProps:co,fieldProps:mo}=a$b({label:g$1,"aria-label":o["aria-label"],"aria-labelledby":o["aria-labelledby"],"aria-describedby":o["aria-describedby"],"aria-details":o["aria-details"]}),{keyboardProps:yo}=j$1({onKeyDown:i=>{o.allowsCustomValue&&i.key==="Enter"&&X(v.current?.value??"");}}),{tooltipProps:ae}=a$c({tooltip:Xe,label:o["aria-label"]}),{pressProps:fo}=d({onPress:U}),se=P?.trim()||void 0,ie=i=>{let{triggerProps:m,triggerRef:h}=i??{};return jsxs("div",{className:a$g(De({labelPosition:c$2}),a,"BaselineUI-ComboBox"),"data-block-id":u,"data-block-class":e$1,style:s,ref:O,children:[g$1||c$2==="start"&&R?jsxs("div",{className:Se({labelPosition:c$2,hasMessage:!!R}),children:[jsx("label",{...g(ro,co),className:Fe,children:g$1}),c$2==="start"&&R]}):null,jsxs("div",{...lo,className:He({validationState:n,isHovered:oe,isFocused:te,variant:C,isReadOnly:!!f$3,isDisabled:!!o.isDisabled}),ref:Q,children:[jsx("input",{...g(fo,m,Z,eo,po,uo,mo,yo,y==="number"?{type:"number",min:t,max:r,onKeyDown:B=>{(B.key==="ArrowUp"||B.key==="ArrowDown")&&B.preventDefault();}}:null,{"aria-describedby":[m?.["aria-describedby"],Z["aria-describedby"],io?ee:void 0].filter(Boolean).join(" ")||void 0}),id:o.id,ref:f$2(h,v),className:a$g(Oe({isDisabled:o.isDisabled,labelPosition:c$2}),"BaselineUI-ComboBox-Input",p),style:d$1}),ne&&w?jsx(ne,{className:Te({validationState:n,isReadOnly:f$3}),size:16}):null,jsx(b$3,{...L,onPressStart:B=>{L.onPressStart?.(B),U?.(B);},ref:G,"data-testid":"combobox-toggle-button",variant:"popover",label:null,"aria-label":se??L["aria-label"],"aria-labelledby":se?void 0:L["aria-labelledby"],className:Ae({isFocusVisible:!o.isDisabled&&!f$3&&re,isHovered:!o.isDisabled&&!f$3&&oe,isOpen:_.isOpen})})]}),c$2==="top"&&R]})};return jsxs(Fragment,{children:[ae?jsx(a$d,{...ae,children:ie}):ie(),jsx(a$e,{ref:T,triggerRef:Q,state:_,isNonModal:true,crossOffset:-2,className:"BaselineUI-ComboBox-Popover",children:jsx(b$2.Provider,{value:_,children:jsx(a$f.Provider,{value:useMemo(()=>({...$,ref:J}),[$]),children:jsx(q,{selectionMode:"single",className:a$g(f$1,Ke,"BaselineUI-ComboBox-ListBox")})})})})]})});Qe.displayName="ComboBoxInner";export{Je as a};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import {c as c$1,b}from'./chunk-TLUB6FCT.mjs';import {a}from'./chunk-Y5LEKSMM.mjs';import {d as d$1}from'./chunk-ST3TDAOP.mjs';import {a as a$1}from'./chunk-PGDGNOYE.mjs';import {d as d$2}from'./chunk-TZSRU3GG.mjs';import {b as b$1}from'./chunk-N2XGJKZG.mjs';import {f,b as b$2}from'./chunk-SMPF53W4.mjs';import {i as i$1,b as b$3}from'./chunk-AIG23SN5.mjs';import {q}from'./chunk-2MNK24YJ.mjs';import {c,g,d,e}from'./chunk-V2C4UDOC.mjs';import {a as a$2}from'./chunk-SVIYLH7R.mjs';import {m,i,a as a$3,h,j}from'./chunk-TYOEGCPS.mjs';import {useRef}from'react';/**
|
|
2
|
+
* Copyright (c) 2023-2024 PSPDFKit GmbH. All rights reserved.
|
|
3
|
+
*
|
|
4
|
+
* THIS SOURCE CODE AND ANY ACCOMPANYING DOCUMENTATION ARE PROTECTED BY INTERNATIONAL COPYRIGHT LAW
|
|
5
|
+
* AND MAY NOT BE RESOLD OR REDISTRIBUTED. USAGE IS BOUND TO THE PSPDFKIT LICENSE AGREEMENT.
|
|
6
|
+
* UNAUTHORIZED REPRODUCTION OR DISTRIBUTION IS SUBJECT TO CIVIL AND CRIMINAL PENALTIES.
|
|
7
|
+
* This notice may not be removed from this file.
|
|
8
|
+
*
|
|
9
|
+
*/
|
|
10
|
+
var M=new WeakMap;function I(n,t){let{id:e}=M.get(n)??{};if(!e)throw new Error("Unknown list");return `${e}-${se(t)}`}function se(n){return typeof n=="string"?n.replace(/\s*/g,""):""+n}function Se(n,t,e){let{isVirtualized:i,keyboardDelegate:a$3,layoutDelegate:u,onAction:p,disallowTypeAhead:d,linkBehavior:y="action",keyboardNavigationBehavior:O="arrow",escapeKeyBehavior:b$1="clearSelection",shouldSelectOnPressUp:F}=n;!n["aria-label"]&&!n["aria-labelledby"]&&console.warn("An aria-label or aria-labelledby prop is required for accessibility.");let{listProps:w}=a({selectionManager:t.selectionManager,collection:t.collection,disabledKeys:t.disabledKeys,ref:e,keyboardDelegate:a$3,layoutDelegate:u,isVirtualized:i,selectOnFocus:t.selectionManager.selectionBehavior==="replace",shouldFocusWrap:n.shouldFocusWrap,linkBehavior:y,disallowTypeAhead:d,autoFocus:n.autoFocus,escapeKeyBehavior:b$1,UNSTABLE_focusOnEntry:n.UNSTABLE_focusOnEntry}),k=c(n.id);M.set(t,{id:k,onAction:p,linkBehavior:y,keyboardNavigationBehavior:O,shouldSelectOnPressUp:F});let T=c$1({selectionManager:t.selectionManager,hasItemActions:!!p,ref:e}),x=a$1(e,{isDisabled:t.collection.size!==0}),g$1=a$2(n,{labelable:true}),E=g(g$1,{role:"grid",id:k,"aria-multiselectable":t.selectionManager.selectionMode==="multiple"?"true":void 0},t.collection.size===0?{tabIndex:x?-1:0}:w,T);return i&&(E["aria-rowcount"]=t.collection.size,E["aria-colcount"]=1),b({},t),{gridProps:E}}var Y={expand:{ltr:"ArrowRight",rtl:"ArrowLeft"},collapse:{ltr:"ArrowLeft",rtl:"ArrowRight"}};function Ue(n,t,e$1){let{node:i$2,isVirtualized:a,focusMode:u="row",allowsArrowNavigation:p}=n,{direction:d$3}=b$1(),{onAction:y,linkBehavior:O,keyboardNavigationBehavior:b,shouldSelectOnPressUp:F}=M.get(t),w=d([],e$1),k=useRef(null),T=()=>{if(e$1.current!==null){if(u==="child"){if(m(e$1.current)&&e$1.current!==i(a$3(e$1.current)))return;let l=d$2(e$1.current,{tabbable:true}).firstChild();if(l){i$1(l),f(l,{containingElement:b$2(l)});return}}(k.current!=null&&i$2.key!==k.current||!m(e$1.current))&&i$1(e$1.current);}},x={},g$1=n.hasChildItems,E=t.selectionManager.isLink(i$2.key);if(i$2!=null&&"expandedKeys"in t){let r=t.collection.getChildren?.(i$2.key);g$1=g$1||[...r??[]].length>1,y==null&&!E&&t.selectionManager.selectionMode==="none"&&g$1&&(y=()=>t.toggleKey(i$2.key));let l=g$1?t.expandedKeys.has(i$2.key):void 0,o=1,c=i$2.index;if(i$2.level>=0&&i$2?.parentKey!=null){let s=t.collection.getItem(i$2.parentKey);if(s){let B=ue(s,t.collection);o=[...B].filter(ae=>ae.type==="item").length,c>0&&B[0].type!=="item"&&(c-=1);}}else o=[...t.collection].filter(s=>s.level===0&&s.type==="item").length;x={"aria-expanded":l,"aria-level":i$2.level+1,"aria-posinset":c+1,"aria-setsize":o};}let{itemProps:Z,...R}=d$1({selectionManager:t.selectionManager,key:i$2.key,ref:e$1,isVirtualized:a,shouldSelectOnPressUp:n.shouldSelectOnPressUp||F,onAction:y||i$2.props?.onAction?e(i$2.props?.onAction,y?()=>y(i$2.key):void 0):void 0,focus:T,linkBehavior:O}),ee=r=>{let l=i(a$3(e$1.current));if(!h(r.currentTarget,j(r))||!e$1.current||!l)return;let o=d$2(e$1.current);if(o.currentNode=l,!J(r,t,i$2,g$1,d$3,l,e$1.current,p))switch(r.key){case "ArrowLeft":{if(b==="arrow"){let c=d$3==="rtl"?o.nextNode():o.previousNode();if(c)r.preventDefault(),r.stopPropagation(),i$1(c),f(c,{containingElement:b$2(e$1.current)});else if(r.preventDefault(),r.stopPropagation(),d$3==="rtl")i$1(e$1.current),f(e$1.current,{containingElement:b$2(e$1.current)});else {o.currentNode=e$1.current;let s=Q(o);s&&(i$1(s),f(s,{containingElement:b$2(e$1.current)}));}}break}case "ArrowRight":{if(b==="arrow"){let c=d$3==="rtl"?o.previousNode():o.nextNode();if(c)r.preventDefault(),r.stopPropagation(),i$1(c),f(c,{containingElement:b$2(e$1.current)});else if(r.preventDefault(),r.stopPropagation(),d$3==="ltr")i$1(e$1.current),f(e$1.current,{containingElement:b$2(e$1.current)});else {o.currentNode=e$1.current;let s=Q(o);s&&(i$1(s),f(s,{containingElement:b$2(e$1.current)}));}}break}case "ArrowUp":case "ArrowDown":!r.altKey&&h(e$1.current,j(r))&&(r.stopPropagation(),r.preventDefault(),e$1.current.parentElement?.dispatchEvent(new KeyboardEvent(r.nativeEvent.type,r.nativeEvent)));break}},te=r=>{if(k.current=i$2.key,j(r)!==e$1.current){b$3()||t.selectionManager.setFocusedKey(i$2.key);return}u==="child"&&r.relatedTarget&&h(e$1.current,r.relatedTarget)||requestAnimationFrame(()=>{u==="child"&&i(a$3(e$1.current))===e$1.current&&T();});},re=r=>{let l=i(a$3(e$1.current));if(!(!h(r.currentTarget,j(r))||!e$1.current||!l)){if(b==="tab"){if(j(r)!==e$1.current&&r.key!=="Tab"){r.stopPropagation();return}if(J(r,t,i$2,g$1,d$3,l,e$1.current,p))return}switch(r.key){case "Tab":if(b==="tab"){let o=d$2(e$1.current,{tabbable:true});o.currentNode=l,(r.shiftKey?o.previousNode():o.nextNode())&&r.stopPropagation();}}}},ie=q(i$2.props),ne=R.hasAction?ie:{},K=g(Z,ne,{role:"row",onKeyDownCapture:b==="arrow"||p?ee:void 0,onFocus:te,"aria-label":i$2["aria-label"]||i$2.textValue||void 0,"aria-selected":t.selectionManager.canSelectItem(i$2.key)?t.selectionManager.isSelected(i$2.key):void 0,"aria-disabled":t.selectionManager.isDisabled(i$2.key)||void 0,"aria-labelledby":w&&(i$2["aria-label"]||i$2.textValue)?`${I(t,i$2.key)} ${w}`:void 0,id:I(t,i$2.key)});u==="child"&&p&&b==="tab"&&(K.tabIndex=-1);let oe=K.onKeyDown;if(K.onKeyDown=r=>{re(r),r.isPropagationStopped()||oe?.(r);},a){let{collection:r}=t,l=[...r];K["aria-rowindex"]=l.find(o=>o.type==="section")?[...r.getKeys()].filter(o=>r.getItem(o)?.type!=="section").findIndex(o=>o===i$2.key)+1:i$2.index+1;}let le={role:"gridcell","aria-colindex":1};return {rowProps:{...g(K,x)},gridCellProps:le,descriptionProps:{id:w},...R}}function J(n,t,e,i,a,u,p,d){if(!("expandedKeys"in t)||!d&&u!==p)return false;if(n.key===Y.expand[a]&&t.selectionManager.focusedKey===e.key&&i&&!t.expandedKeys.has(e.key))return t.toggleKey(e.key),n.stopPropagation(),true;if(n.key===Y.collapse[a]&&t.selectionManager.focusedKey===e.key){if(i&&t.expandedKeys.has(e.key))return t.toggleKey(e.key),n.stopPropagation(),true;if(!t.expandedKeys.has(e.key)&&e.parentKey&&t.collection.getItem(e.parentKey)?.type==="item")return t.selectionManager.setFocusedKey(e.parentKey),n.stopPropagation(),true}return false}function Q(n){let t=null,e=null;do e=n.lastChild(),e&&(t=e);while(e);return t}function ue(n,t){let e=t.getChildren?.(n.key),i=e?Array.from(e):[],a=i.length>0?i[0]:null,u=[];for(;a;)u.push(a),a=a.nextKey!=null?t.getItem(a.nextKey):null;return u}export{I as a,Se as b,Ue as c};
|