@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,266 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { a as __rest } from "./tslib.es6-CpnJrDBv.mjs";
|
|
3
|
+
|
|
4
|
+
import { jsx, jsxs, Fragment } from "react/jsx-runtime";
|
|
5
|
+
|
|
6
|
+
import React, { useState, useEffect, useRef, useId, useMemo } from "react";
|
|
7
|
+
|
|
8
|
+
import { useTheme } from "../hooks/useTheme.mjs";
|
|
9
|
+
|
|
10
|
+
import "../theme/colors.mjs";
|
|
11
|
+
|
|
12
|
+
import "../theme/type.mjs";
|
|
13
|
+
|
|
14
|
+
import "./resolveColor-Kvs7kDyy.mjs";
|
|
15
|
+
|
|
16
|
+
import "./breakpoints-Dn9DgpJe.mjs";
|
|
17
|
+
|
|
18
|
+
import "./broadcastChannel-CPT0S33H.mjs";
|
|
19
|
+
|
|
20
|
+
import "./files-6nwSZlJK.mjs";
|
|
21
|
+
|
|
22
|
+
import "./webRTCStore-BepH2O9l.mjs";
|
|
23
|
+
|
|
24
|
+
import "./microphoneStore-BzSEbtfK.mjs";
|
|
25
|
+
|
|
26
|
+
import "./volumeStore-mqWIRL0J.mjs";
|
|
27
|
+
|
|
28
|
+
import { r as resolveColorProps } from "./resolveColorProps-CwAU25V-.mjs";
|
|
29
|
+
|
|
30
|
+
import { u as usePrefersReducedMotion } from "./usePrefersReducedMotion-BWAwMMLE.mjs";
|
|
31
|
+
|
|
32
|
+
import { I as Icon } from "./Icon-43T0fkr6.mjs";
|
|
33
|
+
|
|
34
|
+
import { AnimatePresence, usePresence, useAnimationControls, motion } from "motion/react";
|
|
35
|
+
|
|
36
|
+
import { m as mergedPresenceMotionValues, a as classNames } from "./misc-DI5GSqkt.mjs";
|
|
37
|
+
|
|
38
|
+
import { g as getWaterTransition } from "./getWaterTransition-CrDSFJdk.mjs";
|
|
39
|
+
|
|
40
|
+
var css$1 = {
|
|
41
|
+
wrapper: "DoneCheck-module_wrapper__AlISD flexBox-module_row__z24tF",
|
|
42
|
+
icon: "DoneCheck-module_icon__bKaFp flexBox-module_row__z24tF"
|
|
43
|
+
};
|
|
44
|
+
|
|
45
|
+
const DoneCheck = React.memo(rawProps => {
|
|
46
|
+
const props = resolveColorProps(rawProps), theme = useTheme(), {size: size = 88, stroke: stroke = 1.5, color: color = theme.current.colors["feedback-positive"], play: play = !0, delay: delay = 0, duration: duration = 1, didStart: didStart, didEnd: didEnd, statusLabel: statusLabel = "Completed", decorative: decorative = !1, className: className, style: style} = props, divAttributes = __rest(props, [ "size", "stroke", "color", "play", "delay", "duration", "didStart", "didEnd", "statusLabel", "decorative", "className", "style" ]), reducedMotion = usePrefersReducedMotion(), shouldAnimate = play && !reducedMotion && duration > 0, [playing, setPlaying] = useState(!play);
|
|
47
|
+
useEffect(() => {
|
|
48
|
+
let frameOne = 0, frameTwo = 0;
|
|
49
|
+
return shouldAnimate ? (setPlaying(!1), frameOne = requestAnimationFrame(() => {
|
|
50
|
+
frameTwo = requestAnimationFrame(() => {
|
|
51
|
+
setPlaying(!0);
|
|
52
|
+
});
|
|
53
|
+
})) : setPlaying(!0), () => {
|
|
54
|
+
frameOne && cancelAnimationFrame(frameOne), frameTwo && cancelAnimationFrame(frameTwo);
|
|
55
|
+
};
|
|
56
|
+
}, [ shouldAnimate ]);
|
|
57
|
+
const cssVars = {
|
|
58
|
+
width: size,
|
|
59
|
+
height: size,
|
|
60
|
+
flexShrink: 0,
|
|
61
|
+
"--icon-size": `${size}px`,
|
|
62
|
+
"--icon-scale": !shouldAnimate || playing ? 1 : 0,
|
|
63
|
+
"--icon-transition": shouldAnimate ? `scale ${duration}s var(--motion-spring) ${delay}s` : "none"
|
|
64
|
+
}, isScaleTransition = event => shouldAnimate && event.target === event.currentTarget && "scale" === event.nativeEvent.propertyName;
|
|
65
|
+
return jsx("div", Object.assign({}, divAttributes, {
|
|
66
|
+
className: [ css$1.wrapper, className ].filter(Boolean).join(" "),
|
|
67
|
+
style: Object.assign(Object.assign({}, style), cssVars),
|
|
68
|
+
role: decorative ? void 0 : "status",
|
|
69
|
+
"aria-label": decorative ? void 0 : statusLabel.trim() || "Completed",
|
|
70
|
+
"aria-hidden": decorative || void 0,
|
|
71
|
+
children: jsx("div", {
|
|
72
|
+
className: css$1.icon,
|
|
73
|
+
"aria-hidden": "true",
|
|
74
|
+
onTransitionEnd: event => {
|
|
75
|
+
isScaleTransition(event) && (null == didEnd || didEnd());
|
|
76
|
+
},
|
|
77
|
+
onTransitionStart: event => {
|
|
78
|
+
isScaleTransition(event) && (null == didStart || didStart());
|
|
79
|
+
},
|
|
80
|
+
children: jsx(Icon, {
|
|
81
|
+
name: "system.check-circle",
|
|
82
|
+
size: size,
|
|
83
|
+
decorative: !0,
|
|
84
|
+
stroke: stroke,
|
|
85
|
+
strokeColor: color
|
|
86
|
+
})
|
|
87
|
+
})
|
|
88
|
+
}));
|
|
89
|
+
});
|
|
90
|
+
|
|
91
|
+
var css = {
|
|
92
|
+
container: "ProgressIndicator-module_container__pW2gW",
|
|
93
|
+
spinning: "ProgressIndicator-module_spinning__PUEMK",
|
|
94
|
+
spin: "ProgressIndicator-module_spin__Nnf62",
|
|
95
|
+
announcement: "ProgressIndicator-module_announcement__6TFJ9",
|
|
96
|
+
label: "ProgressIndicator-module_label__sdrNv",
|
|
97
|
+
xs: "ProgressIndicator-module_xs__8HlWE type-module_body-xs-regular__ZAFft",
|
|
98
|
+
s: "ProgressIndicator-module_s__jWNmh type-module_body-s-regular__vRHSP",
|
|
99
|
+
m: "ProgressIndicator-module_m__VG0Ix type-module_body-m-regular__LuQBA",
|
|
100
|
+
l: "ProgressIndicator-module_l__KmOlD type-module_body-l-regular__lOYbg",
|
|
101
|
+
xl: "ProgressIndicator-module_xl__UkV-d type-module_body-xl-regular__pF2kC"
|
|
102
|
+
};
|
|
103
|
+
|
|
104
|
+
/** Show starts a playback cycle; changing callbacks or expiring its timer cannot restart it. */ const staticState = {
|
|
105
|
+
opacity: 1,
|
|
106
|
+
x: 0,
|
|
107
|
+
y: 0,
|
|
108
|
+
z: 0,
|
|
109
|
+
scale: 1,
|
|
110
|
+
scaleX: 1,
|
|
111
|
+
scaleY: 1,
|
|
112
|
+
rotate: 0,
|
|
113
|
+
rotateX: 0,
|
|
114
|
+
rotateY: 0,
|
|
115
|
+
skewX: 0,
|
|
116
|
+
skewY: 0
|
|
117
|
+
};
|
|
118
|
+
|
|
119
|
+
function IndicatorSurface(_a) {
|
|
120
|
+
var {playing: playing, gradientId: gradientId, variants: variants, timing: timing, forwardedRef: forwardedRef, size: size = 20, stroke: stroke = 1.5, secondsPerSpin: secondsPerSpin = 1, color: color = "var(--core-text-primary)", inset: inset = !0, inline: inline = !1, label: label = "Loading", displayLabel: displayLabel = !1, labelPosition: labelPosition = "right", textSize: textSize = "m", textColor: textColor = "var(--core-text-primary)", className: className, style: style} = _a, attributes = __rest(_a, [ "playing", "gradientId", "variants", "timing", "forwardedRef", "size", "stroke", "secondsPerSpin", "color", "inset", "inline", "label", "displayLabel", "labelPosition", "textSize", "textColor", "className", "style" ]);
|
|
121
|
+
const [present, safeToRemove] = usePresence(), reduced = usePrefersReducedMotion(), controls = useAnimationControls();
|
|
122
|
+
useEffect(() => {
|
|
123
|
+
var _a;
|
|
124
|
+
if (controls.stop(), reduced) return controls.set(staticState), void (present || null == safeToRemove || safeToRemove());
|
|
125
|
+
let active = !0;
|
|
126
|
+
const state = present ? "animate" : "exit", target = variants[state], definition = "function" == typeof target ? state : Object.assign(Object.assign({}, target), {
|
|
127
|
+
transition: null !== (_a = null == target ? void 0 : target.transition) && void 0 !== _a ? _a : timing
|
|
128
|
+
});
|
|
129
|
+
return present && controls.set("initial"), controls.start(definition).then(() => {
|
|
130
|
+
active && !present && (null == safeToRemove || safeToRemove());
|
|
131
|
+
}), () => {
|
|
132
|
+
active = !1, controls.stop();
|
|
133
|
+
};
|
|
134
|
+
}, [ present, reduced, controls, variants, timing, safeToRemove ]);
|
|
135
|
+
const resolvedSize = "string" == typeof size ? size.trim() || 20 : Number.isFinite(size) && size > 0 ? size : 20, resolvedStroke = Number.isFinite(stroke) && stroke >= 0 ? Math.min(stroke, 10) : 1.5, spinTime = Number.isFinite(secondsPerSpin) && secondsPerSpin > 0 ? secondsPerSpin : 1, radius = Math.min(inset ? 8 : 10, 10 - resolvedStroke / 2), path = `M ${10 + radius * Math.cos(-.4)} ${10 + radius * Math.sin(-.4)} A ${radius} ${radius} 0 1 1 10 ${10 - radius}`, variables = {
|
|
136
|
+
"--pi-position": inline ? "relative" : "absolute",
|
|
137
|
+
"--pi-inset": inline ? "auto" : "0",
|
|
138
|
+
"--pi-display": inline ? "inline-flex" : "flex",
|
|
139
|
+
"--pi-spin-duration": `${spinTime}s`,
|
|
140
|
+
"--pi-text-color": textColor
|
|
141
|
+
};
|
|
142
|
+
return jsxs(motion.div, Object.assign({}, attributes, {
|
|
143
|
+
ref: forwardedRef,
|
|
144
|
+
className: classNames(css.container, null != className ? className : ""),
|
|
145
|
+
"aria-hidden": "true",
|
|
146
|
+
"data-label-position": displayLabel ? labelPosition : void 0,
|
|
147
|
+
inert: !present,
|
|
148
|
+
style: Object.assign(Object.assign({}, style), variables),
|
|
149
|
+
initial: !reduced && "initial",
|
|
150
|
+
animate: controls,
|
|
151
|
+
variants: reduced ? void 0 : variants,
|
|
152
|
+
transition: reduced ? {
|
|
153
|
+
duration: 0,
|
|
154
|
+
delay: 0
|
|
155
|
+
} : timing,
|
|
156
|
+
children: [ jsxs("svg", {
|
|
157
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
158
|
+
width: resolvedSize,
|
|
159
|
+
height: resolvedSize,
|
|
160
|
+
viewBox: "0 0 20 20",
|
|
161
|
+
"aria-hidden": "true",
|
|
162
|
+
focusable: "false",
|
|
163
|
+
className: playing && present && !reduced ? css.spinning : void 0,
|
|
164
|
+
style: {
|
|
165
|
+
width: resolvedSize,
|
|
166
|
+
height: resolvedSize
|
|
167
|
+
},
|
|
168
|
+
children: [ jsx("defs", {
|
|
169
|
+
children: jsxs("linearGradient", {
|
|
170
|
+
id: gradientId,
|
|
171
|
+
x1: "0",
|
|
172
|
+
y1: "0",
|
|
173
|
+
x2: "20",
|
|
174
|
+
y2: "0",
|
|
175
|
+
gradientUnits: "userSpaceOnUse",
|
|
176
|
+
children: [ jsx("stop", {
|
|
177
|
+
offset: "0%",
|
|
178
|
+
stopColor: color,
|
|
179
|
+
stopOpacity: 1
|
|
180
|
+
}), jsx("stop", {
|
|
181
|
+
offset: "50%",
|
|
182
|
+
stopColor: color,
|
|
183
|
+
stopOpacity: 1
|
|
184
|
+
}), jsx("stop", {
|
|
185
|
+
offset: "100%",
|
|
186
|
+
stopColor: color,
|
|
187
|
+
stopOpacity: 0
|
|
188
|
+
}) ]
|
|
189
|
+
})
|
|
190
|
+
}), jsx("path", {
|
|
191
|
+
d: path,
|
|
192
|
+
fill: "transparent",
|
|
193
|
+
strokeWidth: resolvedStroke,
|
|
194
|
+
stroke: `url(#${gradientId})`
|
|
195
|
+
}) ]
|
|
196
|
+
}), displayLabel && jsx("span", {
|
|
197
|
+
className: classNames(css.label, css[textSize]),
|
|
198
|
+
children: label
|
|
199
|
+
}) ]
|
|
200
|
+
}));
|
|
201
|
+
}
|
|
202
|
+
|
|
203
|
+
const ProgressIndicatorBase = React.forwardRef((rawProps, ref) => {
|
|
204
|
+
const props = resolveColorProps(rawProps), {show: show = !1, duration: duration, onStart: onStart, onStop: onStop, label: label = "Loading", decorative: decorative = !1, motionValues: motionValues, transition: transition} = props, attributes = __rest(props, [ "show", "duration", "onStart", "onStop", "label", "decorative", "motionValues", "transition" ]), resolvedLabel = label.trim() || "Loading", playing = function({show: show = !1, duration: duration, onStart: onStart, onStop: onStop}) {
|
|
205
|
+
const [playing, setPlaying] = useState(show), active = useRef(!1), callbacks = useRef({
|
|
206
|
+
onStart: onStart,
|
|
207
|
+
onStop: onStop
|
|
208
|
+
});
|
|
209
|
+
return useEffect(() => {
|
|
210
|
+
callbacks.current = {
|
|
211
|
+
onStart: onStart,
|
|
212
|
+
onStop: onStop
|
|
213
|
+
};
|
|
214
|
+
}, [ onStart, onStop ]), useEffect(() => {
|
|
215
|
+
var _a, _b, _c, _d;
|
|
216
|
+
show ? active.current || (active.current = !0, setPlaying(!0), null === (_b = (_a = callbacks.current).onStart) || void 0 === _b || _b.call(_a)) : active.current && (active.current = !1,
|
|
217
|
+
setPlaying(!1), null === (_d = (_c = callbacks.current).onStop) || void 0 === _d || _d.call(_c));
|
|
218
|
+
}, [ show ]), useEffect(() => {
|
|
219
|
+
if (!show || !active.current || void 0 === duration || !Number.isFinite(duration) || duration < 0) return;
|
|
220
|
+
const timer = setTimeout(() => {
|
|
221
|
+
var _a, _b;
|
|
222
|
+
active.current = !1, setPlaying(!1), null === (_b = (_a = callbacks.current).onStop) || void 0 === _b || _b.call(_a);
|
|
223
|
+
}, Math.min(1e3 * duration, 2147483647));
|
|
224
|
+
return () => clearTimeout(timer);
|
|
225
|
+
}, [ show, duration ]), show && playing;
|
|
226
|
+
}({
|
|
227
|
+
show: show,
|
|
228
|
+
duration: duration,
|
|
229
|
+
onStart: onStart,
|
|
230
|
+
onStop: onStop
|
|
231
|
+
}), id = useId().replace(/:/g, ""), theme = useTheme().current, variants = useMemo(() => mergedPresenceMotionValues({
|
|
232
|
+
initial: {
|
|
233
|
+
opacity: 0
|
|
234
|
+
},
|
|
235
|
+
animate: {
|
|
236
|
+
opacity: 1
|
|
237
|
+
},
|
|
238
|
+
exit: {
|
|
239
|
+
opacity: 0
|
|
240
|
+
}
|
|
241
|
+
}, motionValues), [ motionValues ]), timing = useMemo(() => getWaterTransition(theme.motion, transition), [ theme.motion, transition ]);
|
|
242
|
+
return jsxs(Fragment, {
|
|
243
|
+
children: [ !decorative && jsx("span", {
|
|
244
|
+
role: "status",
|
|
245
|
+
"aria-live": "polite",
|
|
246
|
+
"aria-atomic": "true",
|
|
247
|
+
className: css.announcement,
|
|
248
|
+
children: show ? resolvedLabel : ""
|
|
249
|
+
}), jsx(AnimatePresence, {
|
|
250
|
+
children: show && jsx(IndicatorSurface, Object.assign({}, attributes, {
|
|
251
|
+
forwardedRef: ref,
|
|
252
|
+
label: resolvedLabel,
|
|
253
|
+
playing: playing,
|
|
254
|
+
gradientId: id,
|
|
255
|
+
variants: variants,
|
|
256
|
+
timing: timing
|
|
257
|
+
}))
|
|
258
|
+
}) ]
|
|
259
|
+
});
|
|
260
|
+
});
|
|
261
|
+
|
|
262
|
+
ProgressIndicatorBase.displayName = "ProgressIndicator";
|
|
263
|
+
|
|
264
|
+
const ProgressIndicator = React.memo(ProgressIndicatorBase);
|
|
265
|
+
|
|
266
|
+
export { DoneCheck as D, ProgressIndicator as P };
|
|
@@ -0,0 +1,266 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { a as __rest } from "./tslib.es6-CpnJrDBv.mjs";
|
|
3
|
+
|
|
4
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
5
|
+
|
|
6
|
+
import React, { useState, useRef, useCallback, useEffect, useLayoutEffect } from "react";
|
|
7
|
+
|
|
8
|
+
import { s as setStyle } from "./misc-DI5GSqkt.mjs";
|
|
9
|
+
|
|
10
|
+
import { r as resolveColorProps } from "./resolveColorProps-CwAU25V-.mjs";
|
|
11
|
+
|
|
12
|
+
import { u as usePrefersReducedMotion } from "./usePrefersReducedMotion-BWAwMMLE.mjs";
|
|
13
|
+
|
|
14
|
+
import { B as Button } from "./Button-BwTo8mSI.mjs";
|
|
15
|
+
|
|
16
|
+
import { F as FileList } from "./FileList-DxB0ZORo.mjs";
|
|
17
|
+
|
|
18
|
+
import { I as IconButton } from "./IconButton-oqYTUJit.mjs";
|
|
19
|
+
|
|
20
|
+
import { T as TextArea } from "./TextArea-C32MToPG.mjs";
|
|
21
|
+
|
|
22
|
+
import { a as allTypes, u as useFileSelection } from "./UploadArea-Dq7ST-RG.mjs";
|
|
23
|
+
|
|
24
|
+
var css_wrapper = "PromptInput-module_wrapper__UoAEJ", css_surface = "PromptInput-module_surface__GvZDB", css_attachments = "PromptInput-module_attachments__rqgY1", css_buttonBar = "PromptInput-module_buttonBar__X8LDe", css_actions = "PromptInput-module_actions__vMa2p", css_rejection = "PromptInput-module_rejection__cnjdh type-module_body-s-regular__vRHSP";
|
|
25
|
+
|
|
26
|
+
/** Clipboard length and native maxLength both use JavaScript string length. */ const PromptInputBase = React.forwardRef((rawProps, ref) => {
|
|
27
|
+
var _a, _b;
|
|
28
|
+
const _c = resolveColorProps(rawProps), {children: children, attachments: controlledAttachments, defaultAttachments: defaultAttachments = [], value: value, defaultValue: defaultValue = "", width: width = "100%", maxWidth: maxWidth, minWidth: minWidth, working: working = !1, disabled: disabled = !1, readOnly: readOnly = !1, maxHeight: maxHeight = 400, attachmentsDisabled: attachmentsDisabled = !1, submitWorking: submitWorking = !1, borderStyle: borderStyle = "solid", borderColor: borderColor = "var(--core-outline-secondary)", borderColorFocused: borderColorFocused = "var(--core-outline-secondary)", borderAnimate: borderAnimate = !0, borderWidth: borderWidth = 1, borderRadius: borderRadius = 16, focused: focused, placeholder: placeholder = "Ask me anything ...", placeholderWorking: placeholderWorking = "Working ...", submitClears: submitClears = !0, enterSubmits: enterSubmits = !0, attachButton: attachButton = !0, sendButton: sendButton = !0, stopEnabled: stopEnabled = !1, textSize: textSize = "m", maxLength: maxLength, toolbarGap: toolbarGap = 8, inputName: inputName = "Message", textAreaProps: textAreaProps, fileListProps: fileListProps, acceptedTypes: acceptedTypes = allTypes, multiple: multiple = !0, pasteAttachmentThreshold: pasteAttachmentThreshold, attachActionName: attachActionName = "Attach files", sendActionName: sendActionName = "Send message", stopActionName: stopActionName = "Stop generating", onChange: onChange, onBlur: onBlur, onFocus: onFocus, onSubmit: onSubmit, onStop: onStop, onAttachmentsChange: onAttachmentsChange, onReject: onReject, onToolTip: onToolTip, onPaste: onPaste, onKeyDown: onKeyDown, onClick: onClick, onDragEnter: onDragEnter, onDragOver: onDragOver, onDragLeave: onDragLeave, onDrop: onDrop} = _c, attributes = __rest(_c, [ "children", "attachments", "defaultAttachments", "value", "defaultValue", "width", "maxWidth", "minWidth", "working", "disabled", "readOnly", "maxHeight", "attachmentsDisabled", "submitWorking", "borderStyle", "borderColor", "borderColorFocused", "borderAnimate", "borderWidth", "borderRadius", "focused", "placeholder", "placeholderWorking", "submitClears", "enterSubmits", "attachButton", "sendButton", "stopEnabled", "textSize", "maxLength", "toolbarGap", "inputName", "textAreaProps", "fileListProps", "acceptedTypes", "multiple", "pasteAttachmentThreshold", "attachActionName", "sendActionName", "stopActionName", "onChange", "onBlur", "onFocus", "onSubmit", "onStop", "onAttachmentsChange", "onReject", "onToolTip", "onPaste", "onKeyDown", "onClick", "onDragEnter", "onDragOver", "onDragLeave", "onDrop" ]), [localText, setLocalText] = useState(defaultValue), [localAttachments, setLocalAttachments] = useState(defaultAttachments), text = void 0 === value ? localText : value, attachments = null != controlledAttachments ? controlledAttachments : localAttachments, editor = useRef(null), pendingCaret = useRef(void 0), reducedMotion = usePrefersReducedMotion(), canEdit = !disabled && !readOnly, textLimit = null !== (_a = null == textAreaProps ? void 0 : textAreaProps.maxLength) && void 0 !== _a ? _a : maxLength, canAttach = canEdit && !attachmentsDisabled && (void 0 === controlledAttachments || Boolean(onAttachmentsChange)), waiting = attachments.some(item => {
|
|
29
|
+
var _a;
|
|
30
|
+
return item.uploading || Boolean(null === (_a = item.error) || void 0 === _a ? void 0 : _a.trim());
|
|
31
|
+
}), hasContent = Boolean(text.trim()) || attachments.length > 0, blocked = disabled || readOnly || stopEnabled || working && submitWorking || waiting, canSubmit = !blocked && hasContent && Boolean(onSubmit), focus = () => {
|
|
32
|
+
var _a;
|
|
33
|
+
return null === (_a = editor.current) || void 0 === _a ? void 0 : _a.focus();
|
|
34
|
+
}, changeText = next => {
|
|
35
|
+
canEdit && (void 0 === value && setLocalText(next), null == onChange || onChange(next, attachments));
|
|
36
|
+
}, changeAttachments = next => {
|
|
37
|
+
canAttach && (void 0 === controlledAttachments && setLocalAttachments(next), null == onAttachmentsChange || onAttachmentsChange(next),
|
|
38
|
+
null == onChange || onChange(text, next));
|
|
39
|
+
}, selection = useFileSelection({
|
|
40
|
+
files: attachments,
|
|
41
|
+
acceptedTypes: acceptedTypes,
|
|
42
|
+
multiple: multiple,
|
|
43
|
+
disabled: !canAttach,
|
|
44
|
+
onFilesChange: changeAttachments,
|
|
45
|
+
onReject: onReject
|
|
46
|
+
}), [fileDragging, setFileDragging] = useState(!1), dragDepth = useRef(0), resetFileDrag = useCallback(() => {
|
|
47
|
+
dragDepth.current = 0, setFileDragging(!1);
|
|
48
|
+
}, []);
|
|
49
|
+
useEffect(() => {
|
|
50
|
+
var _a;
|
|
51
|
+
if (canAttach || resetFileDrag(), !fileDragging || !canAttach) return;
|
|
52
|
+
const view = null === (_a = editor.current) || void 0 === _a ? void 0 : _a.ownerDocument.defaultView;
|
|
53
|
+
if (!view) return;
|
|
54
|
+
const handleKeyDown = event => {
|
|
55
|
+
"Escape" === event.key && resetFileDrag();
|
|
56
|
+
};
|
|
57
|
+
return view.addEventListener("dragend", resetFileDrag), view.addEventListener("drop", resetFileDrag),
|
|
58
|
+
view.addEventListener("blur", resetFileDrag), view.addEventListener("keydown", handleKeyDown),
|
|
59
|
+
() => {
|
|
60
|
+
view.removeEventListener("dragend", resetFileDrag), view.removeEventListener("drop", resetFileDrag),
|
|
61
|
+
view.removeEventListener("blur", resetFileDrag), view.removeEventListener("keydown", handleKeyDown);
|
|
62
|
+
};
|
|
63
|
+
}, [ canAttach, fileDragging, resetFileDrag ]);
|
|
64
|
+
const isFileDrag = event => event.target instanceof Node && event.currentTarget.contains(event.target) && (Array.from(event.dataTransfer.types).includes("Files") || event.dataTransfer.files.length > 0), submit = () => {
|
|
65
|
+
canSubmit && (null == onSubmit || onSubmit(text, attachments), submitClears && changeText(""),
|
|
66
|
+
focus());
|
|
67
|
+
}, stop = () => {
|
|
68
|
+
!disabled && stopEnabled && (null == onStop || onStop(), focus());
|
|
69
|
+
}, makeTextAttachment = content => !(!canAttach || !function(text, threshold) {
|
|
70
|
+
return "number" == typeof threshold && Number.isFinite(threshold) && threshold >= 0 && text.length > threshold;
|
|
71
|
+
}(content, pasteAttachmentThreshold)) && (selection.selectFiles([ new File([ content ], "Pasted-text.txt", {
|
|
72
|
+
type: "text/plain"
|
|
73
|
+
}) ]), !0);
|
|
74
|
+
useLayoutEffect(() => {
|
|
75
|
+
var _a;
|
|
76
|
+
const pending = pendingCaret.current;
|
|
77
|
+
pending && pending.value === text && (pendingCaret.current = void 0, null === (_a = editor.current) || void 0 === _a || _a.setSelectionRange(pending.caret, pending.caret));
|
|
78
|
+
}, [ text ]);
|
|
79
|
+
const actions = {
|
|
80
|
+
value: text,
|
|
81
|
+
attachments: attachments,
|
|
82
|
+
canSubmit: canSubmit,
|
|
83
|
+
canAttach: canAttach,
|
|
84
|
+
disabled: !canEdit,
|
|
85
|
+
focus: focus,
|
|
86
|
+
submit: submit,
|
|
87
|
+
stop: stop,
|
|
88
|
+
openFilePicker: selection.openPicker,
|
|
89
|
+
addFiles: selection.selectFiles,
|
|
90
|
+
pasteText: content => {
|
|
91
|
+
var _a, _b;
|
|
92
|
+
if (!canEdit || !content) return;
|
|
93
|
+
if (makeTextAttachment(content)) return void focus();
|
|
94
|
+
const element = editor.current, next = function(value, text, start, end, maxLength) {
|
|
95
|
+
const before = value.slice(0, start), after = value.slice(end);
|
|
96
|
+
let inserted = text;
|
|
97
|
+
if ("number" == typeof maxLength && Number.isFinite(maxLength) && maxLength >= 0) {
|
|
98
|
+
let limit = Math.max(0, Math.floor(maxLength) - before.length - after.length);
|
|
99
|
+
const previous = text.charCodeAt(limit - 1), next = text.charCodeAt(limit);
|
|
100
|
+
previous >= 55296 && previous <= 56319 && next >= 56320 && next <= 57343 && (limit -= 1),
|
|
101
|
+
inserted = text.slice(0, limit);
|
|
102
|
+
}
|
|
103
|
+
return {
|
|
104
|
+
value: before + inserted + after,
|
|
105
|
+
caret: before.length + inserted.length
|
|
106
|
+
};
|
|
107
|
+
}(text, content, null !== (_a = null == element ? void 0 : element.selectionStart) && void 0 !== _a ? _a : text.length, null !== (_b = null == element ? void 0 : element.selectionEnd) && void 0 !== _b ? _b : text.length, textLimit);
|
|
108
|
+
pendingCaret.current = next, changeText(next.value), focus();
|
|
109
|
+
}
|
|
110
|
+
}, latestActions = useRef(void 0);
|
|
111
|
+
useLayoutEffect(() => (latestActions.current = actions, () => {
|
|
112
|
+
latestActions.current = void 0;
|
|
113
|
+
}));
|
|
114
|
+
const exposedActions = Object.assign(Object.assign({}, actions), {
|
|
115
|
+
pasteText: content => {
|
|
116
|
+
var _a;
|
|
117
|
+
return null === (_a = latestActions.current) || void 0 === _a ? void 0 : _a.pasteText(content);
|
|
118
|
+
},
|
|
119
|
+
addFiles: files => {
|
|
120
|
+
var _a, _b;
|
|
121
|
+
return null !== (_b = null === (_a = latestActions.current) || void 0 === _a ? void 0 : _a.addFiles(files)) && void 0 !== _b && _b;
|
|
122
|
+
},
|
|
123
|
+
submit: () => {
|
|
124
|
+
var _a;
|
|
125
|
+
return null === (_a = latestActions.current) || void 0 === _a ? void 0 : _a.submit();
|
|
126
|
+
},
|
|
127
|
+
stop: () => {
|
|
128
|
+
var _a;
|
|
129
|
+
return null === (_a = latestActions.current) || void 0 === _a ? void 0 : _a.stop();
|
|
130
|
+
},
|
|
131
|
+
openFilePicker: () => {
|
|
132
|
+
var _a;
|
|
133
|
+
return null === (_a = latestActions.current) || void 0 === _a ? void 0 : _a.openFilePicker();
|
|
134
|
+
}
|
|
135
|
+
}), customActions = "function" == typeof children ? children(exposedActions) : children, hasActions = React.Children.count(customActions) > 0 || attachButton || sendButton, getBorder = () => "none" === borderStyle ? "transparent" : "gradient" === borderStyle ? null != borderColor ? borderColor : "var(--prompt-gradient)" : working ? null != borderColorFocused ? borderColorFocused : "var(--core-outline-special)" : null != borderColor ? borderColor : "var(--core-outline-primary)", size = Number.isFinite(borderWidth) ? Math.max(0, borderWidth) : 1, innerRadius = "number" == typeof borderRadius ? `${Math.max(0, borderRadius - size)}px` : `max(0px, calc(${borderRadius} - ${size}px))`, variables = {
|
|
136
|
+
"--prompt-width": setStyle(width),
|
|
137
|
+
"--prompt-max-width": setStyle(maxWidth, "none"),
|
|
138
|
+
"--prompt-min-width": setStyle(minWidth, "0px"),
|
|
139
|
+
"--prompt-border-color": getBorder(),
|
|
140
|
+
"--prompt-focused-border": null != borderColorFocused ? borderColorFocused : getBorder(),
|
|
141
|
+
"--prompt-border-width": `${size}px`,
|
|
142
|
+
"--prompt-border-radius": setStyle(borderRadius),
|
|
143
|
+
"--prompt-inner-border-radius": innerRadius,
|
|
144
|
+
"--prompt-state": working && borderAnimate && !reducedMotion ? "running" : "paused",
|
|
145
|
+
"--prompt-toolbar-gap": setStyle(toolbarGap)
|
|
146
|
+
};
|
|
147
|
+
return jsx("div", Object.assign({}, attributes, {
|
|
148
|
+
ref: ref,
|
|
149
|
+
"data-file-dragging": canAttach && fileDragging || void 0,
|
|
150
|
+
onDragEnter: event => {
|
|
151
|
+
null == onDragEnter || onDragEnter(event), !event.defaultPrevented && canAttach && isFileDrag(event) && (event.preventDefault(),
|
|
152
|
+
dragDepth.current += 1, setFileDragging(!0));
|
|
153
|
+
},
|
|
154
|
+
onDragOver: event => {
|
|
155
|
+
null == onDragOver || onDragOver(event), !event.defaultPrevented && isFileDrag(event) && (event.preventDefault(),
|
|
156
|
+
event.dataTransfer.dropEffect = canAttach ? "copy" : "none");
|
|
157
|
+
},
|
|
158
|
+
onDragLeave: event => {
|
|
159
|
+
null == onDragLeave || onDragLeave(event), isFileDrag(event) && (dragDepth.current = Math.max(0, dragDepth.current - 1),
|
|
160
|
+
dragDepth.current || setFileDragging(!1));
|
|
161
|
+
},
|
|
162
|
+
onDrop: event => {
|
|
163
|
+
if (null == onDrop || onDrop(event), !isFileDrag(event)) return;
|
|
164
|
+
const cancelled = event.defaultPrevented;
|
|
165
|
+
event.preventDefault(), resetFileDrag(), cancelled || selection.selectFiles(Array.from(event.dataTransfer.files));
|
|
166
|
+
},
|
|
167
|
+
onClick: event => {
|
|
168
|
+
var _a;
|
|
169
|
+
if (null == onClick || onClick(event), event.defaultPrevented || disabled) return;
|
|
170
|
+
const target = event.target;
|
|
171
|
+
target instanceof Element && event.currentTarget.contains(target) && (target.closest('button, a, input, textarea, select, label, [contenteditable]:not([contenteditable="false"]), [tabindex], [role="button"], [role="menuitem"], [role="checkbox"], [role="combobox"], [role="switch"], [role="link"]') || !1 !== (null === (_a = event.currentTarget.ownerDocument.getSelection()) || void 0 === _a ? void 0 : _a.isCollapsed) && focus());
|
|
172
|
+
},
|
|
173
|
+
className: `${css_wrapper} ${null !== (_b = attributes.className) && void 0 !== _b ? _b : ""}`,
|
|
174
|
+
style: Object.assign(Object.assign({}, attributes.style), variables),
|
|
175
|
+
children: jsxs("div", {
|
|
176
|
+
className: css_surface,
|
|
177
|
+
children: [ attachments.length > 0 && jsx("div", {
|
|
178
|
+
className: css_attachments,
|
|
179
|
+
children: jsx(FileList, Object.assign({
|
|
180
|
+
direction: "row",
|
|
181
|
+
gap: 8
|
|
182
|
+
}, fileListProps, {
|
|
183
|
+
files: attachments,
|
|
184
|
+
canRemove: canAttach,
|
|
185
|
+
onChange: changeAttachments,
|
|
186
|
+
onToolTip: onToolTip
|
|
187
|
+
}))
|
|
188
|
+
}), jsx(TextArea, Object.assign({
|
|
189
|
+
rows: 1,
|
|
190
|
+
autoGrow: !0,
|
|
191
|
+
resizable: !1,
|
|
192
|
+
borderStyle: "none",
|
|
193
|
+
backgroundColor: "transparent",
|
|
194
|
+
padding: "var(--spacing-m)",
|
|
195
|
+
maxHeight: maxHeight,
|
|
196
|
+
textSize: textSize,
|
|
197
|
+
inputName: inputName,
|
|
198
|
+
placeholder: working ? placeholderWorking : placeholder
|
|
199
|
+
}, textAreaProps, {
|
|
200
|
+
maxLength: textLimit,
|
|
201
|
+
inputRef: editor,
|
|
202
|
+
value: text,
|
|
203
|
+
disabled: disabled,
|
|
204
|
+
readOnly: readOnly,
|
|
205
|
+
focused: focused,
|
|
206
|
+
showSendButton: !1,
|
|
207
|
+
submitClears: !1,
|
|
208
|
+
returnSubmits: enterSubmits && !blocked,
|
|
209
|
+
allowEmptySubmit: attachments.length > 0 && !waiting,
|
|
210
|
+
onChange: changeText,
|
|
211
|
+
onSubmit: submit,
|
|
212
|
+
onFocus: next => null == onFocus ? void 0 : onFocus(next, attachments),
|
|
213
|
+
onBlur: next => null == onBlur ? void 0 : onBlur(next, attachments),
|
|
214
|
+
onKeyDown: event => {
|
|
215
|
+
null == onKeyDown || onKeyDown(event), event.defaultPrevented || event.repeat && "Enter" === event.key && event.preventDefault();
|
|
216
|
+
},
|
|
217
|
+
onPaste: event => {
|
|
218
|
+
if (null == onPaste || onPaste(event), event.defaultPrevented || !canEdit) return;
|
|
219
|
+
const content = event.clipboardData.getData("text/plain");
|
|
220
|
+
makeTextAttachment(content) && event.preventDefault();
|
|
221
|
+
}
|
|
222
|
+
})), hasActions && jsxs("div", {
|
|
223
|
+
className: css_buttonBar,
|
|
224
|
+
children: [ jsxs("div", {
|
|
225
|
+
className: css_actions,
|
|
226
|
+
children: [ attachButton && jsx(IconButton, {
|
|
227
|
+
actionName: attachActionName,
|
|
228
|
+
icon: "basic.plus",
|
|
229
|
+
buttonSize: "m",
|
|
230
|
+
disabled: !canAttach,
|
|
231
|
+
onClick: event => {
|
|
232
|
+
event.defaultPrevented || selection.openPicker();
|
|
233
|
+
},
|
|
234
|
+
tooltip: attachActionName,
|
|
235
|
+
onToolTip: onToolTip,
|
|
236
|
+
backgroundColor: "core-fill-primary"
|
|
237
|
+
}), customActions ]
|
|
238
|
+
}), sendButton && jsx(Button, {
|
|
239
|
+
round: !0,
|
|
240
|
+
"aria-label": stopEnabled ? stopActionName : sendActionName,
|
|
241
|
+
variant: stopEnabled ? "outline" : "solid",
|
|
242
|
+
iconLeft: stopEnabled ? "media.stop" : "arrows.arrow-top",
|
|
243
|
+
iconSize: stopEnabled ? 16 : 20,
|
|
244
|
+
disabled: stopEnabled ? disabled : !canSubmit,
|
|
245
|
+
progress: !stopEnabled,
|
|
246
|
+
working: !stopEnabled && working && submitWorking,
|
|
247
|
+
onClick: event => {
|
|
248
|
+
(null == event ? void 0 : event.defaultPrevented) || (stopEnabled ? stop() : submit());
|
|
249
|
+
},
|
|
250
|
+
tooltip: stopEnabled ? stopActionName : sendActionName,
|
|
251
|
+
onToolTip: onToolTip
|
|
252
|
+
}) ]
|
|
253
|
+
}), jsx("span", {
|
|
254
|
+
className: css_rejection,
|
|
255
|
+
role: "alert",
|
|
256
|
+
children: selection.rejection
|
|
257
|
+
}), jsx("input", Object.assign({}, selection.inputProps)) ]
|
|
258
|
+
})
|
|
259
|
+
}));
|
|
260
|
+
});
|
|
261
|
+
|
|
262
|
+
PromptInputBase.displayName = "PromptInput";
|
|
263
|
+
|
|
264
|
+
const PromptInput = React.memo(PromptInputBase);
|
|
265
|
+
|
|
266
|
+
export { PromptInput as P };
|
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { a as __rest } from "./tslib.es6-CpnJrDBv.mjs";
|
|
3
|
+
|
|
4
|
+
import { jsxs, jsx } from "react/jsx-runtime";
|
|
5
|
+
|
|
6
|
+
import React, { createContext, useContext } from "react";
|
|
7
|
+
|
|
8
|
+
import { r as resolveColorProps } from "./resolveColorProps-CwAU25V-.mjs";
|
|
9
|
+
|
|
10
|
+
import { I as Icon } from "./Icon-43T0fkr6.mjs";
|
|
11
|
+
|
|
12
|
+
var css = {
|
|
13
|
+
wrapper: "RadioButton-module_wrapper__-pWRe",
|
|
14
|
+
input: "RadioButton-module_input__dHUSs",
|
|
15
|
+
surface: "RadioButton-module_surface__PKlAe",
|
|
16
|
+
icon: "RadioButton-module_icon__4v0uF",
|
|
17
|
+
unchecked: "RadioButton-module_unchecked__5hBsd",
|
|
18
|
+
checked: "RadioButton-module_checked__Uc9Re",
|
|
19
|
+
text: "RadioButton-module_text__aI1uE",
|
|
20
|
+
xs: "RadioButton-module_xs__L6gFZ type-module_body-xs-regular__ZAFft",
|
|
21
|
+
s: "RadioButton-module_s__t-xnF type-module_body-s-regular__vRHSP",
|
|
22
|
+
m: "RadioButton-module_m__xIMOt type-module_body-m-regular__LuQBA",
|
|
23
|
+
l: "RadioButton-module_l__dgWPn type-module_body-l-regular__lOYbg",
|
|
24
|
+
xl: "RadioButton-module_xl__hcEbL type-module_body-xl-regular__pF2kC"
|
|
25
|
+
};
|
|
26
|
+
|
|
27
|
+
const RadioGroupContext = createContext(null), length = (value, fallback) => "number" == typeof value ? Number.isFinite(value) ? `${Math.max(0, value)}px` : fallback : value;
|
|
28
|
+
|
|
29
|
+
function RadioButtonComponent(rawProps) {
|
|
30
|
+
var _a;
|
|
31
|
+
const group = useContext(RadioGroupContext), ownProps = Object.fromEntries(Object.entries(rawProps).filter(([, value]) => void 0 !== value)), props = resolveColorProps(group ? Object.assign(Object.assign({}, group.optionProps), ownProps) : rawProps), {actionName: actionName, align: align = "middle", label: label, children: children, checked: checked, defaultChecked: defaultChecked = !1, disabled: disabled = !1, fieldName: fieldName, value: value, formValue: formValue, iconChecked: iconChecked = "system.check-circle", iconUnChecked: iconUnChecked = "system.circle", iconColor: iconColor = "var(--core-text-primary)", iconColorSelected: iconColorSelected, iconSize: iconSize = 20, gap: gap = 6, textColor: textColor = "var(--core-text-primary)", textSize: textSize = "m", textTopOffset: textTopOffset = 0, backgroundColor: backgroundColor = "transparent", backgroundColorSelected: backgroundColorSelected = "transparent", borderWidth: borderWidth = 0, borderColor: borderColor = "var(--core-outline-primary)", borderRadius: borderRadius = 8, padding: padding = 0, onChange: onChange, onClick: onClick, className: className, style: style} = props, inputAttributes = __rest(props, [ "actionName", "align", "label", "children", "checked", "defaultChecked", "disabled", "fieldName", "value", "formValue", "iconChecked", "iconUnChecked", "iconColor", "iconColorSelected", "iconSize", "gap", "textColor", "textSize", "textTopOffset", "backgroundColor", "backgroundColorSelected", "borderWidth", "borderColor", "borderRadius", "padding", "onChange", "onClick", "className", "style" ]);
|
|
32
|
+
if (group && null == value) throw new Error("RadioButton inside RadioButtonList requires a non-null value.");
|
|
33
|
+
const effectiveChecked = group ? null !== group.value && void 0 !== group.value && Object.is(group.value, value) : checked, effectiveDisabled = disabled || Boolean(null == group ? void 0 : group.disabled), content = null != label ? label : children, hasContent = null != content && "boolean" != typeof content && ("string" != typeof content || content.trim().length > 0), size = Number.isFinite(iconSize) && iconSize >= 0 ? iconSize : 20, offset = Number.isFinite(textTopOffset) ? textTopOffset : 0, cssVars = {
|
|
34
|
+
"--rb-align": "top" === align ? "flex-start" : "bottom" === align ? "flex-end" : "center",
|
|
35
|
+
"--rb-icon-size": `${size}px`,
|
|
36
|
+
"--rb-gap": `${Number.isFinite(gap) ? Math.max(0, gap) : 6}px`,
|
|
37
|
+
"--rb-icon-color": iconColor,
|
|
38
|
+
"--rb-icon-color-selected": null != iconColorSelected ? iconColorSelected : iconColor,
|
|
39
|
+
"--rb-text-color": textColor,
|
|
40
|
+
"--rb-text-top": `${Math.max(0, offset)}px`,
|
|
41
|
+
"--rb-text-bottom": `${Math.max(0, -offset)}px`,
|
|
42
|
+
"--rb-background": backgroundColor,
|
|
43
|
+
"--rb-background-selected": backgroundColorSelected,
|
|
44
|
+
"--rb-border-width": length(borderWidth, "0px"),
|
|
45
|
+
"--rb-border-color": borderColor,
|
|
46
|
+
"--rb-border-radius": length(borderRadius, "8px"),
|
|
47
|
+
"--rb-padding": length(padding, "0px")
|
|
48
|
+
};
|
|
49
|
+
return jsxs("label", {
|
|
50
|
+
className: `${css.wrapper}${className ? ` ${className}` : ""}`,
|
|
51
|
+
style: Object.assign(Object.assign({}, style), cssVars),
|
|
52
|
+
"data-disabled": effectiveDisabled || void 0,
|
|
53
|
+
children: [ jsx("input", Object.assign({}, inputAttributes, {
|
|
54
|
+
className: css.input,
|
|
55
|
+
type: "radio",
|
|
56
|
+
name: null !== (_a = null == group ? void 0 : group.name) && void 0 !== _a ? _a : inputAttributes.name,
|
|
57
|
+
checked: effectiveChecked,
|
|
58
|
+
defaultChecked: group || void 0 !== checked ? void 0 : defaultChecked,
|
|
59
|
+
disabled: effectiveDisabled,
|
|
60
|
+
value: null != formValue ? formValue : "string" == typeof value || "number" == typeof value ? value : void 0,
|
|
61
|
+
"aria-label": (null == actionName ? void 0 : actionName.trim()) || (hasContent ? void 0 : "Option"),
|
|
62
|
+
"aria-labelledby": void 0,
|
|
63
|
+
onClick: onClick,
|
|
64
|
+
onChange: event => {
|
|
65
|
+
if (event.defaultPrevented || event.nativeEvent.defaultPrevented || effectiveDisabled) return;
|
|
66
|
+
const option = {
|
|
67
|
+
fieldName: fieldName,
|
|
68
|
+
label: label,
|
|
69
|
+
value: value
|
|
70
|
+
}, next = event.currentTarget.checked;
|
|
71
|
+
null == onChange || onChange(option, next), next && (null == group || group.select(option));
|
|
72
|
+
}
|
|
73
|
+
})), jsxs("span", {
|
|
74
|
+
className: css.surface,
|
|
75
|
+
children: [ size > 0 && jsxs("span", {
|
|
76
|
+
className: css.icon,
|
|
77
|
+
"aria-hidden": "true",
|
|
78
|
+
children: [ jsx("span", {
|
|
79
|
+
className: css.unchecked,
|
|
80
|
+
children: jsx(Icon, {
|
|
81
|
+
name: iconUnChecked,
|
|
82
|
+
size: size,
|
|
83
|
+
strokeColor: "currentColor",
|
|
84
|
+
pointer: !1,
|
|
85
|
+
tabIndex: -1
|
|
86
|
+
})
|
|
87
|
+
}), jsx("span", {
|
|
88
|
+
className: css.checked,
|
|
89
|
+
children: jsx(Icon, {
|
|
90
|
+
name: iconChecked,
|
|
91
|
+
size: size,
|
|
92
|
+
strokeColor: "currentColor",
|
|
93
|
+
pointer: !1,
|
|
94
|
+
tabIndex: -1
|
|
95
|
+
})
|
|
96
|
+
}) ]
|
|
97
|
+
}), hasContent && jsx("span", {
|
|
98
|
+
className: `${css.text} ${css[textSize]}`,
|
|
99
|
+
children: content
|
|
100
|
+
}) ]
|
|
101
|
+
}) ]
|
|
102
|
+
});
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
RadioButtonComponent.displayName = "RadioButton";
|
|
106
|
+
|
|
107
|
+
const RadioButton = React.memo(RadioButtonComponent);
|
|
108
|
+
|
|
109
|
+
export { RadioButton as R, RadioGroupContext as a };
|