@apple-pie/slice 0.1.30 → 0.1.32
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +36 -276
- package/dist/cjs/chunks/{AudioBubble-DisHuKIC.js → AudioBubble-Dh2IlYW0.js} +3 -5
- package/dist/cjs/chunks/Avatar-WcBAu25_.js +82 -0
- package/dist/cjs/chunks/{AvatarGroup-DhGp_qLw.js → AvatarGroup-eUkVdeTf.js} +1 -3
- package/dist/cjs/chunks/Badge-4tBynWZe.js +22 -0
- package/dist/cjs/chunks/{Button-PsJx1WmV.js → Button-QJ5lsSAz.js} +1 -3
- package/dist/cjs/chunks/{ButtonBar-8zm6a_h7.js → ButtonBar-DcpvT1vD.js} +1 -3
- package/dist/cjs/chunks/{Camera-zFyIXcge.js → Camera-iDyPLq9h.js} +3 -5
- package/dist/cjs/chunks/CheckBox-CmZJd8u2.js +51 -0
- package/dist/cjs/chunks/Chip-Bd1bSYeC.js +77 -0
- package/dist/cjs/chunks/{DivInput-2cMdJQ9U.js → DivInput-BY9pQ6ty.js} +1 -3
- package/dist/cjs/chunks/{Dot-fKIwhjYA.js → Dot-BeWDLajy.js} +1 -3
- package/dist/cjs/chunks/{DrggablePanel-P7TgBI3j.js → DrggablePanel-DzY5wTco.js} +3 -5
- package/dist/cjs/chunks/DropDown-Cn_nX8u7.js +104 -0
- package/dist/cjs/chunks/ErrorSummary-D-0uVwyV.js +85 -0
- package/dist/cjs/chunks/{FileIcon-PuDoz0mF.js → FileIcon-JfY2AYqG.js} +2 -2
- package/dist/cjs/chunks/FileList-Dc1nfpR2.js +222 -0
- package/dist/cjs/chunks/{FlexDiv-D4aSJC_G.js → FlexDiv-B5Pi0-aJ.js} +2 -3
- package/dist/cjs/chunks/Grouper-DKZkTlow.js +61 -0
- package/dist/cjs/chunks/{Icon-BtcHXeqE.js → Icon-BVYVJp9J.js} +4 -7
- package/dist/cjs/chunks/IconButton-CP1Wsvsx.js +82 -0
- package/dist/cjs/chunks/{IndexedDB-BaVmQgkK.js → IndexedDB-CeiVT55Z.js} +1 -1
- package/dist/cjs/chunks/Label-DIs1rOey.js +102 -0
- package/dist/cjs/chunks/Level-3yxetsco.js +58 -0
- package/dist/cjs/chunks/{MdStreamBuffer-CvLO7CVi.js → MdStreamBuffer-BudWFoNw.js} +38 -16
- package/dist/cjs/chunks/Modal-CjpQdoOe.js +127 -0
- package/dist/cjs/chunks/{ModalController-13xmvKnm.js → ModalController-Cp2PXOOS.js} +1 -3
- package/dist/cjs/chunks/{Overlay-GXu6nMnw.js → Overlay-DRpHYZek.js} +1 -3
- package/dist/cjs/chunks/Pager-ChnTKwml.js +36 -0
- package/dist/cjs/chunks/{ProgressIndicator-D06PqCQk.js → ProgressIndicator-CFiAU-aF.js} +2 -6
- package/dist/cjs/chunks/{PromptInput-DuE4vGxR.js → PromptInput-BFWR0TaP.js} +2 -4
- package/dist/cjs/chunks/RadioButton-Bi-FP41j.js +55 -0
- package/dist/cjs/chunks/{RadioButtonList-N7Fmvr5W.js → RadioButtonList-JHPKMCoX.js} +1 -2
- package/dist/cjs/chunks/{Slider-BSy8xciG.js → Slider-D97ws1Cl.js} +1 -3
- package/dist/cjs/chunks/{Spacer-CyZAUR5N.js → Spacer-DvI2M1wZ.js} +1 -1
- package/dist/cjs/chunks/{Switch-Crm-nHYI.js → Switch-DDSSprb7.js} +1 -2
- package/dist/cjs/chunks/{TabBar-BtFfMwiB.js → TabBar-TllSeSzb.js} +2 -4
- package/dist/cjs/chunks/TextArea-DjZRDixt.js +74 -0
- package/dist/cjs/chunks/{TextField-Bh2EA082.js → TextField-CKA3K0AN.js} +3 -5
- package/dist/cjs/chunks/Tip-BdGXN-TQ.js +88 -0
- package/dist/cjs/chunks/Toast-COrDS_50.js +177 -0
- package/dist/cjs/chunks/ToggleButton-hoOMzBZc.js +39 -0
- package/dist/cjs/chunks/UploadArea-ClG8ZgRZ.js +127 -0
- package/dist/cjs/chunks/{WSConnection-DrOC8Z0R.js → WSConnection-Brxc2hEv.js} +1 -1
- package/dist/cjs/chunks/WebRTCConnection-eWP4lueC.js +252 -0
- package/dist/cjs/chunks/{localDBStore-zyDhaEiP.js → localDBStore-SS_r0C6F.js} +1 -1
- package/dist/cjs/chunks/{microphoneStore-D1fV_8QQ.js → microphoneStore-DM_8bhFr.js} +27 -4
- package/dist/cjs/chunks/{misc-QpU0XEOW.js → misc-4xyXRU2K.js} +1 -1
- package/dist/cjs/chunks/{sseStore-1OeJ9TRP.js → sseStore-Ag-UnuQq.js} +2 -2
- package/dist/cjs/chunks/{uploads-worker-Az040BSN.js → uploads-worker-CI-SZptI.js} +1 -1
- package/dist/cjs/chunks/{uploadsStore-8mOTz0Qe.js → uploadsStore-DR2hc4ct.js} +2 -2
- package/dist/cjs/chunks/{volumeStore-Pv23v12t.js → volumeStore-DtTHf-9_.js} +5 -4
- package/dist/cjs/chunks/webRTCStore-DWWn7k-0.js +55 -0
- package/dist/cjs/chunks/{windowStore-CCxCOUqa.js → windowStore-BUo9Du_e.js} +1 -1
- package/dist/cjs/components/AudioBubble/index.js +7 -7
- package/dist/cjs/components/Avatar/index.js +3 -4
- package/dist/cjs/components/AvatarGroup/index.js +4 -4
- package/dist/cjs/components/Badge/index.js +3 -3
- package/dist/cjs/components/Button/index.js +7 -8
- package/dist/cjs/components/ButtonBar/index.js +7 -7
- package/dist/cjs/components/Camera/index.js +8 -8
- package/dist/cjs/components/CheckBox/index.js +7 -7
- package/dist/cjs/components/Chip/index.js +7 -8
- package/dist/cjs/components/DivInput/index.js +3 -4
- package/dist/cjs/components/Dot/index.js +3 -3
- package/dist/cjs/components/DraggablePanel/index.js +6 -6
- package/dist/cjs/components/DropDown/index.js +7 -7
- package/dist/cjs/components/ErrorSummary/index.js +6 -7
- package/dist/cjs/components/FileIcon/index.js +6 -7
- package/dist/cjs/components/FileList/index.js +7 -7
- package/dist/cjs/components/FlexDiv/index.js +3 -4
- package/dist/cjs/components/Grouper/index.js +7 -8
- package/dist/cjs/components/Icon/index.js +6 -7
- package/dist/cjs/components/IconButton/index.js +6 -7
- package/dist/cjs/components/Label/index.js +3 -4
- package/dist/cjs/components/Level/index.js +7 -0
- package/dist/cjs/components/Modal/index.js +7 -8
- package/dist/cjs/components/ModalController/index.js +4 -4
- package/dist/cjs/components/Overlay/index.js +3 -3
- package/dist/cjs/components/Pager/index.js +3 -4
- package/dist/cjs/components/Progress/index.js +5 -6
- package/dist/cjs/components/PromptInput/index.js +9 -10
- package/dist/cjs/components/RadioButton/index.js +7 -7
- package/dist/cjs/components/RadioButtonList/index.js +8 -8
- package/dist/cjs/components/Slider/index.js +4 -5
- package/dist/cjs/components/Spacer/index.js +2 -2
- package/dist/cjs/components/Switch/index.js +3 -3
- package/dist/cjs/components/TabBar/index.js +9 -9
- package/dist/cjs/components/TextArea/index.js +8 -8
- package/dist/cjs/components/Textfield/index.js +9 -9
- package/dist/cjs/components/Tip/index.js +3 -4
- package/dist/cjs/components/Toast/index.js +7 -8
- package/dist/cjs/components/ToggleButton/index.js +8 -8
- package/dist/cjs/components/UploadArea/index.js +7 -7
- package/dist/cjs/hooks/useAudioRecorder.js +1 -1
- package/dist/cjs/hooks/useBindWebRTC.js +60 -0
- package/dist/cjs/hooks/useLocalStore.js +3 -3
- package/dist/cjs/hooks/useMdStreamBuffer.js +55 -30
- package/dist/cjs/hooks/useMicrophone.js +1 -1
- package/dist/cjs/hooks/useObserveTheme.js +3 -3
- package/dist/cjs/hooks/useTheme.js +2 -3
- package/dist/cjs/hooks/useTrackRenders.js +2 -2
- package/dist/cjs/hooks.js +9 -6
- package/dist/cjs/index.js +19 -17
- package/dist/cjs/providers/ThemeProvider.js +6 -17
- package/dist/cjs/providers/themeServer.js +15 -9
- package/dist/cjs/providers.js +4 -5
- package/dist/cjs/stores/LocalDB.js +3 -3
- package/dist/cjs/stores/SSE.js +2 -2
- package/dist/cjs/stores/WS.js +2 -2
- package/dist/cjs/stores/WebRTC.js +9 -0
- package/dist/cjs/stores/microphone.js +5 -4
- package/dist/cjs/stores/modal.js +1 -1
- package/dist/cjs/stores/tip.js +1 -1
- package/dist/cjs/stores/toast.js +1 -1
- package/dist/cjs/stores/uploads.js +2 -2
- package/dist/cjs/stores/volume.js +2 -2
- package/dist/cjs/stores/window.js +2 -2
- package/dist/cjs/stores.js +18 -13
- package/dist/cjs/theme/type.js +1 -1
- package/dist/cjs/utils/index.js +4 -3
- package/dist/cjs/utils/objects/index.js +4 -3
- package/dist/cjs/workers/uploads/uploads.js +2 -2
- package/dist/esm/chunks/{AudioBubble-D052QyPH.mjs → AudioBubble-cYlxxQ7c.mjs} +3 -7
- package/dist/esm/chunks/Avatar-D84wF2os.mjs +88 -0
- package/dist/esm/chunks/{AvatarGroup-C7YRtPmJ.mjs → AvatarGroup-DiwfbRxH.mjs} +2 -6
- package/dist/esm/chunks/Badge-DuUb5-80.mjs +26 -0
- package/dist/esm/chunks/{Button-BQS3rwrS.mjs → Button-BIgwWrPJ.mjs} +6 -10
- package/dist/esm/chunks/{ButtonBar-GLNRjmjv.mjs → ButtonBar-vNvnvw7u.mjs} +3 -7
- package/dist/esm/chunks/{Camera-CAp0Y2gN.mjs → Camera-BMwkTJPq.mjs} +5 -9
- package/dist/esm/chunks/CheckBox-Cpoxy8w_.mjs +61 -0
- package/dist/esm/chunks/Chip-BayNVv7N.mjs +87 -0
- package/dist/esm/chunks/{DivInput-g6F1YWTo.mjs → DivInput-CWRUxy1y.mjs} +2 -6
- package/dist/esm/chunks/{Dot-DZE134mJ.mjs → Dot-v_kcIWV2.mjs} +1 -5
- package/dist/esm/chunks/{DrggablePanel-C0AmJy8g.mjs → DrggablePanel-yEeGeE1w.mjs} +2 -6
- package/dist/esm/chunks/DropDown-QQhwAg_J.mjs +112 -0
- package/dist/esm/chunks/ErrorSummary-DzIZMIll.mjs +90 -0
- package/dist/esm/chunks/{FileIcon-BQ2zZIW5.mjs → FileIcon-6UlkbKzk.mjs} +2 -2
- package/dist/esm/chunks/FileList-vMiGJByw.mjs +230 -0
- package/dist/esm/chunks/{FlexDiv-DnY1_qk4.mjs → FlexDiv-B1m7aY04.mjs} +3 -6
- package/dist/esm/chunks/Grouper-BDrAnfDF.mjs +73 -0
- package/dist/esm/chunks/{Icon--RjjODc9.mjs → Icon-D4A6_c4x.mjs} +3 -8
- package/dist/esm/chunks/IconButton-B_W-aOsB.mjs +96 -0
- package/dist/esm/chunks/{IndexedDB-Dk7a4fPS.mjs → IndexedDB-CTqfKmp1.mjs} +1 -1
- package/dist/esm/chunks/Label-I75yz3gq.mjs +113 -0
- package/dist/esm/chunks/Level-DgczkKBr.mjs +63 -0
- package/dist/esm/chunks/{MdStreamBuffer-By7pHJQL.mjs → MdStreamBuffer-CoQWQwRL.mjs} +38 -16
- package/dist/esm/chunks/Modal-CwwyijaO.mjs +139 -0
- package/dist/esm/chunks/{ModalController-BO5FkAqu.mjs → ModalController-IyB9lDRa.mjs} +2 -6
- package/dist/esm/chunks/{Overlay-sXM7cEYc.mjs → Overlay-C-yori3-.mjs} +1 -5
- package/dist/esm/chunks/Pager-BEtfyKtq.mjs +42 -0
- package/dist/esm/chunks/{ProgressIndicator-B5oByN3i.mjs → ProgressIndicator-BV0ginXb.mjs} +2 -8
- package/dist/esm/chunks/{PromptInput-Cwd53ux7.mjs → PromptInput-Cn5fRYap.mjs} +3 -7
- package/dist/esm/chunks/RadioButton-DWlg6ldv.mjs +63 -0
- package/dist/esm/chunks/{RadioButtonList-C_heuiis.mjs → RadioButtonList-D9FdlhPL.mjs} +3 -6
- package/dist/esm/chunks/{Slider-XEV0D2Rd.mjs → Slider-B2WZkZSg.mjs} +3 -7
- package/dist/esm/chunks/{Spacer-C5651N0N.mjs → Spacer-7Oj0SlD0.mjs} +1 -1
- package/dist/esm/chunks/{Switch-RfA431T4.mjs → Switch-DRhnznnO.mjs} +1 -4
- package/dist/esm/chunks/{TabBar-kPZ6ZJxr.mjs → TabBar-D6VR71ye.mjs} +5 -9
- package/dist/esm/chunks/TextArea-CkB5rJjI.mjs +80 -0
- package/dist/esm/chunks/{TextField-DwVKlLI_.mjs → TextField-BIXmkjEz.mjs} +5 -9
- package/dist/esm/chunks/Tip-CTdrwLky.mjs +96 -0
- package/dist/esm/chunks/Toast-8bUziIgh.mjs +189 -0
- package/dist/esm/chunks/ToggleButton-BOFITa8_.mjs +47 -0
- package/dist/esm/chunks/UploadArea-DE2ccDVx.mjs +135 -0
- package/dist/esm/chunks/{WSConnection-DV7k84B4.mjs → WSConnection-CHudrD62.mjs} +1 -1
- package/dist/esm/chunks/WebRTCConnection-DQbNa7Z9.mjs +252 -0
- package/dist/esm/chunks/{localDBStore-Dnpo5nSv.mjs → localDBStore-CaYiqITY.mjs} +2 -2
- package/dist/esm/chunks/{microphoneStore-Dr3lxoWX.mjs → microphoneStore-COEGtgyX.mjs} +26 -3
- package/dist/esm/chunks/{misc-wS74txaa.mjs → misc-2MIIqzsX.mjs} +1 -1
- package/dist/esm/chunks/{sseStore-DjrfpNAS.mjs → sseStore-nW9CMec_.mjs} +2 -2
- package/dist/esm/chunks/{tslib.es6-C-olHjXV.mjs → tslib.es6-C81Qhn1z.mjs} +1 -1
- package/dist/esm/chunks/{uploads-worker-CYp-F4dz.mjs → uploads-worker-CMomtRvm.mjs} +1 -1
- package/dist/esm/chunks/{uploadsStore-DeRMJ5c9.mjs → uploadsStore-CsfpSOTS.mjs} +1 -1
- package/dist/esm/chunks/{volumeStore-BX7QcrL-.mjs → volumeStore-TSYPqbHx.mjs} +5 -4
- package/dist/esm/chunks/webRTCStore-CVCDJzj5.mjs +57 -0
- package/dist/esm/chunks/{windowStore-CAzx2-QV.mjs → windowStore-BvejIR82.mjs} +1 -1
- package/dist/esm/components/AudioBubble/index.mjs +4 -6
- package/dist/esm/components/Avatar/index.mjs +3 -5
- package/dist/esm/components/AvatarGroup/index.mjs +4 -6
- package/dist/esm/components/Badge/index.mjs +2 -4
- package/dist/esm/components/Button/index.mjs +8 -10
- package/dist/esm/components/ButtonBar/index.mjs +4 -6
- package/dist/esm/components/Camera/index.mjs +6 -8
- package/dist/esm/components/CheckBox/index.mjs +4 -6
- package/dist/esm/components/Chip/index.mjs +5 -7
- package/dist/esm/components/DivInput/index.mjs +3 -5
- package/dist/esm/components/Dot/index.mjs +2 -4
- package/dist/esm/components/DraggablePanel/index.mjs +3 -5
- package/dist/esm/components/DropDown/index.mjs +4 -6
- package/dist/esm/components/ErrorSummary/index.mjs +3 -5
- package/dist/esm/components/FileIcon/index.mjs +3 -5
- package/dist/esm/components/FileList/index.mjs +6 -8
- package/dist/esm/components/FlexDiv/index.mjs +2 -4
- package/dist/esm/components/Grouper/index.mjs +5 -7
- package/dist/esm/components/Icon/index.mjs +4 -6
- package/dist/esm/components/IconButton/index.mjs +7 -9
- package/dist/esm/components/Label/index.mjs +3 -5
- package/dist/esm/components/Level/index.mjs +11 -0
- package/dist/esm/components/Modal/index.mjs +10 -12
- package/dist/esm/components/ModalController/index.mjs +4 -6
- package/dist/esm/components/Overlay/index.mjs +2 -4
- package/dist/esm/components/Pager/index.mjs +3 -5
- package/dist/esm/components/Progress/index.mjs +4 -6
- package/dist/esm/components/PromptInput/index.mjs +11 -13
- package/dist/esm/components/RadioButton/index.mjs +4 -6
- package/dist/esm/components/RadioButtonList/index.mjs +5 -7
- package/dist/esm/components/Slider/index.mjs +4 -6
- package/dist/esm/components/Spacer/index.mjs +2 -2
- package/dist/esm/components/Switch/index.mjs +2 -4
- package/dist/esm/components/TabBar/index.mjs +8 -10
- package/dist/esm/components/TextArea/index.mjs +9 -11
- package/dist/esm/components/Textfield/index.mjs +10 -12
- package/dist/esm/components/Tip/index.mjs +3 -5
- package/dist/esm/components/Toast/index.mjs +5 -7
- package/dist/esm/components/ToggleButton/index.mjs +9 -11
- package/dist/esm/components/UploadArea/index.mjs +9 -11
- package/dist/esm/hooks/useAudioRecorder.mjs +1 -1
- package/dist/esm/hooks/useBindWebRTC.mjs +72 -0
- package/dist/esm/hooks/useLocalStore.mjs +3 -3
- package/dist/esm/hooks/useMdStreamBuffer.mjs +56 -28
- package/dist/esm/hooks/useMicrophone.mjs +1 -1
- package/dist/esm/hooks/useObserveTheme.mjs +0 -2
- package/dist/esm/hooks/useTheme.mjs +0 -2
- package/dist/esm/hooks/useTrackRenders.mjs +2 -2
- package/dist/esm/hooks.mjs +14 -4
- package/dist/esm/index.mjs +62 -52
- package/dist/esm/providers/ThemeProvider.mjs +6 -19
- package/dist/esm/providers/themeServer.mjs +11 -6
- package/dist/esm/providers.mjs +0 -2
- package/dist/esm/stores/LocalDB.mjs +3 -3
- package/dist/esm/stores/SSE.mjs +3 -3
- package/dist/esm/stores/WS.mjs +2 -2
- package/dist/esm/stores/WebRTC.mjs +7 -0
- package/dist/esm/stores/microphone.mjs +2 -2
- package/dist/esm/stores/modal.mjs +1 -1
- package/dist/esm/stores/tip.mjs +1 -1
- package/dist/esm/stores/toast.mjs +1 -1
- package/dist/esm/stores/uploads.mjs +3 -3
- package/dist/esm/stores/volume.mjs +2 -2
- package/dist/esm/stores/window.mjs +2 -2
- package/dist/esm/stores.mjs +17 -13
- package/dist/esm/theme/type.mjs +1 -1
- package/dist/esm/utils/index.mjs +11 -9
- package/dist/esm/utils/objects/index.mjs +8 -6
- package/dist/esm/workers/uploads/uploads.mjs +2 -2
- package/dist/styles.css +8476 -0
- package/dist/types/components/Level/Level.d.ts +5 -0
- package/dist/types/components/Level/_types.d.ts +21 -0
- package/dist/types/components/Level/index.d.ts +2 -0
- package/dist/types/components/Modal/_types.d.ts +4 -0
- package/dist/types/components/Toast/_types.d.ts +1 -0
- package/dist/types/hooks/index.d.ts +2 -0
- package/dist/types/hooks/useBindWebRTC/index.d.ts +1 -0
- package/dist/types/hooks/useBindWebRTC/useBindWebRTC.d.ts +15 -0
- package/dist/types/hooks/useLocalStore/useLocalStore.d.ts +1 -1
- package/dist/types/hooks/useMdStreamBuffer/useMdStreamBuffer.d.ts +6 -1
- package/dist/types/index.d.ts +4 -1
- package/dist/types/providers/ThemeProvider.d.ts +1 -6
- package/dist/types/providers/themeServer.d.ts +7 -3
- package/dist/types/stores/WebRTC/_types.d.ts +16 -0
- package/dist/types/stores/WebRTC/index.d.ts +2 -0
- package/dist/types/stores/WebRTC/webRTCStore.d.ts +21 -0
- package/dist/types/stores/index.d.ts +1 -0
- package/dist/types/stores/microphone/index.d.ts +1 -1
- package/dist/types/stores/microphone/microphoneStore.d.ts +14 -1
- package/dist/types/stores/toast/_types.d.ts +1 -0
- package/dist/types/stores/volume/_types.d.ts +3 -1
- package/dist/types/stores/volume/volumeStore.d.ts +6 -2
- package/dist/types/utils/functions/files.d.ts +1 -1
- package/dist/types/utils/index.d.ts +2 -2
- package/dist/types/utils/objects/MDStreamBuffer/MdStreamBuffer.d.ts +10 -0
- package/dist/types/utils/objects/MDStreamBuffer/_types.d.ts +2 -0
- package/dist/types/utils/objects/WebRTCConnection/WebRTCConnection.d.ts +37 -3
- package/dist/types/utils/objects/WebRTCConnection/_types.d.ts +13 -4
- package/dist/types/utils/objects/index.d.ts +2 -0
- package/package.json +8 -3
- package/dist/cjs/chunks/Avatar-CqUSRzVd.js +0 -84
- package/dist/cjs/chunks/Badge-DjPJ_iJX.js +0 -24
- package/dist/cjs/chunks/CheckBox-Cbh6UK-7.js +0 -53
- package/dist/cjs/chunks/Chip-DcS8dtW2.js +0 -79
- package/dist/cjs/chunks/DropDown-B0970yVe.js +0 -105
- package/dist/cjs/chunks/ErrorSummary-K_rPxGWK.js +0 -87
- package/dist/cjs/chunks/FileList-sDq1jK0b.js +0 -225
- package/dist/cjs/chunks/Grouper-Ccd-x_Nb.js +0 -63
- package/dist/cjs/chunks/IconButton-CF4cR7Tr.js +0 -84
- package/dist/cjs/chunks/Label-htjXHiQ4.js +0 -103
- package/dist/cjs/chunks/Modal-C0Z59meI.js +0 -101
- package/dist/cjs/chunks/Pager-D2_fshTy.js +0 -38
- package/dist/cjs/chunks/RadioButton-DPB2ZGVf.js +0 -56
- package/dist/cjs/chunks/TextArea-CRiPRF8v.js +0 -76
- package/dist/cjs/chunks/Tip-C5keUoHx.js +0 -90
- package/dist/cjs/chunks/Toast-CyiFOsI3.js +0 -178
- package/dist/cjs/chunks/ToggleButton-D5_WnW0o.js +0 -40
- package/dist/cjs/chunks/UploadArea-KqES_OLl.js +0 -129
- package/dist/cjs/chunks/style-inject.es-CMuL-BfJ.js +0 -11
- package/dist/esm/chunks/Avatar-29zhNfxX.mjs +0 -92
- package/dist/esm/chunks/Badge-CC0zSLMf.mjs +0 -30
- package/dist/esm/chunks/CheckBox-7TiT2U47.mjs +0 -65
- package/dist/esm/chunks/Chip-CKsojimU.mjs +0 -91
- package/dist/esm/chunks/DropDown-mwo8fY7p.mjs +0 -115
- package/dist/esm/chunks/ErrorSummary-EzCqVifm.mjs +0 -94
- package/dist/esm/chunks/FileList-fh-x9Dzm.mjs +0 -235
- package/dist/esm/chunks/Grouper-naJMvpB9.mjs +0 -77
- package/dist/esm/chunks/IconButton-ByBYppAj.mjs +0 -100
- package/dist/esm/chunks/Label-C04tD7UZ.mjs +0 -116
- package/dist/esm/chunks/Modal-B9ad9OfJ.mjs +0 -115
- package/dist/esm/chunks/Pager-Bz0FpgO5.mjs +0 -46
- package/dist/esm/chunks/RadioButton-CLeRiZ8x.mjs +0 -66
- package/dist/esm/chunks/TextArea-CxscPLwN.mjs +0 -84
- package/dist/esm/chunks/Tip-C6EcX7_M.mjs +0 -100
- package/dist/esm/chunks/Toast-D4uMNvaa.mjs +0 -192
- package/dist/esm/chunks/ToggleButton-C0QIflzX.mjs +0 -51
- package/dist/esm/chunks/UploadArea-je-1NhGb.mjs +0 -139
- package/dist/esm/chunks/style-inject.es-D0BjEaN8.mjs +0 -11
- /package/dist/cjs/chunks/{SSEConnection-C-1OzEOp.js → SSEConnection-DfjLAlOG.js} +0 -0
- /package/dist/cjs/chunks/{_types-Bdqd2vHh.js → _types-DMyBIF8s.js} +0 -0
- /package/dist/cjs/chunks/{audioVisualizer-EIfIjWH7.js → audioVisualizer-BxPvUj4h.js} +0 -0
- /package/dist/cjs/chunks/{colors-njquvHkx.js → colors-4n0sNFRA.js} +0 -0
- /package/dist/cjs/chunks/{debounce-BF4i6uIC.js → debounce-_IK-La-Z.js} +0 -0
- /package/dist/cjs/chunks/{modalStore-7VjHHM8X.js → modalStore-CFsfK3ba.js} +0 -0
- /package/dist/cjs/chunks/{sharedTypes-gCECyn2N.js → sharedTypes-C0ZHzH_T.js} +0 -0
- /package/dist/cjs/chunks/{tipStore-Ck4NLvml.js → tipStore-dqD9-c30.js} +0 -0
- /package/dist/cjs/chunks/{toastStore-CSStgB9d.js → toastStore-BN1N7WXv.js} +0 -0
- /package/dist/cjs/chunks/{tslib.es6-C8dZW5nY.js → tslib.es6-DsF7Wv4Y.js} +0 -0
- /package/dist/esm/chunks/{SSEConnection-DcA3wFsO.mjs → SSEConnection-iFKOV9Uo.mjs} +0 -0
- /package/dist/esm/chunks/{_types-BVrr_Khp.mjs → _types-DrNviSG6.mjs} +0 -0
- /package/dist/esm/chunks/{audioVisualizer-ZgT77nUw.mjs → audioVisualizer-BsmpLZyK.mjs} +0 -0
- /package/dist/esm/chunks/{colors-FQ0uNQcW.mjs → colors-BAATtfbL.mjs} +0 -0
- /package/dist/esm/chunks/{debounce-Bst1jxMS.mjs → debounce-CYBH5qXQ.mjs} +0 -0
- /package/dist/esm/chunks/{modalStore-BpWnLtOF.mjs → modalStore-DmaeMv7z.mjs} +0 -0
- /package/dist/esm/chunks/{sharedTypes-tn9-uJvb.mjs → sharedTypes-CyrInj1b.mjs} +0 -0
- /package/dist/esm/chunks/{tipStore-CL5a95Bl.mjs → tipStore-B_MUZfr2.mjs} +0 -0
- /package/dist/esm/chunks/{toastStore-D2PEIqCo.mjs → toastStore-DAprlBVj.mjs} +0 -0
|
@@ -1,225 +0,0 @@
|
|
|
1
|
-
'use client';
|
|
2
|
-
"use strict";
|
|
3
|
-
|
|
4
|
-
var tslib_es6 = require("./tslib.es6-C8dZW5nY.js"), jsxRuntime = require("react/jsx-runtime"), React = require("react"), misc = require("./misc-QpU0XEOW.js"), FileIcon = require("./FileIcon-PuDoz0mF.js"), Icon = require("./Icon-BtcHXeqE.js"), ProgressIndicator = require("./ProgressIndicator-D06PqCQk.js"), styleInject_es = require("./style-inject.es-CMuL-BfJ.js");
|
|
5
|
-
|
|
6
|
-
var css = {
|
|
7
|
-
wrapper: "FileList-module_wrapper__9-rrl flexBox-module_rowStart__4tcxS",
|
|
8
|
-
file: "FileList-module_file__61dkh flexBox-module_rowStart__4tcxS",
|
|
9
|
-
fileName: "FileList-module_fileName__amame flexBox-module_row__z24tF",
|
|
10
|
-
meta: "FileList-module_meta__unbpG flexBox-module_columnStart__C7P44",
|
|
11
|
-
status: "FileList-module_status__H1s6f type-module_body-xs-regular__ZAFft",
|
|
12
|
-
error: "FileList-module_error__UZ4-T",
|
|
13
|
-
fileIcon: "FileList-module_fileIcon__xDWW8 flexBox-module_row__z24tF",
|
|
14
|
-
icon: "FileList-module_icon__JR0HE flexBox-module_row__z24tF",
|
|
15
|
-
xs: "FileList-module_xs__i2S-5 type-module_body-xs-regular__ZAFft",
|
|
16
|
-
s: "FileList-module_s__4q0ae type-module_body-s-regular__vRHSP",
|
|
17
|
-
m: "FileList-module_m__hWqBx type-module_body-m-regular__LuQBA",
|
|
18
|
-
l: "FileList-module_l__tHDNp type-module_body-l-regular__lOYbg",
|
|
19
|
-
xl: "FileList-module_xl__fxW11 type-module_body-xl-regular__pF2kC"
|
|
20
|
-
};
|
|
21
|
-
|
|
22
|
-
/**
|
|
23
|
-
* display the remove button if not uploading
|
|
24
|
-
*/
|
|
25
|
-
function displayClose(uploading) {
|
|
26
|
-
return uploading ? {
|
|
27
|
-
display: "none"
|
|
28
|
-
} : {
|
|
29
|
-
display: "flex"
|
|
30
|
-
};
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
styleInject_es.styleInject('.flexBox-module_row__z24tF {\n\tdisplay: flex;\n\tjustify-content: center;\n\talign-items: center;\n\tbox-sizing: border-box;\n\tpadding: 0;\n\tmargin: 0;\n}.flexBox-module_rowBetween__5FEvi {\n\tdisplay: flex;\n\tjustify-content: space-between;\n\talign-items: center;\n\tbox-sizing: border-box;\n\tpadding: 0;\n\tmargin: 0;\n}.flexBox-module_rowStart__4tcxS {\n\tdisplay: flex;\n\tjustify-content: flex-start;\n\talign-items: center;\n\tbox-sizing: border-box;\n\tpadding: 0;\n\tmargin: 0;\n}.flexBox-module_rowEnd__rVdVm {\n\tdisplay: flex;\n\tjustify-content: flex-end;\n\talign-items: center;\n\tbox-sizing: border-box;\n\tpadding: 0;\n\tmargin: 0;\n}.flexBox-module_column__ezvMq {\n\tdisplay: flex;\n\tflex-direction: column;\n\tjustify-content: center;\n\talign-items: center;\n\tbox-sizing: border-box;\n\tpadding: 0;\n\tmargin: 0;\n}.flexBox-module_columnStart__C7P44 {\n\tdisplay: flex;\n\tflex-direction: column;\n\tjustify-content: flex-start;\n\talign-items: flex-start;\n\tbox-sizing: border-box;\n\tpadding: 0;\n\tmargin: 0;\n}.flexBox-module_columnStartCenter__PKcrG {\n\tdisplay: flex;\n\tflex-direction: column;\n\tjustify-content: flex-start;\n\talign-items: center;\n\tbox-sizing: border-box;\n\tpadding: 0;\n\tmargin: 0;\n}.flexBox-module_columnBetween__ERfp7 {\n\tdisplay: flex;\n\tflex-direction: column;\n\tjustify-content: space-between;\n\talign-items: center;\n\tbox-sizing: border-box;\n\tpadding: 0;\n\tmargin: 0;\n}.flexBox-module_columnEnd__lLJuc {\n\tdisplay: flex;\n\tflex-direction: column;\n\tjustify-content: flex-end;\n\talign-items: flex-end;\n\tbox-sizing: border-box;\n\tpadding: 0;\n\tmargin: 0;\n}.type-module_body-xs-regular__ZAFft {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: var(--font-weight-regular);\n\tfont-size: var(--font-size-xs);\n\tline-height: 133.33%;\n\ttext-decoration: none;\n\tletter-spacing: 0.2px;\n}.type-module_body-xs-medium__s3KvF {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: var(--font-weight-medium);\n\tfont-size: var(--font-size-xs);\n\tline-height: 133.33%;\n\ttext-decoration: none;\n\tletter-spacing: 0.2px;\n}.type-module_body-xs-bold__Lhqqq {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: var(--font-weight-bold);\n\tfont-size: var(--font-size-xs);\n\tline-height: 133.33%;\n\ttext-decoration: none;\n\tletter-spacing: 0.25px;\n}.type-module_body-s-regular__vRHSP {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: var(--font-weight-regular);\n\tfont-size: var(--font-size-s);\n\tline-height: 142.86%;\n\ttext-decoration: none;\n\tletter-spacing: 0.15px;\n}.type-module_body-s-medium__tjdFc {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: var(--font-weight-medium);\n\tfont-size: var(--font-size-s);\n\tline-height: 142.86%;\n\ttext-decoration: none;\n\tletter-spacing: 0.15px;\n}.type-module_body-s-bold__Iy-VX {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: var(--font-weight-bold);\n\tfont-size: var(--font-size-s);\n\tline-height: 142.86%;\n\ttext-decoration: none;\n\tletter-spacing: 0.2px;\n}.type-module_body-m-regular__LuQBA {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: var(--font-weight-regular);\n\tfont-size: var(--font-size-m);\n\tline-height: 140%;\n\ttext-decoration: none;\n\tletter-spacing: 0.15px;\n}.type-module_body-m-medium__uW1on {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: var(--font-weight-medium);\n\tfont-size: var(--font-size-m);\n\tline-height: 140%;\n\ttext-decoration: none;\n\tletter-spacing: 0.15px;\n}.type-module_body-m-bold__UBcvQ {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: var(--font-weight-bold);\n\tfont-size: var(--font-size-m);\n\tline-height: 140%;\n\ttext-decoration: none;\n\tletter-spacing: 0.2px;\n}.type-module_body-l-regular__lOYbg {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: var(--font-weight-regular);\n\tfont-size: var(--font-size-l);\n\tline-height: 162.5%;\n\ttext-decoration: none;\n\tletter-spacing: 0.1px;\n}.type-module_body-l-medium__BqRC7 {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: var(--font-weight-medium);\n\tfont-size: var(--font-size-l);\n\tline-height: 162.5%;\n\ttext-decoration: none;\n\tletter-spacing: 0.1px;\n}.type-module_body-l-bold__Fh2dt {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: var(--font-weight-bold);\n\tfont-size: var(--font-size-l);\n\tline-height: 162.5%;\n\ttext-decoration: none;\n\tletter-spacing: 0.15px;\n}.type-module_body-xl-regular__pF2kC {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: var(--font-weight-regular);\n\tfont-size: var(--font-size-xl);\n\tline-height: 162.5%;\n\ttext-decoration: none;\n\tletter-spacing: 0.1px;\n}.type-module_body-xl-medium__BeyrH {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: var(--font-weight-medium);\n\tfont-size: var(--font-size-xl);\n\tline-height: 162.5%;\n\ttext-decoration: none;\n\tletter-spacing: 0.1px;\n}.type-module_body-xl-bold__Ruknj {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: var(--font-weight-bold);\n\tfont-size: var(--font-size-xl);\n\tline-height: 162.5%;\n\ttext-decoration: none;\n\tletter-spacing: 0.15px;\n}.type-module_heading-s-medium__z8L3G {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: 500;\n\tfont-size: 20px;\n\tline-height: 140%;\n\ttext-decoration: none;\n\tletter-spacing: 0.2px;\n}.type-module_heading-s-bold__0O3g6 {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: 600;\n\tfont-size: 20px;\n\tline-height: 140%;\n\ttext-decoration: none;\n\tletter-spacing: 0.2px;\n}.type-module_heading-m-bold__KXxEB {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: 500;\n\tfont-size: 24px;\n\tline-height: 116.67%;\n\ttext-decoration: none;\n\tletter-spacing: 0.2px;\n}.type-module_heading-m-medium__cJeEA {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: 600;\n\tfont-size: 24px;\n\tline-height: 116.67%;\n\ttext-decoration: none;\n\tletter-spacing: 0.2px;\n}.type-module_heading-l-medium__eRe05 {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: 500;\n\tfont-size: 30px;\n\tline-height: 128.57%;\n\ttext-decoration: none;\n\tletter-spacing: 0.2px;\n}.type-module_heading-l-bold__Xmwtf {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: 600;\n\tfont-size: 30px;\n\tline-height: 128.57%;\n\ttext-decoration: none;\n\tletter-spacing: 0.2px;\n}.type-module_heading-xl-medium__5q1m3 {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: 500;\n\tfont-size: 36px;\n\tline-height: 128.57%;\n\ttext-decoration: none;\n\tletter-spacing: 0.2px;\n}.type-module_heading-xl-bold__k9VFV {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: 600;\n\tfont-size: 36px;\n\tline-height: 128.57%;\n\ttext-decoration: none;\n\tletter-spacing: 0.2px;\n}\n\n.FileList-module_wrapper__9-rrl {\n\twidth: 100%;\n\toverflow: hidden;\n\tflex-wrap: var(--file-wrap);\n\tflex-direction: var(--file-direction) !important;\n\talign-items: flex-start !important;\n\tgap: var(--file-gap);\n\tuser-select: none;\n\t-webkit-user-select: none;\n}\n\n.FileList-module_file__61dkh {\n\tposition: relative;\n\tpadding: var(--file-padding) !important;\n\tborder: 1px solid var(--file-border-color);\n\tborder-radius: 4px;\n\toverflow: hidden;\n\tmin-height: max-content;\n\tmax-width: var(--file-max-width);\n\tmin-width: var(--file-min-width);\n\tcolor: var(--core-text-primary);\n\tbackground: transparent;\n\tgap: 4px;\n}\n\n/* file progress bar */\n.FileList-module_file__61dkh::before {\n\tcontent: "";\n\tposition: absolute;\n\tbackground: var(--file-bg-color);\n\ttop: 0;\n\tbottom: 0;\n\tleft: 0;\n\twidth: var(--file-progress);\n\ttransition: width var(--motion-water-duration) var(--motion-water) 0s;\n\tz-index: 1;\n}\n\n.FileList-module_fileName__amame {\n\twidth: 100%;\n\toverflow: hidden;\n\ttext-overflow: ellipsis;\n\twhite-space: nowrap;\n\tword-break: break-all;\n\tdisplay: -webkit-box !important;\n\t-webkit-line-clamp: 1;\n\t-webkit-box-orient: vertical;\n\tz-index: 2;\n}\n\n.FileList-module_meta__unbpG {\n\tflex: 1;\n\tmin-width: 0;\n\tgap: 2px;\n\tz-index: 2;\n}\n\n.FileList-module_status__H1s6f {\n\tcolor: var(--core-text-secondary);\n\tline-height: 1.2;\n}\n\n.FileList-module_error__UZ4-T {\n\tcolor: var(--feedback-warning);\n}\n\n.FileList-module_fileIcon__xDWW8 {\n\tmin-width: var(--file-icon-size);\n\tmin-height: var(--file-icon-size);\n\tmax-width: var(--file-icon-size);\n\tmax-height: var(--file-icon-size);\n\tz-index: 2;\n}\n\n.FileList-module_icon__JR0HE {\n\tmargin-left: 4px !important;\n\tmin-width: 20px;\n\tmin-height: 20px;\n\tmax-width: 20px;\n\tmax-height: 20px;\n\tcursor: pointer;\n\tz-index: 2;\n}\n\n.FileList-module_xs__i2S-5 {\n}\n\n.FileList-module_s__4q0ae {\n}\n\n.FileList-module_m__hWqBx {\n}\n\n.FileList-module_l__tHDNp {\n}\n\n.FileList-module_xl__fxW11 {\n}\n');
|
|
34
|
-
|
|
35
|
-
const FileList = React.memo(props => {
|
|
36
|
-
const {files: files = [], onChange: onChange, onToolTip: onToolTip, maxWidth: maxWidth, minWidth: minWidth, direction: direction = "row", padding: padding, gap: gap = 10, size: size = "s", iconSize: iconSize = 24, backgroundColor: backgroundColor, bgColor: bgColor, canRemove: canRemove = !0} = props, divAttributes = tslib_es6.__rest(props, [ "files", "onChange", "onToolTip", "maxWidth", "minWidth", "direction", "padding", "gap", "size", "iconSize", "backgroundColor", "bgColor", "canRemove" ]), {id: divId, className: className, style: style} = divAttributes, rest = tslib_es6.__rest(divAttributes, [ "id", "className", "style" ]), divStyle = null != style ? style : {}, divClass = className ? ` ${className}` : "", resolvedBackgroundColor = null != backgroundColor ? backgroundColor : bgColor, fileNameToFileItem = React.useCallback(fileName => {
|
|
37
|
-
const {ext: ext, name: name} =
|
|
38
|
-
/**
|
|
39
|
-
* Split a file name into its display name and extension.
|
|
40
|
-
*/
|
|
41
|
-
function(fileName) {
|
|
42
|
-
var _a;
|
|
43
|
-
const ext = null !== (_a = fileName.split(".").pop()) && void 0 !== _a ? _a : "unknown";
|
|
44
|
-
return {
|
|
45
|
-
name: fileName,
|
|
46
|
-
ext: ext
|
|
47
|
-
};
|
|
48
|
-
}
|
|
49
|
-
/**
|
|
50
|
-
* Map a file extension to the corresponding file icon name.
|
|
51
|
-
*/ (fileName);
|
|
52
|
-
return {
|
|
53
|
-
name: name,
|
|
54
|
-
ext: ext,
|
|
55
|
-
icon: function(extension) {
|
|
56
|
-
switch (extension) {
|
|
57
|
-
case "png":
|
|
58
|
-
case "jpeg":
|
|
59
|
-
case "jpg":
|
|
60
|
-
case "gif":
|
|
61
|
-
case "heic":
|
|
62
|
-
return "image";
|
|
63
|
-
|
|
64
|
-
case "docx":
|
|
65
|
-
case "doc":
|
|
66
|
-
case "txt":
|
|
67
|
-
return "text";
|
|
68
|
-
|
|
69
|
-
case "md":
|
|
70
|
-
return "md";
|
|
71
|
-
|
|
72
|
-
case "html":
|
|
73
|
-
case "js":
|
|
74
|
-
case "ts":
|
|
75
|
-
case "tsx":
|
|
76
|
-
case "json":
|
|
77
|
-
case "py":
|
|
78
|
-
return "code";
|
|
79
|
-
|
|
80
|
-
case "xls":
|
|
81
|
-
case "xlsx":
|
|
82
|
-
case "csv":
|
|
83
|
-
return "sheet";
|
|
84
|
-
|
|
85
|
-
case "ppt":
|
|
86
|
-
case "pptx":
|
|
87
|
-
return "preso";
|
|
88
|
-
|
|
89
|
-
case "pdf":
|
|
90
|
-
return "pdf";
|
|
91
|
-
|
|
92
|
-
case "mp3":
|
|
93
|
-
case "aif":
|
|
94
|
-
case "wav":
|
|
95
|
-
return "audio";
|
|
96
|
-
|
|
97
|
-
case "mp4":
|
|
98
|
-
case "mov":
|
|
99
|
-
return "video";
|
|
100
|
-
|
|
101
|
-
case "clipboard":
|
|
102
|
-
return "clipboard";
|
|
103
|
-
|
|
104
|
-
default:
|
|
105
|
-
return "other";
|
|
106
|
-
}
|
|
107
|
-
}(ext)
|
|
108
|
-
};
|
|
109
|
-
}, []), displayList = React.useMemo(() => files.map((item, index) => {
|
|
110
|
-
var _a;
|
|
111
|
-
const fileName =
|
|
112
|
-
/**
|
|
113
|
-
* utility get file name from file item
|
|
114
|
-
*/
|
|
115
|
-
function(item) {
|
|
116
|
-
return "string" == typeof item.file ? item.file : item.file.name;
|
|
117
|
-
}
|
|
118
|
-
/**
|
|
119
|
-
* cal progress as a percentage string
|
|
120
|
-
*/ (item), fileMeta = fileNameToFileItem(fileName), progress = function(uploading, progress) {
|
|
121
|
-
if (void 0 === progress || Number.isNaN(progress)) return uploading ? "0%" : "100%";
|
|
122
|
-
const percent = progress <= 1 ? 100 * progress : progress, clamped = Math.max(0, Math.min(100, percent));
|
|
123
|
-
return `${Math.round(clamped)}%`;
|
|
124
|
-
}
|
|
125
|
-
/**
|
|
126
|
-
* display the progress indicator if uploading
|
|
127
|
-
*/ (item.uploading, item.progress);
|
|
128
|
-
return Object.assign(Object.assign({}, fileMeta), {
|
|
129
|
-
key: `${fileMeta.name}-${index}`,
|
|
130
|
-
index: index,
|
|
131
|
-
uploading: null !== (_a = item.uploading) && void 0 !== _a && _a,
|
|
132
|
-
progress: progress,
|
|
133
|
-
error: item.error
|
|
134
|
-
});
|
|
135
|
-
}), [ files, fileNameToFileItem ]), handleRemove = React.useCallback(index => {
|
|
136
|
-
const updated = files.filter((_, itemIndex) => itemIndex !== index);
|
|
137
|
-
null == onChange || onChange(updated);
|
|
138
|
-
}, [ files, onChange ]), handleMouseOver = React.useCallback(e => {
|
|
139
|
-
const toolTip = {
|
|
140
|
-
payload: {
|
|
141
|
-
label: "Remove file"
|
|
142
|
-
},
|
|
143
|
-
ref: {
|
|
144
|
-
current: e.currentTarget
|
|
145
|
-
}
|
|
146
|
-
};
|
|
147
|
-
null == onToolTip || onToolTip(toolTip);
|
|
148
|
-
}, [ onToolTip ]), handleMouseOut = React.useCallback(() => {
|
|
149
|
-
null == onToolTip || onToolTip(null);
|
|
150
|
-
}, [ onToolTip ]), cssVars = React.useMemo(() => ({
|
|
151
|
-
"--file-max-width": "column" === direction ? "100%" : misc.setStyle(maxWidth),
|
|
152
|
-
"--file-min-width": "column" !== direction || minWidth ? misc.setStyle(minWidth) : "100%",
|
|
153
|
-
"--file-gap": misc.setStyle(gap),
|
|
154
|
-
"--file-direction": direction,
|
|
155
|
-
"--file-wrap": "column" === direction ? "nowrap" : "wrap",
|
|
156
|
-
"--file-padding": padding ? misc.setStyle(padding) : "4px 4px 4px 2px",
|
|
157
|
-
"--file-icon-size": misc.setStyle(iconSize),
|
|
158
|
-
"--file-overflow": "column" === direction ? "unset" : "hidden",
|
|
159
|
-
"--file-bg-color": null != resolvedBackgroundColor ? resolvedBackgroundColor : "var(--core-surface-secondary)"
|
|
160
|
-
}), [ maxWidth, gap, direction, minWidth, padding, iconSize, resolvedBackgroundColor ]), fileCSSVars = React.useCallback((progress, error) => ({
|
|
161
|
-
"--file-progress": `${progress}`,
|
|
162
|
-
"--file-border-color": error ? "var(--feedback-warning)" : "var(--core-outline-primary)"
|
|
163
|
-
}), []);
|
|
164
|
-
return jsxRuntime.jsx("div", Object.assign({
|
|
165
|
-
className: `${css.wrapper}${divClass}`,
|
|
166
|
-
style: Object.assign(Object.assign({}, divStyle), cssVars),
|
|
167
|
-
id: divId
|
|
168
|
-
}, rest, {
|
|
169
|
-
children: displayList.map(i => {
|
|
170
|
-
return jsxRuntime.jsxs("div", {
|
|
171
|
-
className: `${css.file} ${css[size]}`,
|
|
172
|
-
style: fileCSSVars(i.progress, i.error),
|
|
173
|
-
children: [ jsxRuntime.jsx("div", {
|
|
174
|
-
className: css.fileIcon,
|
|
175
|
-
children: jsxRuntime.jsx(FileIcon.FileIcon, {
|
|
176
|
-
name: i.icon,
|
|
177
|
-
size: iconSize
|
|
178
|
-
})
|
|
179
|
-
}), jsxRuntime.jsxs("div", {
|
|
180
|
-
className: css.meta,
|
|
181
|
-
children: [ jsxRuntime.jsx("div", {
|
|
182
|
-
className: css.fileName,
|
|
183
|
-
children: i.name
|
|
184
|
-
}), i.error && jsxRuntime.jsx("div", {
|
|
185
|
-
className: `${css.status} ${i.error ? css.error : ""}`,
|
|
186
|
-
children: i.error
|
|
187
|
-
}) ]
|
|
188
|
-
}), jsxRuntime.jsx("div", {
|
|
189
|
-
className: css.icon,
|
|
190
|
-
style: (uploading = i.uploading, uploading ? {
|
|
191
|
-
display: "flex"
|
|
192
|
-
} : {
|
|
193
|
-
display: "none"
|
|
194
|
-
}),
|
|
195
|
-
children: jsxRuntime.jsx(ProgressIndicator.ProgressIndicator, {
|
|
196
|
-
inline: !0,
|
|
197
|
-
size: 20,
|
|
198
|
-
show: i.uploading
|
|
199
|
-
})
|
|
200
|
-
}), canRemove && jsxRuntime.jsx("div", {
|
|
201
|
-
className: css.icon,
|
|
202
|
-
style: displayClose(i.uploading),
|
|
203
|
-
role: "button",
|
|
204
|
-
"aria-label": "remove file",
|
|
205
|
-
onMouseOver: handleMouseOver,
|
|
206
|
-
onMouseOut: handleMouseOut,
|
|
207
|
-
onFocus: handleMouseOver,
|
|
208
|
-
onBlur: handleMouseOut,
|
|
209
|
-
onClick: () => handleRemove(i.index),
|
|
210
|
-
onKeyDown: e => misc.accessibleKeyDown(e, () => handleRemove(i.index)),
|
|
211
|
-
tabIndex: 0,
|
|
212
|
-
children: jsxRuntime.jsx(Icon.Icon, {
|
|
213
|
-
name: "x",
|
|
214
|
-
style: {
|
|
215
|
-
pointerEvents: "none"
|
|
216
|
-
}
|
|
217
|
-
})
|
|
218
|
-
}) ]
|
|
219
|
-
}, i.key);
|
|
220
|
-
var uploading;
|
|
221
|
-
})
|
|
222
|
-
}));
|
|
223
|
-
});
|
|
224
|
-
|
|
225
|
-
exports.FileList = FileList;
|
|
@@ -1,63 +0,0 @@
|
|
|
1
|
-
'use client';
|
|
2
|
-
"use strict";
|
|
3
|
-
|
|
4
|
-
var tslib_es6 = require("./tslib.es6-C8dZW5nY.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("../hooks/useWindow.js");
|
|
7
|
-
|
|
8
|
-
var Badge = require("./Badge-DjPJ_iJX.js"), Icon = require("./Icon-BtcHXeqE.js"), styleInject_es = require("./style-inject.es-CMuL-BfJ.js"), css_header = "Grouper-module_header__D5fV0 flexBox-module_rowBetween__5FEvi", css_title = "Grouper-module_title__ZKqTP flexBox-module_rowBetween__5FEvi type-module_body-m-regular__LuQBA", css_content = "Grouper-module_content__Mof50 flexBox-module_rowBetween__5FEvi", css_icon = "Grouper-module_icon__14Jis flexBox-module_row__z24tF";
|
|
9
|
-
|
|
10
|
-
styleInject_es.styleInject(".flexBox-module_row__z24tF {\n\tdisplay: flex;\n\tjustify-content: center;\n\talign-items: center;\n\tbox-sizing: border-box;\n\tpadding: 0;\n\tmargin: 0;\n}.flexBox-module_rowBetween__5FEvi {\n\tdisplay: flex;\n\tjustify-content: space-between;\n\talign-items: center;\n\tbox-sizing: border-box;\n\tpadding: 0;\n\tmargin: 0;\n}.flexBox-module_rowStart__4tcxS {\n\tdisplay: flex;\n\tjustify-content: flex-start;\n\talign-items: center;\n\tbox-sizing: border-box;\n\tpadding: 0;\n\tmargin: 0;\n}.flexBox-module_rowEnd__rVdVm {\n\tdisplay: flex;\n\tjustify-content: flex-end;\n\talign-items: center;\n\tbox-sizing: border-box;\n\tpadding: 0;\n\tmargin: 0;\n}.flexBox-module_column__ezvMq {\n\tdisplay: flex;\n\tflex-direction: column;\n\tjustify-content: center;\n\talign-items: center;\n\tbox-sizing: border-box;\n\tpadding: 0;\n\tmargin: 0;\n}.flexBox-module_columnStart__C7P44 {\n\tdisplay: flex;\n\tflex-direction: column;\n\tjustify-content: flex-start;\n\talign-items: flex-start;\n\tbox-sizing: border-box;\n\tpadding: 0;\n\tmargin: 0;\n}.flexBox-module_columnStartCenter__PKcrG {\n\tdisplay: flex;\n\tflex-direction: column;\n\tjustify-content: flex-start;\n\talign-items: center;\n\tbox-sizing: border-box;\n\tpadding: 0;\n\tmargin: 0;\n}.flexBox-module_columnBetween__ERfp7 {\n\tdisplay: flex;\n\tflex-direction: column;\n\tjustify-content: space-between;\n\talign-items: center;\n\tbox-sizing: border-box;\n\tpadding: 0;\n\tmargin: 0;\n}.flexBox-module_columnEnd__lLJuc {\n\tdisplay: flex;\n\tflex-direction: column;\n\tjustify-content: flex-end;\n\talign-items: flex-end;\n\tbox-sizing: border-box;\n\tpadding: 0;\n\tmargin: 0;\n}.type-module_body-xs-regular__ZAFft {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: var(--font-weight-regular);\n\tfont-size: var(--font-size-xs);\n\tline-height: 133.33%;\n\ttext-decoration: none;\n\tletter-spacing: 0.2px;\n}.type-module_body-xs-medium__s3KvF {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: var(--font-weight-medium);\n\tfont-size: var(--font-size-xs);\n\tline-height: 133.33%;\n\ttext-decoration: none;\n\tletter-spacing: 0.2px;\n}.type-module_body-xs-bold__Lhqqq {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: var(--font-weight-bold);\n\tfont-size: var(--font-size-xs);\n\tline-height: 133.33%;\n\ttext-decoration: none;\n\tletter-spacing: 0.25px;\n}.type-module_body-s-regular__vRHSP {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: var(--font-weight-regular);\n\tfont-size: var(--font-size-s);\n\tline-height: 142.86%;\n\ttext-decoration: none;\n\tletter-spacing: 0.15px;\n}.type-module_body-s-medium__tjdFc {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: var(--font-weight-medium);\n\tfont-size: var(--font-size-s);\n\tline-height: 142.86%;\n\ttext-decoration: none;\n\tletter-spacing: 0.15px;\n}.type-module_body-s-bold__Iy-VX {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: var(--font-weight-bold);\n\tfont-size: var(--font-size-s);\n\tline-height: 142.86%;\n\ttext-decoration: none;\n\tletter-spacing: 0.2px;\n}.type-module_body-m-regular__LuQBA {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: var(--font-weight-regular);\n\tfont-size: var(--font-size-m);\n\tline-height: 140%;\n\ttext-decoration: none;\n\tletter-spacing: 0.15px;\n}.type-module_body-m-medium__uW1on {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: var(--font-weight-medium);\n\tfont-size: var(--font-size-m);\n\tline-height: 140%;\n\ttext-decoration: none;\n\tletter-spacing: 0.15px;\n}.type-module_body-m-bold__UBcvQ {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: var(--font-weight-bold);\n\tfont-size: var(--font-size-m);\n\tline-height: 140%;\n\ttext-decoration: none;\n\tletter-spacing: 0.2px;\n}.type-module_body-l-regular__lOYbg {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: var(--font-weight-regular);\n\tfont-size: var(--font-size-l);\n\tline-height: 162.5%;\n\ttext-decoration: none;\n\tletter-spacing: 0.1px;\n}.type-module_body-l-medium__BqRC7 {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: var(--font-weight-medium);\n\tfont-size: var(--font-size-l);\n\tline-height: 162.5%;\n\ttext-decoration: none;\n\tletter-spacing: 0.1px;\n}.type-module_body-l-bold__Fh2dt {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: var(--font-weight-bold);\n\tfont-size: var(--font-size-l);\n\tline-height: 162.5%;\n\ttext-decoration: none;\n\tletter-spacing: 0.15px;\n}.type-module_body-xl-regular__pF2kC {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: var(--font-weight-regular);\n\tfont-size: var(--font-size-xl);\n\tline-height: 162.5%;\n\ttext-decoration: none;\n\tletter-spacing: 0.1px;\n}.type-module_body-xl-medium__BeyrH {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: var(--font-weight-medium);\n\tfont-size: var(--font-size-xl);\n\tline-height: 162.5%;\n\ttext-decoration: none;\n\tletter-spacing: 0.1px;\n}.type-module_body-xl-bold__Ruknj {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: var(--font-weight-bold);\n\tfont-size: var(--font-size-xl);\n\tline-height: 162.5%;\n\ttext-decoration: none;\n\tletter-spacing: 0.15px;\n}.type-module_heading-s-medium__z8L3G {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: 500;\n\tfont-size: 20px;\n\tline-height: 140%;\n\ttext-decoration: none;\n\tletter-spacing: 0.2px;\n}.type-module_heading-s-bold__0O3g6 {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: 600;\n\tfont-size: 20px;\n\tline-height: 140%;\n\ttext-decoration: none;\n\tletter-spacing: 0.2px;\n}.type-module_heading-m-bold__KXxEB {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: 500;\n\tfont-size: 24px;\n\tline-height: 116.67%;\n\ttext-decoration: none;\n\tletter-spacing: 0.2px;\n}.type-module_heading-m-medium__cJeEA {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: 600;\n\tfont-size: 24px;\n\tline-height: 116.67%;\n\ttext-decoration: none;\n\tletter-spacing: 0.2px;\n}.type-module_heading-l-medium__eRe05 {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: 500;\n\tfont-size: 30px;\n\tline-height: 128.57%;\n\ttext-decoration: none;\n\tletter-spacing: 0.2px;\n}.type-module_heading-l-bold__Xmwtf {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: 600;\n\tfont-size: 30px;\n\tline-height: 128.57%;\n\ttext-decoration: none;\n\tletter-spacing: 0.2px;\n}.type-module_heading-xl-medium__5q1m3 {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: 500;\n\tfont-size: 36px;\n\tline-height: 128.57%;\n\ttext-decoration: none;\n\tletter-spacing: 0.2px;\n}.type-module_heading-xl-bold__k9VFV {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: 600;\n\tfont-size: 36px;\n\tline-height: 128.57%;\n\ttext-decoration: none;\n\tletter-spacing: 0.2px;\n}\n\n.Grouper-module_header__D5fV0 {\n\twidth: 100%;\n\tcursor: pointer;\n\tappearance: none;\n\t-webkit-appearance: none;\n\tbackground-image: none;\n\tbackground-color: transparent;\n\tborder: 0;\n\toutline: none;\n\tpadding: 0;\n}\n\n.Grouper-module_title__ZKqTP {\n\tcolor: var(--core-text-primary);\n\tflex: 1;\n}\n\n.Grouper-module_content__Mof50 {\n\tuser-select: none;\n\t-webkit-user-select: none;\n\tpadding: 0 24px !important;\n\twidth: 100%;\n\tgap: 6px;\n\theight: var(--grouper-height);\n\tborder-top: var(--grouper-border) solid var(--core-outline-primary);\n}\n\n.Grouper-module_icon__14Jis {\n\tmin-height: var(--grouper-icon-size);\n\theight: var(--grouper-icon-size);\n\tmin-width: var(--grouper-icon-size);\n\twidth: var(--grouper-icon-size);\n}\n");
|
|
11
|
-
|
|
12
|
-
const Grouper = React.memo(props => {
|
|
13
|
-
const theme = hooks_useTheme.useTheme(), {title: title = "Group Title", toggle: toggle = !0, open: open = !0, hasIcon: hasIcon = !0, iconName: iconName = "chevron down", iconSize: iconSize = 18, frameSize: frameSize = 64, border: border = 0, count: count = 0, unframed: unframed = !1, hideNull: hideNull = !0, showFilterBadge: showFilterBadge = !1, onChange: onChange = () => null, onClick: onClick = () => null} = props, divAttributes = tslib_es6.__rest(props, [ "title", "toggle", "open", "hasIcon", "iconName", "iconSize", "frameSize", "border", "count", "unframed", "hideNull", "showFilterBadge", "onChange", "onClick" ]), {id: divId, className: className, style: style} = divAttributes, rest = tslib_es6.__rest(divAttributes, [ "id", "className", "style" ]), divStyle = null != style ? style : {}, divClass = className ? ` ${className}` : "", [state, setState] = React.useState(open), [icon, animateIcon] = react.useAnimate();
|
|
14
|
-
React.useEffect(() => setState(open), [ open ]);
|
|
15
|
-
const animate = React.useCallback(state => {
|
|
16
|
-
const animation = {
|
|
17
|
-
rotate: state ? 0 : 180
|
|
18
|
-
};
|
|
19
|
-
animateIcon(icon.current, Object.assign({}, animation), {
|
|
20
|
-
ease: "easeInOut",
|
|
21
|
-
duration: .25
|
|
22
|
-
});
|
|
23
|
-
}, [ animateIcon, icon ]), handleToggle = React.useCallback(() => {
|
|
24
|
-
toggle && (onClick(), onChange(!state), animate(!state), setState(!state));
|
|
25
|
-
}, [ toggle, onClick, onChange, state, animate ]), cssVars = React.useMemo(() => ({
|
|
26
|
-
"--grouper-height": unframed ? "auto" : `${frameSize}px`,
|
|
27
|
-
"--grouper-border": border ? `${border}px` : "0",
|
|
28
|
-
"--grouper-icon-size": `${iconSize}px`
|
|
29
|
-
}), [ frameSize, iconSize, border, unframed ]);
|
|
30
|
-
return jsxRuntime.jsx("button", Object.assign({
|
|
31
|
-
id: divId,
|
|
32
|
-
type: "button",
|
|
33
|
-
className: `${css_header}${divClass}`,
|
|
34
|
-
style: Object.assign(Object.assign({}, divStyle), cssVars),
|
|
35
|
-
onClick: handleToggle,
|
|
36
|
-
"aria-expanded": state
|
|
37
|
-
}, rest, {
|
|
38
|
-
children: jsxRuntime.jsxs("div", {
|
|
39
|
-
className: css_content,
|
|
40
|
-
children: [ jsxRuntime.jsxs("div", {
|
|
41
|
-
className: css_title,
|
|
42
|
-
children: [ title, jsxRuntime.jsx(Badge.Badge, {
|
|
43
|
-
hideNull: hideNull,
|
|
44
|
-
count: count,
|
|
45
|
-
variant: "light"
|
|
46
|
-
}), showFilterBadge && jsxRuntime.jsx(Icon.Icon, {
|
|
47
|
-
name: "filter",
|
|
48
|
-
size: 16,
|
|
49
|
-
strokeColor: theme.current.colors["core-text-disabled"]
|
|
50
|
-
}) ]
|
|
51
|
-
}), hasIcon && jsxRuntime.jsx("div", {
|
|
52
|
-
ref: icon,
|
|
53
|
-
className: css_icon,
|
|
54
|
-
children: jsxRuntime.jsx(Icon.Icon, {
|
|
55
|
-
name: iconName,
|
|
56
|
-
size: iconSize
|
|
57
|
-
})
|
|
58
|
-
}) ]
|
|
59
|
-
})
|
|
60
|
-
}));
|
|
61
|
-
});
|
|
62
|
-
|
|
63
|
-
exports.Grouper = Grouper;
|
|
@@ -1,84 +0,0 @@
|
|
|
1
|
-
'use client';
|
|
2
|
-
"use strict";
|
|
3
|
-
|
|
4
|
-
var tslib_es6 = require("./tslib.es6-C8dZW5nY.js"), jsxRuntime = require("react/jsx-runtime"), react = require("motion/react"), React = require("react"), Badge = require("./Badge-DjPJ_iJX.js"), Dot = require("./Dot-fKIwhjYA.js"), Icon = require("./Icon-BtcHXeqE.js"), sharedTypes = require("./sharedTypes-gCECyn2N.js"), styleInject_es = require("./style-inject.es-CMuL-BfJ.js"), css_button = "IconButton-module_button__rziqa flexBox-module_row__z24tF", css_label = "IconButton-module_label__qWGFD flexBox-module_row__z24tF type-module_body-l-regular__lOYbg", css_icon = "IconButton-module_icon__2DDWy flexBox-module_row__z24tF", css_count = "IconButton-module_count__6r373 flexBox-module_row__z24tF";
|
|
5
|
-
|
|
6
|
-
styleInject_es.styleInject(".flexBox-module_row__z24tF {\n\tdisplay: flex;\n\tjustify-content: center;\n\talign-items: center;\n\tbox-sizing: border-box;\n\tpadding: 0;\n\tmargin: 0;\n}.flexBox-module_rowBetween__5FEvi {\n\tdisplay: flex;\n\tjustify-content: space-between;\n\talign-items: center;\n\tbox-sizing: border-box;\n\tpadding: 0;\n\tmargin: 0;\n}.flexBox-module_rowStart__4tcxS {\n\tdisplay: flex;\n\tjustify-content: flex-start;\n\talign-items: center;\n\tbox-sizing: border-box;\n\tpadding: 0;\n\tmargin: 0;\n}.flexBox-module_rowEnd__rVdVm {\n\tdisplay: flex;\n\tjustify-content: flex-end;\n\talign-items: center;\n\tbox-sizing: border-box;\n\tpadding: 0;\n\tmargin: 0;\n}.flexBox-module_column__ezvMq {\n\tdisplay: flex;\n\tflex-direction: column;\n\tjustify-content: center;\n\talign-items: center;\n\tbox-sizing: border-box;\n\tpadding: 0;\n\tmargin: 0;\n}.flexBox-module_columnStart__C7P44 {\n\tdisplay: flex;\n\tflex-direction: column;\n\tjustify-content: flex-start;\n\talign-items: flex-start;\n\tbox-sizing: border-box;\n\tpadding: 0;\n\tmargin: 0;\n}.flexBox-module_columnStartCenter__PKcrG {\n\tdisplay: flex;\n\tflex-direction: column;\n\tjustify-content: flex-start;\n\talign-items: center;\n\tbox-sizing: border-box;\n\tpadding: 0;\n\tmargin: 0;\n}.flexBox-module_columnBetween__ERfp7 {\n\tdisplay: flex;\n\tflex-direction: column;\n\tjustify-content: space-between;\n\talign-items: center;\n\tbox-sizing: border-box;\n\tpadding: 0;\n\tmargin: 0;\n}.flexBox-module_columnEnd__lLJuc {\n\tdisplay: flex;\n\tflex-direction: column;\n\tjustify-content: flex-end;\n\talign-items: flex-end;\n\tbox-sizing: border-box;\n\tpadding: 0;\n\tmargin: 0;\n}.type-module_body-xs-regular__ZAFft {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: var(--font-weight-regular);\n\tfont-size: var(--font-size-xs);\n\tline-height: 133.33%;\n\ttext-decoration: none;\n\tletter-spacing: 0.2px;\n}.type-module_body-xs-medium__s3KvF {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: var(--font-weight-medium);\n\tfont-size: var(--font-size-xs);\n\tline-height: 133.33%;\n\ttext-decoration: none;\n\tletter-spacing: 0.2px;\n}.type-module_body-xs-bold__Lhqqq {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: var(--font-weight-bold);\n\tfont-size: var(--font-size-xs);\n\tline-height: 133.33%;\n\ttext-decoration: none;\n\tletter-spacing: 0.25px;\n}.type-module_body-s-regular__vRHSP {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: var(--font-weight-regular);\n\tfont-size: var(--font-size-s);\n\tline-height: 142.86%;\n\ttext-decoration: none;\n\tletter-spacing: 0.15px;\n}.type-module_body-s-medium__tjdFc {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: var(--font-weight-medium);\n\tfont-size: var(--font-size-s);\n\tline-height: 142.86%;\n\ttext-decoration: none;\n\tletter-spacing: 0.15px;\n}.type-module_body-s-bold__Iy-VX {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: var(--font-weight-bold);\n\tfont-size: var(--font-size-s);\n\tline-height: 142.86%;\n\ttext-decoration: none;\n\tletter-spacing: 0.2px;\n}.type-module_body-m-regular__LuQBA {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: var(--font-weight-regular);\n\tfont-size: var(--font-size-m);\n\tline-height: 140%;\n\ttext-decoration: none;\n\tletter-spacing: 0.15px;\n}.type-module_body-m-medium__uW1on {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: var(--font-weight-medium);\n\tfont-size: var(--font-size-m);\n\tline-height: 140%;\n\ttext-decoration: none;\n\tletter-spacing: 0.15px;\n}.type-module_body-m-bold__UBcvQ {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: var(--font-weight-bold);\n\tfont-size: var(--font-size-m);\n\tline-height: 140%;\n\ttext-decoration: none;\n\tletter-spacing: 0.2px;\n}.type-module_body-l-regular__lOYbg {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: var(--font-weight-regular);\n\tfont-size: var(--font-size-l);\n\tline-height: 162.5%;\n\ttext-decoration: none;\n\tletter-spacing: 0.1px;\n}.type-module_body-l-medium__BqRC7 {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: var(--font-weight-medium);\n\tfont-size: var(--font-size-l);\n\tline-height: 162.5%;\n\ttext-decoration: none;\n\tletter-spacing: 0.1px;\n}.type-module_body-l-bold__Fh2dt {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: var(--font-weight-bold);\n\tfont-size: var(--font-size-l);\n\tline-height: 162.5%;\n\ttext-decoration: none;\n\tletter-spacing: 0.15px;\n}.type-module_body-xl-regular__pF2kC {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: var(--font-weight-regular);\n\tfont-size: var(--font-size-xl);\n\tline-height: 162.5%;\n\ttext-decoration: none;\n\tletter-spacing: 0.1px;\n}.type-module_body-xl-medium__BeyrH {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: var(--font-weight-medium);\n\tfont-size: var(--font-size-xl);\n\tline-height: 162.5%;\n\ttext-decoration: none;\n\tletter-spacing: 0.1px;\n}.type-module_body-xl-bold__Ruknj {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: var(--font-weight-bold);\n\tfont-size: var(--font-size-xl);\n\tline-height: 162.5%;\n\ttext-decoration: none;\n\tletter-spacing: 0.15px;\n}.type-module_heading-s-medium__z8L3G {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: 500;\n\tfont-size: 20px;\n\tline-height: 140%;\n\ttext-decoration: none;\n\tletter-spacing: 0.2px;\n}.type-module_heading-s-bold__0O3g6 {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: 600;\n\tfont-size: 20px;\n\tline-height: 140%;\n\ttext-decoration: none;\n\tletter-spacing: 0.2px;\n}.type-module_heading-m-bold__KXxEB {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: 500;\n\tfont-size: 24px;\n\tline-height: 116.67%;\n\ttext-decoration: none;\n\tletter-spacing: 0.2px;\n}.type-module_heading-m-medium__cJeEA {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: 600;\n\tfont-size: 24px;\n\tline-height: 116.67%;\n\ttext-decoration: none;\n\tletter-spacing: 0.2px;\n}.type-module_heading-l-medium__eRe05 {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: 500;\n\tfont-size: 30px;\n\tline-height: 128.57%;\n\ttext-decoration: none;\n\tletter-spacing: 0.2px;\n}.type-module_heading-l-bold__Xmwtf {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: 600;\n\tfont-size: 30px;\n\tline-height: 128.57%;\n\ttext-decoration: none;\n\tletter-spacing: 0.2px;\n}.type-module_heading-xl-medium__5q1m3 {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: 500;\n\tfont-size: 36px;\n\tline-height: 128.57%;\n\ttext-decoration: none;\n\tletter-spacing: 0.2px;\n}.type-module_heading-xl-bold__k9VFV {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: 600;\n\tfont-size: 36px;\n\tline-height: 128.57%;\n\ttext-decoration: none;\n\tletter-spacing: 0.2px;\n}\n\n.IconButton-module_button__rziqa {\n\tposition: relative;\n\tbackground: var(--ib-bg-color);\n\tborder-radius: var(--ib-border-radius);\n\tborder: var(--ib-border) solid var(--core-outline-primary);\n\tgap: 6px;\n\tcursor: var(--ib-cursor);\n\tappearance: none;\n\t-webkit-appearance: none;\n\tbackground-image: none;\n\toutline: none;\n\tmin-height: var(--ib-button-size);\n\theight: var(--ib-button-size);\n\tmin-width: var(--ib-button-size);\n\twidth: var(--ib-button-size);\n\tuser-select: none;\n\t-webkit-user-select: none;\n\t&:hover {\n\t\tbackground: var(--ib-bg-color-hover);\n\t}\n}\n\n.IconButton-module_label__qWGFD {\n\tcolor: var(--ib-color);\n\ttext-overflow: ellipsis;\n\toverflow: hidden;\n\tword-break: break-all;\n\tdisplay: -webkit-box;\n\t-webkit-line-clamp: 1;\n\t-webkit-box-orient: vertical;\n}\n\n.IconButton-module_icon__2DDWy {\n\tmin-height: var(--ib-icon-size);\n\theight: var(--ib-icon-size);\n\tmin-width: var(--ib-icon-size);\n\twidth: var(--ib-icon-size);\n}\n\n.IconButton-module_count__6r373 {\n\tposition: absolute;\n\ttop: 0;\n\tright: 0;\n\ttransform: translateX(5px) translateY(-2px);\n}\n");
|
|
7
|
-
|
|
8
|
-
const IconButton = React.memo(props => {
|
|
9
|
-
const {frameSize: frameSize = 36, iconSize: iconSize = 20, round: round = !0, icon: icon = "more", borderRadius: borderRadius = 4, border: border = !1, tooltip: tooltip, color: color, colorOn: colorOn, iconFill: iconFill = !1, bgColor: bgColor = "var(--core-surface-secondary)", bgColorHover: bgColorHover = "var(--core-outline-primary)", bgColorOn: bgColorOn = "var(--core-outline-primary)", iconColor: iconColor = "var(--core-text-primary)", iconColorOn: iconColorOn = "var(--core-text-primary)", iconColorHover: iconColorHover = "var(--core-text-primary)", transition: transition, variants: variants, initial: initial, animate: animate, exit: exit, fillColor: fillColor, label: label, hover: hover = !0, count: count = 0, toggle: toggle = !1, toggleIcon: toggleIcon = !1, isToggled: isToggled = !1, disabled: disabled = !1, showDot: showDot = !1, buttonSize: buttonSize = "m", onClick: onClick = () => null, onToolTip: onToolTip = () => null} = props, divAttributes = tslib_es6.__rest(props, [ "frameSize", "iconSize", "round", "icon", "borderRadius", "border", "tooltip", "color", "colorOn", "iconFill", "bgColor", "bgColorHover", "bgColorOn", "iconColor", "iconColorOn", "iconColorHover", "transition", "variants", "initial", "animate", "exit", "fillColor", "label", "hover", "count", "toggle", "toggleIcon", "isToggled", "disabled", "showDot", "buttonSize", "onClick", "onToolTip" ]), {id: divId, className: className, style: style} = divAttributes, rest = tslib_es6.__rest(divAttributes, [ "id", "className", "style" ]), divStyle = null != style ? style : {}, divClass = className ? ` ${className}` : "", ref = React.useRef(null), [on, setOn] = React.useState(isToggled), [hovered, setHovered] = React.useState(!1);
|
|
10
|
-
React.useEffect(() => setOn(isToggled), [ isToggled ]);
|
|
11
|
-
const handleClick = React.useCallback(e => {
|
|
12
|
-
disabled || (tooltip && onToolTip(null), toggle && setOn(!on), onClick(e));
|
|
13
|
-
}, [ disabled, tooltip, onToolTip, on, onClick, toggle ]), handleMouseEnter = React.useCallback(e => {
|
|
14
|
-
if (setHovered(!0), !(null == ref ? void 0 : ref.current) || !tooltip) return;
|
|
15
|
-
const tip = {
|
|
16
|
-
type: sharedTypes.ToolTipType.button,
|
|
17
|
-
payload: {
|
|
18
|
-
label: tooltip
|
|
19
|
-
},
|
|
20
|
-
event: e,
|
|
21
|
-
ref: ref
|
|
22
|
-
};
|
|
23
|
-
onToolTip(tip);
|
|
24
|
-
}, [ tooltip, onToolTip ]), handleMouseLeave = React.useCallback(() => {
|
|
25
|
-
setHovered(!1), tooltip && onToolTip(null);
|
|
26
|
-
}, [ tooltip, onToolTip ]), bgColorNormal = React.useMemo(() => on ? bgColorOn : null != bgColor ? bgColor : "var(--core-surface-secondary)", [ bgColorOn, bgColor, on ]), bgHoverColor = React.useMemo(() => hover && on ? bgColorOn : hover ? bgColorHover : null != bgColor ? bgColor : "transparent", [ hover, bgColor, bgColorOn, bgColorHover, on ]), textColor = React.useMemo(() => on ? colorOn : null != color ? color : "var(--core-text-primary)", [ on, colorOn, color ]), setIconColor = React.useMemo(() => on ? iconColorOn : hovered ? iconColorHover : null != iconColor ? iconColor : "var(--core-text-primary)", [ on, iconColorOn, iconColor, iconColorHover, hovered ]), size = React.useMemo(() => buttonSize ? "s" === buttonSize ? 24 : "m" === buttonSize ? 36 : "l" === buttonSize ? 44 : "xl" === buttonSize ? 56 : void 0 : frameSize, [ frameSize, buttonSize ]), cssVars = React.useMemo(() => ({
|
|
27
|
-
"--ib-bg-color": bgColorNormal,
|
|
28
|
-
"--ib-bg-color-hover": disabled ? bgColorNormal : bgHoverColor,
|
|
29
|
-
"--ib-icon-size": `${null != iconSize ? iconSize : 0}px`,
|
|
30
|
-
"--ib-button-size": `${null != size ? size : 0}px`,
|
|
31
|
-
"--ib-border-radius": round ? "100%" : `${null != borderRadius ? borderRadius : 0}px`,
|
|
32
|
-
"--ib-border": border ? "1px" : 0,
|
|
33
|
-
"--ib-color": textColor,
|
|
34
|
-
"--ib-cursor": disabled ? "default" : "pointer"
|
|
35
|
-
}), [ bgColorNormal, bgHoverColor, textColor, border, size, borderRadius, iconSize, round, disabled ]);
|
|
36
|
-
return jsxRuntime.jsxs(react.motion.button, Object.assign({
|
|
37
|
-
id: divId,
|
|
38
|
-
type: "button",
|
|
39
|
-
className: `${css_button}${divClass}`,
|
|
40
|
-
style: Object.assign(Object.assign({}, divStyle), cssVars),
|
|
41
|
-
onClick: e => handleClick(e),
|
|
42
|
-
onMouseOutCapture: handleMouseLeave,
|
|
43
|
-
onMouseOverCapture: handleMouseEnter,
|
|
44
|
-
transition: transition,
|
|
45
|
-
variants: variants,
|
|
46
|
-
initial: initial,
|
|
47
|
-
animate: animate,
|
|
48
|
-
exit: exit,
|
|
49
|
-
disabled: disabled,
|
|
50
|
-
"aria-disabled": disabled,
|
|
51
|
-
ref: ref
|
|
52
|
-
}, rest, {
|
|
53
|
-
children: [ jsxRuntime.jsx("div", {
|
|
54
|
-
className: css_icon,
|
|
55
|
-
style: {
|
|
56
|
-
opacity: disabled ? .3 : 1
|
|
57
|
-
},
|
|
58
|
-
children: jsxRuntime.jsx(Icon.Icon, {
|
|
59
|
-
name: icon,
|
|
60
|
-
strokeColor: setIconColor,
|
|
61
|
-
fillColor: fillColor,
|
|
62
|
-
disabled: disabled,
|
|
63
|
-
size: iconSize,
|
|
64
|
-
fill: iconFill,
|
|
65
|
-
toggle: !!toggleIcon && on,
|
|
66
|
-
pointer: !0
|
|
67
|
-
})
|
|
68
|
-
}), label && jsxRuntime.jsx("div", {
|
|
69
|
-
className: css_label,
|
|
70
|
-
children: label
|
|
71
|
-
}), jsxRuntime.jsx(Dot.Dot, {
|
|
72
|
-
show: showDot
|
|
73
|
-
}), 0 !== count && jsxRuntime.jsx("div", {
|
|
74
|
-
className: css_count,
|
|
75
|
-
children: jsxRuntime.jsx(Badge.Badge, {
|
|
76
|
-
variant: "light",
|
|
77
|
-
count: count,
|
|
78
|
-
hideNull: !0
|
|
79
|
-
})
|
|
80
|
-
}) ]
|
|
81
|
-
}));
|
|
82
|
-
});
|
|
83
|
-
|
|
84
|
-
exports.IconButton = IconButton;
|
|
@@ -1,103 +0,0 @@
|
|
|
1
|
-
'use client';
|
|
2
|
-
"use strict";
|
|
3
|
-
|
|
4
|
-
var LabelBackground, tslib_es6 = require("./tslib.es6-C8dZW5nY.js"), jsxRuntime = require("react/jsx-runtime"), React = require("react"), misc = require("./misc-QpU0XEOW.js"), styleInject_es = require("./style-inject.es-CMuL-BfJ.js"), css = {
|
|
5
|
-
label: "Label-module_label__RaRvM",
|
|
6
|
-
button: "Label-module_button__N8bcQ type-module_body-m-regular__LuQBA",
|
|
7
|
-
xs: "Label-module_xs__K9Ai6 type-module_body-xs-regular__ZAFft",
|
|
8
|
-
s: "Label-module_s__Zh8Gp type-module_body-s-regular__vRHSP",
|
|
9
|
-
m: "Label-module_m__BJtGL type-module_body-m-regular__LuQBA",
|
|
10
|
-
l: "Label-module_l__t70tt type-module_body-l-regular__lOYbg"
|
|
11
|
-
};
|
|
12
|
-
|
|
13
|
-
function resolveSemanticBackground(backgroundColor) {
|
|
14
|
-
if (!backgroundColor || "string" != typeof backgroundColor) return;
|
|
15
|
-
const semanticKey = backgroundColor;
|
|
16
|
-
return exports.LabelBackground[semanticKey] ? exports.LabelBackground[semanticKey] : Object.values(exports.LabelBackground).find(value => value === backgroundColor);
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
styleInject_es.styleInject(".type-module_body-xs-regular__ZAFft {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: var(--font-weight-regular);\n\tfont-size: var(--font-size-xs);\n\tline-height: 133.33%;\n\ttext-decoration: none;\n\tletter-spacing: 0.2px;\n}.type-module_body-xs-medium__s3KvF {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: var(--font-weight-medium);\n\tfont-size: var(--font-size-xs);\n\tline-height: 133.33%;\n\ttext-decoration: none;\n\tletter-spacing: 0.2px;\n}.type-module_body-xs-bold__Lhqqq {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: var(--font-weight-bold);\n\tfont-size: var(--font-size-xs);\n\tline-height: 133.33%;\n\ttext-decoration: none;\n\tletter-spacing: 0.25px;\n}.type-module_body-s-regular__vRHSP {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: var(--font-weight-regular);\n\tfont-size: var(--font-size-s);\n\tline-height: 142.86%;\n\ttext-decoration: none;\n\tletter-spacing: 0.15px;\n}.type-module_body-s-medium__tjdFc {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: var(--font-weight-medium);\n\tfont-size: var(--font-size-s);\n\tline-height: 142.86%;\n\ttext-decoration: none;\n\tletter-spacing: 0.15px;\n}.type-module_body-s-bold__Iy-VX {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: var(--font-weight-bold);\n\tfont-size: var(--font-size-s);\n\tline-height: 142.86%;\n\ttext-decoration: none;\n\tletter-spacing: 0.2px;\n}.type-module_body-m-regular__LuQBA {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: var(--font-weight-regular);\n\tfont-size: var(--font-size-m);\n\tline-height: 140%;\n\ttext-decoration: none;\n\tletter-spacing: 0.15px;\n}.type-module_body-m-medium__uW1on {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: var(--font-weight-medium);\n\tfont-size: var(--font-size-m);\n\tline-height: 140%;\n\ttext-decoration: none;\n\tletter-spacing: 0.15px;\n}.type-module_body-m-bold__UBcvQ {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: var(--font-weight-bold);\n\tfont-size: var(--font-size-m);\n\tline-height: 140%;\n\ttext-decoration: none;\n\tletter-spacing: 0.2px;\n}.type-module_body-l-regular__lOYbg {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: var(--font-weight-regular);\n\tfont-size: var(--font-size-l);\n\tline-height: 162.5%;\n\ttext-decoration: none;\n\tletter-spacing: 0.1px;\n}.type-module_body-l-medium__BqRC7 {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: var(--font-weight-medium);\n\tfont-size: var(--font-size-l);\n\tline-height: 162.5%;\n\ttext-decoration: none;\n\tletter-spacing: 0.1px;\n}.type-module_body-l-bold__Fh2dt {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: var(--font-weight-bold);\n\tfont-size: var(--font-size-l);\n\tline-height: 162.5%;\n\ttext-decoration: none;\n\tletter-spacing: 0.15px;\n}.type-module_body-xl-regular__pF2kC {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: var(--font-weight-regular);\n\tfont-size: var(--font-size-xl);\n\tline-height: 162.5%;\n\ttext-decoration: none;\n\tletter-spacing: 0.1px;\n}.type-module_body-xl-medium__BeyrH {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: var(--font-weight-medium);\n\tfont-size: var(--font-size-xl);\n\tline-height: 162.5%;\n\ttext-decoration: none;\n\tletter-spacing: 0.1px;\n}.type-module_body-xl-bold__Ruknj {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: var(--font-weight-bold);\n\tfont-size: var(--font-size-xl);\n\tline-height: 162.5%;\n\ttext-decoration: none;\n\tletter-spacing: 0.15px;\n}.type-module_heading-s-medium__z8L3G {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: 500;\n\tfont-size: 20px;\n\tline-height: 140%;\n\ttext-decoration: none;\n\tletter-spacing: 0.2px;\n}.type-module_heading-s-bold__0O3g6 {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: 600;\n\tfont-size: 20px;\n\tline-height: 140%;\n\ttext-decoration: none;\n\tletter-spacing: 0.2px;\n}.type-module_heading-m-bold__KXxEB {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: 500;\n\tfont-size: 24px;\n\tline-height: 116.67%;\n\ttext-decoration: none;\n\tletter-spacing: 0.2px;\n}.type-module_heading-m-medium__cJeEA {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: 600;\n\tfont-size: 24px;\n\tline-height: 116.67%;\n\ttext-decoration: none;\n\tletter-spacing: 0.2px;\n}.type-module_heading-l-medium__eRe05 {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: 500;\n\tfont-size: 30px;\n\tline-height: 128.57%;\n\ttext-decoration: none;\n\tletter-spacing: 0.2px;\n}.type-module_heading-l-bold__Xmwtf {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: 600;\n\tfont-size: 30px;\n\tline-height: 128.57%;\n\ttext-decoration: none;\n\tletter-spacing: 0.2px;\n}.type-module_heading-xl-medium__5q1m3 {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: 500;\n\tfont-size: 36px;\n\tline-height: 128.57%;\n\ttext-decoration: none;\n\tletter-spacing: 0.2px;\n}.type-module_heading-xl-bold__k9VFV {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: 600;\n\tfont-size: 36px;\n\tline-height: 128.57%;\n\ttext-decoration: none;\n\tletter-spacing: 0.2px;\n}\n\n.Label-module_label__RaRvM {\n\tline-height: 1em;\n\twhite-space: nowrap;\n\tpadding: var(--label-padding) !important;\n\twidth: min-content;\n\tcolor: var(--label-color);\n\tborder-radius: var(--label-border-radius);\n\tborder: var(--label-border-size) solid var(--label-border-color);\n\tcursor: default;\n\tbackground: var(--label-bg-color);\n}\n\n.Label-module_button__N8bcQ {\n\tdisplay: inline-flex !important;\n\tbackground: var(--label-bg-color);\n\tcolor: var(--label-color);\n\tborder-radius: var(--label-border-radius);\n\tborder: var(--label-border-size) solid var(--label-border-color);\n\twidth: min-content;\n\tcursor: pointer;\n\twhite-space: nowrap;\n\tappearance: none;\n\t-webkit-appearance: none;\n\tbackground-image: none;\n\toutline: none;\n}\n\n.Label-module_xs__K9Ai6 {\n}\n\n.Label-module_s__Zh8Gp {\n}\n\n.Label-module_m__BJtGL {\n}\n\n.Label-module_l__t70tt {\n}\n"),
|
|
20
|
-
exports.LabelBackground = void 0, (LabelBackground = exports.LabelBackground || (exports.LabelBackground = {})).red = "red",
|
|
21
|
-
LabelBackground.yellow = "yellow", LabelBackground.green = "green", LabelBackground.blue = "blue",
|
|
22
|
-
LabelBackground.grey = "grey", LabelBackground.lightGrey = "lightGrey", LabelBackground.white = "white",
|
|
23
|
-
exports.Label = function(props) {
|
|
24
|
-
const {children: children, label: label, backgroundColor: backgroundColor, borderWidth: borderWidth, borderSize: borderSize = 1, borderColor: borderColor = "var(--core-outline-primary)", bgColor: bgColor = "transparent", borderRadius: borderRadius = 4, padding: padding, textColor: textColor = "var(--core-text-primary)", textSize: textSize = "s", onClick: onClick} = props, divAttributes = tslib_es6.__rest(props, [ "children", "label", "backgroundColor", "borderWidth", "borderSize", "borderColor", "bgColor", "borderRadius", "padding", "textColor", "textSize", "onClick" ]), {id: divId, className: className, style: style} = divAttributes, rest = tslib_es6.__rest(divAttributes, [ "id", "className", "style" ]), divStyle = null != style ? style : {}, divClass = className ? ` ${className}` : "", isInteractive = Boolean(onClick), resolvedBackgroundColor = null != backgroundColor ? backgroundColor : bgColor, resolvedBorderWidth = null != borderWidth ? borderWidth : borderSize, handleClick = React.useCallback(e => {
|
|
25
|
-
isInteractive && (null == onClick || onClick(e));
|
|
26
|
-
}, [ isInteractive, onClick ]), setBgColor = React.useMemo(() => {
|
|
27
|
-
if (!resolvedBackgroundColor) return "transparent";
|
|
28
|
-
const fill = resolveSemanticBackground(resolvedBackgroundColor);
|
|
29
|
-
if (!fill) return resolvedBackgroundColor;
|
|
30
|
-
switch (fill) {
|
|
31
|
-
case "red":
|
|
32
|
-
return "var(--feedback-warning)";
|
|
33
|
-
|
|
34
|
-
case "green":
|
|
35
|
-
return "var(--feedback-positive)";
|
|
36
|
-
|
|
37
|
-
case "yellow":
|
|
38
|
-
return "var(--array-yellow)";
|
|
39
|
-
|
|
40
|
-
case "grey":
|
|
41
|
-
case "white":
|
|
42
|
-
return "var(--core-surface-secondary)";
|
|
43
|
-
|
|
44
|
-
case "lightGrey":
|
|
45
|
-
return "var(--core-button-disabled)";
|
|
46
|
-
|
|
47
|
-
case "blue":
|
|
48
|
-
return "var(--core-button-primary)";
|
|
49
|
-
|
|
50
|
-
default:
|
|
51
|
-
return "var(--core-surface-primary)";
|
|
52
|
-
}
|
|
53
|
-
}, [ resolvedBackgroundColor ]), setBorderColor = React.useMemo(() => {
|
|
54
|
-
if (!resolvedBackgroundColor) return borderColor;
|
|
55
|
-
const fill = resolveSemanticBackground(resolvedBackgroundColor);
|
|
56
|
-
if (!fill) return borderColor;
|
|
57
|
-
switch (fill) {
|
|
58
|
-
case "red":
|
|
59
|
-
return "var(--feedback-warning)";
|
|
60
|
-
|
|
61
|
-
case "green":
|
|
62
|
-
return "var(--feedback-positive)";
|
|
63
|
-
|
|
64
|
-
case "yellow":
|
|
65
|
-
return "var(--array-yellow-label)";
|
|
66
|
-
|
|
67
|
-
case "grey":
|
|
68
|
-
case "lightGrey":
|
|
69
|
-
case "white":
|
|
70
|
-
return "var(--core-outline-primary)";
|
|
71
|
-
|
|
72
|
-
case "blue":
|
|
73
|
-
return "var(--core-button-primary)";
|
|
74
|
-
|
|
75
|
-
default:
|
|
76
|
-
return "var(--core-surface-primary)";
|
|
77
|
-
}
|
|
78
|
-
}, [ resolvedBackgroundColor, borderColor ]), setPadding = React.useMemo(() => padding ? misc.setStyle(padding) : "2px 4px", [ padding ]), cssVars = React.useMemo(() => ({
|
|
79
|
-
"--label-padding": setPadding,
|
|
80
|
-
"--label-border-radius": misc.setStyle(borderRadius),
|
|
81
|
-
"--label-cursor": onClick ? "pointer" : "default",
|
|
82
|
-
"--label-color": textColor,
|
|
83
|
-
"--label-bg-color": setBgColor,
|
|
84
|
-
"--label-border-size": misc.setStyle(resolvedBorderWidth),
|
|
85
|
-
"--label-border-color": setBorderColor
|
|
86
|
-
}), [ setPadding, borderRadius, onClick, textColor, setBorderColor, setBgColor, resolvedBorderWidth ]);
|
|
87
|
-
return isInteractive ? jsxRuntime.jsx("button", Object.assign({
|
|
88
|
-
id: divId,
|
|
89
|
-
type: "button",
|
|
90
|
-
className: `${css.button} ${css[textSize]}${divClass}`,
|
|
91
|
-
style: Object.assign(Object.assign({}, divStyle), cssVars),
|
|
92
|
-
"aria-label": "Label button",
|
|
93
|
-
onClick: e => handleClick(e)
|
|
94
|
-
}, rest, {
|
|
95
|
-
children: null != children ? children : label
|
|
96
|
-
})) : jsxRuntime.jsx("span", Object.assign({
|
|
97
|
-
id: divId,
|
|
98
|
-
className: `${css.label} ${css[textSize]}${divClass}`,
|
|
99
|
-
style: Object.assign(Object.assign({}, divStyle), cssVars)
|
|
100
|
-
}, rest, {
|
|
101
|
-
children: null != children ? children : label
|
|
102
|
-
}));
|
|
103
|
-
};
|