@apple-pie/slice 0.1.30 → 0.1.32
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/README.md +36 -276
- package/dist/cjs/chunks/{AudioBubble-DisHuKIC.js → AudioBubble-Dh2IlYW0.js} +3 -5
- package/dist/cjs/chunks/Avatar-WcBAu25_.js +82 -0
- package/dist/cjs/chunks/{AvatarGroup-DhGp_qLw.js → AvatarGroup-eUkVdeTf.js} +1 -3
- package/dist/cjs/chunks/Badge-4tBynWZe.js +22 -0
- package/dist/cjs/chunks/{Button-PsJx1WmV.js → Button-QJ5lsSAz.js} +1 -3
- package/dist/cjs/chunks/{ButtonBar-8zm6a_h7.js → ButtonBar-DcpvT1vD.js} +1 -3
- package/dist/cjs/chunks/{Camera-zFyIXcge.js → Camera-iDyPLq9h.js} +3 -5
- package/dist/cjs/chunks/CheckBox-CmZJd8u2.js +51 -0
- package/dist/cjs/chunks/Chip-Bd1bSYeC.js +77 -0
- package/dist/cjs/chunks/{DivInput-2cMdJQ9U.js → DivInput-BY9pQ6ty.js} +1 -3
- package/dist/cjs/chunks/{Dot-fKIwhjYA.js → Dot-BeWDLajy.js} +1 -3
- package/dist/cjs/chunks/{DrggablePanel-P7TgBI3j.js → DrggablePanel-DzY5wTco.js} +3 -5
- package/dist/cjs/chunks/DropDown-Cn_nX8u7.js +104 -0
- package/dist/cjs/chunks/ErrorSummary-D-0uVwyV.js +85 -0
- package/dist/cjs/chunks/{FileIcon-PuDoz0mF.js → FileIcon-JfY2AYqG.js} +2 -2
- package/dist/cjs/chunks/FileList-Dc1nfpR2.js +222 -0
- package/dist/cjs/chunks/{FlexDiv-D4aSJC_G.js → FlexDiv-B5Pi0-aJ.js} +2 -3
- package/dist/cjs/chunks/Grouper-DKZkTlow.js +61 -0
- package/dist/cjs/chunks/{Icon-BtcHXeqE.js → Icon-BVYVJp9J.js} +4 -7
- package/dist/cjs/chunks/IconButton-CP1Wsvsx.js +82 -0
- package/dist/cjs/chunks/{IndexedDB-BaVmQgkK.js → IndexedDB-CeiVT55Z.js} +1 -1
- package/dist/cjs/chunks/Label-DIs1rOey.js +102 -0
- package/dist/cjs/chunks/Level-3yxetsco.js +58 -0
- package/dist/cjs/chunks/{MdStreamBuffer-CvLO7CVi.js → MdStreamBuffer-BudWFoNw.js} +38 -16
- package/dist/cjs/chunks/Modal-CjpQdoOe.js +127 -0
- package/dist/cjs/chunks/{ModalController-13xmvKnm.js → ModalController-Cp2PXOOS.js} +1 -3
- package/dist/cjs/chunks/{Overlay-GXu6nMnw.js → Overlay-DRpHYZek.js} +1 -3
- package/dist/cjs/chunks/Pager-ChnTKwml.js +36 -0
- package/dist/cjs/chunks/{ProgressIndicator-D06PqCQk.js → ProgressIndicator-CFiAU-aF.js} +2 -6
- package/dist/cjs/chunks/{PromptInput-DuE4vGxR.js → PromptInput-BFWR0TaP.js} +2 -4
- package/dist/cjs/chunks/RadioButton-Bi-FP41j.js +55 -0
- package/dist/cjs/chunks/{RadioButtonList-N7Fmvr5W.js → RadioButtonList-JHPKMCoX.js} +1 -2
- package/dist/cjs/chunks/{Slider-BSy8xciG.js → Slider-D97ws1Cl.js} +1 -3
- package/dist/cjs/chunks/{Spacer-CyZAUR5N.js → Spacer-DvI2M1wZ.js} +1 -1
- package/dist/cjs/chunks/{Switch-Crm-nHYI.js → Switch-DDSSprb7.js} +1 -2
- package/dist/cjs/chunks/{TabBar-BtFfMwiB.js → TabBar-TllSeSzb.js} +2 -4
- package/dist/cjs/chunks/TextArea-DjZRDixt.js +74 -0
- package/dist/cjs/chunks/{TextField-Bh2EA082.js → TextField-CKA3K0AN.js} +3 -5
- package/dist/cjs/chunks/Tip-BdGXN-TQ.js +88 -0
- package/dist/cjs/chunks/Toast-COrDS_50.js +177 -0
- package/dist/cjs/chunks/ToggleButton-hoOMzBZc.js +39 -0
- package/dist/cjs/chunks/UploadArea-ClG8ZgRZ.js +127 -0
- package/dist/cjs/chunks/{WSConnection-DrOC8Z0R.js → WSConnection-Brxc2hEv.js} +1 -1
- package/dist/cjs/chunks/WebRTCConnection-eWP4lueC.js +252 -0
- package/dist/cjs/chunks/{localDBStore-zyDhaEiP.js → localDBStore-SS_r0C6F.js} +1 -1
- package/dist/cjs/chunks/{microphoneStore-D1fV_8QQ.js → microphoneStore-DM_8bhFr.js} +27 -4
- package/dist/cjs/chunks/{misc-QpU0XEOW.js → misc-4xyXRU2K.js} +1 -1
- package/dist/cjs/chunks/{sseStore-1OeJ9TRP.js → sseStore-Ag-UnuQq.js} +2 -2
- package/dist/cjs/chunks/{uploads-worker-Az040BSN.js → uploads-worker-CI-SZptI.js} +1 -1
- package/dist/cjs/chunks/{uploadsStore-8mOTz0Qe.js → uploadsStore-DR2hc4ct.js} +2 -2
- package/dist/cjs/chunks/{volumeStore-Pv23v12t.js → volumeStore-DtTHf-9_.js} +5 -4
- package/dist/cjs/chunks/webRTCStore-DWWn7k-0.js +55 -0
- package/dist/cjs/chunks/{windowStore-CCxCOUqa.js → windowStore-BUo9Du_e.js} +1 -1
- package/dist/cjs/components/AudioBubble/index.js +7 -7
- package/dist/cjs/components/Avatar/index.js +3 -4
- package/dist/cjs/components/AvatarGroup/index.js +4 -4
- package/dist/cjs/components/Badge/index.js +3 -3
- package/dist/cjs/components/Button/index.js +7 -8
- package/dist/cjs/components/ButtonBar/index.js +7 -7
- package/dist/cjs/components/Camera/index.js +8 -8
- package/dist/cjs/components/CheckBox/index.js +7 -7
- package/dist/cjs/components/Chip/index.js +7 -8
- package/dist/cjs/components/DivInput/index.js +3 -4
- package/dist/cjs/components/Dot/index.js +3 -3
- package/dist/cjs/components/DraggablePanel/index.js +6 -6
- package/dist/cjs/components/DropDown/index.js +7 -7
- package/dist/cjs/components/ErrorSummary/index.js +6 -7
- package/dist/cjs/components/FileIcon/index.js +6 -7
- package/dist/cjs/components/FileList/index.js +7 -7
- package/dist/cjs/components/FlexDiv/index.js +3 -4
- package/dist/cjs/components/Grouper/index.js +7 -8
- package/dist/cjs/components/Icon/index.js +6 -7
- package/dist/cjs/components/IconButton/index.js +6 -7
- package/dist/cjs/components/Label/index.js +3 -4
- package/dist/cjs/components/Level/index.js +7 -0
- package/dist/cjs/components/Modal/index.js +7 -8
- package/dist/cjs/components/ModalController/index.js +4 -4
- package/dist/cjs/components/Overlay/index.js +3 -3
- package/dist/cjs/components/Pager/index.js +3 -4
- package/dist/cjs/components/Progress/index.js +5 -6
- package/dist/cjs/components/PromptInput/index.js +9 -10
- package/dist/cjs/components/RadioButton/index.js +7 -7
- package/dist/cjs/components/RadioButtonList/index.js +8 -8
- package/dist/cjs/components/Slider/index.js +4 -5
- package/dist/cjs/components/Spacer/index.js +2 -2
- package/dist/cjs/components/Switch/index.js +3 -3
- package/dist/cjs/components/TabBar/index.js +9 -9
- package/dist/cjs/components/TextArea/index.js +8 -8
- package/dist/cjs/components/Textfield/index.js +9 -9
- package/dist/cjs/components/Tip/index.js +3 -4
- package/dist/cjs/components/Toast/index.js +7 -8
- package/dist/cjs/components/ToggleButton/index.js +8 -8
- package/dist/cjs/components/UploadArea/index.js +7 -7
- package/dist/cjs/hooks/useAudioRecorder.js +1 -1
- package/dist/cjs/hooks/useBindWebRTC.js +60 -0
- package/dist/cjs/hooks/useLocalStore.js +3 -3
- package/dist/cjs/hooks/useMdStreamBuffer.js +55 -30
- package/dist/cjs/hooks/useMicrophone.js +1 -1
- package/dist/cjs/hooks/useObserveTheme.js +3 -3
- package/dist/cjs/hooks/useTheme.js +2 -3
- package/dist/cjs/hooks/useTrackRenders.js +2 -2
- package/dist/cjs/hooks.js +9 -6
- package/dist/cjs/index.js +19 -17
- package/dist/cjs/providers/ThemeProvider.js +6 -17
- package/dist/cjs/providers/themeServer.js +15 -9
- package/dist/cjs/providers.js +4 -5
- package/dist/cjs/stores/LocalDB.js +3 -3
- package/dist/cjs/stores/SSE.js +2 -2
- package/dist/cjs/stores/WS.js +2 -2
- package/dist/cjs/stores/WebRTC.js +9 -0
- package/dist/cjs/stores/microphone.js +5 -4
- package/dist/cjs/stores/modal.js +1 -1
- package/dist/cjs/stores/tip.js +1 -1
- package/dist/cjs/stores/toast.js +1 -1
- package/dist/cjs/stores/uploads.js +2 -2
- package/dist/cjs/stores/volume.js +2 -2
- package/dist/cjs/stores/window.js +2 -2
- package/dist/cjs/stores.js +18 -13
- package/dist/cjs/theme/type.js +1 -1
- package/dist/cjs/utils/index.js +4 -3
- package/dist/cjs/utils/objects/index.js +4 -3
- package/dist/cjs/workers/uploads/uploads.js +2 -2
- package/dist/esm/chunks/{AudioBubble-D052QyPH.mjs → AudioBubble-cYlxxQ7c.mjs} +3 -7
- package/dist/esm/chunks/Avatar-D84wF2os.mjs +88 -0
- package/dist/esm/chunks/{AvatarGroup-C7YRtPmJ.mjs → AvatarGroup-DiwfbRxH.mjs} +2 -6
- package/dist/esm/chunks/Badge-DuUb5-80.mjs +26 -0
- package/dist/esm/chunks/{Button-BQS3rwrS.mjs → Button-BIgwWrPJ.mjs} +6 -10
- package/dist/esm/chunks/{ButtonBar-GLNRjmjv.mjs → ButtonBar-vNvnvw7u.mjs} +3 -7
- package/dist/esm/chunks/{Camera-CAp0Y2gN.mjs → Camera-BMwkTJPq.mjs} +5 -9
- package/dist/esm/chunks/CheckBox-Cpoxy8w_.mjs +61 -0
- package/dist/esm/chunks/Chip-BayNVv7N.mjs +87 -0
- package/dist/esm/chunks/{DivInput-g6F1YWTo.mjs → DivInput-CWRUxy1y.mjs} +2 -6
- package/dist/esm/chunks/{Dot-DZE134mJ.mjs → Dot-v_kcIWV2.mjs} +1 -5
- package/dist/esm/chunks/{DrggablePanel-C0AmJy8g.mjs → DrggablePanel-yEeGeE1w.mjs} +2 -6
- package/dist/esm/chunks/DropDown-QQhwAg_J.mjs +112 -0
- package/dist/esm/chunks/ErrorSummary-DzIZMIll.mjs +90 -0
- package/dist/esm/chunks/{FileIcon-BQ2zZIW5.mjs → FileIcon-6UlkbKzk.mjs} +2 -2
- package/dist/esm/chunks/FileList-vMiGJByw.mjs +230 -0
- package/dist/esm/chunks/{FlexDiv-DnY1_qk4.mjs → FlexDiv-B1m7aY04.mjs} +3 -6
- package/dist/esm/chunks/Grouper-BDrAnfDF.mjs +73 -0
- package/dist/esm/chunks/{Icon--RjjODc9.mjs → Icon-D4A6_c4x.mjs} +3 -8
- package/dist/esm/chunks/IconButton-B_W-aOsB.mjs +96 -0
- package/dist/esm/chunks/{IndexedDB-Dk7a4fPS.mjs → IndexedDB-CTqfKmp1.mjs} +1 -1
- package/dist/esm/chunks/Label-I75yz3gq.mjs +113 -0
- package/dist/esm/chunks/Level-DgczkKBr.mjs +63 -0
- package/dist/esm/chunks/{MdStreamBuffer-By7pHJQL.mjs → MdStreamBuffer-CoQWQwRL.mjs} +38 -16
- package/dist/esm/chunks/Modal-CwwyijaO.mjs +139 -0
- package/dist/esm/chunks/{ModalController-BO5FkAqu.mjs → ModalController-IyB9lDRa.mjs} +2 -6
- package/dist/esm/chunks/{Overlay-sXM7cEYc.mjs → Overlay-C-yori3-.mjs} +1 -5
- package/dist/esm/chunks/Pager-BEtfyKtq.mjs +42 -0
- package/dist/esm/chunks/{ProgressIndicator-B5oByN3i.mjs → ProgressIndicator-BV0ginXb.mjs} +2 -8
- package/dist/esm/chunks/{PromptInput-Cwd53ux7.mjs → PromptInput-Cn5fRYap.mjs} +3 -7
- package/dist/esm/chunks/RadioButton-DWlg6ldv.mjs +63 -0
- package/dist/esm/chunks/{RadioButtonList-C_heuiis.mjs → RadioButtonList-D9FdlhPL.mjs} +3 -6
- package/dist/esm/chunks/{Slider-XEV0D2Rd.mjs → Slider-B2WZkZSg.mjs} +3 -7
- package/dist/esm/chunks/{Spacer-C5651N0N.mjs → Spacer-7Oj0SlD0.mjs} +1 -1
- package/dist/esm/chunks/{Switch-RfA431T4.mjs → Switch-DRhnznnO.mjs} +1 -4
- package/dist/esm/chunks/{TabBar-kPZ6ZJxr.mjs → TabBar-D6VR71ye.mjs} +5 -9
- package/dist/esm/chunks/TextArea-CkB5rJjI.mjs +80 -0
- package/dist/esm/chunks/{TextField-DwVKlLI_.mjs → TextField-BIXmkjEz.mjs} +5 -9
- package/dist/esm/chunks/Tip-CTdrwLky.mjs +96 -0
- package/dist/esm/chunks/Toast-8bUziIgh.mjs +189 -0
- package/dist/esm/chunks/ToggleButton-BOFITa8_.mjs +47 -0
- package/dist/esm/chunks/UploadArea-DE2ccDVx.mjs +135 -0
- package/dist/esm/chunks/{WSConnection-DV7k84B4.mjs → WSConnection-CHudrD62.mjs} +1 -1
- package/dist/esm/chunks/WebRTCConnection-DQbNa7Z9.mjs +252 -0
- package/dist/esm/chunks/{localDBStore-Dnpo5nSv.mjs → localDBStore-CaYiqITY.mjs} +2 -2
- package/dist/esm/chunks/{microphoneStore-Dr3lxoWX.mjs → microphoneStore-COEGtgyX.mjs} +26 -3
- package/dist/esm/chunks/{misc-wS74txaa.mjs → misc-2MIIqzsX.mjs} +1 -1
- package/dist/esm/chunks/{sseStore-DjrfpNAS.mjs → sseStore-nW9CMec_.mjs} +2 -2
- package/dist/esm/chunks/{tslib.es6-C-olHjXV.mjs → tslib.es6-C81Qhn1z.mjs} +1 -1
- package/dist/esm/chunks/{uploads-worker-CYp-F4dz.mjs → uploads-worker-CMomtRvm.mjs} +1 -1
- package/dist/esm/chunks/{uploadsStore-DeRMJ5c9.mjs → uploadsStore-CsfpSOTS.mjs} +1 -1
- package/dist/esm/chunks/{volumeStore-BX7QcrL-.mjs → volumeStore-TSYPqbHx.mjs} +5 -4
- package/dist/esm/chunks/webRTCStore-CVCDJzj5.mjs +57 -0
- package/dist/esm/chunks/{windowStore-CAzx2-QV.mjs → windowStore-BvejIR82.mjs} +1 -1
- package/dist/esm/components/AudioBubble/index.mjs +4 -6
- package/dist/esm/components/Avatar/index.mjs +3 -5
- package/dist/esm/components/AvatarGroup/index.mjs +4 -6
- package/dist/esm/components/Badge/index.mjs +2 -4
- package/dist/esm/components/Button/index.mjs +8 -10
- package/dist/esm/components/ButtonBar/index.mjs +4 -6
- package/dist/esm/components/Camera/index.mjs +6 -8
- package/dist/esm/components/CheckBox/index.mjs +4 -6
- package/dist/esm/components/Chip/index.mjs +5 -7
- package/dist/esm/components/DivInput/index.mjs +3 -5
- package/dist/esm/components/Dot/index.mjs +2 -4
- package/dist/esm/components/DraggablePanel/index.mjs +3 -5
- package/dist/esm/components/DropDown/index.mjs +4 -6
- package/dist/esm/components/ErrorSummary/index.mjs +3 -5
- package/dist/esm/components/FileIcon/index.mjs +3 -5
- package/dist/esm/components/FileList/index.mjs +6 -8
- package/dist/esm/components/FlexDiv/index.mjs +2 -4
- package/dist/esm/components/Grouper/index.mjs +5 -7
- package/dist/esm/components/Icon/index.mjs +4 -6
- package/dist/esm/components/IconButton/index.mjs +7 -9
- package/dist/esm/components/Label/index.mjs +3 -5
- package/dist/esm/components/Level/index.mjs +11 -0
- package/dist/esm/components/Modal/index.mjs +10 -12
- package/dist/esm/components/ModalController/index.mjs +4 -6
- package/dist/esm/components/Overlay/index.mjs +2 -4
- package/dist/esm/components/Pager/index.mjs +3 -5
- package/dist/esm/components/Progress/index.mjs +4 -6
- package/dist/esm/components/PromptInput/index.mjs +11 -13
- package/dist/esm/components/RadioButton/index.mjs +4 -6
- package/dist/esm/components/RadioButtonList/index.mjs +5 -7
- package/dist/esm/components/Slider/index.mjs +4 -6
- package/dist/esm/components/Spacer/index.mjs +2 -2
- package/dist/esm/components/Switch/index.mjs +2 -4
- package/dist/esm/components/TabBar/index.mjs +8 -10
- package/dist/esm/components/TextArea/index.mjs +9 -11
- package/dist/esm/components/Textfield/index.mjs +10 -12
- package/dist/esm/components/Tip/index.mjs +3 -5
- package/dist/esm/components/Toast/index.mjs +5 -7
- package/dist/esm/components/ToggleButton/index.mjs +9 -11
- package/dist/esm/components/UploadArea/index.mjs +9 -11
- package/dist/esm/hooks/useAudioRecorder.mjs +1 -1
- package/dist/esm/hooks/useBindWebRTC.mjs +72 -0
- package/dist/esm/hooks/useLocalStore.mjs +3 -3
- package/dist/esm/hooks/useMdStreamBuffer.mjs +56 -28
- package/dist/esm/hooks/useMicrophone.mjs +1 -1
- package/dist/esm/hooks/useObserveTheme.mjs +0 -2
- package/dist/esm/hooks/useTheme.mjs +0 -2
- package/dist/esm/hooks/useTrackRenders.mjs +2 -2
- package/dist/esm/hooks.mjs +14 -4
- package/dist/esm/index.mjs +62 -52
- package/dist/esm/providers/ThemeProvider.mjs +6 -19
- package/dist/esm/providers/themeServer.mjs +11 -6
- package/dist/esm/providers.mjs +0 -2
- package/dist/esm/stores/LocalDB.mjs +3 -3
- package/dist/esm/stores/SSE.mjs +3 -3
- package/dist/esm/stores/WS.mjs +2 -2
- package/dist/esm/stores/WebRTC.mjs +7 -0
- package/dist/esm/stores/microphone.mjs +2 -2
- package/dist/esm/stores/modal.mjs +1 -1
- package/dist/esm/stores/tip.mjs +1 -1
- package/dist/esm/stores/toast.mjs +1 -1
- package/dist/esm/stores/uploads.mjs +3 -3
- package/dist/esm/stores/volume.mjs +2 -2
- package/dist/esm/stores/window.mjs +2 -2
- package/dist/esm/stores.mjs +17 -13
- package/dist/esm/theme/type.mjs +1 -1
- package/dist/esm/utils/index.mjs +11 -9
- package/dist/esm/utils/objects/index.mjs +8 -6
- package/dist/esm/workers/uploads/uploads.mjs +2 -2
- package/dist/styles.css +8476 -0
- package/dist/types/components/Level/Level.d.ts +5 -0
- package/dist/types/components/Level/_types.d.ts +21 -0
- package/dist/types/components/Level/index.d.ts +2 -0
- package/dist/types/components/Modal/_types.d.ts +4 -0
- package/dist/types/components/Toast/_types.d.ts +1 -0
- package/dist/types/hooks/index.d.ts +2 -0
- package/dist/types/hooks/useBindWebRTC/index.d.ts +1 -0
- package/dist/types/hooks/useBindWebRTC/useBindWebRTC.d.ts +15 -0
- package/dist/types/hooks/useLocalStore/useLocalStore.d.ts +1 -1
- package/dist/types/hooks/useMdStreamBuffer/useMdStreamBuffer.d.ts +6 -1
- package/dist/types/index.d.ts +4 -1
- package/dist/types/providers/ThemeProvider.d.ts +1 -6
- package/dist/types/providers/themeServer.d.ts +7 -3
- package/dist/types/stores/WebRTC/_types.d.ts +16 -0
- package/dist/types/stores/WebRTC/index.d.ts +2 -0
- package/dist/types/stores/WebRTC/webRTCStore.d.ts +21 -0
- package/dist/types/stores/index.d.ts +1 -0
- package/dist/types/stores/microphone/index.d.ts +1 -1
- package/dist/types/stores/microphone/microphoneStore.d.ts +14 -1
- package/dist/types/stores/toast/_types.d.ts +1 -0
- package/dist/types/stores/volume/_types.d.ts +3 -1
- package/dist/types/stores/volume/volumeStore.d.ts +6 -2
- package/dist/types/utils/functions/files.d.ts +1 -1
- package/dist/types/utils/index.d.ts +2 -2
- package/dist/types/utils/objects/MDStreamBuffer/MdStreamBuffer.d.ts +10 -0
- package/dist/types/utils/objects/MDStreamBuffer/_types.d.ts +2 -0
- package/dist/types/utils/objects/WebRTCConnection/WebRTCConnection.d.ts +37 -3
- package/dist/types/utils/objects/WebRTCConnection/_types.d.ts +13 -4
- package/dist/types/utils/objects/index.d.ts +2 -0
- package/package.json +8 -3
- package/dist/cjs/chunks/Avatar-CqUSRzVd.js +0 -84
- package/dist/cjs/chunks/Badge-DjPJ_iJX.js +0 -24
- package/dist/cjs/chunks/CheckBox-Cbh6UK-7.js +0 -53
- package/dist/cjs/chunks/Chip-DcS8dtW2.js +0 -79
- package/dist/cjs/chunks/DropDown-B0970yVe.js +0 -105
- package/dist/cjs/chunks/ErrorSummary-K_rPxGWK.js +0 -87
- package/dist/cjs/chunks/FileList-sDq1jK0b.js +0 -225
- package/dist/cjs/chunks/Grouper-Ccd-x_Nb.js +0 -63
- package/dist/cjs/chunks/IconButton-CF4cR7Tr.js +0 -84
- package/dist/cjs/chunks/Label-htjXHiQ4.js +0 -103
- package/dist/cjs/chunks/Modal-C0Z59meI.js +0 -101
- package/dist/cjs/chunks/Pager-D2_fshTy.js +0 -38
- package/dist/cjs/chunks/RadioButton-DPB2ZGVf.js +0 -56
- package/dist/cjs/chunks/TextArea-CRiPRF8v.js +0 -76
- package/dist/cjs/chunks/Tip-C5keUoHx.js +0 -90
- package/dist/cjs/chunks/Toast-CyiFOsI3.js +0 -178
- package/dist/cjs/chunks/ToggleButton-D5_WnW0o.js +0 -40
- package/dist/cjs/chunks/UploadArea-KqES_OLl.js +0 -129
- package/dist/cjs/chunks/style-inject.es-CMuL-BfJ.js +0 -11
- package/dist/esm/chunks/Avatar-29zhNfxX.mjs +0 -92
- package/dist/esm/chunks/Badge-CC0zSLMf.mjs +0 -30
- package/dist/esm/chunks/CheckBox-7TiT2U47.mjs +0 -65
- package/dist/esm/chunks/Chip-CKsojimU.mjs +0 -91
- package/dist/esm/chunks/DropDown-mwo8fY7p.mjs +0 -115
- package/dist/esm/chunks/ErrorSummary-EzCqVifm.mjs +0 -94
- package/dist/esm/chunks/FileList-fh-x9Dzm.mjs +0 -235
- package/dist/esm/chunks/Grouper-naJMvpB9.mjs +0 -77
- package/dist/esm/chunks/IconButton-ByBYppAj.mjs +0 -100
- package/dist/esm/chunks/Label-C04tD7UZ.mjs +0 -116
- package/dist/esm/chunks/Modal-B9ad9OfJ.mjs +0 -115
- package/dist/esm/chunks/Pager-Bz0FpgO5.mjs +0 -46
- package/dist/esm/chunks/RadioButton-CLeRiZ8x.mjs +0 -66
- package/dist/esm/chunks/TextArea-CxscPLwN.mjs +0 -84
- package/dist/esm/chunks/Tip-C6EcX7_M.mjs +0 -100
- package/dist/esm/chunks/Toast-D4uMNvaa.mjs +0 -192
- package/dist/esm/chunks/ToggleButton-C0QIflzX.mjs +0 -51
- package/dist/esm/chunks/UploadArea-je-1NhGb.mjs +0 -139
- package/dist/esm/chunks/style-inject.es-D0BjEaN8.mjs +0 -11
- /package/dist/cjs/chunks/{SSEConnection-C-1OzEOp.js → SSEConnection-DfjLAlOG.js} +0 -0
- /package/dist/cjs/chunks/{_types-Bdqd2vHh.js → _types-DMyBIF8s.js} +0 -0
- /package/dist/cjs/chunks/{audioVisualizer-EIfIjWH7.js → audioVisualizer-BxPvUj4h.js} +0 -0
- /package/dist/cjs/chunks/{colors-njquvHkx.js → colors-4n0sNFRA.js} +0 -0
- /package/dist/cjs/chunks/{debounce-BF4i6uIC.js → debounce-_IK-La-Z.js} +0 -0
- /package/dist/cjs/chunks/{modalStore-7VjHHM8X.js → modalStore-CFsfK3ba.js} +0 -0
- /package/dist/cjs/chunks/{sharedTypes-gCECyn2N.js → sharedTypes-C0ZHzH_T.js} +0 -0
- /package/dist/cjs/chunks/{tipStore-Ck4NLvml.js → tipStore-dqD9-c30.js} +0 -0
- /package/dist/cjs/chunks/{toastStore-CSStgB9d.js → toastStore-BN1N7WXv.js} +0 -0
- /package/dist/cjs/chunks/{tslib.es6-C8dZW5nY.js → tslib.es6-DsF7Wv4Y.js} +0 -0
- /package/dist/esm/chunks/{SSEConnection-DcA3wFsO.mjs → SSEConnection-iFKOV9Uo.mjs} +0 -0
- /package/dist/esm/chunks/{_types-BVrr_Khp.mjs → _types-DrNviSG6.mjs} +0 -0
- /package/dist/esm/chunks/{audioVisualizer-ZgT77nUw.mjs → audioVisualizer-BsmpLZyK.mjs} +0 -0
- /package/dist/esm/chunks/{colors-FQ0uNQcW.mjs → colors-BAATtfbL.mjs} +0 -0
- /package/dist/esm/chunks/{debounce-Bst1jxMS.mjs → debounce-CYBH5qXQ.mjs} +0 -0
- /package/dist/esm/chunks/{modalStore-BpWnLtOF.mjs → modalStore-DmaeMv7z.mjs} +0 -0
- /package/dist/esm/chunks/{sharedTypes-tn9-uJvb.mjs → sharedTypes-CyrInj1b.mjs} +0 -0
- /package/dist/esm/chunks/{tipStore-CL5a95Bl.mjs → tipStore-B_MUZfr2.mjs} +0 -0
- /package/dist/esm/chunks/{toastStore-D2PEIqCo.mjs → toastStore-DAprlBVj.mjs} +0 -0
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { _ as __rest } from "./tslib.es6-C81Qhn1z.mjs";
|
|
3
|
+
|
|
4
|
+
import { jsxs, jsx } from "react/jsx-runtime";
|
|
5
|
+
|
|
6
|
+
import { motion } from "motion/react";
|
|
7
|
+
|
|
8
|
+
import React, { useRef, useState, useEffect, useCallback, useMemo } from "react";
|
|
9
|
+
|
|
10
|
+
import { B as Badge } from "./Badge-DuUb5-80.mjs";
|
|
11
|
+
|
|
12
|
+
import { D as Dot } from "./Dot-v_kcIWV2.mjs";
|
|
13
|
+
|
|
14
|
+
import { I as Icon } from "./Icon-D4A6_c4x.mjs";
|
|
15
|
+
|
|
16
|
+
import { T as ToolTipType } from "./sharedTypes-CyrInj1b.mjs";
|
|
17
|
+
|
|
18
|
+
var css_button = "IconButton-module_button__rziqa flexBox-module_row__z24tF", css_label = "IconButton-module_label__qWGFD flexBox-module_row__z24tF type-module_body-l-regular__lOYbg", css_icon = "IconButton-module_icon__2DDWy flexBox-module_row__z24tF", css_count = "IconButton-module_count__6r373 flexBox-module_row__z24tF";
|
|
19
|
+
|
|
20
|
+
const IconButton = React.memo(props => {
|
|
21
|
+
const {frameSize: frameSize = 36, iconSize: iconSize = 20, round: round = !0, icon: icon = "more", borderRadius: borderRadius = 4, border: border = !1, tooltip: tooltip, color: color, colorOn: colorOn, iconFill: iconFill = !1, bgColor: bgColor = "var(--core-surface-secondary)", bgColorHover: bgColorHover = "var(--core-outline-primary)", bgColorOn: bgColorOn = "var(--core-outline-primary)", iconColor: iconColor = "var(--core-text-primary)", iconColorOn: iconColorOn = "var(--core-text-primary)", iconColorHover: iconColorHover = "var(--core-text-primary)", transition: transition, variants: variants, initial: initial, animate: animate, exit: exit, fillColor: fillColor, label: label, hover: hover = !0, count: count = 0, toggle: toggle = !1, toggleIcon: toggleIcon = !1, isToggled: isToggled = !1, disabled: disabled = !1, showDot: showDot = !1, buttonSize: buttonSize = "m", onClick: onClick = () => null, onToolTip: onToolTip = () => null} = props, divAttributes = __rest(props, [ "frameSize", "iconSize", "round", "icon", "borderRadius", "border", "tooltip", "color", "colorOn", "iconFill", "bgColor", "bgColorHover", "bgColorOn", "iconColor", "iconColorOn", "iconColorHover", "transition", "variants", "initial", "animate", "exit", "fillColor", "label", "hover", "count", "toggle", "toggleIcon", "isToggled", "disabled", "showDot", "buttonSize", "onClick", "onToolTip" ]), {id: divId, className: className, style: style} = divAttributes, rest = __rest(divAttributes, [ "id", "className", "style" ]), divStyle = null != style ? style : {}, divClass = className ? ` ${className}` : "", ref = useRef(null), [on, setOn] = useState(isToggled), [hovered, setHovered] = useState(!1);
|
|
22
|
+
useEffect(() => setOn(isToggled), [ isToggled ]);
|
|
23
|
+
const handleClick = useCallback(e => {
|
|
24
|
+
disabled || (tooltip && onToolTip(null), toggle && setOn(!on), onClick(e));
|
|
25
|
+
}, [ disabled, tooltip, onToolTip, on, onClick, toggle ]), handleMouseEnter = useCallback(e => {
|
|
26
|
+
if (setHovered(!0), !(null == ref ? void 0 : ref.current) || !tooltip) return;
|
|
27
|
+
const tip = {
|
|
28
|
+
type: ToolTipType.button,
|
|
29
|
+
payload: {
|
|
30
|
+
label: tooltip
|
|
31
|
+
},
|
|
32
|
+
event: e,
|
|
33
|
+
ref: ref
|
|
34
|
+
};
|
|
35
|
+
onToolTip(tip);
|
|
36
|
+
}, [ tooltip, onToolTip ]), handleMouseLeave = useCallback(() => {
|
|
37
|
+
setHovered(!1), tooltip && onToolTip(null);
|
|
38
|
+
}, [ tooltip, onToolTip ]), bgColorNormal = useMemo(() => on ? bgColorOn : null != bgColor ? bgColor : "var(--core-surface-secondary)", [ bgColorOn, bgColor, on ]), bgHoverColor = useMemo(() => hover && on ? bgColorOn : hover ? bgColorHover : null != bgColor ? bgColor : "transparent", [ hover, bgColor, bgColorOn, bgColorHover, on ]), textColor = useMemo(() => on ? colorOn : null != color ? color : "var(--core-text-primary)", [ on, colorOn, color ]), setIconColor = useMemo(() => on ? iconColorOn : hovered ? iconColorHover : null != iconColor ? iconColor : "var(--core-text-primary)", [ on, iconColorOn, iconColor, iconColorHover, hovered ]), size = useMemo(() => buttonSize ? "s" === buttonSize ? 24 : "m" === buttonSize ? 36 : "l" === buttonSize ? 44 : "xl" === buttonSize ? 56 : void 0 : frameSize, [ frameSize, buttonSize ]), cssVars = useMemo(() => ({
|
|
39
|
+
"--ib-bg-color": bgColorNormal,
|
|
40
|
+
"--ib-bg-color-hover": disabled ? bgColorNormal : bgHoverColor,
|
|
41
|
+
"--ib-icon-size": `${null != iconSize ? iconSize : 0}px`,
|
|
42
|
+
"--ib-button-size": `${null != size ? size : 0}px`,
|
|
43
|
+
"--ib-border-radius": round ? "100%" : `${null != borderRadius ? borderRadius : 0}px`,
|
|
44
|
+
"--ib-border": border ? "1px" : 0,
|
|
45
|
+
"--ib-color": textColor,
|
|
46
|
+
"--ib-cursor": disabled ? "default" : "pointer"
|
|
47
|
+
}), [ bgColorNormal, bgHoverColor, textColor, border, size, borderRadius, iconSize, round, disabled ]);
|
|
48
|
+
return jsxs(motion.button, Object.assign({
|
|
49
|
+
id: divId,
|
|
50
|
+
type: "button",
|
|
51
|
+
className: `${css_button}${divClass}`,
|
|
52
|
+
style: Object.assign(Object.assign({}, divStyle), cssVars),
|
|
53
|
+
onClick: e => handleClick(e),
|
|
54
|
+
onMouseOutCapture: handleMouseLeave,
|
|
55
|
+
onMouseOverCapture: handleMouseEnter,
|
|
56
|
+
transition: transition,
|
|
57
|
+
variants: variants,
|
|
58
|
+
initial: initial,
|
|
59
|
+
animate: animate,
|
|
60
|
+
exit: exit,
|
|
61
|
+
disabled: disabled,
|
|
62
|
+
"aria-disabled": disabled,
|
|
63
|
+
ref: ref
|
|
64
|
+
}, rest, {
|
|
65
|
+
children: [ jsx("div", {
|
|
66
|
+
className: css_icon,
|
|
67
|
+
style: {
|
|
68
|
+
opacity: disabled ? .3 : 1
|
|
69
|
+
},
|
|
70
|
+
children: jsx(Icon, {
|
|
71
|
+
name: icon,
|
|
72
|
+
strokeColor: setIconColor,
|
|
73
|
+
fillColor: fillColor,
|
|
74
|
+
disabled: disabled,
|
|
75
|
+
size: iconSize,
|
|
76
|
+
fill: iconFill,
|
|
77
|
+
toggle: !!toggleIcon && on,
|
|
78
|
+
pointer: !0
|
|
79
|
+
})
|
|
80
|
+
}), label && jsx("div", {
|
|
81
|
+
className: css_label,
|
|
82
|
+
children: label
|
|
83
|
+
}), jsx(Dot, {
|
|
84
|
+
show: showDot
|
|
85
|
+
}), 0 !== count && jsx("div", {
|
|
86
|
+
className: css_count,
|
|
87
|
+
children: jsx(Badge, {
|
|
88
|
+
variant: "light",
|
|
89
|
+
count: count,
|
|
90
|
+
hideNull: !0
|
|
91
|
+
})
|
|
92
|
+
}) ]
|
|
93
|
+
}));
|
|
94
|
+
});
|
|
95
|
+
|
|
96
|
+
export { IconButton as I };
|
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { _ as __rest } from "./tslib.es6-C81Qhn1z.mjs";
|
|
3
|
+
|
|
4
|
+
import { jsx } from "react/jsx-runtime";
|
|
5
|
+
|
|
6
|
+
import { useCallback, useMemo } from "react";
|
|
7
|
+
|
|
8
|
+
import { s as setStyle } from "./misc-2MIIqzsX.mjs";
|
|
9
|
+
|
|
10
|
+
var LabelBackground, css = {
|
|
11
|
+
label: "Label-module_label__RaRvM",
|
|
12
|
+
button: "Label-module_button__N8bcQ type-module_body-m-regular__LuQBA",
|
|
13
|
+
xs: "Label-module_xs__K9Ai6 type-module_body-xs-regular__ZAFft",
|
|
14
|
+
s: "Label-module_s__Zh8Gp type-module_body-s-regular__vRHSP",
|
|
15
|
+
m: "Label-module_m__BJtGL type-module_body-m-regular__LuQBA",
|
|
16
|
+
l: "Label-module_l__t70tt type-module_body-l-regular__lOYbg"
|
|
17
|
+
};
|
|
18
|
+
|
|
19
|
+
function resolveSemanticBackground(backgroundColor) {
|
|
20
|
+
if (!backgroundColor || "string" != typeof backgroundColor) return;
|
|
21
|
+
const semanticKey = backgroundColor;
|
|
22
|
+
return LabelBackground[semanticKey] ? LabelBackground[semanticKey] : Object.values(LabelBackground).find(value => value === backgroundColor);
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
function Label(props) {
|
|
26
|
+
const {children: children, label: label, backgroundColor: backgroundColor, borderWidth: borderWidth, borderSize: borderSize = 1, borderColor: borderColor = "var(--core-outline-primary)", bgColor: bgColor = "transparent", borderRadius: borderRadius = 4, padding: padding, textColor: textColor = "var(--core-text-primary)", textSize: textSize = "s", onClick: onClick} = props, divAttributes = __rest(props, [ "children", "label", "backgroundColor", "borderWidth", "borderSize", "borderColor", "bgColor", "borderRadius", "padding", "textColor", "textSize", "onClick" ]), {id: divId, className: className, style: style} = divAttributes, rest = __rest(divAttributes, [ "id", "className", "style" ]), divStyle = null != style ? style : {}, divClass = className ? ` ${className}` : "", isInteractive = Boolean(onClick), resolvedBackgroundColor = null != backgroundColor ? backgroundColor : bgColor, resolvedBorderWidth = null != borderWidth ? borderWidth : borderSize, handleClick = useCallback(e => {
|
|
27
|
+
isInteractive && (null == onClick || onClick(e));
|
|
28
|
+
}, [ isInteractive, onClick ]), setBgColor = useMemo(() => {
|
|
29
|
+
if (!resolvedBackgroundColor) return "transparent";
|
|
30
|
+
const fill = resolveSemanticBackground(resolvedBackgroundColor);
|
|
31
|
+
if (!fill) return resolvedBackgroundColor;
|
|
32
|
+
switch (fill) {
|
|
33
|
+
case "red":
|
|
34
|
+
return "var(--feedback-warning)";
|
|
35
|
+
|
|
36
|
+
case "green":
|
|
37
|
+
return "var(--feedback-positive)";
|
|
38
|
+
|
|
39
|
+
case "yellow":
|
|
40
|
+
return "var(--array-yellow)";
|
|
41
|
+
|
|
42
|
+
case "grey":
|
|
43
|
+
case "white":
|
|
44
|
+
return "var(--core-surface-secondary)";
|
|
45
|
+
|
|
46
|
+
case "lightGrey":
|
|
47
|
+
return "var(--core-button-disabled)";
|
|
48
|
+
|
|
49
|
+
case "blue":
|
|
50
|
+
return "var(--core-button-primary)";
|
|
51
|
+
|
|
52
|
+
default:
|
|
53
|
+
return "var(--core-surface-primary)";
|
|
54
|
+
}
|
|
55
|
+
}, [ resolvedBackgroundColor ]), setBorderColor = useMemo(() => {
|
|
56
|
+
if (!resolvedBackgroundColor) return borderColor;
|
|
57
|
+
const fill = resolveSemanticBackground(resolvedBackgroundColor);
|
|
58
|
+
if (!fill) return borderColor;
|
|
59
|
+
switch (fill) {
|
|
60
|
+
case "red":
|
|
61
|
+
return "var(--feedback-warning)";
|
|
62
|
+
|
|
63
|
+
case "green":
|
|
64
|
+
return "var(--feedback-positive)";
|
|
65
|
+
|
|
66
|
+
case "yellow":
|
|
67
|
+
return "var(--array-yellow-label)";
|
|
68
|
+
|
|
69
|
+
case "grey":
|
|
70
|
+
case "lightGrey":
|
|
71
|
+
case "white":
|
|
72
|
+
return "var(--core-outline-primary)";
|
|
73
|
+
|
|
74
|
+
case "blue":
|
|
75
|
+
return "var(--core-button-primary)";
|
|
76
|
+
|
|
77
|
+
default:
|
|
78
|
+
return "var(--core-surface-primary)";
|
|
79
|
+
}
|
|
80
|
+
}, [ resolvedBackgroundColor, borderColor ]), setPadding = useMemo(() => padding ? setStyle(padding) : "2px 4px", [ padding ]), cssVars = useMemo(() => ({
|
|
81
|
+
"--label-padding": setPadding,
|
|
82
|
+
"--label-border-radius": setStyle(borderRadius),
|
|
83
|
+
"--label-cursor": onClick ? "pointer" : "default",
|
|
84
|
+
"--label-color": textColor,
|
|
85
|
+
"--label-bg-color": setBgColor,
|
|
86
|
+
"--label-border-size": setStyle(resolvedBorderWidth),
|
|
87
|
+
"--label-border-color": setBorderColor
|
|
88
|
+
}), [ setPadding, borderRadius, onClick, textColor, setBorderColor, setBgColor, resolvedBorderWidth ]);
|
|
89
|
+
return isInteractive ? jsx("button", Object.assign({
|
|
90
|
+
id: divId,
|
|
91
|
+
type: "button",
|
|
92
|
+
className: `${css.button} ${css[textSize]}${divClass}`,
|
|
93
|
+
style: Object.assign(Object.assign({}, divStyle), cssVars),
|
|
94
|
+
"aria-label": "Label button",
|
|
95
|
+
onClick: e => handleClick(e)
|
|
96
|
+
}, rest, {
|
|
97
|
+
children: null != children ? children : label
|
|
98
|
+
})) : jsx("span", Object.assign({
|
|
99
|
+
id: divId,
|
|
100
|
+
className: `${css.label} ${css[textSize]}${divClass}`,
|
|
101
|
+
style: Object.assign(Object.assign({}, divStyle), cssVars)
|
|
102
|
+
}, rest, {
|
|
103
|
+
children: null != children ? children : label
|
|
104
|
+
}));
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
!function(LabelBackground) {
|
|
108
|
+
LabelBackground.red = "red", LabelBackground.yellow = "yellow", LabelBackground.green = "green",
|
|
109
|
+
LabelBackground.blue = "blue", LabelBackground.grey = "grey", LabelBackground.lightGrey = "lightGrey",
|
|
110
|
+
LabelBackground.white = "white";
|
|
111
|
+
}(LabelBackground || (LabelBackground = {}));
|
|
112
|
+
|
|
113
|
+
export { Label as L, LabelBackground as a };
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import { _ as __rest } from "./tslib.es6-C81Qhn1z.mjs";
|
|
2
|
+
|
|
3
|
+
import { jsx } from "react/jsx-runtime";
|
|
4
|
+
|
|
5
|
+
import React, { useRef, useState, useMemo, useEffect } from "react";
|
|
6
|
+
|
|
7
|
+
import { s as setStyle } from "./misc-2MIIqzsX.mjs";
|
|
8
|
+
|
|
9
|
+
import { A as AudioVisualizer } from "./audioVisualizer-BsmpLZyK.mjs";
|
|
10
|
+
|
|
11
|
+
var css_wrapper = "Level-module_wrapper__yOfXw", css_barContainer = "Level-module_barContainer__QMUdv", css_bar = "Level-module_bar__MnApX";
|
|
12
|
+
|
|
13
|
+
const Level = React.memo(function(props) {
|
|
14
|
+
const {width: width = 100, height: height = 4, gap: gap = 0, audioStream: audioStream, playing: playing = !1, minIntensity: minIntensity = 0, maxIntensity: maxIntensity = 5, intensity: intensity = 3.5, peakIntensity: peakIntensity = .5, risePerSeconds: risePerSeconds = 4, releasePerSeconds: releasePerSeconds, ReleasePerSeconds: ReleasePerSeconds = 1.5, borderRadius: borderRadius = 4, borderColor: borderColor = "transparent", borderWidth: borderWidth = 0, colorActive: colorActive = "var(--feedback-positive)", backgroundColor: backgroundColor = "var(--core-surface-primary-tint)"} = props, divAttributes = __rest(props, [ "width", "height", "gap", "audioStream", "playing", "minIntensity", "maxIntensity", "intensity", "peakIntensity", "risePerSeconds", "releasePerSeconds", "ReleasePerSeconds", "borderRadius", "borderColor", "borderWidth", "colorActive", "backgroundColor" ]), {id: divId, className: className, style: style} = divAttributes, rest = __rest(divAttributes, [ "id", "className", "style" ]), divStyle = null != style ? style : {}, divClass = className ? ` ${className}` : "", visualizerRef = useRef(null), [normalizedIntensity, setNormalizedIntensity] = useState(0), totalBars = Math.max(1, Math.floor(maxIntensity)), minBars = Math.max(0, Math.min(Math.floor(minIntensity), totalBars)), releaseRate = null != releasePerSeconds ? releasePerSeconds : ReleasePerSeconds, intensityIntervals = useMemo(() => new Array(totalBars).fill(0).map((_, index) => index), [ totalBars ]), activeBars = useMemo(() => {
|
|
15
|
+
const scaledBars = Math.round(minBars + normalizedIntensity * (totalBars - minBars));
|
|
16
|
+
return Math.max(minBars, Math.min(scaledBars, totalBars));
|
|
17
|
+
}, [ minBars, normalizedIntensity, totalBars ]), visualizerSettings = useMemo(() => ({
|
|
18
|
+
intensityMultiplier: intensity,
|
|
19
|
+
peakIntensity: peakIntensity,
|
|
20
|
+
risePerSecond: risePerSeconds,
|
|
21
|
+
releasePerSecond: releaseRate,
|
|
22
|
+
onUpdate: ({intensity: nextIntensity}) => setNormalizedIntensity(nextIntensity)
|
|
23
|
+
}), [ intensity, peakIntensity, releaseRate, risePerSeconds ]);
|
|
24
|
+
useEffect(() => {
|
|
25
|
+
var _a;
|
|
26
|
+
if (null === (_a = visualizerRef.current) || void 0 === _a || _a.dispose(), visualizerRef.current = null,
|
|
27
|
+
!audioStream) return void setNormalizedIntensity(0);
|
|
28
|
+
const visualizer = new AudioVisualizer(audioStream, visualizerSettings);
|
|
29
|
+
return visualizerRef.current = visualizer, playing && visualizer.start(), () => {
|
|
30
|
+
visualizer.dispose(), visualizerRef.current === visualizer && (visualizerRef.current = null);
|
|
31
|
+
};
|
|
32
|
+
}, [ audioStream, playing, visualizerSettings ]), useEffect(() => {
|
|
33
|
+
visualizerRef.current && (playing ? visualizerRef.current.start() : (visualizerRef.current.stop(),
|
|
34
|
+
setNormalizedIntensity(0)));
|
|
35
|
+
}, [ playing ]);
|
|
36
|
+
const cssVars = useMemo(() => ({
|
|
37
|
+
"--level-width": setStyle(width),
|
|
38
|
+
"--level-height": setStyle(height),
|
|
39
|
+
"--level-gap": setStyle(gap),
|
|
40
|
+
"--level-bar-border-radius": setStyle(borderRadius),
|
|
41
|
+
"--level-border-color": borderColor,
|
|
42
|
+
"--level-border-width": setStyle(borderWidth),
|
|
43
|
+
"--level-color": colorActive,
|
|
44
|
+
"--level-bg-color": backgroundColor
|
|
45
|
+
}), [ width, height, gap, borderRadius, borderColor, borderWidth, colorActive, backgroundColor ]);
|
|
46
|
+
return jsx("div", Object.assign({
|
|
47
|
+
id: divId,
|
|
48
|
+
className: `${css_wrapper}${divClass}`,
|
|
49
|
+
style: Object.assign(Object.assign({}, cssVars), divStyle)
|
|
50
|
+
}, rest, {
|
|
51
|
+
children: intensityIntervals.map(barIndex => jsx("div", {
|
|
52
|
+
className: css_barContainer,
|
|
53
|
+
children: jsx("div", {
|
|
54
|
+
className: css_bar,
|
|
55
|
+
style: {
|
|
56
|
+
opacity: barIndex < activeBars ? 1 : 0
|
|
57
|
+
}
|
|
58
|
+
})
|
|
59
|
+
}, barIndex))
|
|
60
|
+
}));
|
|
61
|
+
});
|
|
62
|
+
|
|
63
|
+
export { Level as L };
|
|
@@ -88,18 +88,19 @@ const DEFAULT_WATCHED_MARKERS = [ {
|
|
|
88
88
|
* Buffer streamed Markdown and emit parser-safe snapshots on animation frames.
|
|
89
89
|
*/ class MdBuffer {
|
|
90
90
|
constructor(options) {
|
|
91
|
-
var _a, _b, _c, _d, _e, rules;
|
|
92
|
-
this.committedRaw = "", this.activeRaw = "", this.frameHandle = null, this.
|
|
93
|
-
this.
|
|
94
|
-
this.htmlHandling = null !== (_a = null == options ? void 0 : options.htmlHandling) && void 0 !== _a ? _a : "ignore",
|
|
91
|
+
var _a, _b, _c, _d, _e, _f, rules;
|
|
92
|
+
this.committedRaw = "", this.activeRaw = "", this.frameHandle = null, this.flushTimer = null,
|
|
93
|
+
this.lastFlushAt = 0, this.lastFlushedRawLength = 0, this.completeSignal = !1, this.endOfStreamToken = null == options ? void 0 : options.endOfStreamToken,
|
|
94
|
+
this.healthyEndMarker = null == options ? void 0 : options.healthyEndMarker, this.htmlHandling = null !== (_a = null == options ? void 0 : options.htmlHandling) && void 0 !== _a ? _a : "ignore",
|
|
95
95
|
this.includeLinksAndImages = null !== (_b = null == options ? void 0 : options.includeLinksAndImages) && void 0 !== _b && _b,
|
|
96
|
-
this.
|
|
96
|
+
this.flushDelayMs = Math.max(0, null !== (_c = null == options ? void 0 : options.flushDelayMs) && void 0 !== _c ? _c : 0),
|
|
97
|
+
this.onFlush = null == options ? void 0 : options.onFlush, this.requestFrame = null !== (_d = null == options ? void 0 : options.requestFrame) && void 0 !== _d ? _d : function() {
|
|
97
98
|
if ("undefined" != typeof globalThis && "function" == typeof globalThis.requestAnimationFrame) return globalThis.requestAnimationFrame.bind(globalThis);
|
|
98
99
|
return callback => globalThis.setTimeout(() => callback(Date.now()), 16);
|
|
99
|
-
}(), this.cancelFrame = null !== (
|
|
100
|
+
}(), this.cancelFrame = null !== (_e = null == options ? void 0 : options.cancelFrame) && void 0 !== _e ? _e : function() {
|
|
100
101
|
if ("undefined" != typeof globalThis && "function" == typeof globalThis.cancelAnimationFrame) return globalThis.cancelAnimationFrame.bind(globalThis);
|
|
101
102
|
return handle => globalThis.clearTimeout(handle);
|
|
102
|
-
}(), this.watchedMarkers = (rules = null !== (
|
|
103
|
+
}(), this.watchedMarkers = (rules = null !== (_f = null == options ? void 0 : options.watchedMarkers) && void 0 !== _f ? _f : DEFAULT_WATCHED_MARKERS,
|
|
103
104
|
[ ...rules ].sort((left, right) => right.open.length - left.open.length));
|
|
104
105
|
}
|
|
105
106
|
/**
|
|
@@ -112,6 +113,11 @@ const DEFAULT_WATCHED_MARKERS = [ {
|
|
|
112
113
|
*/ get healthy() {
|
|
113
114
|
return this.buildHealthyOutput();
|
|
114
115
|
}
|
|
116
|
+
/**
|
|
117
|
+
* Characters appended since the last emitted snapshot.
|
|
118
|
+
*/ get pendingCharacters() {
|
|
119
|
+
return Math.max(0, this.raw.length - this.lastFlushedRawLength);
|
|
120
|
+
}
|
|
115
121
|
/**
|
|
116
122
|
* Append a streamed Markdown token and schedule a frame flush.
|
|
117
123
|
*/ append(chunk) {
|
|
@@ -123,11 +129,15 @@ const DEFAULT_WATCHED_MARKERS = [ {
|
|
|
123
129
|
* Emit the current snapshot immediately.
|
|
124
130
|
*/ flush(reason = "manual") {
|
|
125
131
|
var _a;
|
|
132
|
+
this.clearScheduledFlush();
|
|
133
|
+
const raw = this.committedRaw + this.activeRaw, healthy = this.buildHealthyOutput();
|
|
134
|
+
this.lastFlushAt = Date.now(), this.lastFlushedRawLength = raw.length;
|
|
126
135
|
const snapshot = {
|
|
127
|
-
raw:
|
|
128
|
-
healthy:
|
|
136
|
+
raw: raw,
|
|
137
|
+
healthy: healthy,
|
|
129
138
|
reason: reason,
|
|
130
|
-
isComplete: this.completeSignal
|
|
139
|
+
isComplete: this.completeSignal,
|
|
140
|
+
pendingCharacters: this.pendingCharacters
|
|
131
141
|
};
|
|
132
142
|
return null === (_a = this.onFlush) || void 0 === _a || _a.call(this, snapshot),
|
|
133
143
|
snapshot;
|
|
@@ -135,14 +145,13 @@ const DEFAULT_WATCHED_MARKERS = [ {
|
|
|
135
145
|
/**
|
|
136
146
|
* Mark the stream as complete and flush one final snapshot.
|
|
137
147
|
*/ complete() {
|
|
138
|
-
return
|
|
139
|
-
this.completeSignal = !0, this.flush("complete");
|
|
148
|
+
return this.clearScheduledFlush(), this.completeSignal = !0, this.flush("complete");
|
|
140
149
|
}
|
|
141
150
|
/**
|
|
142
151
|
* Clear the buffered state and cancel any pending frame.
|
|
143
152
|
*/ reset() {
|
|
144
|
-
|
|
145
|
-
this.
|
|
153
|
+
this.clearScheduledFlush(), this.committedRaw = "", this.activeRaw = "", this.lastFlushAt = 0,
|
|
154
|
+
this.lastFlushedRawLength = 0, this.completeSignal = !1;
|
|
146
155
|
}
|
|
147
156
|
/**
|
|
148
157
|
* Cancel future work and release the retained state.
|
|
@@ -158,10 +167,23 @@ const DEFAULT_WATCHED_MARKERS = [ {
|
|
|
158
167
|
return this.dispose(), snapshot;
|
|
159
168
|
}
|
|
160
169
|
scheduleFlush() {
|
|
161
|
-
null === this.frameHandle && (this.frameHandle = this.requestFrame(() => {
|
|
162
|
-
this.frameHandle = null
|
|
170
|
+
null === this.frameHandle && null === this.flushTimer && (this.frameHandle = this.requestFrame(() => {
|
|
171
|
+
this.frameHandle = null;
|
|
172
|
+
const remainingDelay = this.getRemainingFlushDelay();
|
|
173
|
+
remainingDelay <= 0 ? this.flush("raf") : this.flushTimer = setTimeout(() => {
|
|
174
|
+
this.flushTimer = null, this.flush("raf");
|
|
175
|
+
}, remainingDelay);
|
|
163
176
|
}));
|
|
164
177
|
}
|
|
178
|
+
getRemainingFlushDelay() {
|
|
179
|
+
if (this.flushDelayMs <= 0) return 0;
|
|
180
|
+
const elapsed = Date.now() - this.lastFlushAt;
|
|
181
|
+
return Math.max(0, this.flushDelayMs - elapsed);
|
|
182
|
+
}
|
|
183
|
+
clearScheduledFlush() {
|
|
184
|
+
null !== this.frameHandle && (this.cancelFrame(this.frameHandle), this.frameHandle = null),
|
|
185
|
+
null !== this.flushTimer && (clearTimeout(this.flushTimer), this.flushTimer = null);
|
|
186
|
+
}
|
|
165
187
|
commitStableLines() {
|
|
166
188
|
if (this.buildHealthyTail(this.activeRaw) !== this.activeRaw) return;
|
|
167
189
|
const lastNewlineIndex = this.activeRaw.lastIndexOf("\n");
|
|
@@ -0,0 +1,139 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { _ as __rest } from "./tslib.es6-C81Qhn1z.mjs";
|
|
3
|
+
|
|
4
|
+
import { jsxs, jsx } from "react/jsx-runtime";
|
|
5
|
+
|
|
6
|
+
import React, { useRef, useState, useCallback, useMemo, useEffect } from "react";
|
|
7
|
+
|
|
8
|
+
import { s as setStyle } from "./misc-2MIIqzsX.mjs";
|
|
9
|
+
|
|
10
|
+
import { B as Button } from "./Button-BIgwWrPJ.mjs";
|
|
11
|
+
|
|
12
|
+
import { I as Icon } from "./Icon-D4A6_c4x.mjs";
|
|
13
|
+
|
|
14
|
+
import { I as IconButton } from "./IconButton-B_W-aOsB.mjs";
|
|
15
|
+
|
|
16
|
+
var css = {
|
|
17
|
+
wrapper: "Modal-module_wrapper__34Hds flexBox-module_columnBetween__ERfp7",
|
|
18
|
+
title: "Modal-module_title__A5OeE flexBox-module_rowBetween__5FEvi",
|
|
19
|
+
titleBlock: "Modal-module_titleBlock__HUepX flexBox-module_rowStart__4tcxS",
|
|
20
|
+
titleIcon: "Modal-module_titleIcon__xJYzy flexBox-module_row__z24tF",
|
|
21
|
+
contentWrapper: "Modal-module_contentWrapper__Swyjx flexBox-module_columnStart__C7P44",
|
|
22
|
+
content: "Modal-module_content__dWO-B flexBox-module_columnStart__C7P44",
|
|
23
|
+
actions: "Modal-module_actions__hY6zi flexBox-module_rowBetween__5FEvi",
|
|
24
|
+
leftActions: "Modal-module_leftActions__-M-DM flexBox-module_rowStart__4tcxS",
|
|
25
|
+
rightActions: "Modal-module_rightActions__IFgrN flexBox-module_rowEnd__rVdVm",
|
|
26
|
+
xs: "Modal-module_xs__iPcS9 type-module_body-xs-medium__s3KvF",
|
|
27
|
+
s: "Modal-module_s__31sYS type-module_body-s-medium__tjdFc",
|
|
28
|
+
m: "Modal-module_m__Iz82L type-module_body-m-medium__uW1on",
|
|
29
|
+
l: "Modal-module_l__pntdS type-module_body-l-medium__BqRC7",
|
|
30
|
+
xl: "Modal-module_xl__MR-68 type-module_body-xl-medium__BeyrH"
|
|
31
|
+
};
|
|
32
|
+
|
|
33
|
+
const Modal = React.memo(props => {
|
|
34
|
+
const {children: children, id: id, className: className, style: style, minWidth: minWidth = 300, minHeight: minHeight = 200, maxHeight: maxHeight = 400, maxWidth: maxWidth = 400, padding: padding, close: close = !0, title: title, titleSize: titleSize = "l", contentSize: contentSize = "m", actions: actions, titleIcon: titleIcon, titleIconFill: titleIconFill = !0, titleBorderColor: titleBorderColor = "var(--core-outline-primary)", titleBorderWidth: titleBorderWidth = 0, actionsBorderColor: actionsBorderColor = "var(--core-outline-primary)", actionsBorderWidth: actionsBorderWidth = 0, autoBorderBottom: autoBorderBottom = !0, onAction: onAction, onReject: onReject, onResolve: onResolve, onClose: onClose, onToolTip: onToolTip, onDragPointerDown: onDragPointerDown, backgroundColor: backgroundColor = "var(--core-surface-secondary)", scrollHandleColor: scrollHandleColor = "var(--core-text-disabled)", scrollHandleColorHover: scrollHandleColorHover = "var(--core-text-disabled)", titleColor: titleColor = "var(--core-text-special)", borderColor: borderColor = "var(--core-outline-primary)", borderRadius: borderRadius = 8, borderWidth: borderWidth = 1} = props, rest = __rest(props, [ "children", "id", "className", "style", "minWidth", "minHeight", "maxHeight", "maxWidth", "padding", "close", "title", "titleSize", "contentSize", "actions", "titleIcon", "titleIconFill", "titleBorderColor", "titleBorderWidth", "actionsBorderColor", "actionsBorderWidth", "autoBorderBottom", "onAction", "onReject", "onResolve", "onClose", "onToolTip", "onDragPointerDown", "backgroundColor", "scrollHandleColor", "scrollHandleColorHover", "titleColor", "borderColor", "borderRadius", "borderWidth" ]), contentWrapperRef = useRef(null), modalStyle = null != style ? style : {}, modalClass = className ? ` ${className}` : "", [scrolls, setScrolls] = useState(!1), getScrolls = useCallback(() => {
|
|
35
|
+
var _a, _b;
|
|
36
|
+
const height = null === (_a = contentWrapperRef.current) || void 0 === _a ? void 0 : _a.offsetHeight, scrollHeight = null === (_b = contentWrapperRef.current) || void 0 === _b ? void 0 : _b.scrollHeight;
|
|
37
|
+
return !(!height || !scrollHeight) && height < scrollHeight;
|
|
38
|
+
}, []), setActionBorderWidth = useMemo(() => scrolls && 0 === actionsBorderWidth && autoBorderBottom ? "1px" : setStyle(actionsBorderWidth), [ actionsBorderWidth, scrolls, autoBorderBottom ]), setContentPaddingTops = useMemo(() => {
|
|
39
|
+
if (scrolls && autoBorderBottom) {
|
|
40
|
+
if ("string" == typeof padding) {
|
|
41
|
+
return padding.split(" ")[0];
|
|
42
|
+
}
|
|
43
|
+
return setStyle(padding, "16px");
|
|
44
|
+
}
|
|
45
|
+
return "0";
|
|
46
|
+
}, [ scrolls, padding, autoBorderBottom ]), cssVars = useMemo(() => ({
|
|
47
|
+
"--modal-min-width": setStyle(minWidth),
|
|
48
|
+
"--modal-min-height": setStyle(minHeight),
|
|
49
|
+
"--modal-max-height": setStyle(maxHeight),
|
|
50
|
+
"--modal-max-width": setStyle(maxWidth),
|
|
51
|
+
"--modal-border-color": borderColor,
|
|
52
|
+
"--modal-title-color": titleColor,
|
|
53
|
+
"--modal-border-radius": setStyle(borderRadius),
|
|
54
|
+
"--modal-border-width": setStyle(borderWidth),
|
|
55
|
+
"--modal-padding": setStyle(padding, "16px 24px"),
|
|
56
|
+
"--modal-background-color": backgroundColor,
|
|
57
|
+
"--modal-title-border-color": titleBorderColor,
|
|
58
|
+
"--modal-title-border-width": setStyle(titleBorderWidth),
|
|
59
|
+
"--modal-actions-border-color": actionsBorderColor,
|
|
60
|
+
"--modal-scroll-handle": setStyle(scrollHandleColor),
|
|
61
|
+
"--modal-scroll-handle-hover": setStyle(scrollHandleColorHover),
|
|
62
|
+
"--modal-actions-border-width": setActionBorderWidth,
|
|
63
|
+
"--modal-content-padding-tops": setContentPaddingTops
|
|
64
|
+
}), [ minWidth, minHeight, maxHeight, maxWidth, borderColor, titleColor, borderRadius, borderWidth, padding, titleBorderWidth, titleBorderColor, actionsBorderColor, backgroundColor, scrollHandleColor, scrollHandleColorHover, setContentPaddingTops, setActionBorderWidth ]);
|
|
65
|
+
useEffect(() => {
|
|
66
|
+
children && maxHeight && setScrolls(getScrolls());
|
|
67
|
+
}, [ children, maxHeight, getScrolls ]);
|
|
68
|
+
const renderActions = position => null == actions ? void 0 : actions.map((action, index) => action.position || "left" !== position ? action.position && position !== action.position ? null : jsx(Button, {
|
|
69
|
+
variant: action.primary ? "solid" : "outline",
|
|
70
|
+
label: action.label,
|
|
71
|
+
onClick: e => (action => {
|
|
72
|
+
const resolves = !action.promise || "resolve" === action.promise, rejects = "reject" === action.promise;
|
|
73
|
+
null == onAction || onAction(action.value), resolves && (null == onResolve || onResolve(action.value)),
|
|
74
|
+
rejects && (null == onReject || onReject(new Error("Modal rejected", {
|
|
75
|
+
cause: action.value
|
|
76
|
+
})));
|
|
77
|
+
})(action),
|
|
78
|
+
round: !0 === action.round,
|
|
79
|
+
iconLeft: action.iconLeft,
|
|
80
|
+
iconRight: action.iconRight,
|
|
81
|
+
tooltip: action.tooltip,
|
|
82
|
+
onToolTip: tip => null == onToolTip ? void 0 : onToolTip(tip)
|
|
83
|
+
}, `${action.id}_${index}`) : null);
|
|
84
|
+
return jsxs("div", Object.assign({
|
|
85
|
+
id: id,
|
|
86
|
+
className: `${css.wrapper}${modalClass}`,
|
|
87
|
+
style: Object.assign(Object.assign({}, modalStyle), cssVars)
|
|
88
|
+
}, rest, {
|
|
89
|
+
children: [ (title || close) && jsxs("div", {
|
|
90
|
+
className: `${css.title} ${css[titleSize]}`,
|
|
91
|
+
onPointerDown: onDragPointerDown,
|
|
92
|
+
children: [ jsxs("div", {
|
|
93
|
+
className: css.titleBlock,
|
|
94
|
+
children: [ titleIcon && jsx("div", {
|
|
95
|
+
className: css.titleIcon,
|
|
96
|
+
children: jsx(Icon, {
|
|
97
|
+
name: titleIcon,
|
|
98
|
+
fill: titleIconFill,
|
|
99
|
+
size: 20
|
|
100
|
+
})
|
|
101
|
+
}), title ]
|
|
102
|
+
}), close && jsx("div", {
|
|
103
|
+
className: css.close,
|
|
104
|
+
children: jsx("div", {
|
|
105
|
+
className: css.titleIcon,
|
|
106
|
+
children: jsx(IconButton, {
|
|
107
|
+
tooltip: "close",
|
|
108
|
+
icon: "x",
|
|
109
|
+
onClick: () => {
|
|
110
|
+
null == onReject || onReject(new Error("Modal was closed", {
|
|
111
|
+
cause: "user action"
|
|
112
|
+
})), null == onClose || onClose();
|
|
113
|
+
},
|
|
114
|
+
onToolTip: tip => null == onToolTip ? void 0 : onToolTip(tip)
|
|
115
|
+
})
|
|
116
|
+
})
|
|
117
|
+
}) ]
|
|
118
|
+
}), jsx("div", {
|
|
119
|
+
className: css.contentWrapper,
|
|
120
|
+
ref: contentWrapperRef,
|
|
121
|
+
children: jsx("div", {
|
|
122
|
+
className: `${css.content} ${css[contentSize]}`,
|
|
123
|
+
children: children
|
|
124
|
+
})
|
|
125
|
+
}), actions && actions.length > 0 && jsxs("div", {
|
|
126
|
+
className: css.actions,
|
|
127
|
+
onPointerDown: onDragPointerDown,
|
|
128
|
+
children: [ jsx("div", {
|
|
129
|
+
className: css.leftActions,
|
|
130
|
+
children: renderActions("left")
|
|
131
|
+
}), jsx("div", {
|
|
132
|
+
className: css.rightActions,
|
|
133
|
+
children: renderActions("right")
|
|
134
|
+
}) ]
|
|
135
|
+
}) ]
|
|
136
|
+
}));
|
|
137
|
+
});
|
|
138
|
+
|
|
139
|
+
export { Modal as M };
|
|
@@ -2,16 +2,12 @@ import { jsxs, Fragment, jsx } from "react/jsx-runtime";
|
|
|
2
2
|
|
|
3
3
|
import { useDragControls, AnimatePresence, motion } from "motion/react";
|
|
4
4
|
|
|
5
|
-
import { O as Overlay } from "./Overlay-
|
|
5
|
+
import { O as Overlay } from "./Overlay-C-yori3-.mjs";
|
|
6
6
|
|
|
7
|
-
import {
|
|
8
|
-
|
|
9
|
-
import { u as useModal, a as useModalActions } from "./modalStore-BpWnLtOF.mjs";
|
|
7
|
+
import { u as useModal, a as useModalActions } from "./modalStore-DmaeMv7z.mjs";
|
|
10
8
|
|
|
11
9
|
var css_wrapper = "ModalController-module_wrapper__HkOoX flexBox-module_row__z24tF";
|
|
12
10
|
|
|
13
|
-
styleInject(".flexBox-module_row__z24tF {\n\tdisplay: flex;\n\tjustify-content: center;\n\talign-items: center;\n\tbox-sizing: border-box;\n\tpadding: 0;\n\tmargin: 0;\n}.flexBox-module_rowBetween__5FEvi {\n\tdisplay: flex;\n\tjustify-content: space-between;\n\talign-items: center;\n\tbox-sizing: border-box;\n\tpadding: 0;\n\tmargin: 0;\n}.flexBox-module_rowStart__4tcxS {\n\tdisplay: flex;\n\tjustify-content: flex-start;\n\talign-items: center;\n\tbox-sizing: border-box;\n\tpadding: 0;\n\tmargin: 0;\n}.flexBox-module_rowEnd__rVdVm {\n\tdisplay: flex;\n\tjustify-content: flex-end;\n\talign-items: center;\n\tbox-sizing: border-box;\n\tpadding: 0;\n\tmargin: 0;\n}.flexBox-module_column__ezvMq {\n\tdisplay: flex;\n\tflex-direction: column;\n\tjustify-content: center;\n\talign-items: center;\n\tbox-sizing: border-box;\n\tpadding: 0;\n\tmargin: 0;\n}.flexBox-module_columnStart__C7P44 {\n\tdisplay: flex;\n\tflex-direction: column;\n\tjustify-content: flex-start;\n\talign-items: flex-start;\n\tbox-sizing: border-box;\n\tpadding: 0;\n\tmargin: 0;\n}.flexBox-module_columnStartCenter__PKcrG {\n\tdisplay: flex;\n\tflex-direction: column;\n\tjustify-content: flex-start;\n\talign-items: center;\n\tbox-sizing: border-box;\n\tpadding: 0;\n\tmargin: 0;\n}.flexBox-module_columnBetween__ERfp7 {\n\tdisplay: flex;\n\tflex-direction: column;\n\tjustify-content: space-between;\n\talign-items: center;\n\tbox-sizing: border-box;\n\tpadding: 0;\n\tmargin: 0;\n}.flexBox-module_columnEnd__lLJuc {\n\tdisplay: flex;\n\tflex-direction: column;\n\tjustify-content: flex-end;\n\talign-items: flex-end;\n\tbox-sizing: border-box;\n\tpadding: 0;\n\tmargin: 0;\n}.ModalController-module_wrapper__HkOoX {\n\tposition: absolute;\n\tz-index: var(--elevation-confirm);\n}\n");
|
|
14
|
-
|
|
15
11
|
const defaultTransition = {
|
|
16
12
|
ease: "easeOut",
|
|
17
13
|
duration: .25,
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
'use client';
|
|
2
|
-
import {
|
|
2
|
+
import { _ as __rest } from "./tslib.es6-C81Qhn1z.mjs";
|
|
3
3
|
|
|
4
4
|
import { jsx } from "react/jsx-runtime";
|
|
5
5
|
|
|
@@ -7,12 +7,8 @@ import { AnimatePresence, motion } from "motion/react";
|
|
|
7
7
|
|
|
8
8
|
import React, { useMemo, useCallback } from "react";
|
|
9
9
|
|
|
10
|
-
import { s as styleInject } from "./style-inject.es-D0BjEaN8.mjs";
|
|
11
|
-
|
|
12
10
|
var css_overlay = "Overlay-module_overlay__EkbfA";
|
|
13
11
|
|
|
14
|
-
styleInject(".Overlay-module_overlay__EkbfA {\n\tposition: fixed;\n\ttop: 0;\n\tleft: 0;\n\tright: 0;\n\tbottom: 0;\n\tbackground-color: var(--overlay-color);\n\tz-index: var(--elevation-overlay);\n}\n");
|
|
15
|
-
|
|
16
12
|
const defaultTransition = {
|
|
17
13
|
ease: "easeOut",
|
|
18
14
|
duration: .25
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { _ as __rest } from "./tslib.es6-C81Qhn1z.mjs";
|
|
3
|
+
|
|
4
|
+
import { jsx } from "react/jsx-runtime";
|
|
5
|
+
|
|
6
|
+
import React, { useState, useMemo, useEffect, useCallback } from "react";
|
|
7
|
+
|
|
8
|
+
import { a as accessibleKeyDown } from "./misc-2MIIqzsX.mjs";
|
|
9
|
+
|
|
10
|
+
var css_wrapper = "Pager-module_wrapper__eutVg flexBox-module_row__z24tF", css_bullet = "Pager-module_bullet__TxyR5 flexBox-module_row__z24tF", css_selected = "Pager-module_selected__C6xbR";
|
|
11
|
+
|
|
12
|
+
const Pager = React.memo(props => {
|
|
13
|
+
const {size: size = 8, index: index = 0, color: color, colorHover: colorHover, colorOn: colorOn, pages: pages = 2, gap: gap = 4, onChange: onChange = () => null} = props, divAttributes = __rest(props, [ "size", "index", "color", "colorHover", "colorOn", "pages", "gap", "onChange" ]), {id: divId, className: className, style: style} = divAttributes, rest = __rest(divAttributes, [ "id", "className", "style" ]), divStyle = null != style ? style : {}, divClass = className ? ` ${className}` : "", [selected, setSelected] = useState(index), bullets = useMemo(() => Array.from({
|
|
14
|
+
length: pages
|
|
15
|
+
}, (_, i) => i), [ pages ]);
|
|
16
|
+
useEffect(() => setSelected(index), [ index ]);
|
|
17
|
+
const handleClick = useCallback(i => {
|
|
18
|
+
setSelected(i), onChange(i);
|
|
19
|
+
}, [ onChange ]), cssVars = useMemo(() => ({
|
|
20
|
+
"--pager-gap": `${gap}px`,
|
|
21
|
+
"--pager-size": `${size}px`,
|
|
22
|
+
"--pager-color": null != color ? color : "var(--core-text-disabled)",
|
|
23
|
+
"--pager-colorOn": null != colorOn ? colorOn : "var(--core-text-primary)",
|
|
24
|
+
"--pager-colorHover": null != colorHover ? colorHover : "var(--core-text-disabled)"
|
|
25
|
+
}), [ gap, size, color, colorOn, colorHover ]);
|
|
26
|
+
return jsx("div", Object.assign({
|
|
27
|
+
id: divId,
|
|
28
|
+
style: Object.assign(Object.assign({}, divStyle), cssVars),
|
|
29
|
+
className: `${css_wrapper}${divClass}`
|
|
30
|
+
}, rest, {
|
|
31
|
+
children: bullets.map(bulletId => jsx("input", {
|
|
32
|
+
className: `${css_bullet} ${selected === bulletId ? css_selected : ""}`,
|
|
33
|
+
type: "button",
|
|
34
|
+
onClick: () => handleClick(bulletId),
|
|
35
|
+
onKeyDown: e => accessibleKeyDown(e, () => handleClick(bulletId)),
|
|
36
|
+
onTouchStart: () => handleClick(bulletId),
|
|
37
|
+
tabIndex: bulletId
|
|
38
|
+
}, `paging_bullet_${bulletId}`))
|
|
39
|
+
}));
|
|
40
|
+
});
|
|
41
|
+
|
|
42
|
+
export { Pager as P };
|