@apple-pie/slice 0.1.60 → 0.2.0
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 +17 -1
- package/dist/cjs/chunks/ActionButton-DhHiZwXV.js +200 -0
- package/dist/cjs/chunks/Attachment-DhyXAQUf.js +351 -0
- package/dist/cjs/chunks/AudioBubble-DS5Oea-b.js +46 -0
- package/dist/cjs/chunks/AudioLevel-uQJ-v5Qz.js +54 -0
- package/dist/cjs/chunks/Avatar-a2GHmu1o.js +125 -0
- package/dist/cjs/chunks/AvatarGroup-CWpoauJP.js +70 -0
- package/dist/cjs/chunks/Badge-DtVP2qH0.js +26 -0
- package/dist/cjs/chunks/Button-Cr5SlNim.js +293 -0
- package/dist/cjs/chunks/ButtonBar-DDupZZ_u.js +96 -0
- package/dist/cjs/chunks/Camera-bjjzmzar.js +560 -0
- package/dist/cjs/chunks/CheckBox-DBaKpMhg.js +66 -0
- package/dist/cjs/chunks/Chip-DsZHDLKG.js +203 -0
- package/dist/cjs/chunks/ContentEditable-BaxU62Mg.js +144 -0
- package/dist/cjs/chunks/DialogBox-C-ZvHDH6.js +204 -0
- package/dist/cjs/chunks/Dot-0Dv8WX0n.js +92 -0
- package/dist/cjs/chunks/DrggablePanel-zi27w3wY.js +251 -0
- package/dist/cjs/chunks/DropDown-BcTjhAtE.js +269 -0
- package/dist/cjs/chunks/ErrorSummary-DDz7nQWX.js +166 -0
- package/dist/cjs/chunks/{FileIcon-DctPd_KB.js → FileIcon-BM8n3o-c.js} +68 -40
- package/dist/cjs/chunks/FileList-T2_mhI_t.js +204 -0
- package/dist/cjs/chunks/FlexBox-DTCyWJeT.js +278 -0
- package/dist/cjs/chunks/FlexDiv-5YN9Hgxy.js +7 -0
- package/dist/cjs/chunks/Icon-COY7IZkK.js +7821 -0
- package/dist/cjs/chunks/IconButton-KJr15EW6.js +10 -0
- package/dist/cjs/chunks/{IndexedDB-Dn5mB5-k.js → IndexedDB-DwKh2Gfp.js} +1 -1
- package/dist/cjs/chunks/ModalController-D0S9VnNH.js +143 -0
- package/dist/cjs/chunks/ModalHostContext-DLgUa9Vl.js +5 -0
- package/dist/cjs/chunks/Overlay-CVZLmK8H.js +77 -0
- package/dist/cjs/chunks/Pager-QEUi0r59.js +146 -0
- package/dist/cjs/chunks/PopMenu-DkxhTcwD.js +423 -0
- package/dist/cjs/chunks/PopMenuController-CmS28S4h.js +32 -0
- package/dist/cjs/chunks/ProgressIndicator-Ddj5dfEA.js +237 -0
- package/dist/cjs/chunks/PromptInput-DtepCo-l.js +248 -0
- package/dist/cjs/chunks/RadioButton-B2HGjkQk.js +101 -0
- package/dist/cjs/chunks/RadioButtonList-Oc7oMivb.js +88 -0
- package/dist/cjs/chunks/Slider-Y7zMFKiM.js +170 -0
- package/dist/cjs/chunks/Spacer-CM7sstpQ.js +22 -0
- package/dist/cjs/chunks/Switch-CWJh4Pi4.js +70 -0
- package/dist/cjs/chunks/Tab-DFvjUNPs.js +96 -0
- package/dist/cjs/chunks/TabBar-lB0aqabp.js +186 -0
- package/dist/cjs/chunks/TextArea-UudvZQ9R.js +189 -0
- package/dist/cjs/chunks/TextField-QzgdqFys.js +312 -0
- package/dist/cjs/chunks/Tip-BxS2Wzz3.js +115 -0
- package/dist/cjs/chunks/ToggleButton-De8_kkMd.js +53 -0
- package/dist/cjs/chunks/UploadArea-BtqwFTDl.js +223 -0
- package/dist/cjs/chunks/Video-C1GATYS9.js +396 -0
- package/dist/cjs/chunks/VideoController-CnYz7Sdt.js +169 -0
- package/dist/cjs/chunks/{WSConnection-D5nSdN7z.js → WSConnection-DZKTeDtZ.js} +1 -1
- package/dist/cjs/chunks/{WebRTCConnection-CxMqLK-l.js → WebRTCConnection-DIUG7Gx3.js} +1 -1
- package/dist/cjs/chunks/_types-3m6769Z0.js +910 -0
- package/dist/cjs/chunks/_types-C_Jf14DZ.js +273 -0
- package/dist/cjs/chunks/audioVisualizer-Bak7PWOv.js +71 -0
- package/dist/cjs/chunks/breakpoints-BDw1OJh9.js +18 -0
- package/dist/cjs/chunks/{browserChannelsStore-CvkRtX7s.js → browserChannelsStore-DHE7Vr4_.js} +4 -2
- package/dist/cjs/chunks/colors-hDzzq_Dk.js +62 -0
- package/dist/cjs/chunks/files-RYD9L_pI.js +25 -0
- package/dist/cjs/chunks/getVideoControls-LxSY7z8h.js +19 -0
- package/dist/cjs/chunks/getWaterTransition-s_55VKK2.js +11 -0
- package/dist/cjs/chunks/{localDBStore-BYxZNIrv.js → localDBStore-CTWlm2t-.js} +6 -2
- package/dist/cjs/chunks/{microphoneStore-Dw-7f6Jb.js → microphoneStore-D7DuvQeX.js} +1 -1
- package/dist/cjs/chunks/{misc-B3tF47Um.js → misc-PmT7cZzC.js} +29 -38
- package/dist/cjs/chunks/{modalStore-BNeHu-nv.js → modalStore-BCn998Jz.js} +20 -17
- package/dist/cjs/chunks/popMenuStore-DqyTqDrl.js +20 -0
- package/dist/cjs/chunks/resolveColor-DkYThq2J.js +9 -0
- package/dist/cjs/chunks/resolveColorProps-DE1k1P-Z.js +17 -0
- package/dist/cjs/chunks/resolveShortcut-DiQdb8VR.js +38 -0
- package/dist/cjs/chunks/sharedTypes-BDMIewR9.js +22 -0
- package/dist/cjs/chunks/{sseStore-Dw-nvmmG.js → sseStore-DfS7e3vY.js} +3 -3
- package/dist/cjs/chunks/themes-bwU5x3_5.js +34 -0
- package/dist/cjs/chunks/toastStore-BxX1AtE7.js +33 -0
- package/dist/cjs/chunks/type.module-Dk5b_rHG.js +28 -0
- package/dist/cjs/chunks/{uploads-worker-BiugXTT6.js → uploads-worker-stCHn8-D.js} +1 -1
- package/dist/cjs/chunks/{uploadsStore-CxCy0NB7.js → uploadsStore-Ck3gzZuD.js} +2 -2
- package/dist/cjs/chunks/useAudioVisualizer-D7bStvIe.js +42 -0
- package/dist/cjs/chunks/useModalHost-B8oi4tfb.js +52 -0
- package/dist/cjs/chunks/usePrefersReducedMotion-GpD17CAE.js +16 -0
- package/dist/cjs/chunks/viewState-CMugA-g4.js +627 -0
- package/dist/cjs/chunks/{volumeStore-BQIMqtSw.js → volumeStore-BoEoo9wA.js} +1 -1
- package/dist/cjs/chunks/{webRTCStore-B8IKsBKT.js → webRTCStore-OGkXAovD.js} +6 -2
- package/dist/cjs/chunks/{windowStore-H9Jg7tnm.js → windowStore-HYnXbosz.js} +1 -1
- package/dist/cjs/components/Attachment/index.js +26 -0
- package/dist/cjs/components/AudioBubble/index.js +11 -8
- package/dist/cjs/components/AudioLevel/index.js +9 -0
- package/dist/cjs/components/Avatar/index.js +5 -3
- package/dist/cjs/components/AvatarGroup/index.js +4 -3
- package/dist/cjs/components/Badge/index.js +4 -3
- package/dist/cjs/components/Button/index.js +14 -11
- package/dist/cjs/components/ButtonBar/index.js +11 -9
- package/dist/cjs/components/Camera/index.js +15 -9
- package/dist/cjs/components/CheckBox/index.js +11 -10
- package/dist/cjs/components/Chip/index.js +13 -10
- package/dist/cjs/components/ContentEditable/index.js +8 -0
- package/dist/cjs/components/DataTable/index.js +12 -10
- package/dist/cjs/components/DialogBox/index.js +21 -0
- package/dist/cjs/components/Dot/index.js +8 -3
- package/dist/cjs/components/DraggablePanel/index.js +10 -10
- package/dist/cjs/components/DropDown/index.js +12 -10
- package/dist/cjs/components/ErrorSummary/index.js +10 -7
- package/dist/cjs/components/FileIcon/index.js +8 -9
- package/dist/cjs/components/FileList/index.js +16 -10
- package/dist/cjs/components/FlexBox/index.js +23 -0
- package/dist/cjs/components/FlexDiv/index.js +11 -5
- package/dist/cjs/components/Icon/index.js +8 -7
- package/dist/cjs/components/IconButton/index.js +15 -21
- package/dist/cjs/components/ModalController/index.js +11 -6
- package/dist/cjs/components/Overlay/index.js +9 -3
- package/dist/cjs/components/Pager/index.js +9 -3
- package/dist/cjs/components/PopMenu/index.js +17 -0
- package/dist/cjs/components/PopMenuController/index.js +18 -0
- package/dist/cjs/components/Progress/index.js +13 -10
- package/dist/cjs/components/PromptInput/index.js +19 -13
- package/dist/cjs/components/RadioButton/index.js +11 -10
- package/dist/cjs/components/RadioButtonList/index.js +12 -10
- package/dist/cjs/components/Slider/index.js +4 -8
- package/dist/cjs/components/Spacer/index.js +2 -2
- package/dist/cjs/components/Switch/index.js +9 -3
- package/dist/cjs/components/Tab/index.js +15 -0
- package/dist/cjs/components/TabBar/index.js +15 -11
- package/dist/cjs/components/TextArea/index.js +11 -12
- package/dist/cjs/components/Textfield/index.js +15 -11
- package/dist/cjs/components/Tip/index.js +9 -4
- package/dist/cjs/components/Toast/index.js +13 -10
- package/dist/cjs/components/ToggleButton/index.js +14 -11
- package/dist/cjs/components/UploadArea/index.js +17 -11
- package/dist/cjs/components/Video/index.js +18 -14
- package/dist/cjs/components/VideoController/index.js +17 -13
- package/dist/cjs/hooks/useAudioRecorder.js +1 -1
- package/dist/cjs/hooks/useBindWebRTC.js +4 -3
- package/dist/cjs/hooks/useClipboard.js +3 -2
- package/dist/cjs/hooks/useDoubleClick.js +6 -4
- package/dist/cjs/hooks/useInfiniteScroll.js +1 -1
- package/dist/cjs/hooks/useMdStreamBuffer.js +7 -2
- package/dist/cjs/hooks/useMicrophone.js +1 -1
- package/dist/cjs/hooks/useObserveTheme.js +4 -4
- package/dist/cjs/hooks/useTheme.js +9 -1
- package/dist/cjs/hooks/useToolTip.js +27 -32
- package/dist/cjs/hooks/useTrackRenders.js +2 -2
- package/dist/cjs/hooks/useWindow.js +13 -23
- package/dist/cjs/hooks.js +13 -12
- package/dist/cjs/index.js +55 -47
- package/dist/cjs/providers/ThemeProvider.js +4 -3
- package/dist/cjs/providers/themeServer.test.js +398 -403
- package/dist/cjs/providers.js +4 -3
- package/dist/cjs/stores/LocalDB.js +8 -6
- package/dist/cjs/stores/SSE.js +4 -3
- package/dist/cjs/stores/WS.js +4 -3
- package/dist/cjs/stores/WebRTC.js +8 -6
- package/dist/cjs/stores/activeTab.js +1 -1
- package/dist/cjs/stores/browserChannel.js +5 -4
- package/dist/cjs/stores/microphone.js +2 -2
- package/dist/cjs/stores/modal.js +1 -1
- package/dist/cjs/stores/popMenu.js +7 -0
- 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/video.js +1 -1
- package/dist/cjs/stores/volume.js +2 -2
- package/dist/cjs/stores/window.js +2 -2
- package/dist/cjs/stores.js +38 -34
- package/dist/cjs/theme/colors.js +479 -231
- package/dist/cjs/theme/themes.js +3 -30
- package/dist/cjs/theme/type.js +31 -0
- package/dist/cjs/theme.js +10 -3
- package/dist/cjs/utils/index.js +24 -5
- package/dist/cjs/utils/objects/index.js +2 -2
- package/dist/cjs/workers/uploads/uploads.js +2 -2
- package/dist/css/type.module.css +27 -0
- package/dist/esm/chunks/ActionButton-guWI4qko.mjs +235 -0
- package/dist/esm/chunks/Attachment-BTSb0hKX.mjs +370 -0
- package/dist/esm/chunks/AudioBubble-D15lr4H6.mjs +68 -0
- package/dist/esm/chunks/AudioLevel-BcNrcGlh.mjs +63 -0
- package/dist/esm/chunks/Avatar-C4JzdLTW.mjs +132 -0
- package/dist/esm/chunks/AvatarGroup-Cn33-JkE.mjs +78 -0
- package/dist/esm/chunks/Badge-DpnuS-Ey.mjs +32 -0
- package/dist/esm/chunks/Button-BwTo8mSI.mjs +315 -0
- package/dist/esm/chunks/ButtonBar-BwHxexlC.mjs +111 -0
- package/dist/esm/chunks/Camera-DWmX5FZ-.mjs +585 -0
- package/dist/esm/chunks/CheckBox-CjmPDfLi.mjs +76 -0
- package/dist/esm/chunks/Chip-BfyUpZbH.mjs +223 -0
- package/dist/esm/chunks/ContentEditable-BvlyAJve.mjs +154 -0
- package/dist/esm/chunks/DialogBox-W9i6k5mv.mjs +224 -0
- package/dist/esm/chunks/Dot-CG395pS6.mjs +104 -0
- package/dist/esm/chunks/DrggablePanel-0Ef6TYrd.mjs +270 -0
- package/dist/esm/chunks/DropDown-CiB0Rp_P.mjs +286 -0
- package/dist/esm/chunks/ErrorSummary-3XoZyvmX.mjs +192 -0
- package/dist/esm/chunks/{FileIcon-DSPzFDJY.mjs → FileIcon-hKJZoGIx.mjs} +73 -53
- package/dist/esm/chunks/FileList-DxB0ZORo.mjs +220 -0
- package/dist/esm/chunks/FlexBox-VfQehVtm.mjs +296 -0
- package/dist/esm/chunks/FlexDiv-BZ5PBnE3.mjs +6 -0
- package/dist/esm/chunks/Icon-43T0fkr6.mjs +7841 -0
- package/dist/esm/chunks/IconButton-oqYTUJit.mjs +12 -0
- package/dist/esm/chunks/{IndexedDB-DpULdzpq.mjs → IndexedDB-DjCLZUf0.mjs} +1 -1
- package/dist/esm/chunks/ModalController-fvF-RWS8.mjs +169 -0
- package/dist/esm/chunks/ModalHostContext-BrT_g7sc.mjs +5 -0
- package/dist/esm/chunks/Overlay-C_FMcUyg.mjs +93 -0
- package/dist/esm/chunks/Pager-LqYNCZ8I.mjs +158 -0
- package/dist/esm/chunks/PopMenu-BkXfm6Sz.mjs +455 -0
- package/dist/esm/chunks/PopMenuController-Dj3uvc8F.mjs +44 -0
- package/dist/esm/chunks/ProgressIndicator-CR3pA1Me.mjs +266 -0
- package/dist/esm/chunks/PromptInput-Bq18i1Ac.mjs +266 -0
- package/dist/esm/chunks/RadioButton-DTUKMjvM.mjs +109 -0
- package/dist/esm/chunks/RadioButtonList-DsOgpe0m.mjs +99 -0
- package/dist/esm/chunks/Slider-DaZTE-eD.mjs +176 -0
- package/dist/esm/chunks/Spacer-CsJxUJ7E.mjs +24 -0
- package/dist/esm/chunks/Switch-BDFgMC0b.mjs +84 -0
- package/dist/esm/chunks/Tab-B8yJ9Qy4.mjs +105 -0
- package/dist/esm/chunks/TabBar-2kQmtcwW.mjs +214 -0
- package/dist/esm/chunks/TextArea-C32MToPG.mjs +201 -0
- package/dist/esm/chunks/TextField-BXrN1QkD.mjs +344 -0
- package/dist/esm/chunks/Tip-4R9wW1mE.mjs +133 -0
- package/dist/esm/chunks/ToggleButton-CGHa458C.mjs +61 -0
- package/dist/esm/chunks/UploadArea-Dq7ST-RG.mjs +237 -0
- package/dist/esm/chunks/Video-KuG0k3ly.mjs +418 -0
- package/dist/esm/chunks/VideoController-DQoDDY1a.mjs +201 -0
- package/dist/esm/chunks/{WSConnection-DNh3_RKt.mjs → WSConnection-ByCYrNOq.mjs} +1 -1
- package/dist/esm/chunks/{WebRTCConnection-B9ztLs_6.mjs → WebRTCConnection-DTjS3UUU.mjs} +1 -1
- package/dist/esm/chunks/_types-B6NStINb.mjs +296 -0
- package/dist/esm/chunks/_types-ntN11tyz.mjs +910 -0
- package/dist/esm/chunks/audioVisualizer-BMSpJwTS.mjs +71 -0
- package/dist/esm/chunks/breakpoints-Dn9DgpJe.mjs +18 -0
- package/dist/esm/chunks/{browserChannelsStore-CmMyobjW.mjs → browserChannelsStore-s7VUhLS9.mjs} +6 -2
- package/dist/esm/chunks/colors-DZ9xpMoE.mjs +63 -0
- package/dist/esm/chunks/files-6nwSZlJK.mjs +26 -0
- package/dist/esm/chunks/getVideoControls-aoqr4T3P.mjs +20 -0
- package/dist/esm/chunks/getWaterTransition-CrDSFJdk.mjs +12 -0
- package/dist/esm/chunks/{localDBStore-3uHThx73.mjs → localDBStore-DYhPmkHz.mjs} +7 -3
- package/dist/esm/chunks/{microphoneStore-lnK3t3JC.mjs → microphoneStore-BzSEbtfK.mjs} +1 -1
- package/dist/esm/chunks/{misc-CagHFpjD.mjs → misc-DI5GSqkt.mjs} +24 -34
- package/dist/esm/chunks/{modalStore-DDbEcsqD.mjs → modalStore-BgYt3q8T.mjs} +20 -17
- package/dist/esm/chunks/popMenuStore-DtApFGaq.mjs +18 -0
- package/dist/esm/chunks/resolveColor-Kvs7kDyy.mjs +9 -0
- package/dist/esm/chunks/resolveColorProps-CwAU25V-.mjs +17 -0
- package/dist/esm/chunks/resolveShortcut-C43ivgMc.mjs +37 -0
- package/dist/esm/chunks/sharedTypes-DYXO7VNa.mjs +25 -0
- package/dist/esm/chunks/{sseStore-CCkhffxC.mjs → sseStore-Duybemwt.mjs} +7 -3
- package/dist/esm/chunks/themes-DCtDY7XT.mjs +40 -0
- package/dist/esm/chunks/toastStore-Ds1Kx4-O.mjs +29 -0
- package/dist/esm/chunks/type.module--fVZ2ic7.mjs +28 -0
- package/dist/esm/chunks/{uploads-worker-BAc2rfWa.mjs → uploads-worker-CpJtBCvY.mjs} +1 -1
- package/dist/esm/chunks/{uploadsStore-CnmPPpay.mjs → uploadsStore-B_7wyr8k.mjs} +1 -1
- package/dist/esm/chunks/useAudioVisualizer-Dw8XLBmS.mjs +42 -0
- package/dist/esm/chunks/useModalHost-DiYFB7Mq.mjs +51 -0
- package/dist/esm/chunks/usePrefersReducedMotion-BWAwMMLE.mjs +15 -0
- package/dist/esm/chunks/viewState-D7e7CrHf.mjs +659 -0
- package/dist/esm/chunks/{volumeStore-CSItrUF2.mjs → volumeStore-mqWIRL0J.mjs} +1 -1
- package/dist/esm/chunks/{webRTCStore-BpDbSd4Q.mjs → webRTCStore-BepH2O9l.mjs} +7 -3
- package/dist/esm/chunks/{windowStore-Dkr9ooZW.mjs → windowStore-C8rGk_0b.mjs} +1 -1
- package/dist/esm/components/Attachment/index.mjs +71 -0
- package/dist/esm/components/AudioBubble/index.mjs +21 -11
- package/dist/esm/components/AudioLevel/index.mjs +21 -0
- package/dist/esm/components/Avatar/index.mjs +9 -3
- package/dist/esm/components/AvatarGroup/index.mjs +10 -4
- package/dist/esm/components/Badge/index.mjs +8 -2
- package/dist/esm/components/Button/index.mjs +27 -17
- package/dist/esm/components/ButtonBar/index.mjs +22 -14
- package/dist/esm/components/Camera/index.mjs +37 -13
- package/dist/esm/components/CheckBox/index.mjs +20 -16
- package/dist/esm/components/Chip/index.mjs +27 -17
- package/dist/esm/components/ContentEditable/index.mjs +17 -0
- package/dist/esm/components/DataTable/index.mjs +27 -21
- package/dist/esm/components/DialogBox/index.mjs +75 -0
- package/dist/esm/components/Dot/index.mjs +28 -2
- package/dist/esm/components/DraggablePanel/index.mjs +16 -20
- package/dist/esm/components/DropDown/index.mjs +25 -15
- package/dist/esm/components/ErrorSummary/index.mjs +22 -10
- package/dist/esm/components/FileIcon/index.mjs +8 -16
- package/dist/esm/components/FileList/index.mjs +40 -16
- package/dist/esm/components/FlexBox/index.mjs +39 -0
- package/dist/esm/components/FlexDiv/index.mjs +33 -3
- package/dist/esm/components/Icon/index.mjs +15 -11
- package/dist/esm/components/IconButton/index.mjs +31 -19
- package/dist/esm/components/ModalController/index.mjs +33 -9
- package/dist/esm/components/Overlay/index.mjs +30 -2
- package/dist/esm/components/Pager/index.mjs +31 -3
- package/dist/esm/components/PopMenu/index.mjs +59 -0
- package/dist/esm/components/PopMenuController/index.mjs +63 -0
- package/dist/esm/components/Progress/index.mjs +21 -11
- package/dist/esm/components/PromptInput/index.mjs +43 -21
- package/dist/esm/components/RadioButton/index.mjs +18 -14
- package/dist/esm/components/RadioButtonList/index.mjs +23 -17
- package/dist/esm/components/Slider/index.mjs +5 -23
- package/dist/esm/components/Spacer/index.mjs +2 -2
- package/dist/esm/components/Switch/index.mjs +30 -2
- package/dist/esm/components/Tab/index.mjs +51 -0
- package/dist/esm/components/TabBar/index.mjs +32 -16
- package/dist/esm/components/TextArea/index.mjs +17 -23
- package/dist/esm/components/Textfield/index.mjs +33 -17
- package/dist/esm/components/Tip/index.mjs +29 -3
- package/dist/esm/components/Toast/index.mjs +23 -13
- package/dist/esm/components/ToggleButton/index.mjs +30 -22
- package/dist/esm/components/UploadArea/index.mjs +41 -17
- package/dist/esm/components/Video/index.mjs +34 -24
- package/dist/esm/components/VideoController/index.mjs +44 -26
- package/dist/esm/hooks/useAudioRecorder.mjs +1 -1
- package/dist/esm/hooks/useBindWebRTC.mjs +12 -6
- package/dist/esm/hooks/useClipboard.mjs +9 -3
- package/dist/esm/hooks/useDoubleClick.mjs +8 -5
- package/dist/esm/hooks/useInfiniteScroll.mjs +1 -1
- package/dist/esm/hooks/useMdStreamBuffer.mjs +9 -3
- package/dist/esm/hooks/useMicrophone.mjs +1 -1
- package/dist/esm/hooks/useObserveTheme.mjs +5 -1
- package/dist/esm/hooks/useTheme.mjs +5 -1
- package/dist/esm/hooks/useToolTip.mjs +28 -33
- package/dist/esm/hooks/useTrackRenders.mjs +2 -2
- package/dist/esm/hooks/useWindow.mjs +6 -22
- package/dist/esm/hooks.mjs +16 -10
- package/dist/esm/index.mjs +96 -60
- package/dist/esm/providers/ThemeProvider.mjs +5 -1
- package/dist/esm/providers/themeServer.test.mjs +398 -403
- package/dist/esm/providers.mjs +5 -1
- package/dist/esm/stores/LocalDB.mjs +10 -4
- package/dist/esm/stores/SSE.mjs +10 -4
- package/dist/esm/stores/WS.mjs +9 -3
- package/dist/esm/stores/WebRTC.mjs +10 -4
- package/dist/esm/stores/activeTab.mjs +1 -1
- package/dist/esm/stores/browserChannel.mjs +9 -3
- package/dist/esm/stores/microphone.mjs +2 -2
- package/dist/esm/stores/modal.mjs +1 -1
- package/dist/esm/stores/popMenu.mjs +3 -0
- 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/video.mjs +1 -1
- package/dist/esm/stores/volume.mjs +2 -2
- package/dist/esm/stores/window.mjs +2 -2
- package/dist/esm/stores.mjs +28 -20
- package/dist/esm/theme/colors.mjs +479 -231
- package/dist/esm/theme/themes.mjs +6 -35
- package/dist/esm/theme/type.mjs +31 -0
- package/dist/esm/theme.mjs +5 -1
- package/dist/esm/utils/index.mjs +37 -12
- package/dist/esm/utils/objects/index.mjs +8 -8
- package/dist/esm/workers/uploads/uploads.mjs +2 -2
- package/dist/styles.css +5343 -4109
- package/dist/types/components/Attachment/Attachment.d.ts +2 -0
- package/dist/types/components/Attachment/AttachmentImagePreview.d.ts +6 -0
- package/dist/types/components/Attachment/_types.d.ts +47 -0
- package/dist/types/components/Attachment/index.d.ts +3 -0
- package/dist/types/components/Attachment/useContentThumbnail.d.ts +19 -0
- package/dist/types/components/AudioBubble/AudioBubble.d.ts +1 -1
- package/dist/types/components/AudioBubble/_types.d.ts +4 -3
- package/dist/types/components/AudioLevel/AudioLevel.d.ts +5 -0
- package/dist/types/components/AudioLevel/_types.d.ts +22 -0
- package/dist/types/components/AudioLevel/index.d.ts +2 -0
- package/dist/types/components/Avatar/Avatar.d.ts +6 -1
- package/dist/types/components/Avatar/_types.d.ts +28 -15
- package/dist/types/components/AvatarGroup/AvatarGroup.d.ts +1 -1
- package/dist/types/components/AvatarGroup/AvatarGroupContext.d.ts +7 -0
- package/dist/types/components/AvatarGroup/_types.d.ts +26 -15
- package/dist/types/components/AvatarGroup/index.d.ts +1 -1
- package/dist/types/components/Badge/Badge.d.ts +1 -1
- package/dist/types/components/Badge/_types.d.ts +11 -3
- package/dist/types/components/Button/Button.d.ts +19 -52
- package/dist/types/components/Button/_types.d.ts +18 -14
- package/dist/types/components/ButtonBar/ButtonBar.d.ts +0 -14
- package/dist/types/components/ButtonBar/_types.d.ts +16 -13
- package/dist/types/components/Camera/Camera.d.ts +2 -4
- package/dist/types/components/Camera/_types.d.ts +25 -29
- package/dist/types/components/Camera/cameraSession.d.ts +59 -0
- package/dist/types/components/Camera/index.d.ts +1 -1
- package/dist/types/components/CheckBox/CheckBox.d.ts +1 -1
- package/dist/types/components/CheckBox/_types.d.ts +16 -4
- package/dist/types/components/Chip/Chip.d.ts +1 -1
- package/dist/types/components/Chip/_types.d.ts +35 -19
- package/dist/types/components/ContentEditable/ContentEditable.d.ts +3 -0
- package/dist/types/components/ContentEditable/_types.d.ts +26 -0
- package/dist/types/components/ContentEditable/index.d.ts +2 -0
- package/dist/types/components/DataTable/DataTable.d.ts +1 -1
- package/dist/types/components/DataTable/_types.d.ts +21 -11
- package/dist/types/components/DataTable/_useResizeColumn.d.ts +1 -1
- package/dist/types/components/DataTable/_useRowWindow.d.ts +1 -0
- package/dist/types/components/DataTable/compareValues.d.ts +2 -0
- package/dist/types/components/DialogBox/DialogBox.d.ts +6 -0
- package/dist/types/components/DialogBox/_types.d.ts +68 -0
- package/dist/types/components/DialogBox/index.d.ts +3 -0
- package/dist/types/components/DialogBox/parseSections.d.ts +7 -0
- package/dist/types/components/DialogBox/sections.d.ts +20 -0
- package/dist/types/components/DialogBox/useDialogBox.d.ts +4 -0
- package/dist/types/components/Dot/Dot.d.ts +1 -1
- package/dist/types/components/Dot/_types.d.ts +8 -2
- package/dist/types/components/DraggablePanel/DrggablePanel.d.ts +5 -55
- package/dist/types/components/DraggablePanel/_types.d.ts +46 -0
- package/dist/types/components/DraggablePanel/index.d.ts +1 -0
- package/dist/types/components/DraggablePanel/panelConstraints.d.ts +3 -0
- package/dist/types/components/DropDown/_types.d.ts +45 -16
- package/dist/types/components/DropDown/resolveOptions.d.ts +11 -0
- package/dist/types/components/ErrorSummary/ErrorSummary.d.ts +30 -2
- package/dist/types/components/ErrorSummary/_types.d.ts +16 -4
- package/dist/types/components/FileIcon/FileIcon.d.ts +1 -2
- package/dist/types/components/FileIcon/_types.d.ts +11 -6
- package/dist/types/components/FileIcon/index.d.ts +2 -2
- package/dist/types/components/FileList/FileList.d.ts +2 -2
- package/dist/types/components/FileList/_types.d.ts +16 -6
- package/dist/types/components/FileList/fileListValues.d.ts +5 -0
- package/dist/types/components/FlexBox/FlexBox.d.ts +3 -0
- package/dist/types/components/FlexBox/_types.d.ts +62 -0
- package/dist/types/components/FlexBox/index.d.ts +2 -0
- package/dist/types/components/FlexDiv/FlexDiv.d.ts +2 -64
- package/dist/types/components/FlexDiv/_types.d.ts +4 -146
- package/dist/types/components/Icon/Icon.d.ts +1 -1
- package/dist/types/components/Icon/_types.d.ts +910 -133
- package/dist/types/components/Icon/iconRegistry.d.ts +3 -2
- package/dist/types/components/Icon/index.d.ts +1 -0
- package/dist/types/components/IconButton/ActionButton.d.ts +19 -0
- package/dist/types/components/IconButton/IconButton.d.ts +1 -1
- package/dist/types/components/IconButton/_types.d.ts +24 -72
- package/dist/types/components/IconButton/index.d.ts +1 -2
- package/dist/types/components/ModalController/ModalController.d.ts +2 -2
- package/dist/types/components/ModalController/ModalHostContext.d.ts +1 -0
- package/dist/types/components/ModalController/_types.d.ts +3 -5
- package/dist/types/components/ModalController/useModalHost.d.ts +3 -0
- package/dist/types/components/Overlay/Overlay.d.ts +1 -1
- package/dist/types/components/Overlay/_types.d.ts +7 -8
- package/dist/types/components/Pager/Pager.d.ts +1 -1
- package/dist/types/components/Pager/_types.d.ts +21 -5
- package/dist/types/components/Pager/pagerLogic.d.ts +9 -0
- package/dist/types/components/PopMenu/PopMenu.d.ts +3 -0
- package/dist/types/components/PopMenu/PopMenuContext.d.ts +10 -0
- package/dist/types/components/PopMenu/PopMenuGroup.d.ts +2 -0
- package/dist/types/components/PopMenu/PopMenuItem.d.ts +3 -0
- package/dist/types/components/PopMenu/_types.d.ts +110 -0
- package/dist/types/components/PopMenu/index.d.ts +4 -0
- package/dist/types/components/PopMenu/usePopMenu.d.ts +17 -0
- package/dist/types/components/PopMenu/usePopMenuPortal.d.ts +3 -0
- package/dist/types/components/PopMenuController/PopMenuController.d.ts +2 -0
- package/dist/types/components/PopMenuController/index.d.ts +1 -0
- package/dist/types/components/Progress/DoneCheck/DoneCheck.d.ts +1 -1
- package/dist/types/components/Progress/DoneCheck/_types.d.ts +5 -2
- package/dist/types/components/Progress/ProgressIndicator/ProgressIndicator.d.ts +2 -4
- package/dist/types/components/Progress/ProgressIndicator/_types.d.ts +19 -7
- package/dist/types/components/Progress/ProgressIndicator/useSpinnerPlayback.d.ts +3 -0
- package/dist/types/components/PromptInput/PromptInput.d.ts +50 -15
- package/dist/types/components/PromptInput/_types.d.ts +45 -8
- package/dist/types/components/PromptInput/index.d.ts +1 -1
- package/dist/types/components/PromptInput/promptText.d.ts +6 -0
- package/dist/types/components/RadioButton/RadioGroupContext.d.ts +11 -0
- package/dist/types/components/RadioButton/_types.d.ts +24 -13
- package/dist/types/components/RadioButtonList/_types.d.ts +17 -19
- package/dist/types/components/RadioButtonList/index.d.ts +1 -1
- package/dist/types/components/Slider/Slider.d.ts +1 -1
- package/dist/types/components/Slider/_types.d.ts +15 -9
- package/dist/types/components/Slider/sliderLogic.d.ts +6 -0
- package/dist/types/components/Spacer/index.d.ts +1 -1
- package/dist/types/components/Switch/_types.d.ts +18 -7
- package/dist/types/components/Tab/Tab.d.ts +3 -0
- package/dist/types/components/Tab/_types.d.ts +26 -0
- package/dist/types/components/Tab/index.d.ts +2 -0
- package/dist/types/components/TabBar/TabBar.d.ts +1 -1
- package/dist/types/components/TabBar/_types.d.ts +14 -37
- package/dist/types/components/TabBar/index.d.ts +1 -1
- package/dist/types/components/TabBar/shared.d.ts +22 -0
- package/dist/types/components/TextArea/TextArea.d.ts +1 -1
- package/dist/types/components/TextArea/_types.d.ts +32 -11
- package/dist/types/components/TextArea/index.d.ts +1 -1
- package/dist/types/components/Textfield/TextField.d.ts +2 -2
- package/dist/types/components/Textfield/_types.d.ts +41 -37
- package/dist/types/components/Tip/Tip.d.ts +1 -2
- package/dist/types/components/Tip/_types.d.ts +11 -18
- package/dist/types/components/Tip/useTipVisibility.d.ts +6 -0
- package/dist/types/components/Toast/Toast.d.ts +2 -2
- package/dist/types/components/Toast/_types.d.ts +25 -12
- package/dist/types/components/Toast/index.d.ts +1 -1
- package/dist/types/components/Toast/useToastLifecycle.d.ts +15 -0
- package/dist/types/components/ToggleButton/ToggleButton.d.ts +2 -2
- package/dist/types/components/ToggleButton/_types.d.ts +18 -30
- package/dist/types/components/UploadArea/UploadArea.d.ts +27 -19
- package/dist/types/components/UploadArea/_types.d.ts +23 -20
- package/dist/types/components/UploadArea/index.d.ts +1 -1
- package/dist/types/components/UploadArea/selection.d.ts +7 -0
- package/dist/types/components/UploadArea/useFileSelection.d.ts +30 -0
- package/dist/types/components/Video/Video.d.ts +2 -72
- package/dist/types/components/Video/_types.d.ts +37 -11
- package/dist/types/components/Video/getVideoControls.d.ts +3 -0
- package/dist/types/components/Video/index.d.ts +1 -1
- package/dist/types/components/VideoController/VideoController.d.ts +1 -1
- package/dist/types/components/VideoController/_types.d.ts +6 -1
- package/dist/types/components/playHelpers.d.ts +10 -233
- package/dist/types/components/sharedTypes.d.ts +31 -0
- package/dist/types/hooks/index.d.ts +1 -1
- package/dist/types/hooks/useToolTip/useToolTip.d.ts +1 -0
- package/dist/types/hooks/useWindow/useWindow.d.ts +5 -16
- package/dist/types/index.d.ts +39 -30
- package/dist/types/stores/index.d.ts +1 -0
- package/dist/types/stores/popMenu/_types.d.ts +13 -0
- package/dist/types/stores/popMenu/index.d.ts +2 -0
- package/dist/types/stores/popMenu/popMenuStore.d.ts +12 -0
- package/dist/types/stores/toast/_types.d.ts +6 -11
- package/dist/types/stores/toast/toastStore.d.ts +6 -6
- package/dist/types/stores/window/windowStore.d.ts +2 -2
- package/dist/types/theme/breakpoints/breakpoints.d.ts +11 -0
- package/dist/types/theme/colors/palette.d.ts +461 -0
- package/dist/types/theme/colors/recipes.d.ts +34 -0
- package/dist/types/theme/colors/resolveColor.d.ts +7 -0
- package/dist/types/theme/colors/types.d.ts +8 -92
- package/dist/types/theme/index.d.ts +4 -0
- package/dist/types/theme/type/type.d.ts +1 -0
- package/dist/types/theme/type/types.d.ts +3 -0
- package/dist/types/utils/audio/useAudioVisualizer.d.ts +3 -0
- package/dist/types/utils/functions/colors.d.ts +7 -0
- package/dist/types/utils/functions/files.d.ts +3 -4
- package/dist/types/utils/functions/misc.d.ts +12 -2
- package/dist/types/utils/functions/resolveColorProps.d.ts +2 -0
- package/dist/types/utils/functions/resolveShortcut.d.ts +3 -0
- package/dist/types/utils/index.d.ts +5 -1
- package/dist/types/utils/objects/audioVisualizer/audioVisualizer.d.ts +3 -0
- package/dist/types/utils/styling/getWaterTransition.d.ts +4 -0
- package/dist/types/utils/styling/reduceMotionTargets.d.ts +4 -0
- package/dist/types/utils/styling/usePrefersReducedMotion.d.ts +2 -0
- package/package.json +195 -201
- package/scripts/README.md +19 -0
- package/dist/cjs/chunks/AudioBubble-B7rjYKZR.js +0 -55
- package/dist/cjs/chunks/Avatar-_FkV6_bj.js +0 -82
- package/dist/cjs/chunks/AvatarGroup-BMOQtckJ.js +0 -41
- package/dist/cjs/chunks/Badge-CQrpFFZl.js +0 -22
- package/dist/cjs/chunks/Button-D53KhAkv.js +0 -265
- package/dist/cjs/chunks/ButtonBar-N5L7PGg6.js +0 -72
- package/dist/cjs/chunks/Camera-BULkeKNC.js +0 -380
- package/dist/cjs/chunks/CheckBox-CxQeRMKr.js +0 -51
- package/dist/cjs/chunks/Chip-D0tBR0Uq.js +0 -80
- package/dist/cjs/chunks/DivInput-D0VUXFiS.js +0 -101
- package/dist/cjs/chunks/Dot-GHGV4L29.js +0 -72
- package/dist/cjs/chunks/DrggablePanel-DSNgmB_o.js +0 -224
- package/dist/cjs/chunks/DropDown-DRcukAxl.js +0 -105
- package/dist/cjs/chunks/ErrorSummary-DWh383tt.js +0 -88
- package/dist/cjs/chunks/FileList-Cl82aFlO.js +0 -223
- package/dist/cjs/chunks/FlexDiv-CwjTwIXH.js +0 -178
- package/dist/cjs/chunks/Grouper-DjUdigNr.js +0 -63
- package/dist/cjs/chunks/Icon-B07V8-iO.js +0 -1489
- package/dist/cjs/chunks/IconButton-C8l4gN5C.js +0 -182
- package/dist/cjs/chunks/Label-BbJHiOmP.js +0 -106
- package/dist/cjs/chunks/Level-Bj5Kg1W3.js +0 -63
- package/dist/cjs/chunks/Modal-CVmIsdGy.js +0 -128
- package/dist/cjs/chunks/ModalController-DeSot1gM.js +0 -81
- package/dist/cjs/chunks/Overlay-CFoktASG.js +0 -41
- package/dist/cjs/chunks/Pager-NsKBlF0O.js +0 -36
- package/dist/cjs/chunks/ProgressIndicator-BK0eIP3-.js +0 -140
- package/dist/cjs/chunks/PromptInput-BG1-rzlA.js +0 -161
- package/dist/cjs/chunks/RadioButton-DCiNs99y.js +0 -55
- package/dist/cjs/chunks/RadioButtonList-DLdTst71.js +0 -73
- package/dist/cjs/chunks/Slider-CekvQKaG.js +0 -169
- package/dist/cjs/chunks/Spacer-C-nVP3Ic.js +0 -26
- package/dist/cjs/chunks/Switch-DkU5T0Hm.js +0 -44
- package/dist/cjs/chunks/TabBar-Dm3tMtlm.js +0 -183
- package/dist/cjs/chunks/TextArea-Drq3c8dZ.js +0 -77
- package/dist/cjs/chunks/TextField-D38gJzBN.js +0 -190
- package/dist/cjs/chunks/Tip-DMQjQT85.js +0 -89
- package/dist/cjs/chunks/Toast-sZSVZ0ND.js +0 -185
- package/dist/cjs/chunks/ToggleButton-I3AxfCqI.js +0 -45
- package/dist/cjs/chunks/UploadArea-eGZIGNi3.js +0 -132
- package/dist/cjs/chunks/Video-CK1Ui0jI.js +0 -301
- package/dist/cjs/chunks/VideoController-Z2VgDcSG.js +0 -95
- package/dist/cjs/chunks/_types-Bvz68-MM.js +0 -141
- package/dist/cjs/chunks/audioVisualizer-cC1Q8TJs.js +0 -60
- package/dist/cjs/chunks/colors-BLmUwGPt.js +0 -27
- package/dist/cjs/chunks/debounce-CiNBCKOh.js +0 -18
- package/dist/cjs/chunks/sharedTypes-CnzGgdys.js +0 -6
- package/dist/cjs/chunks/toastStore-DtZ3Woz_.js +0 -17
- package/dist/cjs/chunks/viewState-C9dAI8FG.js +0 -497
- package/dist/cjs/components/DivInput/index.js +0 -7
- package/dist/cjs/components/Grouper/index.js +0 -14
- package/dist/cjs/components/Label/index.js +0 -12
- package/dist/cjs/components/Level/index.js +0 -7
- package/dist/cjs/components/Modal/index.js +0 -15
- package/dist/esm/chunks/AudioBubble-nUxpObow.mjs +0 -69
- package/dist/esm/chunks/Avatar-tdg93uhg.mjs +0 -88
- package/dist/esm/chunks/AvatarGroup-C-8btUsy.mjs +0 -47
- package/dist/esm/chunks/Badge-BsLebku3.mjs +0 -26
- package/dist/esm/chunks/Button-BtxNw6ia.mjs +0 -283
- package/dist/esm/chunks/ButtonBar-Duch_kZq.mjs +0 -82
- package/dist/esm/chunks/Camera-CcUUY3V-.mjs +0 -398
- package/dist/esm/chunks/CheckBox-CMzqOPXk.mjs +0 -61
- package/dist/esm/chunks/Chip-fbi2OZwl.mjs +0 -92
- package/dist/esm/chunks/DivInput-C0E2-H7Q.mjs +0 -113
- package/dist/esm/chunks/Dot-CUKJwIzW.mjs +0 -78
- package/dist/esm/chunks/DrggablePanel-R5vyKmMt.mjs +0 -236
- package/dist/esm/chunks/DropDown-Dak1tC81.mjs +0 -115
- package/dist/esm/chunks/ErrorSummary-7St6DRq1.mjs +0 -101
- package/dist/esm/chunks/FileList-DxypG1gf.mjs +0 -231
- package/dist/esm/chunks/FlexDiv-CaNnli-r.mjs +0 -188
- package/dist/esm/chunks/Grouper-Cfkyb5fu.mjs +0 -83
- package/dist/esm/chunks/Icon-BZ634R5u.mjs +0 -1503
- package/dist/esm/chunks/IconButton-BW8BwWt1.mjs +0 -197
- package/dist/esm/chunks/Label-gjoEtJAw.mjs +0 -119
- package/dist/esm/chunks/Level-D4r_4yC6.mjs +0 -68
- package/dist/esm/chunks/Modal-BpeG1ufF.mjs +0 -142
- package/dist/esm/chunks/ModalController-CWJu74sJ.mjs +0 -92
- package/dist/esm/chunks/Overlay-Ctpj5rdn.mjs +0 -47
- package/dist/esm/chunks/Pager-BqAdm87r.mjs +0 -42
- package/dist/esm/chunks/ProgressIndicator-BJGyKW4y.mjs +0 -156
- package/dist/esm/chunks/PromptInput-DAAohdde.mjs +0 -175
- package/dist/esm/chunks/RadioButton-Mubr8ARW.mjs +0 -63
- package/dist/esm/chunks/RadioButtonList-Mw2IVegX.mjs +0 -81
- package/dist/esm/chunks/Slider-tbgzaids.mjs +0 -183
- package/dist/esm/chunks/Spacer-DMPc2plL.mjs +0 -28
- package/dist/esm/chunks/Switch-CV6qfAb7.mjs +0 -50
- package/dist/esm/chunks/TabBar-e13ZmdaD.mjs +0 -205
- package/dist/esm/chunks/TextArea-Bhut96m6.mjs +0 -87
- package/dist/esm/chunks/TextField-iqgBuz_w.mjs +0 -210
- package/dist/esm/chunks/Tip-BhNgf7ae.mjs +0 -99
- package/dist/esm/chunks/Toast-C4ij2wVB.mjs +0 -203
- package/dist/esm/chunks/ToggleButton-74KPRo9V.mjs +0 -53
- package/dist/esm/chunks/UploadArea-CoI7E5w5.mjs +0 -142
- package/dist/esm/chunks/Video-DPue5vFh.mjs +0 -316
- package/dist/esm/chunks/VideoController-Ce6X6aAe.mjs +0 -114
- package/dist/esm/chunks/_types-YqjUzbuI.mjs +0 -141
- package/dist/esm/chunks/audioVisualizer-_H-alvTA.mjs +0 -60
- package/dist/esm/chunks/colors-qznBTNSD.mjs +0 -30
- package/dist/esm/chunks/debounce-Ck7nvyAV.mjs +0 -19
- package/dist/esm/chunks/sharedTypes-BS0kCucU.mjs +0 -8
- package/dist/esm/chunks/toastStore-OATPs-NI.mjs +0 -15
- package/dist/esm/chunks/viewState-DHKdCOat.mjs +0 -527
- package/dist/esm/components/DivInput/index.mjs +0 -13
- package/dist/esm/components/Grouper/index.mjs +0 -47
- package/dist/esm/components/Label/index.mjs +0 -11
- package/dist/esm/components/Level/index.mjs +0 -15
- package/dist/esm/components/Modal/index.mjs +0 -57
- package/dist/types/components/DataTable/_resolveVirtualizeRows.test.d.ts +0 -1
- package/dist/types/components/DataTable/_useReorderColumns.test.d.ts +0 -1
- package/dist/types/components/DataTable/_useResizeColumn.test.d.ts +0 -1
- package/dist/types/components/DataTable/_useRowWindow.test.d.ts +0 -1
- package/dist/types/components/DataTable/columnHelper.test.d.ts +0 -1
- package/dist/types/components/DataTable/viewState.test.d.ts +0 -1
- package/dist/types/components/DivInput/DivInput.d.ts +0 -3
- package/dist/types/components/DivInput/_types.d.ts +0 -24
- package/dist/types/components/DivInput/index.d.ts +0 -2
- package/dist/types/components/Grouper/Grouper.d.ts +0 -3
- package/dist/types/components/Grouper/_types.d.ts +0 -20
- package/dist/types/components/Grouper/index.d.ts +0 -2
- package/dist/types/components/Icon/iconRegistry.test.d.ts +0 -1
- package/dist/types/components/IconButton/_animation.d.ts +0 -18
- package/dist/types/components/IconButton/_animation.test.d.ts +0 -1
- package/dist/types/components/Label/Label.d.ts +0 -3
- package/dist/types/components/Label/_types.d.ts +0 -25
- package/dist/types/components/Label/index.d.ts +0 -3
- package/dist/types/components/Level/Level.d.ts +0 -5
- package/dist/types/components/Level/_types.d.ts +0 -21
- package/dist/types/components/Level/index.d.ts +0 -2
- package/dist/types/components/Modal/Modal.d.ts +0 -3
- package/dist/types/components/Modal/_types.d.ts +0 -49
- package/dist/types/components/Modal/index.d.ts +0 -2
- package/dist/types/hooks/useActiveTab/useActiveTab.test.d.ts +0 -1
- package/dist/types/hooks/useAudioRecorder/useAudioRecorder.test.d.ts +0 -1
- package/dist/types/hooks/useBindWebRTC/useBindWebRTC.test.d.ts +0 -1
- package/dist/types/hooks/useClipboard/useClipboard.test.d.ts +0 -1
- package/dist/types/hooks/useDoubleClick/useDoubleClick.test.d.ts +0 -1
- package/dist/types/hooks/useInfiniteScroll/useInfiniteScroll.test.d.ts +0 -1
- package/dist/types/hooks/useIntersecting/useIntersecting.test.d.ts +0 -1
- package/dist/types/hooks/useKeyboardShortcuts/useKeyboardShortcuts.test.d.ts +0 -1
- package/dist/types/hooks/useLastUpdated/useLastUpdated.test.d.ts +0 -1
- package/dist/types/hooks/useLocalStore/useLocalStore.test.d.ts +0 -1
- package/dist/types/hooks/useMdStreamBuffer/useMdStreamBuffer.test.d.ts +0 -1
- package/dist/types/hooks/useMicrophone/useMicrophone.test.d.ts +0 -1
- package/dist/types/hooks/useObserveTheme/useObserveTheme.test.d.ts +0 -1
- package/dist/types/hooks/useTheme/useTheme.test.d.ts +0 -1
- package/dist/types/hooks/useToolTip/useToolTip.test.d.ts +0 -1
- package/dist/types/hooks/useTrackRenders/useTrackRenders.test.d.ts +0 -1
- package/dist/types/hooks/useWindow/useWindow.test.d.ts +0 -1
- package/dist/types/providers/themeServer.test.d.ts +0 -1
- package/dist/types/stores/LocalDB/localDBStore.test.d.ts +0 -1
- package/dist/types/stores/SSE/sseStore.test.d.ts +0 -1
- package/dist/types/stores/WS/wsStore.test.d.ts +0 -1
- package/dist/types/stores/WebRTC/webRTCStore.test.d.ts +0 -1
- package/dist/types/stores/activeTab/activeTabStore.test.d.ts +0 -1
- package/dist/types/stores/browserChannel/browserChannelsStore.test.d.ts +0 -1
- package/dist/types/stores/microphone/microphoneStore.test.d.ts +0 -1
- package/dist/types/stores/modal/modalStore.test.d.ts +0 -1
- package/dist/types/stores/tip/tipStore.test.d.ts +0 -1
- package/dist/types/stores/toast/toastStore.test.d.ts +0 -1
- package/dist/types/stores/uploads/uploadsStore.test.d.ts +0 -1
- package/dist/types/stores/video/videoStore.test.d.ts +0 -1
- package/dist/types/stores/volume/volumeStore.test.d.ts +0 -1
- package/dist/types/stores/window/windowStore.test.d.ts +0 -1
- package/dist/types/utils/functions/colors.test.d.ts +0 -1
- package/dist/types/utils/functions/debounce.test.d.ts +0 -1
- package/dist/types/utils/functions/files.test.d.ts +0 -1
- package/dist/types/utils/functions/misc.test.d.ts +0 -1
- package/dist/types/utils/functions/rafThrottle.test.d.ts +0 -1
- package/dist/types/utils/objects/IndexedDB/IndexedDB.test.d.ts +0 -1
- package/dist/types/utils/objects/MDStreamBuffer/MdStreamBuffer.test.d.ts +0 -1
- package/dist/types/utils/objects/SSEConnection/SSEConnection.test.d.ts +0 -1
- package/dist/types/utils/objects/WSConnection/WSConnection.test.d.ts +0 -1
- package/dist/types/utils/objects/WebRTCConnection/WebRTCConnection.test.d.ts +0 -1
- package/dist/types/utils/objects/audioVisualizer/audioVisualizer.test.d.ts +0 -1
- package/dist/types/utils/objects/browserChannel/broadcastChannel.test.d.ts +0 -1
- package/dist/types/workers/uploads/uploads-worker.test.d.ts +0 -1
- /package/dist/cjs/chunks/{MdStreamBuffer-BwrT84Xh.js → MdStreamBuffer-B0KtaR_k.js} +0 -0
- /package/dist/cjs/chunks/{SSEConnection-Dciti25t.js → SSEConnection-BXWkgT66.js} +0 -0
- /package/dist/cjs/chunks/{activeTabStore-qP5wXhKH.js → activeTabStore-D2gxAoK6.js} +0 -0
- /package/dist/cjs/chunks/{broadcastChannel-BV0gIfvH.js → broadcastChannel-DdPZ3LUB.js} +0 -0
- /package/dist/cjs/chunks/{magic-string.es-Vs_88NMN.js → magic-string.es-DsAR0Q7u.js} +0 -0
- /package/dist/cjs/chunks/{rafThrottle-BlnxmQVH.js → rafThrottle-BRdLzPo7.js} +0 -0
- /package/dist/cjs/chunks/{tipStore-K8csyK2D.js → tipStore-DDHyGeyK.js} +0 -0
- /package/dist/cjs/chunks/{tslib.es6-DL37Dyu4.js → tslib.es6-B8JY5ZGw.js} +0 -0
- /package/dist/cjs/chunks/{videoStore-CR0cDt-h.js → videoStore-B0l9iBw4.js} +0 -0
- /package/dist/esm/chunks/{MdStreamBuffer-DFtBr080.mjs → MdStreamBuffer-CcO5IBxD.mjs} +0 -0
- /package/dist/esm/chunks/{SSEConnection-Djeh2C5G.mjs → SSEConnection-B5rVxalP.mjs} +0 -0
- /package/dist/esm/chunks/{activeTabStore-DSluAldJ.mjs → activeTabStore-CCstpXAC.mjs} +0 -0
- /package/dist/esm/chunks/{broadcastChannel-B2yT2lpA.mjs → broadcastChannel-CPT0S33H.mjs} +0 -0
- /package/dist/esm/chunks/{magic-string.es-Cm4dLOmN.mjs → magic-string.es-CI4cCGRB.mjs} +0 -0
- /package/dist/esm/chunks/{rafThrottle-CJcLGMwV.mjs → rafThrottle-Dl8Z5sJ-.mjs} +0 -0
- /package/dist/esm/chunks/{tipStore-BrCvK80A.mjs → tipStore-CBvk303u.mjs} +0 -0
- /package/dist/esm/chunks/{tslib.es6-DiR-r3pp.mjs → tslib.es6-CpnJrDBv.mjs} +0 -0
- /package/dist/esm/chunks/{videoStore-CLWsJ-oG.mjs → videoStore-Cd-Lewfy.mjs} +0 -0
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
"use strict";
|
|
3
|
+
|
|
4
|
+
var tslib_es6 = require("./tslib.es6-B8JY5ZGw.js"), jsxRuntime = require("react/jsx-runtime"), React = require("react"), misc = require("./misc-PmT7cZzC.js"), resolveColorProps = require("./resolveColorProps-DE1k1P-Z.js"), Icon = require("./Icon-COY7IZkK.js"), css = {
|
|
5
|
+
wrapper: "CheckBox-module_wrapper__uRsjI",
|
|
6
|
+
icon: "CheckBox-module_icon__FoDJN",
|
|
7
|
+
label: "CheckBox-module_label__0AiBp",
|
|
8
|
+
xs: "CheckBox-module_xs__8HP4h type-module_body-xs-regular__ZAFft",
|
|
9
|
+
s: "CheckBox-module_s__qWZbK type-module_body-s-regular__vRHSP",
|
|
10
|
+
m: "CheckBox-module_m__cOkhr type-module_body-m-regular__LuQBA",
|
|
11
|
+
l: "CheckBox-module_l__wz2rr type-module_body-l-regular__lOYbg",
|
|
12
|
+
xl: "CheckBox-module_xl__exBbQ type-module_body-xl-regular__pF2kC"
|
|
13
|
+
};
|
|
14
|
+
|
|
15
|
+
const CheckBox = React.memo(rawProps => {
|
|
16
|
+
var _a;
|
|
17
|
+
const props = resolveColorProps.resolveColorProps(rawProps), {align: align = "middle", children: children, label: label, checked: checked = !1, disabled: disabled = !1, iconChecked: iconChecked = "system.checkbox-checked", iconUnChecked: iconUnChecked = "system.checkbox", iconPartial: iconPartial = "system.checkbox-partial", iconColor: iconColor, iconColorSelected: iconColorSelected, iconSize: iconSize = 20, gap: gap = 6, textColor: textColor, textSize: textSize = "m", textTopOffset: textTopOffset = 0, onChange: onChange, onClick: onClick, onKeyDown: onKeyDown, tabIndex: tabIndex = 0, "aria-label": ariaLabel, "aria-labelledby": ariaLabelledBy, className: className, style: style} = props, rest = tslib_es6.__rest(props, [ "align", "children", "label", "checked", "disabled", "iconChecked", "iconUnChecked", "iconPartial", "iconColor", "iconColorSelected", "iconSize", "gap", "textColor", "textSize", "textTopOffset", "onChange", "onClick", "onKeyDown", "tabIndex", "aria-label", "aria-labelledby", "className", "style" ]), [state, setState] = React.useState(checked), contentId = React.useId(), content = null != label ? label : children, hasContent = null != content && !1 !== content;
|
|
18
|
+
React.useEffect(() => setState(checked), [ checked ]);
|
|
19
|
+
const iconName = !0 === state ? iconChecked : "mixed" === state ? iconPartial : iconUnChecked, selectedIconColor = !1 !== state ? iconColorSelected : void 0, resolvedIconColor = null !== (_a = null != selectedIconColor ? selectedIconColor : iconColor) && void 0 !== _a ? _a : disabled ? "var(--core-icon-disabled)" : "mixed" === state ? "var(--core-icon-primary)" : state ? "var(--core-text-special)" : "var(--core-icon-secondary)", resolvedTextColor = null != textColor ? textColor : disabled ? "var(--core-text-disabled)" : "var(--core-text-primary)", offset = Number.isFinite(textTopOffset) ? textTopOffset : 0, textShift = "top" === align ? Math.min(offset, 0) : "bottom" === align ? Math.max(offset, 0) : offset / 2, cssVars = {
|
|
20
|
+
"--cb-align": "top" === align ? "flex-start" : "bottom" === align ? "flex-end" : "center",
|
|
21
|
+
"--cb-icon-size": `${iconSize}px`,
|
|
22
|
+
"--cb-gap": `${gap}px`,
|
|
23
|
+
"--cb-text-color": resolvedTextColor,
|
|
24
|
+
"--cb-text-padding-top": `${Math.max(offset, 0)}px`,
|
|
25
|
+
"--cb-text-padding-bottom": `${Math.max(-offset, 0)}px`,
|
|
26
|
+
"--cb-text-shift": `${textShift}px`,
|
|
27
|
+
"--cb-cursor": disabled ? "default" : "pointer"
|
|
28
|
+
}, handleToggle = () => {
|
|
29
|
+
if (disabled) return;
|
|
30
|
+
const next = !0 !== state;
|
|
31
|
+
setState(next), null == onChange || onChange(next);
|
|
32
|
+
};
|
|
33
|
+
return jsxRuntime.jsxs("div", Object.assign({}, rest, {
|
|
34
|
+
className: `${css.wrapper}${className ? ` ${className}` : ""}`,
|
|
35
|
+
style: Object.assign(Object.assign({}, style), cssVars),
|
|
36
|
+
role: "checkbox",
|
|
37
|
+
"aria-checked": state,
|
|
38
|
+
"aria-disabled": disabled,
|
|
39
|
+
"aria-label": null != ariaLabel ? ariaLabel : ariaLabelledBy ? void 0 : label,
|
|
40
|
+
"aria-labelledby": null != ariaLabelledBy ? ariaLabelledBy : void 0 === ariaLabel && void 0 === label && hasContent ? contentId : void 0,
|
|
41
|
+
tabIndex: disabled ? -1 : tabIndex,
|
|
42
|
+
onClick: event => {
|
|
43
|
+
null == onClick || onClick(event), event.defaultPrevented || handleToggle();
|
|
44
|
+
},
|
|
45
|
+
onKeyDown: event => {
|
|
46
|
+
null == onKeyDown || onKeyDown(event), event.defaultPrevented || misc.accessibleKeyDown(event, handleToggle);
|
|
47
|
+
},
|
|
48
|
+
children: [ jsxRuntime.jsx("span", {
|
|
49
|
+
className: css.icon,
|
|
50
|
+
"aria-hidden": "true",
|
|
51
|
+
children: jsxRuntime.jsx(Icon.Icon, {
|
|
52
|
+
name: iconName,
|
|
53
|
+
strokeColor: resolvedIconColor,
|
|
54
|
+
size: iconSize,
|
|
55
|
+
pointer: !1,
|
|
56
|
+
tabIndex: -1
|
|
57
|
+
})
|
|
58
|
+
}), hasContent && jsxRuntime.jsx("span", {
|
|
59
|
+
id: contentId,
|
|
60
|
+
className: `${css.label} ${css[textSize]}`,
|
|
61
|
+
children: content
|
|
62
|
+
}) ]
|
|
63
|
+
}));
|
|
64
|
+
});
|
|
65
|
+
|
|
66
|
+
exports.CheckBox = CheckBox;
|
|
@@ -0,0 +1,203 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
"use strict";
|
|
3
|
+
|
|
4
|
+
var tslib_es6 = require("./tslib.es6-B8JY5ZGw.js"), jsxRuntime = require("react/jsx-runtime"), react = require("motion/react"), React = require("react"), hooks_useTheme = require("../hooks/useTheme.js"), misc = require("./misc-PmT7cZzC.js"), theme_corners = require("../theme/corners.js"), resolveColorProps = require("./resolveColorProps-DE1k1P-Z.js"), usePrefersReducedMotion = require("./usePrefersReducedMotion-GpD17CAE.js"), Icon = require("./Icon-COY7IZkK.js"), sharedTypes = require("./sharedTypes-BDMIewR9.js"), css = {
|
|
5
|
+
chip: "Chip-module_chip__0nys-",
|
|
6
|
+
action: "Chip-module_action__-EHB0",
|
|
7
|
+
remove: "Chip-module_remove__PcFU2",
|
|
8
|
+
content: "Chip-module_content__1dG8p",
|
|
9
|
+
icon: "Chip-module_icon__dtR-K",
|
|
10
|
+
xs: "Chip-module_xs__s-KNG type-module_body-xs-regular__ZAFft",
|
|
11
|
+
s: "Chip-module_s__2KTXi type-module_body-s-regular__vRHSP",
|
|
12
|
+
m: "Chip-module_m__l2u3N type-module_body-m-regular__LuQBA",
|
|
13
|
+
l: "Chip-module_l__3MqPN type-module_body-l-regular__lOYbg",
|
|
14
|
+
xl: "Chip-module_xl__iJX-F type-module_body-xl-regular__pF2kC"
|
|
15
|
+
};
|
|
16
|
+
|
|
17
|
+
function ChipPresence({children: children}) {
|
|
18
|
+
return children(react.useIsPresent());
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
const Chip = React.memo(rawProps => {
|
|
22
|
+
var _a;
|
|
23
|
+
const props = resolveColorProps.resolveColorProps(rawProps), interactive = Boolean(props.onClick || props.onRemove), {onClick: onClick, onRemove: onRemove, removeLabel: removeLabel, selected: selected, textColorSelected: textColorSelected = "var(--core-text-special)", iconColorSelected: iconColorSelected = "var(--core-text-special)", backgroundColorSelected: backgroundColorSelected = "var(--core-surface-secondary)", borderColorSelected: borderColorSelected = "transparent", layout: layout = void 0 !== selected, transition: transition, children: children, label: label, icon: icon, tooltip: tooltip, iconSize: iconSize = 16, disabled: disabled = !1, iconPosition: iconPosition = "left", textSize: textSize = "m", textColor: textColor = "var(--core-text-primary)", textColorHover: textColorHover = (interactive ? "var(--core-text-special)" : textColor), iconColor: iconColor = "var(--core-text-primary)", iconColorHover: iconColorHover = (interactive ? "var(--core-text-special)" : iconColor), backgroundColor: backgroundColor = "var(--core-fill-primary)", backgroundColorHover: backgroundColorHover = (interactive ? "var(--core-fill-primary)" : backgroundColor), borderWidth: borderWidth = 0, borderColor: borderColor = "var(--core-outline-primary)", borderColorHover: borderColorHover = (interactive ? "var(--core-text-special)" : borderColor), borderColorDisabled: borderColorDisabled = "var(--core-fill-primary)", borderRadius: borderRadius = theme_corners.corners["corner-l"], padding: padding, paddingTop: paddingTop, paddingRight: paddingRight, paddingBottom: paddingBottom, paddingLeft: paddingLeft, gap: gap = 4, onToolTip: onToolTip, className: className, style: style} = props, nativeAttributes = tslib_es6.__rest(props, [ "onClick", "onRemove", "removeLabel", "selected", "textColorSelected", "iconColorSelected", "backgroundColorSelected", "borderColorSelected", "layout", "transition", "children", "label", "icon", "tooltip", "iconSize", "disabled", "iconPosition", "textSize", "textColor", "textColorHover", "iconColor", "iconColorHover", "backgroundColor", "backgroundColorHover", "borderWidth", "borderColor", "borderColorHover", "borderColorDisabled", "borderRadius", "padding", "paddingTop", "paddingRight", "paddingBottom", "paddingLeft", "gap", "onToolTip", "className", "style" ]), rootRef = React.useRef(null), reduceMotion = usePrefersReducedMotion.usePrefersReducedMotion(), [removed, setRemoved] = React.useState(!1), pendingRemoval = React.useRef(null), waterCurve = null === (_a = hooks_useTheme.useTheme().current.motion["motion-water"].match(/cubic-bezier\(([^)]+)\)/)) || void 0 === _a ? void 0 : _a[1].split(",").map(Number), waterEase = 4 === (null == waterCurve ? void 0 : waterCurve.length) && waterCurve.every(Number.isFinite) ? waterCurve : [ .36, 0, .64, 1 ], layoutTransition = reduceMotion ? {
|
|
24
|
+
duration: 0
|
|
25
|
+
} : null != transition ? transition : {
|
|
26
|
+
type: "tween",
|
|
27
|
+
duration: .15,
|
|
28
|
+
ease: waterEase
|
|
29
|
+
}, animateLayout = layout && !reduceMotion, hovered = React.useRef(!1), focused = React.useRef(!1), content = null != label ? label : children, hasContent = null != content && !1 !== content && "" !== content, compact = "xs" === textSize || "s" === textSize, vertical = compact ? "var(--spacing-xs)" : "var(--spacing-s)", horizontal = compact ? "var(--spacing-s)" : "var(--spacing-m)", iconSide = `calc(${horizontal} - var(--spacing-${compact ? "xxs" : "xs"}))`, iconOnly = Boolean(icon) && !hasContent, hasLeadingIcon = Boolean(icon) && ("left" === iconPosition || iconOnly), hasTrailingIcon = Boolean(onRemove) || Boolean(icon) && ("right" === iconPosition || iconOnly), paddingSides = {
|
|
30
|
+
paddingTop: void 0 === paddingTop ? void 0 : misc.setStyle(paddingTop),
|
|
31
|
+
paddingRight: void 0 === paddingRight ? void 0 : misc.setStyle(paddingRight),
|
|
32
|
+
paddingBottom: void 0 === paddingBottom ? void 0 : misc.setStyle(paddingBottom),
|
|
33
|
+
paddingLeft: void 0 === paddingLeft ? void 0 : misc.setStyle(paddingLeft)
|
|
34
|
+
}, stateColor = (normal, selectedColor, disabledColor = normal) => disabled ? disabledColor : selected ? selectedColor : normal, cssVars = {
|
|
35
|
+
"--ui-chip-padding": void 0 === padding ? void 0 : misc.setStyle(padding),
|
|
36
|
+
"--ui-chip-padding-top": vertical,
|
|
37
|
+
"--ui-chip-padding-right": hasTrailingIcon ? iconSide : horizontal,
|
|
38
|
+
"--ui-chip-padding-bottom": vertical,
|
|
39
|
+
"--ui-chip-padding-left": hasLeadingIcon ? iconSide : horizontal,
|
|
40
|
+
"--ui-chip-gap": `${gap}px`,
|
|
41
|
+
"--ui-chip-icon-size": `${iconSize}px`,
|
|
42
|
+
"--ui-chip-border-radius": misc.setStyle(borderRadius),
|
|
43
|
+
"--ui-chip-border-width": `${borderWidth}px`,
|
|
44
|
+
"--ui-chip-border-color": stateColor(borderColor, borderColorSelected, borderColorDisabled),
|
|
45
|
+
"--ui-chip-border-color-hover": stateColor(borderColorHover, borderColorSelected, borderColorDisabled),
|
|
46
|
+
"--ui-chip-bg-color": stateColor(backgroundColor, backgroundColorSelected),
|
|
47
|
+
"--ui-chip-bg-color-hover": stateColor(backgroundColorHover, backgroundColorSelected, backgroundColor),
|
|
48
|
+
"--ui-chip-text-color": stateColor(textColor, textColorSelected, "var(--core-text-disabled)"),
|
|
49
|
+
"--ui-chip-text-color-hover": stateColor(textColorHover, textColorSelected, "var(--core-text-disabled)"),
|
|
50
|
+
"--ui-chip-icon-color": stateColor(iconColor, iconColorSelected, "var(--core-text-disabled)"),
|
|
51
|
+
"--ui-chip-icon-color-hover": stateColor(iconColorHover, iconColorSelected, "var(--core-text-disabled)"),
|
|
52
|
+
"--ui-chip-cursor": disabled || !interactive ? "default" : "pointer"
|
|
53
|
+
}, iconContent = icon ? jsxRuntime.jsx("span", {
|
|
54
|
+
className: css.icon,
|
|
55
|
+
"aria-hidden": "true",
|
|
56
|
+
children: jsxRuntime.jsx(Icon.Icon, {
|
|
57
|
+
name: icon,
|
|
58
|
+
size: iconSize,
|
|
59
|
+
strokeColor: "currentColor",
|
|
60
|
+
pointer: !1,
|
|
61
|
+
tabIndex: -1
|
|
62
|
+
})
|
|
63
|
+
}) : null, contentNodes = jsxRuntime.jsxs(react.motion.span, {
|
|
64
|
+
className: css.content,
|
|
65
|
+
layout: !!animateLayout && "position",
|
|
66
|
+
transition: {
|
|
67
|
+
layout: layoutTransition
|
|
68
|
+
},
|
|
69
|
+
children: [ "left" === iconPosition && iconContent, hasContent && jsxRuntime.jsx("span", {
|
|
70
|
+
className: css[textSize],
|
|
71
|
+
children: content
|
|
72
|
+
}), "right" === iconPosition && iconContent ]
|
|
73
|
+
}), actionShared = {
|
|
74
|
+
className: css.action,
|
|
75
|
+
"aria-disabled": !!disabled || nativeAttributes["aria-disabled"],
|
|
76
|
+
style: Object.assign(Object.assign({}, paddingSides), {
|
|
77
|
+
paddingRight: onRemove ? void 0 : paddingSides.paddingRight
|
|
78
|
+
})
|
|
79
|
+
};
|
|
80
|
+
function handlers(attributes) {
|
|
81
|
+
const showTooltip = event => {
|
|
82
|
+
tooltip && (null == onToolTip || onToolTip({
|
|
83
|
+
type: sharedTypes.ToolTipType.button,
|
|
84
|
+
payload: {
|
|
85
|
+
label: tooltip
|
|
86
|
+
},
|
|
87
|
+
ref: rootRef,
|
|
88
|
+
event: event
|
|
89
|
+
}));
|
|
90
|
+
};
|
|
91
|
+
return {
|
|
92
|
+
onClick: event => {
|
|
93
|
+
var _a;
|
|
94
|
+
disabled ? event.preventDefault() : (null === (_a = attributes.onClick) || void 0 === _a || _a.call(attributes, event),
|
|
95
|
+
null == onToolTip || onToolTip(null));
|
|
96
|
+
},
|
|
97
|
+
onMouseEnter: event => {
|
|
98
|
+
var _a;
|
|
99
|
+
null === (_a = attributes.onMouseEnter) || void 0 === _a || _a.call(attributes, event),
|
|
100
|
+
event.defaultPrevented || (hovered.current = !0, showTooltip(event));
|
|
101
|
+
},
|
|
102
|
+
onMouseLeave: event => {
|
|
103
|
+
var _a;
|
|
104
|
+
null === (_a = attributes.onMouseLeave) || void 0 === _a || _a.call(attributes, event),
|
|
105
|
+
hovered.current = !1, focused.current || null == onToolTip || onToolTip(null);
|
|
106
|
+
},
|
|
107
|
+
onFocus: event => {
|
|
108
|
+
var _a;
|
|
109
|
+
null === (_a = attributes.onFocus) || void 0 === _a || _a.call(attributes, event),
|
|
110
|
+
event.defaultPrevented || (focused.current = !0, showTooltip());
|
|
111
|
+
},
|
|
112
|
+
onBlur: event => {
|
|
113
|
+
var _a;
|
|
114
|
+
null === (_a = attributes.onBlur) || void 0 === _a || _a.call(attributes, event),
|
|
115
|
+
focused.current = !1, hovered.current || null == onToolTip || onToolTip(null);
|
|
116
|
+
}
|
|
117
|
+
};
|
|
118
|
+
}
|
|
119
|
+
const primary = onClick ? (() => {
|
|
120
|
+
var _a;
|
|
121
|
+
const attributes = nativeAttributes;
|
|
122
|
+
return jsxRuntime.jsx("button", Object.assign({}, attributes, actionShared, handlers(Object.assign(Object.assign({}, attributes), {
|
|
123
|
+
onClick: onClick
|
|
124
|
+
})), {
|
|
125
|
+
type: null !== (_a = attributes.type) && void 0 !== _a ? _a : "button",
|
|
126
|
+
disabled: disabled,
|
|
127
|
+
"aria-pressed": selected,
|
|
128
|
+
children: contentNodes
|
|
129
|
+
}));
|
|
130
|
+
})() : (() => {
|
|
131
|
+
const attributes = nativeAttributes;
|
|
132
|
+
return jsxRuntime.jsx("span", Object.assign({}, attributes, actionShared, handlers(attributes), {
|
|
133
|
+
children: contentNodes
|
|
134
|
+
}));
|
|
135
|
+
})(), readableLabel = null != label ? label : "string" == typeof children || "number" == typeof children ? String(children) : void 0, removalName = null != removeLabel ? removeLabel : readableLabel ? `Remove ${readableLabel}` : "Remove chip";
|
|
136
|
+
return jsxRuntime.jsx(react.AnimatePresence, {
|
|
137
|
+
initial: !1,
|
|
138
|
+
onExitComplete: () => {
|
|
139
|
+
const notify = pendingRemoval.current;
|
|
140
|
+
pendingRemoval.current = null, null == notify || notify();
|
|
141
|
+
},
|
|
142
|
+
children: !removed && jsxRuntime.jsx(ChipPresence, {
|
|
143
|
+
children: isPresent => jsxRuntime.jsxs(react.motion.span, {
|
|
144
|
+
ref: rootRef,
|
|
145
|
+
className: `${css.chip}${className ? ` ${className}` : ""}`,
|
|
146
|
+
style: Object.assign(Object.assign({}, cssVars), style),
|
|
147
|
+
layout: animateLayout,
|
|
148
|
+
initial: !1,
|
|
149
|
+
animate: {
|
|
150
|
+
opacity: 1,
|
|
151
|
+
scale: 1
|
|
152
|
+
},
|
|
153
|
+
exit: reduceMotion ? {
|
|
154
|
+
opacity: 1,
|
|
155
|
+
scale: 1
|
|
156
|
+
} : {
|
|
157
|
+
opacity: 0,
|
|
158
|
+
scale: .9
|
|
159
|
+
},
|
|
160
|
+
transition: Object.assign(Object.assign({}, layoutTransition), {
|
|
161
|
+
layout: layoutTransition
|
|
162
|
+
}),
|
|
163
|
+
inert: !isPresent,
|
|
164
|
+
"aria-hidden": !isPresent || void 0,
|
|
165
|
+
"data-selected": !0 === selected ? "true" : void 0,
|
|
166
|
+
"data-removable": onRemove ? "true" : void 0,
|
|
167
|
+
children: [ primary, onRemove && jsxRuntime.jsx("button", {
|
|
168
|
+
className: css.remove,
|
|
169
|
+
style: Object.assign(Object.assign({}, paddingSides), {
|
|
170
|
+
paddingLeft: 0
|
|
171
|
+
}),
|
|
172
|
+
type: "button",
|
|
173
|
+
"aria-label": removalName,
|
|
174
|
+
disabled: disabled,
|
|
175
|
+
onClick: event => {
|
|
176
|
+
if (event.stopPropagation(), pendingRemoval.current) return;
|
|
177
|
+
const removalEvent = Object.assign(Object.assign({}, event), {
|
|
178
|
+
currentTarget: event.currentTarget
|
|
179
|
+
});
|
|
180
|
+
pendingRemoval.current = () => onRemove(removalEvent), setRemoved(!0), null == onToolTip || onToolTip(null);
|
|
181
|
+
},
|
|
182
|
+
children: jsxRuntime.jsx(react.motion.span, {
|
|
183
|
+
layout: !!animateLayout && "position",
|
|
184
|
+
transition: {
|
|
185
|
+
layout: layoutTransition
|
|
186
|
+
},
|
|
187
|
+
className: css.icon,
|
|
188
|
+
"aria-hidden": "true",
|
|
189
|
+
children: jsxRuntime.jsx(Icon.Icon, {
|
|
190
|
+
name: "basic.cross",
|
|
191
|
+
size: iconSize,
|
|
192
|
+
strokeColor: "currentColor",
|
|
193
|
+
pointer: !1,
|
|
194
|
+
tabIndex: -1
|
|
195
|
+
})
|
|
196
|
+
})
|
|
197
|
+
}) ]
|
|
198
|
+
})
|
|
199
|
+
}, "chip")
|
|
200
|
+
});
|
|
201
|
+
});
|
|
202
|
+
|
|
203
|
+
exports.Chip = Chip;
|
|
@@ -0,0 +1,144 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
"use strict";
|
|
3
|
+
|
|
4
|
+
var tslib_es6 = require("./tslib.es6-B8JY5ZGw.js"), jsxRuntime = require("react/jsx-runtime"), React = require("react"), misc = require("./misc-PmT7cZzC.js"), theme_corners = require("../theme/corners.js"), resolveColorProps = require("./resolveColorProps-DE1k1P-Z.js"), css = {
|
|
5
|
+
input: "ContentEditable-module_input__fFaaA",
|
|
6
|
+
xs: "ContentEditable-module_xs__xo-26 type-module_body-xs-regular__ZAFft",
|
|
7
|
+
s: "ContentEditable-module_s__Pe-jp type-module_body-s-regular__vRHSP",
|
|
8
|
+
m: "ContentEditable-module_m__DbJgE type-module_body-m-regular__LuQBA",
|
|
9
|
+
l: "ContentEditable-module_l__zy7GY type-module_body-l-regular__lOYbg",
|
|
10
|
+
xl: "ContentEditable-module_xl__vdqCU type-module_body-xl-regular__pF2kC"
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
const useClientLayoutEffect = "undefined" == typeof window ? React.useEffect : React.useLayoutEffect, singleLine = text => text.replace(/[\r\n\t]+/g, " ");
|
|
14
|
+
|
|
15
|
+
function selectText(element, all) {
|
|
16
|
+
const selection = element.ownerDocument.getSelection();
|
|
17
|
+
if (!selection) return;
|
|
18
|
+
const range = element.ownerDocument.createRange();
|
|
19
|
+
range.selectNodeContents(element), all || range.collapse(!1), selection.removeAllRanges(),
|
|
20
|
+
selection.addRange(range);
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
function ContentEditableComponent(rawProps) {
|
|
24
|
+
const props = resolveColorProps.resolveColorProps(rawProps), {name: name = "Editable text", value: value, defaultValue: defaultValue = "", isEditable: isEditable = !1, selectOnEdit: selectOnEdit = !1, placeholder: placeholder = "Untitled", width: width = "auto", textAlign: textAlign = "left", textSize: textSize, textColor: textColor, textColorPlaceholder: textColorPlaceholder = "var(--core-text-tertiary)", clamp: clamp = 0, padding: padding = 0, borderRadius: borderRadius = theme_corners.corners["corner-xs"], backgroundColor: backgroundColor = "var(--core-surface-secondary)", onChange: onChange, onCommit: onCommit, onEditStart: onEditStart, onEditEnd: onEditEnd, onInput: onInput, onKeyDown: onKeyDown, onFocus: onFocus, onBlur: onBlur, onPaste: onPaste, onCompositionStart: onCompositionStart, onCompositionEnd: onCompositionEnd, tabIndex: tabIndex, className: className, style: style} = props, attributes = tslib_es6.__rest(props, [ "name", "value", "defaultValue", "isEditable", "selectOnEdit", "placeholder", "width", "textAlign", "textSize", "textColor", "textColorPlaceholder", "clamp", "padding", "borderRadius", "backgroundColor", "onChange", "onCommit", "onEditStart", "onEditEnd", "onInput", "onKeyDown", "onFocus", "onBlur", "onPaste", "onCompositionStart", "onCompositionEnd", "tabIndex", "className", "style" ]), controlled = void 0 !== value, [localValue, setLocalValue] = React.useState(defaultValue), committed = controlled ? null != value ? value : "" : localValue, firstText = React.useRef(committed), ref = React.useRef(null), session = React.useRef({
|
|
25
|
+
active: !1,
|
|
26
|
+
initial: committed
|
|
27
|
+
}), draftRef = React.useRef(committed), composing = React.useRef(!1), [draft, setDraft] = React.useState(committed), [isFocused, setIsFocused] = React.useState(!1), syncText = text => {
|
|
28
|
+
ref.current && ref.current.textContent !== text && (ref.current.textContent = text),
|
|
29
|
+
draftRef.current = text, setDraft(text);
|
|
30
|
+
}, start = () => {
|
|
31
|
+
session.current.active || (session.current = {
|
|
32
|
+
active: !0,
|
|
33
|
+
initial: committed
|
|
34
|
+
}, syncText(committed));
|
|
35
|
+
}, publish = () => {
|
|
36
|
+
var _a;
|
|
37
|
+
if (!session.current.active || !ref.current) return;
|
|
38
|
+
const next = singleLine(null !== (_a = ref.current.textContent) && void 0 !== _a ? _a : "");
|
|
39
|
+
next !== draftRef.current && (draftRef.current = next, setDraft(next), null == onChange || onChange(next));
|
|
40
|
+
}, finish = (reason, blur = !0) => {
|
|
41
|
+
var _a, _b;
|
|
42
|
+
if (!session.current.active) return;
|
|
43
|
+
const previous = session.current.initial, next = singleLine(null !== (_b = null === (_a = ref.current) || void 0 === _a ? void 0 : _a.textContent) && void 0 !== _b ? _b : draftRef.current);
|
|
44
|
+
session.current.active = !1, composing.current = !1, "escape" === reason ? syncText(committed) : (draftRef.current = next,
|
|
45
|
+
setDraft(next), controlled || setLocalValue(next));
|
|
46
|
+
try {
|
|
47
|
+
"escape" !== reason && next !== previous && (null == onCommit || onCommit(next, previous));
|
|
48
|
+
} finally {
|
|
49
|
+
null == onEditEnd || onEditEnd(reason);
|
|
50
|
+
const element = ref.current;
|
|
51
|
+
blur && element && element.ownerDocument.activeElement === element && element.blur();
|
|
52
|
+
}
|
|
53
|
+
};
|
|
54
|
+
useClientLayoutEffect(() => {
|
|
55
|
+
const element = ref.current;
|
|
56
|
+
if (element) if (isEditable) {
|
|
57
|
+
const selection = element.ownerDocument.getSelection();
|
|
58
|
+
let activationRange;
|
|
59
|
+
(null == selection ? void 0 : selection.rangeCount) && element.contains(selection.getRangeAt(0).commonAncestorContainer) && (activationRange = selection.getRangeAt(0).cloneRange()),
|
|
60
|
+
start(), element.focus(), selectOnEdit || !element.textContent ? selectText(element, selectOnEdit) : selection && activationRange && element.contains(activationRange.commonAncestorContainer) ? (selection.removeAllRanges(),
|
|
61
|
+
selection.addRange(activationRange)) : selectText(element, !1);
|
|
62
|
+
} else session.current.active && finish("external");
|
|
63
|
+
}, [ isEditable ]), useClientLayoutEffect(() => {
|
|
64
|
+
session.current.active || syncText(committed);
|
|
65
|
+
});
|
|
66
|
+
const cssVars = {
|
|
67
|
+
"--di-width": misc.setStyle(width),
|
|
68
|
+
"--di-padding": misc.setStyle(padding),
|
|
69
|
+
"--di-text-align": textAlign,
|
|
70
|
+
"--di-color": null != textColor ? textColor : "inherit",
|
|
71
|
+
"--di-placeholder-color": textColorPlaceholder,
|
|
72
|
+
"--di-background": isEditable ? backgroundColor : "transparent",
|
|
73
|
+
"--di-radius": misc.setStyle(borderRadius),
|
|
74
|
+
"--di-clamp": Number.isFinite(clamp) && clamp > 0 ? Math.floor(clamp) : "none"
|
|
75
|
+
};
|
|
76
|
+
return jsxRuntime.jsx("span", Object.assign({}, (attributes => Object.fromEntries(Object.entries(attributes).filter(([key]) => !key.startsWith("aria-") && "role" !== key)))(attributes), {
|
|
77
|
+
ref: ref,
|
|
78
|
+
className: `${css.input}${textSize ? ` ${css[textSize]}` : ""}${className ? ` ${className}` : ""}`,
|
|
79
|
+
style: Object.assign(Object.assign({}, style), cssVars),
|
|
80
|
+
contentEditable: isEditable,
|
|
81
|
+
suppressContentEditableWarning: !0,
|
|
82
|
+
role: isEditable ? "textbox" : void 0,
|
|
83
|
+
"aria-label": isEditable ? name.trim() || "Editable text" : void 0,
|
|
84
|
+
"aria-multiline": !isEditable && void 0,
|
|
85
|
+
tabIndex: null != tabIndex ? tabIndex : isEditable || onEditStart ? 0 : void 0,
|
|
86
|
+
"data-editable": isEditable || void 0,
|
|
87
|
+
"data-clamped": Number.isFinite(clamp) && clamp > 0 || void 0,
|
|
88
|
+
"data-focused": isFocused || void 0,
|
|
89
|
+
"data-empty": 0 === draft.length || void 0,
|
|
90
|
+
"data-placeholder": placeholder,
|
|
91
|
+
onInput: event => {
|
|
92
|
+
null == onInput || onInput(event), isEditable && publish();
|
|
93
|
+
},
|
|
94
|
+
onKeyDown: event => {
|
|
95
|
+
null == onKeyDown || onKeyDown(event), event.defaultPrevented || composing.current || event.nativeEvent.isComposing || 229 === event.nativeEvent.keyCode || (isEditable ? "Enter" === event.key ? (event.preventDefault(),
|
|
96
|
+
event.stopPropagation(), finish("enter")) : "Escape" === event.key && (event.preventDefault(),
|
|
97
|
+
event.stopPropagation(), finish("escape")) : !onEditStart || "Enter" !== event.key && "F2" !== event.key || (event.preventDefault(),
|
|
98
|
+
onEditStart()));
|
|
99
|
+
},
|
|
100
|
+
onFocus: event => {
|
|
101
|
+
isEditable && !session.current.active && (start(), selectOnEdit && selectText(event.currentTarget, !0)),
|
|
102
|
+
setIsFocused(!0), null == onFocus || onFocus(event);
|
|
103
|
+
},
|
|
104
|
+
onBlur: event => {
|
|
105
|
+
setIsFocused(!1), finish("blur", !1), null == onBlur || onBlur(event);
|
|
106
|
+
},
|
|
107
|
+
onPaste: event => {
|
|
108
|
+
null == onPaste || onPaste(event), !event.defaultPrevented && isEditable && (event.preventDefault(),
|
|
109
|
+
(text => {
|
|
110
|
+
var _a, _b;
|
|
111
|
+
const element = ref.current;
|
|
112
|
+
if (!element || !session.current.active) return;
|
|
113
|
+
const document = element.ownerDocument, selection = document.getSelection();
|
|
114
|
+
if (!selection) return;
|
|
115
|
+
element.textContent && selection.rangeCount && element.contains(selection.getRangeAt(0).commonAncestorContainer) || selectText(element, !1);
|
|
116
|
+
let inserted = !1;
|
|
117
|
+
try {
|
|
118
|
+
inserted = null !== (_b = null === (_a = document.execCommand) || void 0 === _a ? void 0 : _a.call(document, "insertText", !1, text)) && void 0 !== _b && _b;
|
|
119
|
+
} catch (_c) {}
|
|
120
|
+
if (!inserted && selection.rangeCount) {
|
|
121
|
+
const range = selection.getRangeAt(0);
|
|
122
|
+
range.deleteContents();
|
|
123
|
+
const node = document.createTextNode(text);
|
|
124
|
+
range.insertNode(node), range.setStartAfter(node), range.collapse(!0), selection.removeAllRanges(),
|
|
125
|
+
selection.addRange(range);
|
|
126
|
+
}
|
|
127
|
+
publish();
|
|
128
|
+
})(singleLine(event.clipboardData.getData("text/plain"))));
|
|
129
|
+
},
|
|
130
|
+
onCompositionStart: event => {
|
|
131
|
+
composing.current = !0, null == onCompositionStart || onCompositionStart(event);
|
|
132
|
+
},
|
|
133
|
+
onCompositionEnd: event => {
|
|
134
|
+
composing.current = !1, isEditable && publish(), null == onCompositionEnd || onCompositionEnd(event);
|
|
135
|
+
},
|
|
136
|
+
children: firstText.current
|
|
137
|
+
}));
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
ContentEditableComponent.displayName = "ContentEditable";
|
|
141
|
+
|
|
142
|
+
const ContentEditable = React.memo(ContentEditableComponent);
|
|
143
|
+
|
|
144
|
+
exports.ContentEditable = ContentEditable;
|
|
@@ -0,0 +1,204 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
"use strict";
|
|
3
|
+
|
|
4
|
+
var tslib_es6 = require("./tslib.es6-B8JY5ZGw.js"), jsxRuntime = require("react/jsx-runtime"), React = require("react"), hooks_useObserveResize = require("../hooks/useObserveResize.js"), misc = require("./misc-PmT7cZzC.js"), resolveColorProps = require("./resolveColorProps-DE1k1P-Z.js"), Button = require("./Button-Cr5SlNim.js"), Icon = require("./Icon-COY7IZkK.js"), IconButton = require("./IconButton-KJr15EW6.js"), ModalHostContext = require("./ModalHostContext-DLgUa9Vl.js"), css = {
|
|
5
|
+
wrapper: "DialogBox-module_wrapper__wjjoL",
|
|
6
|
+
title: "DialogBox-module_title__--Kqh",
|
|
7
|
+
titleBlock: "DialogBox-module_titleBlock__IYvXQ",
|
|
8
|
+
titleIcon: "DialogBox-module_titleIcon__c1D62",
|
|
9
|
+
contentWrapper: "DialogBox-module_contentWrapper__joTiu scrollBars-module_scrollbars__c-ZPl",
|
|
10
|
+
content: "DialogBox-module_content__v-uwY",
|
|
11
|
+
actions: "DialogBox-module_actions__3cCCV",
|
|
12
|
+
leftActions: "DialogBox-module_leftActions__FdJuY",
|
|
13
|
+
rightActions: "DialogBox-module_rightActions__ITrsA",
|
|
14
|
+
xs: "DialogBox-module_xs__auub2 type-module_body-xs-medium__s3KvF",
|
|
15
|
+
s: "DialogBox-module_s__5wLg8 type-module_body-s-medium__tjdFc",
|
|
16
|
+
m: "DialogBox-module_m__vszaJ type-module_body-m-medium__uW1on",
|
|
17
|
+
l: "DialogBox-module_l__BdCML type-module_body-l-medium__BqRC7",
|
|
18
|
+
xl: "DialogBox-module_xl__BDrzK type-module_body-xl-medium__BeyrH",
|
|
19
|
+
close: "DialogBox-module_close__Xu-Dk",
|
|
20
|
+
heading: "DialogBox-module_heading__DRHIp"
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
function Title(_props) {
|
|
24
|
+
throw new Error("DialogBox.Title must be a direct child of DialogBox (fragments are supported).");
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
function Content(_props) {
|
|
28
|
+
throw new Error("DialogBox.Content must be a direct child of DialogBox (fragments are supported).");
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
function Actions(_props) {
|
|
32
|
+
throw new Error("DialogBox.Actions must be a direct child of DialogBox (fragments are supported).");
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
Title.displayName = "DialogBox.Title", Content.displayName = "DialogBox.Content",
|
|
36
|
+
Actions.displayName = "DialogBox.Actions";
|
|
37
|
+
|
|
38
|
+
const sections = {
|
|
39
|
+
Title: Title,
|
|
40
|
+
Content: Content,
|
|
41
|
+
Actions: Actions
|
|
42
|
+
};
|
|
43
|
+
|
|
44
|
+
const DialogBoxContext = React.createContext(null);
|
|
45
|
+
|
|
46
|
+
/** Use inside a descendant of DialogBox. Match T to the parent's action value type. */ const DialogBox = Object.assign(React.memo(rawProps => {
|
|
47
|
+
const props = resolveColorProps.resolveColorProps(rawProps), {children: children, id: id, className: className, style: style, minWidth: minWidth, minHeight: minHeight = "unset", maxHeight: maxHeight = 400, maxWidth: maxWidth = 400, padding: padding, close: close = !0, title: title, dialogName: dialogName, titleBackgroundColor: titleBackgroundColor, titleTextSize: titleTextSize = "l", contentTextSize: contentTextSize = "m", actions: actions, actionsBackgroundColor: actionsBackgroundColor, titleIcon: titleIcon, titleIconFill: titleIconFill = !0, titleBorderColor: titleBorderColor = "var(--core-fill-primary)", titleBorderWidth: titleBorderWidth, actionsBorderColor: actionsBorderColor = "var(--core-fill-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)", titleTextColor: titleTextColor = "var(--core-text-primary)", borderColor: borderColor = "var(--core-outline-primary)", borderRadius: borderRadius = "var(--corner-xl)", borderWidth: borderWidth = 0} = props, rest = tslib_es6.__rest(props, [ "children", "id", "className", "style", "minWidth", "minHeight", "maxHeight", "maxWidth", "padding", "close", "title", "dialogName", "titleBackgroundColor", "titleTextSize", "contentTextSize", "actions", "actionsBackgroundColor", "titleIcon", "titleIconFill", "titleBorderColor", "titleBorderWidth", "actionsBorderColor", "actionsBorderWidth", "autoBorderBottom", "onAction", "onReject", "onResolve", "onClose", "onToolTip", "onDragPointerDown", "backgroundColor", "scrollHandleColor", "scrollHandleColorHover", "titleTextColor", "borderColor", "borderRadius", "borderWidth" ]), slots = function(children, title, actions) {
|
|
48
|
+
const found = new Map;
|
|
49
|
+
let unsupported = !1;
|
|
50
|
+
const visit = nodes => React.Children.forEach(nodes, child => {
|
|
51
|
+
if (null == child || "boolean" == typeof child || "string" == typeof child && "" === child.trim()) return;
|
|
52
|
+
if (React.isValidElement(child) && child.type === React.Fragment) return void visit(child.props.children);
|
|
53
|
+
let slot;
|
|
54
|
+
if (React.isValidElement(child) && (child.type === sections.Title && (slot = "title"),
|
|
55
|
+
child.type === sections.Content && (slot = "content"), child.type === sections.Actions && (slot = "actions"),
|
|
56
|
+
slot)) {
|
|
57
|
+
if (found.has(slot)) throw new Error(`DialogBox accepts only one ${slot} section.`);
|
|
58
|
+
found.set(slot, child.props.children);
|
|
59
|
+
} else unsupported = !0;
|
|
60
|
+
});
|
|
61
|
+
visit(children);
|
|
62
|
+
const composed = found.size > 0;
|
|
63
|
+
if (composed && unsupported) throw new Error("DialogBox composition accepts only DialogBox.Title, DialogBox.Content, and DialogBox.Actions as direct children. Place body content inside DialogBox.Content.");
|
|
64
|
+
if (found.has("title") && void 0 !== title) throw new Error("Use either title or DialogBox.Title, not both.");
|
|
65
|
+
if (found.has("actions") && void 0 !== actions) throw new Error("Use either actions or DialogBox.Actions, not both.");
|
|
66
|
+
return {
|
|
67
|
+
title: found.has("title") ? found.get("title") : title,
|
|
68
|
+
content: composed ? found.get("content") : children,
|
|
69
|
+
actions: found.get("actions"),
|
|
70
|
+
hasActions: found.has("actions")
|
|
71
|
+
};
|
|
72
|
+
}(children, title, actions), hasTitle = React.Children.toArray(slots.title).some(child => "string" != typeof child || child.trim().length > 0), accessibleName = null == dialogName ? void 0 : dialogName.trim(), controls = React.useMemo(() => ({
|
|
73
|
+
close: () => null == onClose ? void 0 : onClose(),
|
|
74
|
+
resolve: value => null == onResolve ? void 0 : onResolve(value),
|
|
75
|
+
reject: error => null == onReject ? void 0 : onReject(error)
|
|
76
|
+
}), [ onClose, onResolve, onReject ]), titleId = React.useId(), modalHost = React.useContext(ModalHostContext.ModalHostContext), contentRef = React.useRef(null), contentWrapperRef = React.useRef(null), modalStyle = null != style ? style : {}, modalClass = className ? ` ${className}` : "", contentSize = hooks_useObserveResize.useObserveResize(contentRef), viewportSize = hooks_useObserveResize.useObserveResize(contentWrapperRef), scrolls = contentSize.height > viewportSize.height, resolvedTitleBorderWidth = null != titleBorderWidth ? titleBorderWidth : scrolls ? 1 : 0, titlePaddingBottom = scrolls ? "var(--spacing-xs)" : "0px", setActionBorderWidth = React.useMemo(() => scrolls && 0 === actionsBorderWidth && autoBorderBottom ? "1px" : misc.setStyle(actionsBorderWidth), [ actionsBorderWidth, scrolls, autoBorderBottom ]), setPaddingAdjustment = React.useMemo(() => scrolls ? padding && "number" == typeof padding ? misc.setStyle(padding) : padding && "string" == typeof padding ? padding.split(" ")[0] : "var(--spacing-s)" : "0px", [ scrolls, padding ]), cssVars = React.useMemo(() => ({
|
|
77
|
+
"--modal-min-width": misc.setStyle(minWidth, "min(300px, 100%)"),
|
|
78
|
+
"--modal-min-height": misc.setStyle(minHeight),
|
|
79
|
+
"--modal-max-height": misc.setStyle(maxHeight),
|
|
80
|
+
"--modal-max-width": misc.setStyle(maxWidth),
|
|
81
|
+
"--modal-border-color": borderColor,
|
|
82
|
+
"--modal-title-color": titleTextColor,
|
|
83
|
+
"--modal-border-radius": misc.setStyle(borderRadius),
|
|
84
|
+
"--modal-border-width": misc.setStyle(borderWidth),
|
|
85
|
+
"--modal-padding": misc.setStyle(padding, "var(--spacing-m) var(--spacing-m)"),
|
|
86
|
+
"--modal-title-padding": misc.setStyle(padding, `var(--spacing-m) var(--spacing-m) ${titlePaddingBottom}`),
|
|
87
|
+
"--modal-padding-adjust": setPaddingAdjustment,
|
|
88
|
+
"--modal-content-margin-top": scrolls ? "var(--spacing-xxs)" : "0px",
|
|
89
|
+
"--modal-background-color": backgroundColor,
|
|
90
|
+
"--modal-title-border-color": titleBorderColor,
|
|
91
|
+
"--modal-title-border-width": misc.setStyle(resolvedTitleBorderWidth),
|
|
92
|
+
"--modal-title-background-color": null != titleBackgroundColor ? titleBackgroundColor : backgroundColor,
|
|
93
|
+
"--modal-actions-background-color": null != actionsBackgroundColor ? actionsBackgroundColor : backgroundColor,
|
|
94
|
+
"--modal-actions-border-color": actionsBorderColor,
|
|
95
|
+
"--modal-scroll-handle": misc.setStyle(scrollHandleColor),
|
|
96
|
+
"--modal-scroll-handle-hover": misc.setStyle(scrollHandleColorHover),
|
|
97
|
+
"--modal-actions-border-width": setActionBorderWidth
|
|
98
|
+
}), [ minWidth, minHeight, maxHeight, maxWidth, borderColor, titleTextColor, borderRadius, borderWidth, padding, setPaddingAdjustment, scrolls, titlePaddingBottom, resolvedTitleBorderWidth, titleBorderColor, actionsBorderColor, actionsBackgroundColor, titleBackgroundColor, backgroundColor, scrollHandleColor, scrollHandleColorHover, setActionBorderWidth ]), handleClose = controls.close, renderActions = position => null == actions ? void 0 : actions.map(action => action.position || "left" !== position ? action.position && position !== action.position ? null : jsxRuntime.jsx(Button.Button, {
|
|
99
|
+
variant: action.primary ? "solid" : "outline",
|
|
100
|
+
label: action.label,
|
|
101
|
+
"aria-label": action.label || action.tooltip || "Action",
|
|
102
|
+
onClick: () => (action => {
|
|
103
|
+
if (action.disabled || action.working) return;
|
|
104
|
+
const resolves = !action.promise || "resolve" === action.promise, rejects = "reject" === action.promise;
|
|
105
|
+
try {
|
|
106
|
+
null == onAction || onAction(action.value);
|
|
107
|
+
} finally {
|
|
108
|
+
resolves && (null == onResolve || onResolve(action.value)), rejects && (null == onReject || onReject(new Error("DialogBox rejected", {
|
|
109
|
+
cause: action.value
|
|
110
|
+
})));
|
|
111
|
+
}
|
|
112
|
+
})(action),
|
|
113
|
+
disabled: action.disabled,
|
|
114
|
+
working: action.working,
|
|
115
|
+
round: !0 === action.round,
|
|
116
|
+
iconLeft: action.iconLeft,
|
|
117
|
+
iconRight: action.iconRight,
|
|
118
|
+
tooltip: action.tooltip,
|
|
119
|
+
onToolTip: tip => null == onToolTip ? void 0 : onToolTip(tip)
|
|
120
|
+
}, action.id) : null);
|
|
121
|
+
return jsxRuntime.jsx(DialogBoxContext.Provider, {
|
|
122
|
+
value: controls,
|
|
123
|
+
children: jsxRuntime.jsxs("div", Object.assign({}, Object.fromEntries(Object.entries(rest).filter(([key]) => !key.startsWith("aria-") && "role" !== key)), {
|
|
124
|
+
id: id,
|
|
125
|
+
className: `${css.wrapper}${modalClass}`,
|
|
126
|
+
style: Object.assign(Object.assign({}, modalStyle), cssVars),
|
|
127
|
+
role: "dialog",
|
|
128
|
+
"aria-modal": modalHost || void 0,
|
|
129
|
+
"aria-labelledby": !accessibleName && hasTitle ? titleId : void 0,
|
|
130
|
+
"aria-label": accessibleName || (hasTitle ? void 0 : "Dialog"),
|
|
131
|
+
tabIndex: -1,
|
|
132
|
+
children: [ (hasTitle || close) && jsxRuntime.jsxs("div", {
|
|
133
|
+
className: `${css.title} ${css[titleTextSize]}`,
|
|
134
|
+
onPointerDown: event => {
|
|
135
|
+
event.target.closest('button, a, input, select, textarea, [contenteditable="true"]') || null == onDragPointerDown || onDragPointerDown(event);
|
|
136
|
+
},
|
|
137
|
+
children: [ jsxRuntime.jsxs("div", {
|
|
138
|
+
className: css.titleBlock,
|
|
139
|
+
children: [ titleIcon && jsxRuntime.jsx("div", {
|
|
140
|
+
className: css.titleIcon,
|
|
141
|
+
"aria-hidden": "true",
|
|
142
|
+
children: jsxRuntime.jsx(Icon.Icon, {
|
|
143
|
+
name: titleIcon,
|
|
144
|
+
fill: titleIconFill,
|
|
145
|
+
size: 20
|
|
146
|
+
})
|
|
147
|
+
}), hasTitle && jsxRuntime.jsx("h2", {
|
|
148
|
+
id: titleId,
|
|
149
|
+
className: css.heading,
|
|
150
|
+
children: slots.title
|
|
151
|
+
}) ]
|
|
152
|
+
}), close && jsxRuntime.jsx("div", {
|
|
153
|
+
className: css.close,
|
|
154
|
+
children: jsxRuntime.jsx("div", {
|
|
155
|
+
className: css.titleIcon,
|
|
156
|
+
children: jsxRuntime.jsx(IconButton.IconButton, {
|
|
157
|
+
tooltip: "close",
|
|
158
|
+
actionName: "close",
|
|
159
|
+
icon: "basic.cross",
|
|
160
|
+
onClick: handleClose,
|
|
161
|
+
onToolTip: tip => null == onToolTip ? void 0 : onToolTip(tip),
|
|
162
|
+
hover: !1,
|
|
163
|
+
backgroundColor: "transparent",
|
|
164
|
+
backgroundColorHover: "transparent",
|
|
165
|
+
backgroundColorSelected: "transparent",
|
|
166
|
+
buttonSize: "s"
|
|
167
|
+
})
|
|
168
|
+
})
|
|
169
|
+
}) ]
|
|
170
|
+
}), jsxRuntime.jsx("div", {
|
|
171
|
+
className: css.contentWrapper,
|
|
172
|
+
ref: contentWrapperRef,
|
|
173
|
+
children: jsxRuntime.jsx("div", {
|
|
174
|
+
ref: contentRef,
|
|
175
|
+
className: `${css.content} ${css[contentTextSize]}`,
|
|
176
|
+
children: slots.content
|
|
177
|
+
})
|
|
178
|
+
}), (slots.hasActions || actions && actions.length > 0) && jsxRuntime.jsx("div", {
|
|
179
|
+
className: css.actions,
|
|
180
|
+
onPointerDown: event => {
|
|
181
|
+
event.target.closest('button, a, input, select, textarea, [contenteditable="true"]') || null == onDragPointerDown || onDragPointerDown(event);
|
|
182
|
+
},
|
|
183
|
+
children: slots.hasActions ? jsxRuntime.jsx("div", {
|
|
184
|
+
className: css.rightActions,
|
|
185
|
+
children: slots.actions
|
|
186
|
+
}) : jsxRuntime.jsxs(jsxRuntime.Fragment, {
|
|
187
|
+
children: [ jsxRuntime.jsx("div", {
|
|
188
|
+
className: css.leftActions,
|
|
189
|
+
children: renderActions("left")
|
|
190
|
+
}), jsxRuntime.jsx("div", {
|
|
191
|
+
className: css.rightActions,
|
|
192
|
+
children: renderActions("right")
|
|
193
|
+
}) ]
|
|
194
|
+
})
|
|
195
|
+
}) ]
|
|
196
|
+
}))
|
|
197
|
+
});
|
|
198
|
+
}), sections);
|
|
199
|
+
|
|
200
|
+
exports.DialogBox = DialogBox, exports.useDialogBox = function() {
|
|
201
|
+
const context = React.useContext(DialogBoxContext);
|
|
202
|
+
if (!context) throw new Error("useDialogBox must be used inside DialogBox.");
|
|
203
|
+
return context;
|
|
204
|
+
};
|