@apple-pie/slice 0.1.59 → 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-63XvrV1q.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-ClIpb2ob.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-CDWOkk8n.js → WSConnection-DZKTeDtZ.js} +1 -1
- package/dist/cjs/chunks/{WebRTCConnection-b8jZNRYr.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-PGtTaJyY.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-BRd0iQuq.js → localDBStore-CTWlm2t-.js} +6 -2
- package/dist/cjs/chunks/{microphoneStore-DljI0Zpj.js → microphoneStore-D7DuvQeX.js} +1 -1
- package/dist/cjs/chunks/{misc-BallZ366.js → misc-PmT7cZzC.js} +29 -38
- package/dist/cjs/chunks/{modalStore-BexwvT-T.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-cSWpKohM.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-DzrC-YiR.js → uploads-worker-stCHn8-D.js} +1 -1
- package/dist/cjs/chunks/{uploadsStore-BajO-auR.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-DzgmrI6q.js → volumeStore-BoEoo9wA.js} +1 -1
- package/dist/cjs/chunks/{webRTCStore-BXHg9abP.js → webRTCStore-OGkXAovD.js} +6 -2
- package/dist/cjs/chunks/{windowStore-DpNMptuw.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 +18 -12
- 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-B7_cbtHF.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-CB92RX6-.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-BENe51Ue.mjs → WSConnection-ByCYrNOq.mjs} +1 -1
- package/dist/esm/chunks/{WebRTCConnection-Cwx1C6Ta.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-oGeBSxAT.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-ZwQD3ino.mjs → localDBStore-DYhPmkHz.mjs} +7 -3
- package/dist/esm/chunks/{microphoneStore-D8VxjdFZ.mjs → microphoneStore-BzSEbtfK.mjs} +1 -1
- package/dist/esm/chunks/{misc-DBIXjc2Q.mjs → misc-DI5GSqkt.mjs} +24 -34
- package/dist/esm/chunks/{modalStore-GWNWh1tE.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-CZqJmpUR.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-DuyqBeHz.mjs → uploads-worker-CpJtBCvY.mjs} +1 -1
- package/dist/esm/chunks/{uploadsStore-D9Ftk4Ke.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-hrteUkB-.mjs → volumeStore-mqWIRL0J.mjs} +1 -1
- package/dist/esm/chunks/{webRTCStore-B2ri-_li.mjs → webRTCStore-BepH2O9l.mjs} +7 -3
- package/dist/esm/chunks/{windowStore-DIdy_IoC.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 +5106 -3872
- 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 -132
- 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 -193
- package/scripts/README.md +19 -0
- package/dist/cjs/chunks/AudioBubble-DAtkPfFK.js +0 -55
- package/dist/cjs/chunks/Avatar-BI8Gvsp7.js +0 -82
- package/dist/cjs/chunks/AvatarGroup-1IxbG6-D.js +0 -41
- package/dist/cjs/chunks/Badge-DMey3Pf3.js +0 -22
- package/dist/cjs/chunks/Button-BjmkIu7l.js +0 -265
- package/dist/cjs/chunks/ButtonBar-BxA8GQPM.js +0 -72
- package/dist/cjs/chunks/Camera-ByjATQDE.js +0 -380
- package/dist/cjs/chunks/CheckBox-DZng-9wI.js +0 -51
- package/dist/cjs/chunks/Chip-CqUDN_QK.js +0 -80
- package/dist/cjs/chunks/DivInput-GYDtuy4a.js +0 -101
- package/dist/cjs/chunks/Dot-BgyxIyrr.js +0 -72
- package/dist/cjs/chunks/DrggablePanel-BjOFnl0l.js +0 -224
- package/dist/cjs/chunks/DropDown-C0vZNCK4.js +0 -105
- package/dist/cjs/chunks/ErrorSummary-CVzk_ASK.js +0 -88
- package/dist/cjs/chunks/FileList-6qXKA_Ux.js +0 -223
- package/dist/cjs/chunks/FlexDiv-LwjVh6ls.js +0 -178
- package/dist/cjs/chunks/Grouper-BlWyuh_b.js +0 -63
- package/dist/cjs/chunks/Icon-BTjtQLNe.js +0 -1473
- package/dist/cjs/chunks/IconButton-C0yNYhI6.js +0 -182
- package/dist/cjs/chunks/Label-DsMFZd91.js +0 -106
- package/dist/cjs/chunks/Level-VKdsTW_-.js +0 -63
- package/dist/cjs/chunks/Modal-Dp5Wg1Bw.js +0 -128
- package/dist/cjs/chunks/ModalController-Cb2_7DtS.js +0 -81
- package/dist/cjs/chunks/Overlay-hOm9sYjr.js +0 -41
- package/dist/cjs/chunks/Pager-CPhi9uyP.js +0 -36
- package/dist/cjs/chunks/ProgressIndicator-CMsc_Npc.js +0 -140
- package/dist/cjs/chunks/PromptInput-6eDiLG4g.js +0 -161
- package/dist/cjs/chunks/RadioButton-DMxqwM6_.js +0 -55
- package/dist/cjs/chunks/RadioButtonList-kG_Y1d4X.js +0 -73
- package/dist/cjs/chunks/Slider-DGJomZGG.js +0 -169
- package/dist/cjs/chunks/Spacer-Z97EoNtJ.js +0 -26
- package/dist/cjs/chunks/Switch-CfzJd19R.js +0 -44
- package/dist/cjs/chunks/TabBar-C2aNS0Sd.js +0 -183
- package/dist/cjs/chunks/TextArea-G_MUJAHw.js +0 -77
- package/dist/cjs/chunks/TextField-CWIGERkd.js +0 -190
- package/dist/cjs/chunks/Tip-B7RF879X.js +0 -89
- package/dist/cjs/chunks/Toast-pkSkNuZo.js +0 -185
- package/dist/cjs/chunks/ToggleButton-DPc2x2EV.js +0 -45
- package/dist/cjs/chunks/UploadArea-DyVGwChS.js +0 -132
- package/dist/cjs/chunks/Video-Dh-_ouTP.js +0 -301
- package/dist/cjs/chunks/VideoController-CVm1CtaE.js +0 -95
- package/dist/cjs/chunks/_types-DxINS-ge.js +0 -140
- package/dist/cjs/chunks/audioVisualizer-C74sRH6D.js +0 -60
- package/dist/cjs/chunks/colors-BDwwQ2Y3.js +0 -27
- package/dist/cjs/chunks/debounce-Bi3gt_i6.js +0 -18
- package/dist/cjs/chunks/sharedTypes-XAbs742N.js +0 -6
- package/dist/cjs/chunks/toastStore-Bwus7v5O.js +0 -17
- package/dist/cjs/chunks/viewState-BVtEQ4sR.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-B8vlO9fq.mjs +0 -69
- package/dist/esm/chunks/Avatar-BMHnrzr3.mjs +0 -88
- package/dist/esm/chunks/AvatarGroup-BoBXPEbH.mjs +0 -47
- package/dist/esm/chunks/Badge-C7xDwrvC.mjs +0 -26
- package/dist/esm/chunks/Button-C6sTA1hG.mjs +0 -283
- package/dist/esm/chunks/ButtonBar-Bh3-UpMU.mjs +0 -82
- package/dist/esm/chunks/Camera-BXSLetAD.mjs +0 -398
- package/dist/esm/chunks/CheckBox-DkXJwLeU.mjs +0 -61
- package/dist/esm/chunks/Chip-XTbAoiHl.mjs +0 -92
- package/dist/esm/chunks/DivInput-TsyOx4x2.mjs +0 -113
- package/dist/esm/chunks/Dot-D0NtTwqi.mjs +0 -78
- package/dist/esm/chunks/DrggablePanel-BK9ukIbF.mjs +0 -236
- package/dist/esm/chunks/DropDown-F7yIB6EJ.mjs +0 -115
- package/dist/esm/chunks/ErrorSummary-SseJ5z1U.mjs +0 -101
- package/dist/esm/chunks/FileList-Bv9yn2QS.mjs +0 -231
- package/dist/esm/chunks/FlexDiv-3OxQ9y_1.mjs +0 -188
- package/dist/esm/chunks/Grouper-BcrjlgM-.mjs +0 -83
- package/dist/esm/chunks/Icon-He4S-Q8N.mjs +0 -1487
- package/dist/esm/chunks/IconButton-BGL-_8VW.mjs +0 -197
- package/dist/esm/chunks/Label-BouM6sY2.mjs +0 -119
- package/dist/esm/chunks/Level-CTkhQuiZ.mjs +0 -68
- package/dist/esm/chunks/Modal-BnbUOsKH.mjs +0 -142
- package/dist/esm/chunks/ModalController-Dk2VZcXW.mjs +0 -92
- package/dist/esm/chunks/Overlay-D5cMQSvL.mjs +0 -47
- package/dist/esm/chunks/Pager-4-2T_ZbJ.mjs +0 -42
- package/dist/esm/chunks/ProgressIndicator-DBf_bLtr.mjs +0 -156
- package/dist/esm/chunks/PromptInput-I10dUhFO.mjs +0 -175
- package/dist/esm/chunks/RadioButton-ZD7w9pql.mjs +0 -63
- package/dist/esm/chunks/RadioButtonList-h2_5VM4X.mjs +0 -81
- package/dist/esm/chunks/Slider-2Q6yVb8H.mjs +0 -183
- package/dist/esm/chunks/Spacer-Rj8PKnt3.mjs +0 -28
- package/dist/esm/chunks/Switch-C4zkPOMU.mjs +0 -50
- package/dist/esm/chunks/TabBar-bYgmIa-q.mjs +0 -205
- package/dist/esm/chunks/TextArea-BS0Iu1RB.mjs +0 -87
- package/dist/esm/chunks/TextField-BT1quQpj.mjs +0 -210
- package/dist/esm/chunks/Tip-B4Tg6gIC.mjs +0 -99
- package/dist/esm/chunks/Toast-DWHhX64K.mjs +0 -203
- package/dist/esm/chunks/ToggleButton-KAplYW5q.mjs +0 -53
- package/dist/esm/chunks/UploadArea-D_ytxxSf.mjs +0 -142
- package/dist/esm/chunks/Video-BHSzz3Wx.mjs +0 -316
- package/dist/esm/chunks/VideoController-D9ihYFYq.mjs +0 -114
- package/dist/esm/chunks/_types-FIe85AYv.mjs +0 -140
- package/dist/esm/chunks/audioVisualizer-BiB7Hun_.mjs +0 -60
- package/dist/esm/chunks/colors-DAIBQReF.mjs +0 -30
- package/dist/esm/chunks/debounce-BPsURiHk.mjs +0 -19
- package/dist/esm/chunks/sharedTypes-DdC4rvjp.mjs +0 -8
- package/dist/esm/chunks/toastStore-CRMyZAzS.mjs +0 -15
- package/dist/esm/chunks/viewState-BdLOLJlv.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-DiL2zm2P.js → MdStreamBuffer-B0KtaR_k.js} +0 -0
- /package/dist/cjs/chunks/{SSEConnection-CTxnFASS.js → SSEConnection-BXWkgT66.js} +0 -0
- /package/dist/cjs/chunks/{activeTabStore-C8afog5l.js → activeTabStore-D2gxAoK6.js} +0 -0
- /package/dist/cjs/chunks/{broadcastChannel-DLSijpj_.js → broadcastChannel-DdPZ3LUB.js} +0 -0
- /package/dist/cjs/chunks/{magic-string.es-DRDyITUv.js → magic-string.es-DsAR0Q7u.js} +0 -0
- /package/dist/cjs/chunks/{rafThrottle-DdNEpMIw.js → rafThrottle-BRdLzPo7.js} +0 -0
- /package/dist/cjs/chunks/{tipStore-BKFK6F3e.js → tipStore-DDHyGeyK.js} +0 -0
- /package/dist/cjs/chunks/{tslib.es6-B2uEaXWi.js → tslib.es6-B8JY5ZGw.js} +0 -0
- /package/dist/cjs/chunks/{videoStore-BYmE3fJZ.js → videoStore-B0l9iBw4.js} +0 -0
- /package/dist/esm/chunks/{MdStreamBuffer-D2Yh0SCY.mjs → MdStreamBuffer-CcO5IBxD.mjs} +0 -0
- /package/dist/esm/chunks/{SSEConnection-B3iPwyF_.mjs → SSEConnection-B5rVxalP.mjs} +0 -0
- /package/dist/esm/chunks/{activeTabStore-BsoH1tFV.mjs → activeTabStore-CCstpXAC.mjs} +0 -0
- /package/dist/esm/chunks/{broadcastChannel-DahousoM.mjs → broadcastChannel-CPT0S33H.mjs} +0 -0
- /package/dist/esm/chunks/{magic-string.es-DOKITkor.mjs → magic-string.es-CI4cCGRB.mjs} +0 -0
- /package/dist/esm/chunks/{rafThrottle-BX9f7-D1.mjs → rafThrottle-Dl8Z5sJ-.mjs} +0 -0
- /package/dist/esm/chunks/{tipStore-CF42G3w9.mjs → tipStore-CBvk303u.mjs} +0 -0
- /package/dist/esm/chunks/{tslib.es6-DatKI43-.mjs → tslib.es6-CpnJrDBv.mjs} +0 -0
- /package/dist/esm/chunks/{videoStore-CiDDAB4E.mjs → videoStore-Cd-Lewfy.mjs} +0 -0
|
@@ -0,0 +1,189 @@
|
|
|
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"), Icon = require("./Icon-COY7IZkK.js"), css = {
|
|
5
|
+
field: "TextArea-module_field__Tx6iH",
|
|
6
|
+
label: "TextArea-module_label__2TV89",
|
|
7
|
+
wrapper: "TextArea-module_wrapper__O0sWP",
|
|
8
|
+
textarea: "TextArea-module_textarea__-R2n0 scrollBars-module_scrollbars__c-ZPl",
|
|
9
|
+
resizeGrip: "TextArea-module_resizeGrip__TOC7J",
|
|
10
|
+
message: "TextArea-module_message__y0kVC",
|
|
11
|
+
sendSpace: "TextArea-module_sendSpace__dvtg9",
|
|
12
|
+
send: "TextArea-module_send__Cub13",
|
|
13
|
+
xs: "TextArea-module_xs__5e748 type-module_body-xs-regular__ZAFft",
|
|
14
|
+
s: "TextArea-module_s__Ac-fq type-module_body-s-regular__vRHSP",
|
|
15
|
+
m: "TextArea-module_m__dod4R type-module_body-m-regular__LuQBA",
|
|
16
|
+
l: "TextArea-module_l__-uLCG type-module_body-l-regular__lOYbg",
|
|
17
|
+
xl: "TextArea-module_xl__H6-7T type-module_body-xl-regular__pF2kC"
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
const useClientLayoutEffect = "undefined" == typeof window ? React.useEffect : React.useLayoutEffect, withoutAria = attributes => Object.fromEntries(Object.entries(attributes).filter(([key]) => !key.startsWith("aria-") && "role" !== key)), defaultSendOffset = {
|
|
21
|
+
bottom: 10,
|
|
22
|
+
right: 10
|
|
23
|
+
};
|
|
24
|
+
|
|
25
|
+
function TextAreaComponent(rawProps) {
|
|
26
|
+
var _a;
|
|
27
|
+
const props = resolveColorProps.resolveColorProps(rawProps), {value: value, inputRef: inputRef, defaultValue: defaultValue = "", name: name, inputName: inputName, inputId: inputId, inputAttributes: inputAttributes = {}, label: label, labelSize: labelSize = "m", labelColor: labelColor = "var(--core-text-primary)", width: width = "100%", height: height = "auto", maxHeight: maxHeight, minWidth: minWidth, rows: rows = 6, autoGrow: autoGrow = !0, focused: focused, placeholder: placeholder = "Enter text here...", padding: padding = "var(--spacing-m) var(--spacing-s) var(--spacing-m) var(--spacing-m)", borderStyle: borderStyle = "box", borderRadius: borderRadius = theme_corners.corners["corner-xs"], error: error = !1, errorMessage: errorMessage, tip: tip, borderColor: borderColor = "var(--core-outline-primary)", borderColorFocused: borderColorFocused = "var(--core-link-primary)", borderColorError: borderColorError = "var(--feedback-warning)", backgroundColor: backgroundColor = "var(--core-surface-secondary)", resizable: resizable = !0, showSendButton: showSendButton = !1, sendActionName: sendActionName = "Send", sendOffset: sendOffset = defaultSendOffset, sendSize: sendSize = 36, returnSubmits: returnSubmits = !1, textSize: textSize = "m", textColor: textColor = "var(--core-text-primary)", textColorDisabled: textColorDisabled = "var(--core-text-disabled)", textColorPlaceholder: textColorPlaceholder = "var(--core-text-disabled)", textColorError: textColorError = "var(--feedback-warning)", disabled: disabled = !1, readOnly: readOnly = !1, submitClears: submitClears = !0, allowEmptySubmit: allowEmptySubmit = !1, maxLength: maxLength, onChange: onChange, onFocus: onFocus, onBlur: onBlur, onSubmit: onSubmit, onKeyDown: onKeyDown, onPaste: onPaste, className: className, style: style} = props, divAttributes = tslib_es6.__rest(props, [ "value", "inputRef", "defaultValue", "name", "inputName", "inputId", "inputAttributes", "label", "labelSize", "labelColor", "width", "height", "maxHeight", "minWidth", "rows", "autoGrow", "focused", "placeholder", "padding", "borderStyle", "borderRadius", "error", "errorMessage", "tip", "borderColor", "borderColorFocused", "borderColorError", "backgroundColor", "resizable", "showSendButton", "sendActionName", "sendOffset", "sendSize", "returnSubmits", "textSize", "textColor", "textColorDisabled", "textColorPlaceholder", "textColorError", "disabled", "readOnly", "submitClears", "allowEmptySubmit", "maxLength", "onChange", "onFocus", "onBlur", "onSubmit", "onKeyDown", "onPaste", "className", "style" ]), generatedId = React.useId(), id = inputId || generatedId, hasLabel = Boolean(null == label ? void 0 : label.trim()), message = null === (_a = error ? errorMessage : tip) || void 0 === _a ? void 0 : _a.trim(), messageId = `${id}-message`, ref = React.useRef(null), setInputRef = React.useCallback(element => {
|
|
28
|
+
if (ref.current = element, "function" == typeof inputRef) {
|
|
29
|
+
const cleanup = inputRef(element);
|
|
30
|
+
if ("function" == typeof cleanup) return () => {
|
|
31
|
+
ref.current = null, cleanup();
|
|
32
|
+
};
|
|
33
|
+
} else inputRef && (inputRef.current = element);
|
|
34
|
+
}, [ inputRef ]), wrapperRef = React.useRef(null), initialValue = React.useRef(defaultValue), [localText, setLocalText] = React.useState(defaultValue), [isFocused, setIsFocused] = React.useState(!1), controlled = void 0 !== value, text = controlled ? value : localText, canEdit = !disabled && !readOnly, canSubmit = canEdit && (Boolean(text.trim()) || allowEmptySubmit) && Boolean(onSubmit), growing = autoGrow && "auto" === height, nativeResizable = resizable && !growing && "auto" === height, rowCount = Number.isFinite(rows) ? Math.max(1, Math.floor(rows)) : 6, buttonSize = Number.isFinite(sendSize) ? Math.max(0, sendSize) : 36, bottomOffset = Number.isFinite(sendOffset.bottom) ? Math.max(0, sendOffset.bottom) : 10, rightOffset = Number.isFinite(sendOffset.right) ? Math.max(0, sendOffset.right) : 10, changeText = next => {
|
|
35
|
+
canEdit && (controlled || setLocalText(next), null == onChange || onChange(next));
|
|
36
|
+
}, submit = () => {
|
|
37
|
+
var _a;
|
|
38
|
+
canSubmit && (null == onSubmit || onSubmit(text), submitClears && changeText(""),
|
|
39
|
+
null === (_a = ref.current) || void 0 === _a || _a.focus());
|
|
40
|
+
};
|
|
41
|
+
React.useEffect(() => {
|
|
42
|
+
var _a, _b;
|
|
43
|
+
disabled ? setIsFocused(!1) : void 0 !== focused && (focused ? null === (_a = ref.current) || void 0 === _a || _a.focus() : null === (_b = ref.current) || void 0 === _b || _b.blur());
|
|
44
|
+
}, [ focused, disabled ]), React.useEffect(() => {
|
|
45
|
+
var _a;
|
|
46
|
+
if (controlled) return;
|
|
47
|
+
const form = null === (_a = ref.current) || void 0 === _a ? void 0 : _a.form;
|
|
48
|
+
if (!form) return;
|
|
49
|
+
let mounted = !0;
|
|
50
|
+
const reset = event => queueMicrotask(() => {
|
|
51
|
+
mounted && !event.defaultPrevented && setLocalText(initialValue.current);
|
|
52
|
+
});
|
|
53
|
+
return form.addEventListener("reset", reset), () => {
|
|
54
|
+
mounted = !1, form.removeEventListener("reset", reset);
|
|
55
|
+
};
|
|
56
|
+
}, [ controlled, inputAttributes.form ]), useClientLayoutEffect(() => {
|
|
57
|
+
var _a;
|
|
58
|
+
const element = ref.current, wrapper = wrapperRef.current;
|
|
59
|
+
if (!element || !wrapper) return;
|
|
60
|
+
const measure = () => {
|
|
61
|
+
var _a, _b;
|
|
62
|
+
const styles = getComputedStyle(wrapper), resizeOffset = Math.max(0, Number.parseFloat(styles.paddingBottom) - Number.parseFloat(styles.paddingRight));
|
|
63
|
+
if (wrapper.style.setProperty("--ta-resize-offset", `${resizeOffset}px`), null === (_a = wrapper.parentElement) || void 0 === _a || _a.style.setProperty("--ta-message-left", styles.paddingLeft),
|
|
64
|
+
null === (_b = wrapper.parentElement) || void 0 === _b || _b.style.setProperty("--ta-message-right", styles.paddingRight),
|
|
65
|
+
!growing) return;
|
|
66
|
+
element.style.height = "auto";
|
|
67
|
+
const baseline = element.offsetHeight;
|
|
68
|
+
element.style.height = "0px";
|
|
69
|
+
const content = element.scrollHeight;
|
|
70
|
+
element.style.height = `${Math.max(baseline, content)}px`;
|
|
71
|
+
};
|
|
72
|
+
measure();
|
|
73
|
+
let previousWidth = wrapper.clientWidth;
|
|
74
|
+
const observer = new ResizeObserver(() => {
|
|
75
|
+
wrapper.clientWidth !== previousWidth && (previousWidth = wrapper.clientWidth, measure());
|
|
76
|
+
});
|
|
77
|
+
observer.observe(wrapper);
|
|
78
|
+
let mounted = !0;
|
|
79
|
+
return null === (_a = document.fonts) || void 0 === _a || _a.ready.then(() => {
|
|
80
|
+
mounted && measure();
|
|
81
|
+
}), () => {
|
|
82
|
+
mounted = !1, observer.disconnect(), growing && element.style.removeProperty("height");
|
|
83
|
+
};
|
|
84
|
+
}, [ growing, text, rowCount, width, height, maxHeight, minWidth, textSize, padding, showSendButton, resizable, sendSize, sendOffset, style, className ]),
|
|
85
|
+
useClientLayoutEffect(() => {
|
|
86
|
+
const element = ref.current, wrapper = wrapperRef.current;
|
|
87
|
+
if (!nativeResizable || !element || !wrapper) return;
|
|
88
|
+
const positionGrip = () => {
|
|
89
|
+
wrapper.style.setProperty("--ta-grip-top", element.offsetTop + element.offsetHeight - 16 + "px"),
|
|
90
|
+
wrapper.style.setProperty("--ta-grip-right", wrapper.clientWidth - element.offsetLeft - element.offsetWidth + "px");
|
|
91
|
+
};
|
|
92
|
+
positionGrip();
|
|
93
|
+
const observer = new ResizeObserver(positionGrip);
|
|
94
|
+
return observer.observe(element), observer.observe(wrapper), () => observer.disconnect();
|
|
95
|
+
}, [ nativeResizable, padding, style ]);
|
|
96
|
+
const getBorderColor = () => error ? borderColorError : isFocused ? borderColorFocused : borderColor, getResize = () => !resizable || growing || "auto" !== height ? "none" : "vertical", cssVars = {
|
|
97
|
+
"--ta-height": misc.setStyle(height),
|
|
98
|
+
"--ta-max-height": misc.setStyle(maxHeight, "none"),
|
|
99
|
+
"--ta-padding": misc.setStyle(padding),
|
|
100
|
+
"--ta-border-radius": misc.setStyle(borderRadius),
|
|
101
|
+
"--ta-bg-color": backgroundColor,
|
|
102
|
+
"--ta-box-shadow": "none" === borderStyle ? "none" : "underline" === borderStyle ? `0 1px 0 0 ${getBorderColor()}` : `0 0 0 1px ${getBorderColor()}`,
|
|
103
|
+
"--ta-text-color": disabled ? textColorDisabled : textColor,
|
|
104
|
+
"--ta-placeholder-color": textColorPlaceholder,
|
|
105
|
+
"--ta-label-color": disabled ? textColorDisabled : labelColor,
|
|
106
|
+
"--ta-send-bottom": `${bottomOffset}px`,
|
|
107
|
+
"--ta-send-right": `${rightOffset}px`,
|
|
108
|
+
"--ta-send-size": `${buttonSize}px`,
|
|
109
|
+
"--ta-resize": getResize()
|
|
110
|
+
};
|
|
111
|
+
return jsxRuntime.jsxs("div", {
|
|
112
|
+
className: css.field,
|
|
113
|
+
style: Object.assign({
|
|
114
|
+
width: misc.setStyle(width),
|
|
115
|
+
minWidth: misc.setStyle(minWidth, "0px")
|
|
116
|
+
}, cssVars),
|
|
117
|
+
children: [ hasLabel && jsxRuntime.jsx("label", {
|
|
118
|
+
htmlFor: id,
|
|
119
|
+
className: `${css.label} ${css[labelSize]}`,
|
|
120
|
+
children: label
|
|
121
|
+
}), jsxRuntime.jsxs("div", Object.assign({}, withoutAria(divAttributes), {
|
|
122
|
+
ref: wrapperRef,
|
|
123
|
+
className: `${css.wrapper}${className ? ` ${className}` : ""}`,
|
|
124
|
+
style: Object.assign(Object.assign({}, style), cssVars),
|
|
125
|
+
children: [ jsxRuntime.jsx("textarea", Object.assign({}, withoutAria(inputAttributes), {
|
|
126
|
+
ref: setInputRef,
|
|
127
|
+
id: id,
|
|
128
|
+
name: name,
|
|
129
|
+
className: `${css.textarea} ${css[textSize]}`,
|
|
130
|
+
"data-resizable": "vertical" === getResize() || void 0,
|
|
131
|
+
value: text,
|
|
132
|
+
placeholder: placeholder,
|
|
133
|
+
"aria-label": (null == inputName ? void 0 : inputName.trim()) ? inputName.trim() : hasLabel ? void 0 : (null == name ? void 0 : name.trim()) || "Text input",
|
|
134
|
+
"aria-invalid": error || void 0,
|
|
135
|
+
"aria-describedby": message ? messageId : void 0,
|
|
136
|
+
rows: rowCount,
|
|
137
|
+
maxLength: maxLength,
|
|
138
|
+
disabled: disabled,
|
|
139
|
+
readOnly: readOnly,
|
|
140
|
+
onChange: event => changeText(event.currentTarget.value),
|
|
141
|
+
onFocus: event => {
|
|
142
|
+
setIsFocused(!0), null == onFocus || onFocus(event.currentTarget.value);
|
|
143
|
+
},
|
|
144
|
+
onBlur: event => {
|
|
145
|
+
setIsFocused(!1), null == onBlur || onBlur(event.currentTarget.value);
|
|
146
|
+
},
|
|
147
|
+
onPaste: event => {
|
|
148
|
+
canEdit && (null == onPaste || onPaste(event));
|
|
149
|
+
},
|
|
150
|
+
onKeyDown: event => {
|
|
151
|
+
null == onKeyDown || onKeyDown(event), event.defaultPrevented || !canEdit || !returnSubmits || !onSubmit || "Enter" !== event.key || event.shiftKey || event.altKey || event.ctrlKey || event.metaKey || event.nativeEvent.isComposing || 229 === event.nativeEvent.keyCode || (event.preventDefault(),
|
|
152
|
+
submit());
|
|
153
|
+
}
|
|
154
|
+
})), nativeResizable && jsxRuntime.jsx("span", {
|
|
155
|
+
className: css.resizeGrip,
|
|
156
|
+
"aria-hidden": "true"
|
|
157
|
+
}), showSendButton && jsxRuntime.jsx("div", {
|
|
158
|
+
className: css.sendSpace,
|
|
159
|
+
children: jsxRuntime.jsx("button", {
|
|
160
|
+
type: "button",
|
|
161
|
+
className: css.send,
|
|
162
|
+
"aria-label": sendActionName.trim() || "Send",
|
|
163
|
+
disabled: !canSubmit,
|
|
164
|
+
onMouseDown: event => event.preventDefault(),
|
|
165
|
+
onClick: submit,
|
|
166
|
+
children: jsxRuntime.jsx(Icon.Icon, {
|
|
167
|
+
name: "arrows.arrow-top",
|
|
168
|
+
size: 20,
|
|
169
|
+
"aria-hidden": "true",
|
|
170
|
+
strokeColor: "var(--core-text-light)"
|
|
171
|
+
})
|
|
172
|
+
})
|
|
173
|
+
}) ]
|
|
174
|
+
})), message && jsxRuntime.jsx("div", {
|
|
175
|
+
id: messageId,
|
|
176
|
+
className: `${css.message} ${css.xs}`,
|
|
177
|
+
style: {
|
|
178
|
+
color: error ? textColorError : "var(--core-text-tertiary)"
|
|
179
|
+
},
|
|
180
|
+
children: message
|
|
181
|
+
}) ]
|
|
182
|
+
});
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
TextAreaComponent.displayName = "TextArea";
|
|
186
|
+
|
|
187
|
+
const TextArea = React.memo(TextAreaComponent);
|
|
188
|
+
|
|
189
|
+
exports.TextArea = TextArea;
|
|
@@ -0,0 +1,312 @@
|
|
|
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");
|
|
5
|
+
|
|
6
|
+
require("../theme/colors.js"), require("../theme/type.js"), require("./resolveColor-DkYThq2J.js"),
|
|
7
|
+
require("./breakpoints-BDw1OJh9.js");
|
|
8
|
+
|
|
9
|
+
var misc = require("./misc-PmT7cZzC.js");
|
|
10
|
+
|
|
11
|
+
require("./broadcastChannel-DdPZ3LUB.js"), require("./files-RYD9L_pI.js"), require("./webRTCStore-OGkXAovD.js"),
|
|
12
|
+
require("./microphoneStore-D7DuvQeX.js"), require("./volumeStore-BoEoo9wA.js");
|
|
13
|
+
|
|
14
|
+
var resolveColorProps = require("./resolveColorProps-DE1k1P-Z.js"), getWaterTransition = require("./getWaterTransition-s_55VKK2.js"), type_module = require("./type.module-Dk5b_rHG.js"), usePrefersReducedMotion = require("./usePrefersReducedMotion-GpD17CAE.js"), Button = require("./Button-Cr5SlNim.js"), Icon = require("./Icon-COY7IZkK.js"), IconButton = require("./IconButton-KJr15EW6.js"), css = {
|
|
15
|
+
field: "TextField-module_field__2fv4g",
|
|
16
|
+
message: "TextField-module_message__O6FPe",
|
|
17
|
+
wrapper: "TextField-module_wrapper__qZ-p-",
|
|
18
|
+
container: "TextField-module_container__5U9yK",
|
|
19
|
+
label: "TextField-module_label__jD8MR",
|
|
20
|
+
input: "TextField-module_input__AkWBQ",
|
|
21
|
+
leadingIcon: "TextField-module_leadingIcon__PK1q-",
|
|
22
|
+
showPassword: "TextField-module_showPassword__4Ecfo",
|
|
23
|
+
clearButton: "TextField-module_clearButton__O9ed3",
|
|
24
|
+
action: "TextField-module_action__73kLf",
|
|
25
|
+
xs: "TextField-module_xs__vyt2t type-module_body-xs-regular__ZAFft",
|
|
26
|
+
s: "TextField-module_s__0qm83 type-module_body-s-regular__vRHSP",
|
|
27
|
+
m: "TextField-module_m__M-tLl type-module_body-m-regular__LuQBA",
|
|
28
|
+
l: "TextField-module_l__gbNRz type-module_body-l-regular__lOYbg",
|
|
29
|
+
xl: "TextField-module_xl__tp--W type-module_body-xl-regular__pF2kC",
|
|
30
|
+
textColumn: "TextField-module_textColumn__tRLYT",
|
|
31
|
+
labelSlot: "TextField-module_labelSlot__0ZwGi",
|
|
32
|
+
separator: "TextField-module_separator__jgs61"
|
|
33
|
+
};
|
|
34
|
+
|
|
35
|
+
const withoutAria = attributes => Object.fromEntries(Object.entries(attributes).filter(([key]) => !key.startsWith("aria-") && "role" !== key)), useClientLayoutEffect = "undefined" == typeof window ? React.useEffect : React.useLayoutEffect, defaultClearButton = {
|
|
36
|
+
size: 20
|
|
37
|
+
};
|
|
38
|
+
|
|
39
|
+
function ActionFrame({children: children, settings: settings}) {
|
|
40
|
+
const [present, safeToRemove] = react.usePresence(), presenceSettings = react.usePresenceData(), live = present ? settings : null != presenceSettings ? presenceSettings : settings, controls = react.useAnimationControls();
|
|
41
|
+
return React.useEffect(() => {
|
|
42
|
+
if (live.reduced) return controls.set({
|
|
43
|
+
opacity: present ? 1 : 0
|
|
44
|
+
}), void (present || null == safeToRemove || safeToRemove());
|
|
45
|
+
let active = !0;
|
|
46
|
+
return controls.start({
|
|
47
|
+
opacity: present ? 1 : 0,
|
|
48
|
+
transition: live.transition
|
|
49
|
+
}).then(() => {
|
|
50
|
+
active && !present && (null == safeToRemove || safeToRemove());
|
|
51
|
+
}), () => {
|
|
52
|
+
active = !1, controls.stop();
|
|
53
|
+
};
|
|
54
|
+
}, [ controls, live.reduced, live.transition, present, safeToRemove ]), jsxRuntime.jsx(react.motion.div, {
|
|
55
|
+
className: css.action,
|
|
56
|
+
initial: {
|
|
57
|
+
opacity: live.reduced ? 1 : 0
|
|
58
|
+
},
|
|
59
|
+
animate: controls,
|
|
60
|
+
inert: !present,
|
|
61
|
+
"aria-hidden": !present || void 0,
|
|
62
|
+
children: children
|
|
63
|
+
});
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
function TextFieldComponent(rawProps) {
|
|
67
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
68
|
+
const props = resolveColorProps.resolveColorProps(rawProps), theme = hooks_useTheme.useTheme(), reduced = usePrefersReducedMotion.usePrefersReducedMotion(), {name: name, inputName: inputName, inputId: inputId, inputAttributes: inputAttributes = {}, value: value, defaultValue: defaultValue = "", label: label, variant: variant = "simple", behavior: behavior = "persistent", stackedGap: stackedGap = 2, labelBackgroundColor: labelBackgroundColor = "var(--core-surface-primary)", stackedLabelTextSize: stackedLabelTextSize = "body-xs-regular", labelSize: labelSize = "m", textSize: textSize = "m", placeholder: placeholder = "placeholder", focused: focused, onSubmit: onSubmit, onChange: onChange, onBlur: onBlur, onFocus: onFocus, onKeyDown: onKeyDown, onAction: onAction, onPaste: onPaste, onClear: onClear, actionButton: actionButton = !1, actionLabel: actionLabel = "Action", maxLength: maxLength, width: width = "100%", height: height = "auto", padding: padding, borderRadius: borderRadius, readOnly: readOnly = !1, textAlign: textAlign = "left", inline: inline = !1, showPasswordToggle: showPasswordToggle = !0, borderStyle: borderStyle = "box", error: error = !1, errorMessage: errorMessage, tip: tip, borderColorFocused: borderColorFocused = "var(--core-link-primary)", borderColorBlurred: borderColorBlurred = "var(--core-outline-primary)", borderColorError: borderColorError = "var(--feedback-warning)", backgroundColorFocused: backgroundColorFocused, backgroundColorBlurred: backgroundColorBlurred, textColorFocused: textColorFocused = "var(--core-text-primary)", textColorBlurred: textColorBlurred = "var(--core-text-primary)", textColorError: textColorError = "var(--feedback-warning)", textColorPlaceholder: textColorPlaceholder = "var(--core-text-disabled)", textColorDisabled: textColorDisabled = "var(--core-text-disabled)", labelColor: labelColor = "var(--core-text-primary)", iconLeft: iconLeft, clearButton: clearButton = defaultClearButton, clearBlurs: clearBlurs = !1, disabled: disabled = !1, inputType: inputType = "text", transition: transition, className: className, style: style} = props, divAttributes = tslib_es6.__rest(props, [ "name", "inputName", "inputId", "inputAttributes", "value", "defaultValue", "label", "variant", "behavior", "stackedGap", "labelBackgroundColor", "stackedLabelTextSize", "labelSize", "textSize", "placeholder", "focused", "onSubmit", "onChange", "onBlur", "onFocus", "onKeyDown", "onAction", "onPaste", "onClear", "actionButton", "actionLabel", "maxLength", "width", "height", "padding", "borderRadius", "readOnly", "textAlign", "inline", "showPasswordToggle", "borderStyle", "error", "errorMessage", "tip", "borderColorFocused", "borderColorBlurred", "borderColorError", "backgroundColorFocused", "backgroundColorBlurred", "textColorFocused", "textColorBlurred", "textColorError", "textColorPlaceholder", "textColorDisabled", "labelColor", "iconLeft", "clearButton", "clearBlurs", "disabled", "inputType", "transition", "className", "style" ]), generatedId = React.useId(), id = inputId || generatedId, hasLabel = Boolean(null == label ? void 0 : label.trim()), accessibleName = (() => {
|
|
69
|
+
const customName = null == inputName ? void 0 : inputName.trim();
|
|
70
|
+
return customName || (hasLabel ? void 0 : (null == name ? void 0 : name.trim()) || "Text input");
|
|
71
|
+
})(), message = null === (_a = error ? errorMessage : tip) || void 0 === _a ? void 0 : _a.trim(), messageId = `${id}-message`, input = React.useRef(null), column = React.useRef(null);
|
|
72
|
+
useClientLayoutEffect(() => {
|
|
73
|
+
if (!message || !input.current) return;
|
|
74
|
+
const wrapper = input.current.closest("[data-variant]"), field = null == wrapper ? void 0 : wrapper.parentElement;
|
|
75
|
+
if (!wrapper || !field) return;
|
|
76
|
+
const measure = () => {
|
|
77
|
+
const padding = getComputedStyle(wrapper);
|
|
78
|
+
field.style.setProperty("--tf-message-left", padding.paddingLeft), field.style.setProperty("--tf-message-right", padding.paddingRight);
|
|
79
|
+
};
|
|
80
|
+
measure();
|
|
81
|
+
const observer = new ResizeObserver(measure);
|
|
82
|
+
return observer.observe(wrapper), () => {
|
|
83
|
+
observer.disconnect(), field.style.removeProperty("--tf-message-left"), field.style.removeProperty("--tf-message-right");
|
|
84
|
+
};
|
|
85
|
+
}, [ message, variant, iconLeft, padding, width, inputType, showPasswordToggle, clearButton, actionButton ]);
|
|
86
|
+
const initialValue = React.useRef(defaultValue), [localText, setLocalText] = React.useState(defaultValue), controlled = void 0 !== value, text = controlled ? value : localText, [isFocused, setIsFocused] = React.useState(!1), [show, setShow] = React.useState(!1), canEdit = !disabled && !readOnly, canPreviewPassword = !disabled && text.length > 0, appearing = "stacked" === variant && "appear" === behavior && !reduced && hasLabel, collapsedLabel = appearing && 0 === text.length;
|
|
87
|
+
useClientLayoutEffect(() => {
|
|
88
|
+
if ("outlined" !== variant || !hasLabel || !column.current) return;
|
|
89
|
+
const element = column.current, label = element.querySelector("label"), wrapper = element.closest("[data-variant]"), measure = () => {
|
|
90
|
+
label && wrapper && wrapper.style.setProperty("--tf-label-font-size", getComputedStyle(label).fontSize),
|
|
91
|
+
element.style.setProperty("--tf-column-top", `${element.offsetTop}px`);
|
|
92
|
+
};
|
|
93
|
+
measure();
|
|
94
|
+
const observer = new ResizeObserver(measure);
|
|
95
|
+
return observer.observe(element), label && observer.observe(label), element.offsetParent && observer.observe(element.offsetParent),
|
|
96
|
+
() => {
|
|
97
|
+
observer.disconnect(), element.style.removeProperty("--tf-column-top"), null == wrapper || wrapper.style.removeProperty("--tf-label-font-size");
|
|
98
|
+
};
|
|
99
|
+
}, [ variant, hasLabel, padding, width, height, null == iconLeft ? void 0 : iconLeft.size, labelSize, stackedLabelTextSize ]),
|
|
100
|
+
useClientLayoutEffect(() => {
|
|
101
|
+
if ("stacked" !== variant || !hasLabel || !column.current) return;
|
|
102
|
+
const slot = column.current.firstElementChild, container = column.current.parentElement;
|
|
103
|
+
if (!(slot instanceof HTMLElement && container)) return;
|
|
104
|
+
const measure = () => {
|
|
105
|
+
const style = getComputedStyle(slot), labelHeight = Number.parseFloat(style.height) || 0, gap = Number.parseFloat(style.marginBottom) || 0;
|
|
106
|
+
container.style.setProperty("--tf-label-space", `${labelHeight + gap}px`);
|
|
107
|
+
};
|
|
108
|
+
measure();
|
|
109
|
+
const observer = new ResizeObserver(measure);
|
|
110
|
+
return observer.observe(slot), () => {
|
|
111
|
+
observer.disconnect(), container.style.removeProperty("--tf-label-space");
|
|
112
|
+
};
|
|
113
|
+
}, [ variant, hasLabel, stackedGap, stackedLabelTextSize ]);
|
|
114
|
+
const timing = React.useMemo(() => getWaterTransition.getWaterTransition(theme.current.motion, transition), [ theme.current.motion, transition ]), actionMotion = React.useMemo(() => ({
|
|
115
|
+
reduced: reduced,
|
|
116
|
+
transition: timing
|
|
117
|
+
}), [ reduced, timing ]);
|
|
118
|
+
React.useEffect(() => {
|
|
119
|
+
var _a, _b;
|
|
120
|
+
disabled ? setIsFocused(!1) : void 0 !== focused && (focused ? null === (_a = input.current) || void 0 === _a || _a.focus() : null === (_b = input.current) || void 0 === _b || _b.blur());
|
|
121
|
+
}, [ focused, disabled ]), React.useEffect(() => {
|
|
122
|
+
"password" !== inputType && setShow(!1);
|
|
123
|
+
}, [ inputType ]), React.useEffect(() => {
|
|
124
|
+
var _a;
|
|
125
|
+
if (controlled) return;
|
|
126
|
+
const form = null === (_a = input.current) || void 0 === _a ? void 0 : _a.form;
|
|
127
|
+
if (!form) return;
|
|
128
|
+
let mounted = !0;
|
|
129
|
+
const reset = event => queueMicrotask(() => {
|
|
130
|
+
mounted && !event.defaultPrevented && setLocalText(initialValue.current);
|
|
131
|
+
});
|
|
132
|
+
return form.addEventListener("reset", reset), () => {
|
|
133
|
+
mounted = !1, form.removeEventListener("reset", reset);
|
|
134
|
+
};
|
|
135
|
+
}, [ controlled, inputAttributes.form ]);
|
|
136
|
+
const changeText = next => {
|
|
137
|
+
canEdit && (controlled || setLocalText(next), null == onChange || onChange(next));
|
|
138
|
+
}, iconInset = "calc(var(--spacing-m) - var(--spacing-xs))", trailingIcon = "password" === inputType && showPasswordToggle || !actionButton && clearButton, cssVars = {
|
|
139
|
+
"--tf-width": misc.setStyle(width),
|
|
140
|
+
"--tf-height": misc.setStyle(height),
|
|
141
|
+
"--tf-padding": (() => {
|
|
142
|
+
if (null != padding) return misc.setStyle(padding);
|
|
143
|
+
if ("outlined" === variant) return "calc(var(--spacing-s) + var(--tf-label-font-size, 0px) / 2) var(--spacing-m)";
|
|
144
|
+
return `var(--spacing-s) ${trailingIcon ? iconInset : "var(--spacing-m)"} var(--spacing-s) ${iconLeft ? iconInset : "var(--spacing-m)"}`;
|
|
145
|
+
})(),
|
|
146
|
+
"--tf-border-radius": misc.setStyle(borderRadius, "underline" === borderStyle ? 0 : 8),
|
|
147
|
+
"--tf-bg-color": (() => {
|
|
148
|
+
if (inline) return "transparent";
|
|
149
|
+
const fallback = "underline" === borderStyle ? "transparent" : "var(--core-surface-secondary)";
|
|
150
|
+
return isFocused ? null != backgroundColorFocused ? backgroundColorFocused : fallback : null != backgroundColorBlurred ? backgroundColorBlurred : fallback;
|
|
151
|
+
})(),
|
|
152
|
+
"--tf-box-shadow": (() => {
|
|
153
|
+
if ("none" === borderStyle) return "none";
|
|
154
|
+
const borderColor = error ? borderColorError : isFocused ? borderColorFocused : borderColorBlurred;
|
|
155
|
+
return "underline" === borderStyle ? `0 1px 0 0 ${borderColor}` : `0 0 0 1px ${borderColor}`;
|
|
156
|
+
})(),
|
|
157
|
+
"--tf-text-color": disabled ? textColorDisabled : isFocused ? textColorFocused : textColorBlurred,
|
|
158
|
+
"--tf-label-color": disabled ? textColorDisabled : labelColor,
|
|
159
|
+
"--tf-text-align": textAlign,
|
|
160
|
+
"--tf-placeholder-color": textColorPlaceholder,
|
|
161
|
+
"--tf-field-size": "auto" === width ? "content" : "fixed",
|
|
162
|
+
"--tf-input-width": "auto" === width ? "auto" : "100%",
|
|
163
|
+
"--tf-clear-size": misc.setStyle(null !== (_b = null == clearButton ? void 0 : clearButton.size) && void 0 !== _b ? _b : 20),
|
|
164
|
+
"--tf-icon-size": misc.setStyle(null !== (_c = null == iconLeft ? void 0 : iconLeft.size) && void 0 !== _c ? _c : 20),
|
|
165
|
+
"--tf-stacked-gap": misc.setStyle(Number.isFinite(stackedGap) ? Math.max(0, stackedGap) : 2),
|
|
166
|
+
"--tf-label-background": labelBackgroundColor
|
|
167
|
+
}, leadingIcon = iconLeft ? jsxRuntime.jsx("span", {
|
|
168
|
+
className: css.leadingIcon,
|
|
169
|
+
"aria-hidden": "true",
|
|
170
|
+
children: jsxRuntime.jsx(Icon.Icon, {
|
|
171
|
+
name: iconLeft.name,
|
|
172
|
+
size: null !== (_d = iconLeft.size) && void 0 !== _d ? _d : 20,
|
|
173
|
+
strokeColor: null !== (_e = iconLeft.color) && void 0 !== _e ? _e : theme.current.colors["core-icon-secondary"]
|
|
174
|
+
})
|
|
175
|
+
}) : null;
|
|
176
|
+
return jsxRuntime.jsxs("div", {
|
|
177
|
+
className: css.field,
|
|
178
|
+
style: {
|
|
179
|
+
width: misc.setStyle(width)
|
|
180
|
+
},
|
|
181
|
+
children: [ jsxRuntime.jsxs("div", Object.assign({}, withoutAria(divAttributes), {
|
|
182
|
+
"data-variant": variant,
|
|
183
|
+
"data-appear": appearing || void 0,
|
|
184
|
+
"data-collapsed-label": collapsedLabel || void 0,
|
|
185
|
+
className: `${css.wrapper}${className ? ` ${className}` : ""}`,
|
|
186
|
+
style: Object.assign(Object.assign(Object.assign({}, style), cssVars), {
|
|
187
|
+
"--tf-width": "100%"
|
|
188
|
+
}),
|
|
189
|
+
children: [ "simple" === variant && leadingIcon, hasLabel && "simple" === variant && jsxRuntime.jsx("label", {
|
|
190
|
+
className: `${css.label} ${css[labelSize]}`,
|
|
191
|
+
htmlFor: id,
|
|
192
|
+
children: label
|
|
193
|
+
}), hasLabel && "simple" === variant && jsxRuntime.jsx("span", {
|
|
194
|
+
className: `${css.separator} ${css[labelSize]}`,
|
|
195
|
+
"aria-hidden": "true",
|
|
196
|
+
children: "|"
|
|
197
|
+
}), jsxRuntime.jsxs("div", {
|
|
198
|
+
className: css.container,
|
|
199
|
+
children: [ "simple" !== variant && leadingIcon, jsxRuntime.jsxs("div", {
|
|
200
|
+
ref: column,
|
|
201
|
+
className: css.textColumn,
|
|
202
|
+
children: [ hasLabel && "simple" !== variant && jsxRuntime.jsx("div", {
|
|
203
|
+
className: css.labelSlot,
|
|
204
|
+
children: jsxRuntime.jsx("label", {
|
|
205
|
+
className: `${css.label} ${null !== (_f = type_module.typeCss[stackedLabelTextSize]) && void 0 !== _f ? _f : type_module.typeCss["body-xs-regular"]}`,
|
|
206
|
+
htmlFor: id,
|
|
207
|
+
children: label
|
|
208
|
+
})
|
|
209
|
+
}), jsxRuntime.jsx("input", Object.assign({}, withoutAria(inputAttributes), {
|
|
210
|
+
id: id,
|
|
211
|
+
className: `${css.input} ${css[textSize]}`,
|
|
212
|
+
ref: input,
|
|
213
|
+
type: "password" === inputType && show ? "text" : inputType,
|
|
214
|
+
name: name,
|
|
215
|
+
"aria-label": accessibleName,
|
|
216
|
+
"aria-invalid": error || void 0,
|
|
217
|
+
"aria-describedby": message ? messageId : void 0,
|
|
218
|
+
autoCapitalize: null !== (_g = inputAttributes.autoCapitalize) && void 0 !== _g ? _g : "none",
|
|
219
|
+
autoCorrect: null !== (_h = inputAttributes.autoCorrect) && void 0 !== _h ? _h : "off",
|
|
220
|
+
value: text,
|
|
221
|
+
onChange: event => changeText(event.target.value),
|
|
222
|
+
placeholder: collapsedLabel ? label : placeholder,
|
|
223
|
+
maxLength: maxLength,
|
|
224
|
+
disabled: disabled,
|
|
225
|
+
readOnly: readOnly,
|
|
226
|
+
onFocus: event => {
|
|
227
|
+
setIsFocused(!0), null == onFocus || onFocus(event.currentTarget.value);
|
|
228
|
+
},
|
|
229
|
+
onBlur: event => {
|
|
230
|
+
setIsFocused(!1), null == onBlur || onBlur(event.currentTarget.value);
|
|
231
|
+
},
|
|
232
|
+
onPaste: event => {
|
|
233
|
+
canEdit && (null == onPaste || onPaste(event));
|
|
234
|
+
},
|
|
235
|
+
onMouseDown: event => {
|
|
236
|
+
var _a;
|
|
237
|
+
null === (_a = inputAttributes.onMouseDown) || void 0 === _a || _a.call(inputAttributes, event),
|
|
238
|
+
event.stopPropagation();
|
|
239
|
+
},
|
|
240
|
+
onKeyDown: event => {
|
|
241
|
+
disabled || (null == onKeyDown || onKeyDown(event), event.defaultPrevented || readOnly || "Enter" !== event.key || event.nativeEvent.isComposing || 229 === event.nativeEvent.keyCode || onSubmit && (event.preventDefault(),
|
|
242
|
+
onSubmit(event.currentTarget.value), event.currentTarget.blur()));
|
|
243
|
+
}
|
|
244
|
+
})) ]
|
|
245
|
+
}), clearButton && jsxRuntime.jsx("button", {
|
|
246
|
+
type: "button",
|
|
247
|
+
"aria-label": "Clear text",
|
|
248
|
+
className: css.clearButton,
|
|
249
|
+
"data-has-value": "" !== text || void 0,
|
|
250
|
+
disabled: !canEdit || "" === text,
|
|
251
|
+
onMouseDown: event => {
|
|
252
|
+
clearBlurs || event.preventDefault();
|
|
253
|
+
},
|
|
254
|
+
onClick: () => {
|
|
255
|
+
var _a, _b;
|
|
256
|
+
canEdit && "" !== text && (changeText(""), null == onClear || onClear(), clearBlurs ? null === (_a = input.current) || void 0 === _a || _a.blur() : null === (_b = input.current) || void 0 === _b || _b.focus());
|
|
257
|
+
},
|
|
258
|
+
children: jsxRuntime.jsx(Icon.Icon, {
|
|
259
|
+
"aria-hidden": "true",
|
|
260
|
+
name: "basic.cross",
|
|
261
|
+
size: null !== (_j = clearButton.size) && void 0 !== _j ? _j : 20,
|
|
262
|
+
strokeColor: theme.current.colors["core-icon-secondary"]
|
|
263
|
+
})
|
|
264
|
+
}), jsxRuntime.jsx(react.AnimatePresence, {
|
|
265
|
+
initial: !1,
|
|
266
|
+
custom: actionMotion,
|
|
267
|
+
children: actionButton && jsxRuntime.jsx(ActionFrame, {
|
|
268
|
+
settings: actionMotion,
|
|
269
|
+
children: jsxRuntime.jsx(Button.Button, {
|
|
270
|
+
label: actionLabel.trim() || "Action",
|
|
271
|
+
variant: "text",
|
|
272
|
+
buttonSize: "s",
|
|
273
|
+
state: canEdit && "" !== text ? "normal" : "disabled",
|
|
274
|
+
textColor: theme.current.colors["core-button-primary"],
|
|
275
|
+
onClick: () => {
|
|
276
|
+
canEdit && "" !== text && (null == onAction || onAction());
|
|
277
|
+
}
|
|
278
|
+
})
|
|
279
|
+
}, "action")
|
|
280
|
+
}), "password" === inputType && showPasswordToggle && jsxRuntime.jsx("div", {
|
|
281
|
+
className: css.showPassword,
|
|
282
|
+
children: jsxRuntime.jsx(IconButton.IconButton, {
|
|
283
|
+
actionName: show ? "Hide password" : "Show password",
|
|
284
|
+
icon: show ? "security.eye-slash" : "security.eye",
|
|
285
|
+
toggle: !0,
|
|
286
|
+
selected: show,
|
|
287
|
+
iconSize: 18,
|
|
288
|
+
buttonSize: 18,
|
|
289
|
+
disabled: !canPreviewPassword,
|
|
290
|
+
onClick: () => {
|
|
291
|
+
canPreviewPassword && setShow(previous => !previous);
|
|
292
|
+
}
|
|
293
|
+
})
|
|
294
|
+
}) ]
|
|
295
|
+
}) ]
|
|
296
|
+
})), message && jsxRuntime.jsx("div", {
|
|
297
|
+
id: messageId,
|
|
298
|
+
className: `${css.message} ${type_module.typeCss["body-xs-regular"]}`,
|
|
299
|
+
"data-error": error || void 0,
|
|
300
|
+
style: {
|
|
301
|
+
color: error ? textColorError : "var(--core-text-tertiary)"
|
|
302
|
+
},
|
|
303
|
+
children: message
|
|
304
|
+
}) ]
|
|
305
|
+
});
|
|
306
|
+
}
|
|
307
|
+
|
|
308
|
+
TextFieldComponent.displayName = "TextField";
|
|
309
|
+
|
|
310
|
+
const TextField = React.memo(TextFieldComponent);
|
|
311
|
+
|
|
312
|
+
exports.TextField = TextField;
|
|
@@ -0,0 +1,115 @@
|
|
|
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"), getWaterTransition = require("./getWaterTransition-s_55VKK2.js"), usePrefersReducedMotion = require("./usePrefersReducedMotion-GpD17CAE.js"), css = {
|
|
5
|
+
wrapper: "Tip-module_wrapper__D7ACT flexBox-module_rowStart__4tcxS",
|
|
6
|
+
xs: "Tip-module_xs__wsz9y type-module_body-xs-regular__ZAFft",
|
|
7
|
+
s: "Tip-module_s__Wvz3q type-module_body-s-regular__vRHSP",
|
|
8
|
+
m: "Tip-module_m__9qJbB type-module_body-m-regular__LuQBA",
|
|
9
|
+
l: "Tip-module_l__OdNuh type-module_body-l-regular__lOYbg",
|
|
10
|
+
xl: "Tip-module_xl__izmFk type-module_body-xl-regular__pF2kC"
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
const milliseconds = (value, fallback) => Number.isFinite(value) ? Math.max(0, value) : fallback;
|
|
14
|
+
|
|
15
|
+
/** Coordinate updates do not restart a request's show delay or visible lifetime. */ const staticState = {
|
|
16
|
+
opacity: 1,
|
|
17
|
+
x: 0,
|
|
18
|
+
y: 0,
|
|
19
|
+
scale: 1,
|
|
20
|
+
scaleX: 1,
|
|
21
|
+
scaleY: 1,
|
|
22
|
+
rotate: 0,
|
|
23
|
+
rotateX: 0,
|
|
24
|
+
rotateY: 0
|
|
25
|
+
}, TipBase = React.forwardRef((rawProps, ref) => {
|
|
26
|
+
var _a, _b, _c, _d;
|
|
27
|
+
const props = resolveColorProps.resolveColorProps(rawProps), {tip: tip, textSize: textSize = "s", backgroundColor: backgroundColor, textColor: textColor, border: border = !0, borderColor: borderColor, padding: padding, borderRadius: borderRadius = theme_corners.corners["corner-xs"], coords: coords, showDelay: showDelay = 500, hideDelay: hideDelay = 2500, motionValues: motionValues, transition: transition, id: suppliedId, className: className, style: style} = props, attributes = tslib_es6.__rest(props, [ "tip", "textSize", "backgroundColor", "textColor", "border", "borderColor", "padding", "borderRadius", "coords", "showDelay", "hideDelay", "motionValues", "transition", "id", "className", "style" ]), generatedId = React.useId(), id = suppliedId || generatedId, enabled = Boolean((null === (_a = null == tip ? void 0 : tip.payload) || void 0 === _a ? void 0 : _a.label) && coords && Number.isFinite(coords.x) && Number.isFinite(coords.y)), {visible: visible, dismiss: dismiss} = function(tip, enabled, showDelay, hideDelay) {
|
|
28
|
+
var _a, _b;
|
|
29
|
+
const [shown, setShown] = React.useState(null), showTimer = React.useRef(void 0), hideTimer = React.useRef(void 0), clearTimers = React.useCallback(() => {
|
|
30
|
+
clearTimeout(showTimer.current), clearTimeout(hideTimer.current);
|
|
31
|
+
}, []), dismiss = React.useCallback(() => {
|
|
32
|
+
clearTimers(), setShown(null);
|
|
33
|
+
}, [ clearTimers ]), lifetime = null !== (_b = null === (_a = null == tip ? void 0 : tip.payload) || void 0 === _a ? void 0 : _a.duration) && void 0 !== _b ? _b : hideDelay;
|
|
34
|
+
return React.useEffect(() => {
|
|
35
|
+
var _a;
|
|
36
|
+
if (dismiss(), enabled && (null === (_a = null == tip ? void 0 : tip.payload) || void 0 === _a ? void 0 : _a.label)) return showTimer.current = setTimeout(() => {
|
|
37
|
+
setShown(tip), hideTimer.current = setTimeout(() => setShown(null), milliseconds(lifetime, 2500));
|
|
38
|
+
}, milliseconds(showDelay, 500)), clearTimers;
|
|
39
|
+
}, [ tip, enabled, showDelay, lifetime, dismiss, clearTimers ]), {
|
|
40
|
+
visible: enabled && Boolean(tip) && shown === tip,
|
|
41
|
+
dismiss: dismiss
|
|
42
|
+
};
|
|
43
|
+
}(tip, enabled, showDelay, hideDelay), reduced = usePrefersReducedMotion.usePrefersReducedMotion(), theme = hooks_useTheme.useTheme().current, controls = react.useAnimationControls(), variants = React.useMemo(() => reduced ? {
|
|
44
|
+
initial: staticState,
|
|
45
|
+
animate: staticState
|
|
46
|
+
} : misc.mergedPresenceMotionValues({
|
|
47
|
+
initial: {
|
|
48
|
+
opacity: 0
|
|
49
|
+
},
|
|
50
|
+
animate: {
|
|
51
|
+
opacity: 1
|
|
52
|
+
}
|
|
53
|
+
}, motionValues), [ reduced, motionValues ]), resolvedTransition = React.useMemo(() => getWaterTransition.getWaterTransition(theme.motion, Object.assign({
|
|
54
|
+
duration: .15
|
|
55
|
+
}, transition)), [ theme.motion, transition ]);
|
|
56
|
+
React.useEffect(() => {
|
|
57
|
+
controls.stop(), reduced ? controls.set(staticState) : (controls.set("initial"),
|
|
58
|
+
visible && variants.animate && controls.start("animate"));
|
|
59
|
+
}, [ visible, reduced, variants, controls ]), React.useEffect(() => {
|
|
60
|
+
var _a, _b;
|
|
61
|
+
const target = null === (_a = null == tip ? void 0 : tip.ref) || void 0 === _a ? void 0 : _a.current;
|
|
62
|
+
if (!(visible && target instanceof HTMLElement)) return;
|
|
63
|
+
const existing = (null !== (_b = target.getAttribute("aria-describedby")) && void 0 !== _b ? _b : "").split(/\s+/).filter(Boolean);
|
|
64
|
+
return existing.includes(id) ? void 0 : (target.setAttribute("aria-describedby", [ ...existing, id ].join(" ")),
|
|
65
|
+
() => {
|
|
66
|
+
var _a;
|
|
67
|
+
const remaining = (null !== (_a = target.getAttribute("aria-describedby")) && void 0 !== _a ? _a : "").split(/\s+/).filter(value => value && value !== id);
|
|
68
|
+
remaining.length ? target.setAttribute("aria-describedby", remaining.join(" ")) : target.removeAttribute("aria-describedby");
|
|
69
|
+
});
|
|
70
|
+
}, [ tip, visible, id ]), React.useEffect(() => {
|
|
71
|
+
var _a, _b, _c;
|
|
72
|
+
if (!enabled) return;
|
|
73
|
+
const document = null !== (_c = null === (_b = null === (_a = null == tip ? void 0 : tip.ref) || void 0 === _a ? void 0 : _a.current) || void 0 === _b ? void 0 : _b.ownerDocument) && void 0 !== _c ? _c : globalThis.document, keyDown = event => {
|
|
74
|
+
"Escape" === event.key && dismiss();
|
|
75
|
+
};
|
|
76
|
+
return document.addEventListener("pointerdown", dismiss, !0), document.addEventListener("click", dismiss, !0),
|
|
77
|
+
document.addEventListener("keydown", keyDown, !0), () => {
|
|
78
|
+
document.removeEventListener("pointerdown", dismiss, !0), document.removeEventListener("click", dismiss, !0),
|
|
79
|
+
document.removeEventListener("keydown", keyDown, !0);
|
|
80
|
+
};
|
|
81
|
+
}, [ enabled, tip, dismiss ]);
|
|
82
|
+
const cssVars = {
|
|
83
|
+
"--tooltip-padding": misc.setStyle(padding, "var(--spacing-xs) var(--spacing-s)"),
|
|
84
|
+
"--tooltip-background": null != backgroundColor ? backgroundColor : "var(--core-surface-secondary)",
|
|
85
|
+
"--tooltip-color": null != textColor ? textColor : "var(--core-text-primary)",
|
|
86
|
+
"--tooltip-border": border ? `1px solid ${null != borderColor ? borderColor : "var(--core-outline-primary)"}` : "unset",
|
|
87
|
+
"--tooltip-border-radius": misc.setStyle(borderRadius)
|
|
88
|
+
};
|
|
89
|
+
return jsxRuntime.jsx(react.motion.div, Object.assign({}, attributes, {
|
|
90
|
+
ref: ref,
|
|
91
|
+
id: id,
|
|
92
|
+
role: "tooltip",
|
|
93
|
+
"aria-hidden": !visible,
|
|
94
|
+
className: misc.classNames(css.wrapper, css[textSize], null != className ? className : ""),
|
|
95
|
+
style: Object.assign(Object.assign(Object.assign({}, style), cssVars), {
|
|
96
|
+
left: null !== (_b = null == coords ? void 0 : coords.x) && void 0 !== _b ? _b : 0,
|
|
97
|
+
top: null !== (_c = null == coords ? void 0 : coords.y) && void 0 !== _c ? _c : 0,
|
|
98
|
+
visibility: visible ? "visible" : "hidden"
|
|
99
|
+
}),
|
|
100
|
+
initial: !1,
|
|
101
|
+
animate: controls,
|
|
102
|
+
variants: variants,
|
|
103
|
+
transition: reduced ? {
|
|
104
|
+
duration: 0,
|
|
105
|
+
delay: 0
|
|
106
|
+
} : resolvedTransition,
|
|
107
|
+
children: null === (_d = null == tip ? void 0 : tip.payload) || void 0 === _d ? void 0 : _d.label
|
|
108
|
+
}));
|
|
109
|
+
});
|
|
110
|
+
|
|
111
|
+
TipBase.displayName = "Tip";
|
|
112
|
+
|
|
113
|
+
const Tip = React.memo(TipBase);
|
|
114
|
+
|
|
115
|
+
exports.Tip = Tip;
|