@apple-pie/slice 0.1.29 → 0.1.31
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 +174 -4
- package/dist/cjs/chunks/{AudioBubble-DisHuKIC.js → AudioBubble-k7qS53g6.js} +3 -5
- package/dist/cjs/chunks/Avatar-hP8GuwvD.js +82 -0
- package/dist/cjs/chunks/{AvatarGroup-DYN73N5x.js → AvatarGroup-DMy34q7_.js} +1 -3
- package/dist/cjs/chunks/Badge-D2TbyfJS.js +22 -0
- package/dist/cjs/chunks/{Button-B1qbfQgN.js → Button-CTsHZBEB.js} +1 -3
- package/dist/cjs/chunks/{ButtonBar-zpC3sClM.js → ButtonBar-BRb1PTmw.js} +1 -3
- package/dist/cjs/chunks/{Camera-CCzynmXT.js → Camera-CKv087kr.js} +3 -5
- package/dist/cjs/chunks/CheckBox-VRIL1FHh.js +51 -0
- package/dist/cjs/chunks/Chip-Dr3vKvRY.js +77 -0
- package/dist/cjs/chunks/{DivInput-932r3bvF.js → DivInput-Ci0gaCWL.js} +1 -3
- package/dist/cjs/chunks/{Dot-fKIwhjYA.js → Dot-C0MvSJOl.js} +1 -3
- package/dist/cjs/chunks/{DrggablePanel-u8C-Y4dA.js → DrggablePanel-DflouLUs.js} +3 -5
- package/dist/cjs/chunks/DropDown-BS1H62yj.js +104 -0
- package/dist/cjs/chunks/ErrorSummary-B3tof7ir.js +85 -0
- package/dist/cjs/chunks/{FileIcon-Dxn9OL10.js → FileIcon-Te8MaqTs.js} +2 -2
- package/dist/cjs/chunks/FileList-CDcfKIV6.js +222 -0
- package/dist/cjs/chunks/{FlexDiv-D4aSJC_G.js → FlexDiv-wO8IY0Zf.js} +2 -3
- package/dist/cjs/chunks/Grouper-DyGkzdvz.js +61 -0
- package/dist/cjs/chunks/{Icon-BFiN8Wzm.js → Icon-BFZ_5Qv3.js} +4 -7
- package/dist/cjs/chunks/IconButton-CgsuJIuF.js +82 -0
- package/dist/cjs/chunks/{IndexedDB-BaVmQgkK.js → IndexedDB-Dgwal8na.js} +1 -1
- package/dist/cjs/chunks/Label-BuyhcJbF.js +102 -0
- package/dist/cjs/chunks/Modal-ByRyv3wy.js +101 -0
- package/dist/cjs/chunks/ModalController-xjflFsjF.js +68 -0
- package/dist/cjs/chunks/Overlay-FooE9M_s.js +41 -0
- package/dist/cjs/chunks/Pager-B-cuwffo.js +36 -0
- package/dist/cjs/chunks/ProgressIndicator-ByZ_aYAZ.js +138 -0
- package/dist/cjs/chunks/{PromptInput-C8-V67sS.js → PromptInput--grtHPvy.js} +2 -4
- package/dist/cjs/chunks/RadioButton-DP2X1dA_.js +55 -0
- package/dist/cjs/chunks/{RadioButtonList-DvJV6Qdg.js → RadioButtonList-COGNW5y3.js} +1 -2
- package/dist/cjs/chunks/{Slider-D8OYGFsN.js → Slider-G1a8UKef.js} +2 -6
- package/dist/cjs/chunks/{Spacer-CyZAUR5N.js → Spacer-CsRCleXv.js} +1 -1
- package/dist/cjs/chunks/{Switch-Crm-nHYI.js → Switch-OBVHKn_D.js} +1 -2
- package/dist/cjs/chunks/{TabBar-VzxuAesC.js → TabBar-C1HkBaxE.js} +2 -4
- package/dist/cjs/chunks/TextArea-BEmNI_HZ.js +74 -0
- package/dist/cjs/chunks/{TextField-BpoLF6pZ.js → TextField-D9_COA9H.js} +3 -5
- package/dist/cjs/chunks/Tip-2W0u_oQN.js +88 -0
- package/dist/cjs/chunks/Toast-B9jX6ioq.js +177 -0
- package/dist/cjs/chunks/ToggleButton-C_Gu5dYR.js +39 -0
- package/dist/cjs/chunks/UploadArea-ENFAf4tE.js +127 -0
- package/dist/cjs/chunks/{WSConnection-DrOC8Z0R.js → WSConnection-CZ22tcLz.js} +1 -1
- package/dist/cjs/chunks/{localDBStore-zyDhaEiP.js → localDBStore-Ca73jeFf.js} +1 -1
- package/dist/cjs/chunks/{microphoneStore-D1fV_8QQ.js → microphoneStore-lxYIvhN8.js} +1 -1
- package/dist/cjs/chunks/{misc-CTl4GDxI.js → misc-DZAbObFp.js} +16 -19
- package/dist/cjs/chunks/modalStore-D4bOjuWd.js +70 -0
- package/dist/cjs/chunks/{sseStore-1OeJ9TRP.js → sseStore-Bq7sVvyA.js} +2 -2
- package/dist/cjs/chunks/{uploads-worker-mD8pcsGP.js → uploads-worker-CD-annza.js} +2 -2
- package/dist/cjs/chunks/{uploadsStore-CxWIctvI.js → uploadsStore-CUeB10zx.js} +2 -2
- package/dist/cjs/chunks/{volumeStore-oYwlRVN0.js → volumeStore-roYTyKJ2.js} +3 -3
- package/dist/cjs/chunks/{windowStore-CCxCOUqa.js → windowStore-BdJv-RF0.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/Modal/index.js +13 -0
- package/dist/cjs/components/ModalController/index.js +7 -0
- 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 +6 -6
- package/dist/cjs/components/ToggleButton/index.js +8 -8
- package/dist/cjs/components/UploadArea/index.js +7 -7
- package/dist/cjs/hooks/useAudioRecorder.js +4 -5
- package/dist/cjs/hooks/useLocalStore.js +3 -9
- package/dist/cjs/hooks/useMdStreamBuffer.js +2 -2
- package/dist/cjs/hooks/useMicrophone.js +7 -11
- 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 +3 -3
- package/dist/cjs/index.js +9 -7
- package/dist/cjs/providers/ThemeProvider.js +1 -13
- 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/microphone.js +2 -2
- package/dist/cjs/stores/modal.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/volume.js +2 -2
- package/dist/cjs/stores/window.js +2 -2
- package/dist/cjs/stores.js +18 -15
- package/dist/cjs/theme/colors.js +1 -1
- package/dist/cjs/theme/type.js +1 -1
- package/dist/cjs/utils/index.js +2 -2
- package/dist/cjs/utils/objects/index.js +2 -2
- package/dist/cjs/workers/uploads/uploads.js +2 -2
- package/dist/esm/chunks/{AudioBubble-D052QyPH.mjs → AudioBubble-DfrxyTX_.mjs} +3 -7
- package/dist/esm/chunks/Avatar-pA41Pcyl.mjs +88 -0
- package/dist/esm/chunks/{AvatarGroup-CBGi99eo.mjs → AvatarGroup-CZBtWjnj.mjs} +2 -6
- package/dist/esm/chunks/Badge-pLwG0zm7.mjs +26 -0
- package/dist/esm/chunks/{Button-CYFpitCp.mjs → Button-BJoMLZIs.mjs} +6 -10
- package/dist/esm/chunks/{ButtonBar-ieMA0SHi.mjs → ButtonBar-BO2RUJ8R.mjs} +3 -7
- package/dist/esm/chunks/{Camera-jn9CcaD0.mjs → Camera-4MNA52HG.mjs} +5 -9
- package/dist/esm/chunks/CheckBox-7KAsvZld.mjs +61 -0
- package/dist/esm/chunks/Chip-BuGvCLLU.mjs +87 -0
- package/dist/esm/chunks/{DivInput-BVhcU0y0.mjs → DivInput-D0YzSWjJ.mjs} +2 -6
- package/dist/esm/chunks/{Dot-DZE134mJ.mjs → Dot-h26m47Z-.mjs} +1 -5
- package/dist/esm/chunks/{DrggablePanel-G5HHlntD.mjs → DrggablePanel-Bh6HLPMX.mjs} +2 -6
- package/dist/esm/chunks/DropDown-NgMYjjXn.mjs +112 -0
- package/dist/esm/chunks/ErrorSummary-nNm9qymE.mjs +90 -0
- package/dist/esm/chunks/{FileIcon-fJV_Cl6v.mjs → FileIcon-BqyV1wut.mjs} +2 -2
- package/dist/esm/chunks/FileList-C1tOvoc0.mjs +230 -0
- package/dist/esm/chunks/{FlexDiv-DnY1_qk4.mjs → FlexDiv-CkK-DAyg.mjs} +3 -6
- package/dist/esm/chunks/Grouper-CyrOkuu2.mjs +73 -0
- package/dist/esm/chunks/{Icon-BOJAk-hM.mjs → Icon-DjW0Krm8.mjs} +3 -8
- package/dist/esm/chunks/IconButton-DdLhTUl0.mjs +96 -0
- package/dist/esm/chunks/{IndexedDB-Dk7a4fPS.mjs → IndexedDB-DVoDikoA.mjs} +1 -1
- package/dist/esm/chunks/Label-DhmJ_Sln.mjs +113 -0
- package/dist/esm/chunks/Modal-FztrJsQo.mjs +113 -0
- package/dist/esm/chunks/ModalController-C1BnM5Dz.mjs +76 -0
- package/dist/esm/chunks/Overlay-Dsy55Bxm.mjs +47 -0
- package/dist/esm/chunks/Pager-BqSdwL0L.mjs +42 -0
- package/dist/esm/chunks/ProgressIndicator-BnqZFATV.mjs +146 -0
- package/dist/esm/chunks/{PromptInput-COJnOFZf.mjs → PromptInput-CRkcPXJu.mjs} +3 -7
- package/dist/esm/chunks/RadioButton-DXq3yniV.mjs +63 -0
- package/dist/esm/chunks/{RadioButtonList-XqlqadYn.mjs → RadioButtonList-BgOskHCP.mjs} +3 -6
- package/dist/esm/chunks/{Slider-CU0Zdlpu.mjs → Slider-DPOy9uNI.mjs} +4 -10
- package/dist/esm/chunks/{Spacer-C5651N0N.mjs → Spacer-BJd_D0Fn.mjs} +1 -1
- package/dist/esm/chunks/{Switch-RfA431T4.mjs → Switch-DHqlyizo.mjs} +1 -4
- package/dist/esm/chunks/{TabBar-v8Dp4dr-.mjs → TabBar-RBXExqMK.mjs} +5 -9
- package/dist/esm/chunks/TextArea-CIlx_P26.mjs +80 -0
- package/dist/esm/chunks/{TextField-j4q0RUzH.mjs → TextField-CX72ybwH.mjs} +5 -9
- package/dist/esm/chunks/Tip-COBSyEjm.mjs +96 -0
- package/dist/esm/chunks/Toast-BTm3HxDD.mjs +189 -0
- package/dist/esm/chunks/ToggleButton-DujsCKF3.mjs +47 -0
- package/dist/esm/chunks/UploadArea-D--Nt8Ed.mjs +135 -0
- package/dist/esm/chunks/{WSConnection-DV7k84B4.mjs → WSConnection-BMXcuW3f.mjs} +1 -1
- package/dist/esm/chunks/{localDBStore-Dnpo5nSv.mjs → localDBStore-36E3160Z.mjs} +2 -2
- package/dist/esm/chunks/{microphoneStore-Dr3lxoWX.mjs → microphoneStore-Cexu82zH.mjs} +1 -1
- package/dist/esm/chunks/{misc-Bjbro8Xe.mjs → misc-CTGTuM2J.mjs} +16 -19
- package/dist/esm/chunks/modalStore-Crg_QmSJ.mjs +68 -0
- package/dist/esm/chunks/{sseStore-DjrfpNAS.mjs → sseStore-Dow4NXkZ.mjs} +2 -2
- package/dist/esm/chunks/{uploads-worker-7X9EwX9N.mjs → uploads-worker-Dhyp4ot3.mjs} +2 -2
- package/dist/esm/chunks/{uploadsStore-B7VECR5Q.mjs → uploadsStore-DT4lFybE.mjs} +1 -1
- package/dist/esm/chunks/{volumeStore-GZnCDBMU.mjs → volumeStore-RAxdmQ60.mjs} +3 -3
- package/dist/esm/chunks/{windowStore-CAzx2-QV.mjs → windowStore-C4AZexIa.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/Modal/index.mjs +45 -0
- package/dist/esm/components/ModalController/index.mjs +15 -0
- 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 +6 -6
- package/dist/esm/components/ToggleButton/index.mjs +9 -11
- package/dist/esm/components/UploadArea/index.mjs +9 -11
- package/dist/esm/hooks/useAudioRecorder.mjs +4 -5
- package/dist/esm/hooks/useLocalStore.mjs +3 -9
- package/dist/esm/hooks/useMdStreamBuffer.mjs +2 -2
- package/dist/esm/hooks/useMicrophone.mjs +7 -11
- 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 +2 -4
- package/dist/esm/index.mjs +53 -47
- package/dist/esm/providers/ThemeProvider.mjs +0 -14
- 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/microphone.mjs +2 -2
- package/dist/esm/stores/modal.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/volume.mjs +2 -2
- package/dist/esm/stores/window.mjs +2 -2
- package/dist/esm/stores.mjs +14 -12
- package/dist/esm/theme/colors.mjs +1 -1
- package/dist/esm/theme/type.mjs +1 -1
- package/dist/esm/utils/index.mjs +9 -9
- package/dist/esm/utils/objects/index.mjs +6 -6
- package/dist/esm/workers/uploads/uploads.mjs +2 -2
- package/dist/styles.css +8436 -0
- package/dist/types/components/Modal/Modal.d.ts +3 -0
- package/dist/types/components/Modal/_types.d.ts +46 -0
- package/dist/types/components/Modal/index.d.ts +2 -0
- package/dist/types/components/ModalController/ModalController.d.ts +2 -0
- package/dist/types/components/ModalController/_types.d.ts +13 -0
- package/dist/types/components/ModalController/index.d.ts +2 -0
- package/dist/types/components/Overlay/_types.d.ts +4 -0
- package/dist/types/components/Progress/ProgressIndicator/ProgressIndicator.d.ts +1 -1
- package/dist/types/components/Progress/ProgressIndicator/_types.d.ts +2 -1
- package/dist/types/components/Toast/_types.d.ts +2 -0
- package/dist/types/index.d.ts +5 -0
- package/dist/types/providers/ThemeProvider.d.ts +0 -6
- package/dist/types/stores/index.d.ts +1 -0
- package/dist/types/stores/modal/_types.d.ts +27 -0
- package/dist/types/stores/modal/index.d.ts +2 -0
- package/dist/types/stores/modal/modalStore.d.ts +20 -0
- package/dist/types/stores/toast/_types.d.ts +3 -1
- package/package.json +8 -3
- package/dist/cjs/chunks/Avatar-vIquH-Uk.js +0 -84
- package/dist/cjs/chunks/Badge-DjPJ_iJX.js +0 -24
- package/dist/cjs/chunks/CheckBox-DNctUlTA.js +0 -53
- package/dist/cjs/chunks/Chip-BN4qBz6w.js +0 -79
- package/dist/cjs/chunks/DropDown-BZbrZOkx.js +0 -105
- package/dist/cjs/chunks/ErrorSummary-K_rPxGWK.js +0 -87
- package/dist/cjs/chunks/FileList-D5_igVaC.js +0 -225
- package/dist/cjs/chunks/Grouper-D6rSl9nK.js +0 -63
- package/dist/cjs/chunks/IconButton-Cv-po19M.js +0 -84
- package/dist/cjs/chunks/Label-BQ6flU4-.js +0 -103
- package/dist/cjs/chunks/Overlay-DDOvMM6L.js +0 -37
- package/dist/cjs/chunks/Pager-GH2y7l5h.js +0 -38
- package/dist/cjs/chunks/ProgressIndicator-7pLk4Dvn.js +0 -138
- package/dist/cjs/chunks/RadioButton-3CzhKBn6.js +0 -56
- package/dist/cjs/chunks/TextArea-CBNHvcK3.js +0 -76
- package/dist/cjs/chunks/Tip-CUKFhP9K.js +0 -90
- package/dist/cjs/chunks/Toast-CKqGjsEk.js +0 -169
- package/dist/cjs/chunks/ToggleButton-BdCsChJM.js +0 -40
- package/dist/cjs/chunks/UploadArea-M9oc-No2.js +0 -129
- package/dist/cjs/chunks/style-inject.es-CMuL-BfJ.js +0 -11
- package/dist/esm/chunks/Avatar-Ds6MWC2c.mjs +0 -92
- package/dist/esm/chunks/Badge-CC0zSLMf.mjs +0 -30
- package/dist/esm/chunks/CheckBox-CoOmnGWD.mjs +0 -65
- package/dist/esm/chunks/Chip-ClG6cUX0.mjs +0 -91
- package/dist/esm/chunks/DropDown-AuQW_DWv.mjs +0 -115
- package/dist/esm/chunks/ErrorSummary-EzCqVifm.mjs +0 -94
- package/dist/esm/chunks/FileList-CxHaEEUi.mjs +0 -235
- package/dist/esm/chunks/Grouper-CyWZ8tfm.mjs +0 -77
- package/dist/esm/chunks/IconButton-Ck0IMn4i.mjs +0 -100
- package/dist/esm/chunks/Label-DSfCcKtQ.mjs +0 -116
- package/dist/esm/chunks/Overlay-DiSvgIQP.mjs +0 -45
- package/dist/esm/chunks/Pager-ByJ2Cr0n.mjs +0 -46
- package/dist/esm/chunks/ProgressIndicator-d2JGUDW_.mjs +0 -148
- package/dist/esm/chunks/RadioButton-BB73OY2a.mjs +0 -66
- package/dist/esm/chunks/TextArea-DGF43RON.mjs +0 -84
- package/dist/esm/chunks/Tip-Bj9d-230.mjs +0 -100
- package/dist/esm/chunks/Toast-CoioLlEG.mjs +0 -181
- package/dist/esm/chunks/ToggleButton-CwTm8Yx0.mjs +0 -51
- package/dist/esm/chunks/UploadArea-DAwoJxtr.mjs +0 -139
- package/dist/esm/chunks/style-inject.es-D0BjEaN8.mjs +0 -11
- /package/dist/cjs/chunks/{MdStreamBuffer-CvLO7CVi.js → MdStreamBuffer-CbG_VeRI.js} +0 -0
- /package/dist/cjs/chunks/{SSEConnection-C-1OzEOp.js → SSEConnection-ACoOeeTO.js} +0 -0
- /package/dist/cjs/chunks/{_types-Bdqd2vHh.js → _types-k-3V1fz_.js} +0 -0
- /package/dist/cjs/chunks/{audioVisualizer-EIfIjWH7.js → audioVisualizer-MOSbvvnZ.js} +0 -0
- /package/dist/cjs/chunks/{colors-njquvHkx.js → colors-B0_3srZN.js} +0 -0
- /package/dist/cjs/chunks/{debounce-BF4i6uIC.js → debounce-CaoYvh12.js} +0 -0
- /package/dist/cjs/chunks/{sharedTypes-gCECyn2N.js → sharedTypes-CthHPjrO.js} +0 -0
- /package/dist/cjs/chunks/{tipStore-Ck4NLvml.js → tipStore-CPB7RHKY.js} +0 -0
- /package/dist/cjs/chunks/{toastStore-CSStgB9d.js → toastStore-6eHe6esp.js} +0 -0
- /package/dist/cjs/chunks/{tslib.es6-C8dZW5nY.js → tslib.es6-CzpRaW14.js} +0 -0
- /package/dist/esm/chunks/{MdStreamBuffer-By7pHJQL.mjs → MdStreamBuffer-4AJH8WaN.mjs} +0 -0
- /package/dist/esm/chunks/{SSEConnection-DcA3wFsO.mjs → SSEConnection-qNnkZUOe.mjs} +0 -0
- /package/dist/esm/chunks/{_types-BVrr_Khp.mjs → _types-CEStVWlB.mjs} +0 -0
- /package/dist/esm/chunks/{audioVisualizer-ZgT77nUw.mjs → audioVisualizer-BUNbarKP.mjs} +0 -0
- /package/dist/esm/chunks/{colors-FQ0uNQcW.mjs → colors-D-qeA9gU.mjs} +0 -0
- /package/dist/esm/chunks/{debounce-Bst1jxMS.mjs → debounce-D5b6tZ5a.mjs} +0 -0
- /package/dist/esm/chunks/{sharedTypes-tn9-uJvb.mjs → sharedTypes-U5H1I85x.mjs} +0 -0
- /package/dist/esm/chunks/{tipStore-CL5a95Bl.mjs → tipStore-pvswaezx.mjs} +0 -0
- /package/dist/esm/chunks/{toastStore-D2PEIqCo.mjs → toastStore-80oOTYsj.mjs} +0 -0
- /package/dist/esm/chunks/{tslib.es6-C-olHjXV.mjs → tslib.es6-BX2F90pK.mjs} +0 -0
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import type React from 'react';
|
|
2
|
+
import type { ToolTip } from '../sharedTypes';
|
|
3
|
+
export type ModalAction<T = string> = {
|
|
4
|
+
id: string;
|
|
5
|
+
label?: string;
|
|
6
|
+
value?: T;
|
|
7
|
+
primary?: boolean;
|
|
8
|
+
iconLeft?: string;
|
|
9
|
+
tooltip?: string;
|
|
10
|
+
iconRight?: string;
|
|
11
|
+
round?: boolean;
|
|
12
|
+
position?: 'left' | 'right';
|
|
13
|
+
promise?: 'resolve' | 'reject';
|
|
14
|
+
};
|
|
15
|
+
type ModalBaseProps<T = string> = {
|
|
16
|
+
children?: React.ReactNode;
|
|
17
|
+
minHeight?: number | string;
|
|
18
|
+
minWidth?: number | string;
|
|
19
|
+
maxWidth?: number | string;
|
|
20
|
+
maxHeight?: number | string;
|
|
21
|
+
borderRadius?: number | string;
|
|
22
|
+
borderColor?: string;
|
|
23
|
+
borderWidth?: number | string;
|
|
24
|
+
backgroundColor?: string;
|
|
25
|
+
padding?: number | string;
|
|
26
|
+
title?: string;
|
|
27
|
+
titleColor?: string;
|
|
28
|
+
titleBorderColor?: string;
|
|
29
|
+
titleBorderWidth?: number;
|
|
30
|
+
titleIcon?: string;
|
|
31
|
+
titleIconFill?: boolean;
|
|
32
|
+
titleSize?: 'xs' | 's' | 'm' | 'l' | 'xl';
|
|
33
|
+
contentSize?: 'xs' | 's' | 'm' | 'l' | 'xl';
|
|
34
|
+
close?: boolean;
|
|
35
|
+
actions?: ModalAction<T>[];
|
|
36
|
+
actionsBorderColor?: string;
|
|
37
|
+
actionsBorderWidth?: number;
|
|
38
|
+
onAction?: (value?: T) => void;
|
|
39
|
+
onResolve?: (value?: T) => void;
|
|
40
|
+
onReject?: (value?: Error) => void;
|
|
41
|
+
onClose?: () => void;
|
|
42
|
+
onDragPointerDown?: (e: React.PointerEvent<any>) => void;
|
|
43
|
+
onToolTip?: (tip: ToolTip | null) => void;
|
|
44
|
+
};
|
|
45
|
+
export type ModalProps<T = string> = Omit<React.HTMLAttributes<HTMLElement>, keyof ModalBaseProps<T>> & ModalBaseProps<T>;
|
|
46
|
+
export {};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { Transition, Variants } from 'motion/react';
|
|
2
|
+
import type React from 'react';
|
|
3
|
+
export type ModalControllerProps = {
|
|
4
|
+
dragConstraintsRef?: React.RefObject<HTMLElement | null>;
|
|
5
|
+
overlayColor?: string;
|
|
6
|
+
overlayOpacity?: number;
|
|
7
|
+
transition?: Transition;
|
|
8
|
+
variants?: Variants;
|
|
9
|
+
initial?: string;
|
|
10
|
+
animate?: string;
|
|
11
|
+
exit?: string;
|
|
12
|
+
draggable?: boolean;
|
|
13
|
+
};
|
|
@@ -1,11 +1,15 @@
|
|
|
1
|
+
import type { Transition } from 'motion/react';
|
|
1
2
|
import type React from 'react';
|
|
2
3
|
type OverlayBaseProps = {
|
|
4
|
+
children?: React.ReactNode;
|
|
5
|
+
show?: boolean;
|
|
3
6
|
opacity?: number;
|
|
4
7
|
color?: string;
|
|
5
8
|
type?: 'clear' | 'dark';
|
|
6
9
|
global?: boolean;
|
|
7
10
|
overlay?: any;
|
|
8
11
|
onClick?: () => void;
|
|
12
|
+
transition?: Transition;
|
|
9
13
|
toggleOverlay?: (state: boolean) => void;
|
|
10
14
|
};
|
|
11
15
|
export type OverlayProps = Omit<React.HTMLAttributes<HTMLDivElement>, keyof OverlayBaseProps> & OverlayBaseProps;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import type { ProgressIndicatorProps } from './_types';
|
|
2
2
|
export declare function ProgressIndicator(props: Readonly<ProgressIndicatorProps>): import("react/jsx-runtime").JSX.Element;
|
|
3
|
-
export declare const OpenCircle: (size: number, secondsPerSpin: number, color: string, stroke?: number, playing?: boolean) => import("react/jsx-runtime").JSX.Element;
|
|
3
|
+
export declare const OpenCircle: (size: number | string, secondsPerSpin: number, color: string, stroke?: number, playing?: boolean, inset?: boolean, gradientId?: string) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
import type React from 'react';
|
|
2
2
|
type ProgressIndicatorBaseProps = {
|
|
3
|
-
size?: number;
|
|
3
|
+
size?: number | string;
|
|
4
4
|
secondsPerSpin?: number;
|
|
5
5
|
show?: boolean;
|
|
6
6
|
color?: string;
|
|
7
7
|
stroke?: number;
|
|
8
8
|
duration?: number;
|
|
9
9
|
inline?: boolean;
|
|
10
|
+
inset?: boolean;
|
|
10
11
|
didStart?: () => void;
|
|
11
12
|
didStop?: () => void;
|
|
12
13
|
};
|
|
@@ -18,6 +18,8 @@ type ToastBaseProps = {
|
|
|
18
18
|
duration?: number | 'Infinite';
|
|
19
19
|
close?: boolean;
|
|
20
20
|
type?: ToastType;
|
|
21
|
+
progress?: boolean;
|
|
22
|
+
onShow?: () => void;
|
|
21
23
|
didHide?: () => void;
|
|
22
24
|
};
|
|
23
25
|
type ReservedToastEvents = 'onMouseEnter' | 'onMouseLeave' | 'onFocus' | 'onBlur';
|
package/dist/types/index.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import './theme.css';
|
|
1
2
|
export type { ToolTip, ToolTipInfo } from './components/sharedTypes';
|
|
2
3
|
export { ToolTipType } from './components/sharedTypes';
|
|
3
4
|
export { light, dark, lightTheme, darkTheme, motion, elevations, Elevation, } from './theme';
|
|
@@ -31,6 +32,10 @@ export { Grouper } from './components/Grouper';
|
|
|
31
32
|
export type { GrouperProps } from './components/Grouper';
|
|
32
33
|
export { Overlay } from './components/Overlay';
|
|
33
34
|
export type { OverlayProps } from './components/Overlay';
|
|
35
|
+
export { Modal } from './components/Modal';
|
|
36
|
+
export type { ModalAction, ModalProps } from './components/Modal';
|
|
37
|
+
export { ModalController } from './components/ModalController';
|
|
38
|
+
export type { ModalControllerProps } from './components/ModalController';
|
|
34
39
|
export { FlexDiv, Size, Preset } from './components/FlexDiv';
|
|
35
40
|
export type { FlexDivProps } from './components/FlexDiv';
|
|
36
41
|
export { Pager } from './components/Pager';
|
|
@@ -1,10 +1,4 @@
|
|
|
1
1
|
import type React from 'react';
|
|
2
|
-
import '../theme/colors/colors.css';
|
|
3
|
-
import '../theme/elevations/elevation.css';
|
|
4
|
-
import '../theme/type/type.css';
|
|
5
|
-
import '../theme/breakpoints/custom-media.css';
|
|
6
|
-
import '../theme/motion/motion.css';
|
|
7
|
-
import '../theme/global/global.css';
|
|
8
2
|
interface ThemeProviderProps {
|
|
9
3
|
children?: React.ReactNode;
|
|
10
4
|
theme?: string;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import type React from 'react';
|
|
2
|
+
export type ModalComponentProps<TResult = unknown> = {
|
|
3
|
+
onResolve?: (value?: TResult) => void;
|
|
4
|
+
onReject?: (error?: Error) => void;
|
|
5
|
+
onClose?: () => void;
|
|
6
|
+
onDragPointerDown?: React.PointerEventHandler;
|
|
7
|
+
};
|
|
8
|
+
export type ModalDescriptor<TProps extends Record<string, unknown> = Record<string, unknown>, TResult = unknown> = {
|
|
9
|
+
id?: string;
|
|
10
|
+
component: React.ComponentType<TProps & ModalComponentProps<TResult>>;
|
|
11
|
+
props?: TProps;
|
|
12
|
+
};
|
|
13
|
+
export type ActiveModal = ModalDescriptor & {
|
|
14
|
+
resolve?: (value?: unknown) => void;
|
|
15
|
+
reject?: (reason?: unknown) => void;
|
|
16
|
+
};
|
|
17
|
+
export interface ModalStore {
|
|
18
|
+
modal: ActiveModal | null;
|
|
19
|
+
actions: {
|
|
20
|
+
show: (modal: ModalDescriptor | null) => void;
|
|
21
|
+
hide: (reason?: unknown) => void;
|
|
22
|
+
modalResponse: <TResult = unknown>(modal: ModalDescriptor) => Promise<TResult | undefined>;
|
|
23
|
+
resolve: <TResult = unknown>(value?: TResult) => void;
|
|
24
|
+
reject: (reason?: unknown) => void;
|
|
25
|
+
clear: () => void;
|
|
26
|
+
};
|
|
27
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import type { ActiveModal, ModalDescriptor, ModalStore } from './_types';
|
|
2
|
+
export declare const useModalStore: import("zustand").UseBoundStore<import("zustand").StoreApi<ModalStore>>;
|
|
3
|
+
export declare const useModal: () => ActiveModal | null;
|
|
4
|
+
export declare const useModalActions: () => {
|
|
5
|
+
show: (modal: ModalDescriptor | null) => void;
|
|
6
|
+
hide: (reason?: unknown) => void;
|
|
7
|
+
modalResponse: <TResult = unknown>(modal: ModalDescriptor) => Promise<TResult | undefined>;
|
|
8
|
+
resolve: <TResult = unknown>(value?: TResult) => void;
|
|
9
|
+
reject: (reason?: unknown) => void;
|
|
10
|
+
clear: () => void;
|
|
11
|
+
};
|
|
12
|
+
export declare const modalActions: {
|
|
13
|
+
show: (modal: ModalDescriptor | null) => void;
|
|
14
|
+
hide: (reason?: unknown) => void;
|
|
15
|
+
modalResponse: <TResult = unknown>(modal: ModalDescriptor) => Promise<TResult | undefined>;
|
|
16
|
+
resolve: <TResult = unknown>(value?: TResult) => void;
|
|
17
|
+
reject: (reason?: unknown) => void;
|
|
18
|
+
clear: () => void;
|
|
19
|
+
};
|
|
20
|
+
export declare const getModal: () => ActiveModal | null;
|
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
import type { ToastType } from '../../components/Toast';
|
|
2
2
|
export type Toast = {
|
|
3
3
|
message: string | null;
|
|
4
|
-
duration?: number;
|
|
4
|
+
duration?: number | 'Infinite';
|
|
5
5
|
type?: ToastType;
|
|
6
6
|
close?: boolean;
|
|
7
|
+
position?: 'top' | 'bottom';
|
|
8
|
+
progress?: boolean;
|
|
7
9
|
};
|
|
8
10
|
export interface ToastStore {
|
|
9
11
|
toast: Toast | null;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@apple-pie/slice",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.31",
|
|
4
4
|
"main": "dist/cjs/index.js",
|
|
5
5
|
"module": "dist/esm/index.mjs",
|
|
6
6
|
"exports": {
|
|
@@ -73,6 +73,9 @@
|
|
|
73
73
|
"import": "./dist/esm/theme/type.mjs",
|
|
74
74
|
"require": "./dist/cjs/theme/type.js"
|
|
75
75
|
},
|
|
76
|
+
"./styles.css": "./dist/styles.css",
|
|
77
|
+
"./css/flexBox.module.css": "./dist/css/flexBox.module.css",
|
|
78
|
+
"./css/type.module.css": "./dist/css/type.module.css",
|
|
76
79
|
"./theme/themes": {
|
|
77
80
|
"types": "./dist/types/theme/themes.d.ts",
|
|
78
81
|
"import": "./dist/esm/theme/themes.mjs",
|
|
@@ -109,8 +112,8 @@
|
|
|
109
112
|
"pack:tarball": "npm pack && ./scripts/copy-tgz.sh",
|
|
110
113
|
"prepack": "npm run build",
|
|
111
114
|
"prebuild": "rm -rf dist",
|
|
112
|
-
"build": "NODE_ENV=production rollup -c --bundleConfigAsCjs && tsc -p tsconfig.build.json && ./scripts/copy-css.sh",
|
|
113
|
-
"build:min": "MINIFY=true NODE_ENV=production rollup -c --bundleConfigAsCjs && tsc -p tsconfig.build.json && ./scripts/copy-css.sh",
|
|
115
|
+
"build": "NODE_ENV=production rollup -c --bundleConfigAsCjs && tsc -p tsconfig.build.json && node ./scripts/finalize-styles.mjs && ./scripts/copy-css.sh",
|
|
116
|
+
"build:min": "MINIFY=true NODE_ENV=production rollup -c --bundleConfigAsCjs && tsc -p tsconfig.build.json && node ./scripts/finalize-styles.mjs && ./scripts/copy-css.sh",
|
|
114
117
|
"dev": "vite",
|
|
115
118
|
"storybook": "storybook dev -p 6006",
|
|
116
119
|
"build-storybook": "storybook build"
|
|
@@ -152,6 +155,8 @@
|
|
|
152
155
|
"jsdom": "^28.1.0",
|
|
153
156
|
"playwright": "^1.58.2",
|
|
154
157
|
"postcss-custom-media": "^11.0.6",
|
|
158
|
+
"postcss-import": "^16.1.1",
|
|
159
|
+
"postcss-nested": "^6.2.0",
|
|
155
160
|
"rollup": "^4.32.0",
|
|
156
161
|
"rollup-plugin-json": "^4.0.0",
|
|
157
162
|
"rollup-plugin-peer-deps-external": "^2.2.4",
|
|
@@ -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("react"), misc = require("./misc-CTl4GDxI.js"), styleInject_es = require("./style-inject.es-CMuL-BfJ.js"), css_wrapper = "Avatar-module_wrapper__ab1D7 flexBox-module_row__z24tF type-module_body-m-regular__LuQBA", css_user = "Avatar-module_user__ZQv0Q flexBox-module_row__z24tF type-module_body-m-regular__LuQBA";
|
|
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.Avatar-module_wrapper__ab1D7 {\n\tposition: relative;\n\tmin-height: var(--avatar-size);\n\tmin-width: var(--avatar-size);\n\tmax-height: var(--avatar-size);\n\tmax-width: var(--avatar-size);\n\theight: var(--avatar-size);\n\twidth: var(--avatar-size);\n\tborder: var(--avatar-outer-border-size) solid var(--avatar-outer-border-color);\n\tborder-radius: 100%;\n\toutline: 0;\n}\n\n.Avatar-module_user__ZQv0Q {\n\tfont-size: var(--avatar-font-size) !important;\n\theight: 100%;\n\twidth: 100%;\n\tline-height: 1em;\n\ttext-transform: uppercase;\n\tborder-radius: 100%;\n\tborder: var(--avatar-border) solid var(--avatar-border-color);\n\tbackground-color: var(--avatar-bg-color);\n\tcolor: var(--avatar-color);\n\tbackground-image: var(--avatar-bg-image);\n\tbackground-size: cover;\n\tcursor: pointer;\n\tuser-select: none;\n\t-webkit-user-select: none;\n\ttransition: border-color var(--motion-water-duration) var(--motion-water) 0s;\n\t&:hover {\n\t\tborder-color: var(--avatar-border-color-hover);\n\t}\n}\n");
|
|
7
|
-
|
|
8
|
-
const Avatar = React.memo(props => {
|
|
9
|
-
var _a;
|
|
10
|
-
const {email: email, name: name, image: image = "", textColor: textColor, borderWidth: borderWidth, borderSize: borderSize = 0, color: color, borderColor: borderColor, borderColorHover: borderColorHover, outerBorderSize: outerBorderSize, outerBorderColor: outerBorderColor, backgroundColor: backgroundColor, bgColor: bgColor, onClick: onClick, onKeyDown: onKeyDown, fontSize: fontSize, onToolTip: onToolTip = () => null, size: size = 34, frame: frame = 34, tabIndex: tabIndex = 0} = props, divAttributes = tslib_es6.__rest(props, [ "email", "name", "image", "textColor", "borderWidth", "borderSize", "color", "borderColor", "borderColorHover", "outerBorderSize", "outerBorderColor", "backgroundColor", "bgColor", "onClick", "onKeyDown", "fontSize", "onToolTip", "size", "frame", "tabIndex" ]), {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), [textSize, setTextSize] = React.useState("inherit"), resolvedTextColor = null != textColor ? textColor : color, resolvedBorderWidth = null != borderWidth ? borderWidth : borderSize, resolvedBackgroundColor = null != backgroundColor ? backgroundColor : bgColor, initials = React.useMemo(() => {
|
|
11
|
-
if (!name && !email) return "";
|
|
12
|
-
if (name) {
|
|
13
|
-
let last;
|
|
14
|
-
const parts = name.trim().split(" "), first = parts[0];
|
|
15
|
-
return parts.length > 1 && (last = parts.at(-1)), `${first.charAt(0)}${last ? last.charAt(0) : ""}`;
|
|
16
|
-
}
|
|
17
|
-
return email ? email.charAt(0) : void 0;
|
|
18
|
-
}, [ name, email ]), bgImage = React.useMemo(() => image ? `url(${image})` : "", [ image ]);
|
|
19
|
-
React.useEffect(() => {
|
|
20
|
-
var _a;
|
|
21
|
-
if (void 0 !== fontSize) {
|
|
22
|
-
if ("auto" === fontSize || "number" == typeof fontSize && fontSize <= 1) {
|
|
23
|
-
const parentHeight = null === (_a = ref.current) || void 0 === _a ? void 0 : _a.offsetHeight;
|
|
24
|
-
if (!parentHeight) return void setTextSize("inherit");
|
|
25
|
-
let size = .5;
|
|
26
|
-
"number" == typeof fontSize && (size = fontSize);
|
|
27
|
-
const fSize = Math.round(parentHeight * size);
|
|
28
|
-
return void setTextSize(fSize);
|
|
29
|
-
}
|
|
30
|
-
if ("string" == typeof fontSize && fontSize.includes("%")) {
|
|
31
|
-
const normalized = misc.normalizedPercent(fontSize);
|
|
32
|
-
return void setTextSize(normalized);
|
|
33
|
-
}
|
|
34
|
-
setTextSize(fontSize);
|
|
35
|
-
} else setTextSize("inherit");
|
|
36
|
-
}, [ fontSize ]);
|
|
37
|
-
const displayContent = React.useMemo(() => image ? null : initials, [ image, initials ]), onMouseEnter = React.useCallback(event => {
|
|
38
|
-
var _a;
|
|
39
|
-
const payload = {
|
|
40
|
-
label: null !== (_a = null != name ? name : email) && void 0 !== _a ? _a : ""
|
|
41
|
-
};
|
|
42
|
-
onToolTip({
|
|
43
|
-
payload: payload,
|
|
44
|
-
event: event
|
|
45
|
-
});
|
|
46
|
-
}, [ name, email, onToolTip ]), onMouseLeave = React.useCallback(() => {
|
|
47
|
-
onToolTip(null);
|
|
48
|
-
}, [ onToolTip ]), handleKeyDown = React.useCallback(event => {
|
|
49
|
-
null == onKeyDown || onKeyDown(event), onClick && !event.defaultPrevented && misc.accessibleKeyDown(event, () => onClick(event));
|
|
50
|
-
}, [ onClick, onKeyDown ]), avatarVars = React.useMemo(() => ({
|
|
51
|
-
"--avatar-size": misc.setStyle(size),
|
|
52
|
-
"--avatar-frame": misc.setStyle(frame),
|
|
53
|
-
"--avatar-border": `${resolvedBorderWidth}px`,
|
|
54
|
-
"--avatar-color": null != resolvedTextColor ? resolvedTextColor : "var(--core-text-primary)",
|
|
55
|
-
"--avatar-bg-color": null != resolvedBackgroundColor ? resolvedBackgroundColor : "var(--core-surface-secondary)",
|
|
56
|
-
"--avatar-border-color": null != borderColor ? borderColor : "var(--core-outline-primary)",
|
|
57
|
-
"--avatar-border-color-hover": null != borderColorHover ? borderColorHover : "var(--core-outline-special)",
|
|
58
|
-
"--avatar-bg-image": `${bgImage}`,
|
|
59
|
-
"--avatar-font-size": misc.setStyle(textSize),
|
|
60
|
-
"--avatar-outer-border-size": misc.setStyle(outerBorderSize),
|
|
61
|
-
"--avatar-outer-border-color": null != outerBorderColor ? outerBorderColor : "var(--core-surface-primary)"
|
|
62
|
-
}), [ size, frame, resolvedBorderWidth, resolvedTextColor, resolvedBackgroundColor, borderColor, borderColorHover, bgImage, textSize, outerBorderSize, outerBorderColor ]), classNames = React.useMemo(() => `${css_wrapper}${divClass}`, [ divClass ]);
|
|
63
|
-
return jsxRuntime.jsx("div", Object.assign({
|
|
64
|
-
id: divId,
|
|
65
|
-
className: classNames,
|
|
66
|
-
style: Object.assign(Object.assign({}, divStyle), avatarVars),
|
|
67
|
-
onMouseEnter: onMouseEnter,
|
|
68
|
-
onMouseLeave: onMouseLeave,
|
|
69
|
-
onClick: onClick,
|
|
70
|
-
onKeyDown: handleKeyDown,
|
|
71
|
-
role: onClick ? "button" : "img",
|
|
72
|
-
tabIndex: onClick ? tabIndex : void 0,
|
|
73
|
-
"aria-label": `User Avatar - ${null !== (_a = null != name ? name : email) && void 0 !== _a ? _a : "Unknown User"}`
|
|
74
|
-
}, rest, {
|
|
75
|
-
children: jsxRuntime.jsx("div", {
|
|
76
|
-
ref: ref,
|
|
77
|
-
"aria-hidden": !0,
|
|
78
|
-
className: css_user,
|
|
79
|
-
children: displayContent
|
|
80
|
-
})
|
|
81
|
-
}));
|
|
82
|
-
});
|
|
83
|
-
|
|
84
|
-
exports.Avatar = Avatar;
|
|
@@ -1,24 +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"), styleInject_es = require("./style-inject.es-CMuL-BfJ.js"), css_badge = "Badge-module_badge__RsuMz flexBox-module_row__z24tF type-module_body-xs-medium__s3KvF";
|
|
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}.Badge-module_badge__RsuMz {\n\tline-height: 1em;\n\tcolor: var(--badge-color);\n\tbackground: var(--badge-bg);\n\tpadding: 2px 8px;\n\tmin-width: 24px;\n\twidth: min-content;\n\tborder-radius: 8px;\n\twhite-space: nowrap;\n}\n");
|
|
7
|
-
|
|
8
|
-
const Badge = React.memo(props => {
|
|
9
|
-
const {count: count, variant: variant = "dark", hideNull: hideNull = !0} = props, divAttributes = tslib_es6.__rest(props, [ "count", "variant", "hideNull" ]), {id: divId, className: className, style: style} = divAttributes, rest = tslib_es6.__rest(divAttributes, [ "id", "className", "style" ]), divStyle = null != style ? style : {}, divClass = className ? ` ${className}` : "", displayCount = React.useMemo(() => void 0 === count ? "0" : "string" == typeof count ? count : count > 99 ? "99+" : count.toString(), [ count ]), cssVars = React.useMemo(() => ({
|
|
10
|
-
"--badge-color": "light" === variant ? "var(--core-text-primary)" : "var(--core-text-light)",
|
|
11
|
-
"--badge-bg": "light" === variant ? "var(--core-badge-secondary)" : "var(--core-badge-primary)"
|
|
12
|
-
}), [ variant ]);
|
|
13
|
-
return void 0 === count || "" === count || hideNull && 0 === count ? null : jsxRuntime.jsx("div", Object.assign({
|
|
14
|
-
id: divId,
|
|
15
|
-
className: `${css_badge}${divClass}`,
|
|
16
|
-
style: Object.assign(Object.assign({}, divStyle), cssVars),
|
|
17
|
-
role: "status",
|
|
18
|
-
"aria-live": "polite"
|
|
19
|
-
}, rest, {
|
|
20
|
-
children: displayCount
|
|
21
|
-
}));
|
|
22
|
-
});
|
|
23
|
-
|
|
24
|
-
exports.Badge = Badge;
|
|
@@ -1,53 +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"), misc = require("./misc-CTl4GDxI.js"), Icon = require("./Icon-BFiN8Wzm.js"), styleInject_es = require("./style-inject.es-CMuL-BfJ.js"), css_wrapper = "CheckBox-module_wrapper__uRsjI flexBox-module_row__z24tF", css_icon = "CheckBox-module_icon__FoDJN flexBox-module_row__z24tF", css_label = "CheckBox-module_label__0AiBp type-module_body-m-regular__LuQBA";
|
|
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.CheckBox-module_wrapper__uRsjI {\n\tmin-height: var(--cb-size);\n\theight: var(--cb-size);\n\twidth: auto;\n\tgap: 6px;\n\tcursor: pointer;\n\toverflow: hidden;\n\tuser-select: none;\n\t-webkit-user-select: none;\n\toutline: none;\n\tborder: 0;\n}\n\n.CheckBox-module_icon__FoDJN {\n\tmin-width: var(--cb-size);\n\tmax-width: var(--cb-size);\n\tmin-height: var(--cb-size);\n\tmax-height: var(--cb-size);\n}\n\n.CheckBox-module_label__0AiBp {\n\tcolor: var(--cb-label-color);\n\ttransition: color var(--motion-water-duration) var(--motion-water-easing) 0s;\n}\n");
|
|
7
|
-
|
|
8
|
-
const CheckBox = React.memo(props => {
|
|
9
|
-
const {size: size = 20, checked: checked = !1, disabled: disabled = !1, color: color, children: children, onChange: onChange = () => null} = props, divAttributes = tslib_es6.__rest(props, [ "size", "checked", "disabled", "color", "children", "onChange" ]), {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(checked);
|
|
10
|
-
React.useEffect(() => setState(checked), [ checked ]);
|
|
11
|
-
const iconName = React.useMemo(() => !0 === state ? "checkbox checked" : "mixed" === state ? "checkbox partial" : "checkbox", [ state ]), iconColor = React.useMemo(() => color || (disabled ? "var(--core-icon-disabled)" : "mixed" === state ? "var(--core-icon-primary)" : state ? "var(--core-text-special)" : "var(--core-icon-secondary"), [ color, disabled, state ]), labelColor = React.useMemo(() => color || (disabled ? "var(--core-text-disabled)" : "var(--core-text-primary)"), [ color, disabled ]), cssVars = React.useMemo(() => ({
|
|
12
|
-
"--cb-size": `${size}px`,
|
|
13
|
-
"--cb-label-color": labelColor
|
|
14
|
-
}), [ size, labelColor ]), handleToggle = React.useCallback(() => {
|
|
15
|
-
if (disabled) return;
|
|
16
|
-
let newState = !1;
|
|
17
|
-
switch (state) {
|
|
18
|
-
case !0:
|
|
19
|
-
break;
|
|
20
|
-
|
|
21
|
-
case "mixed":
|
|
22
|
-
case !1:
|
|
23
|
-
newState = !0;
|
|
24
|
-
}
|
|
25
|
-
setState(newState), onChange(newState);
|
|
26
|
-
}, [ state, disabled, onChange ]);
|
|
27
|
-
return jsxRuntime.jsxs(react.motion.div, Object.assign({
|
|
28
|
-
id: divId,
|
|
29
|
-
className: `${css_wrapper}${divClass}`,
|
|
30
|
-
style: Object.assign(Object.assign({}, divStyle), cssVars),
|
|
31
|
-
onClick: handleToggle,
|
|
32
|
-
onKeyDown: e => misc.accessibleKeyDown(e, handleToggle),
|
|
33
|
-
tabIndex: disabled ? -1 : 0,
|
|
34
|
-
role: "checkbox",
|
|
35
|
-
"aria-checked": state,
|
|
36
|
-
"aria-disabled": disabled,
|
|
37
|
-
"aria-label": String(children)
|
|
38
|
-
}, rest, {
|
|
39
|
-
children: [ jsxRuntime.jsx("div", {
|
|
40
|
-
className: css_icon,
|
|
41
|
-
children: jsxRuntime.jsx(Icon.Icon, {
|
|
42
|
-
name: iconName,
|
|
43
|
-
strokeColor: iconColor,
|
|
44
|
-
size: size
|
|
45
|
-
})
|
|
46
|
-
}), children && jsxRuntime.jsx("span", {
|
|
47
|
-
className: css_label,
|
|
48
|
-
children: children
|
|
49
|
-
}) ]
|
|
50
|
-
}));
|
|
51
|
-
});
|
|
52
|
-
|
|
53
|
-
exports.CheckBox = CheckBox;
|
|
@@ -1,79 +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-CTl4GDxI.js"), Icon = require("./Icon-BFiN8Wzm.js"), sharedTypes = require("./sharedTypes-gCECyn2N.js"), styleInject_es = require("./style-inject.es-CMuL-BfJ.js"), css = {
|
|
5
|
-
chip: "Chip-module_chip__0nys- flexBox-module_row__z24tF",
|
|
6
|
-
icon: "Chip-module_icon__dtR-K flexBox-module_row__z24tF",
|
|
7
|
-
xs: "Chip-module_xs__s-KNG type-module_body-xs-regular__ZAFft",
|
|
8
|
-
s: "Chip-module_s__2KTXi type-module_body-s-regular__vRHSP",
|
|
9
|
-
m: "Chip-module_m__l2u3N type-module_body-m-regular__LuQBA",
|
|
10
|
-
l: "Chip-module_l__3MqPN type-module_body-l-regular__lOYbg"
|
|
11
|
-
};
|
|
12
|
-
|
|
13
|
-
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.Chip-module_chip__0nys- {\n\tpadding: var(--ui-chip-padding) !important;\n\twidth: min-content;\n\tmin-height: 30px;\n\tgap: var(--ui-chip-gap);\n\tbackground: var(--ui-chip-bg-color);\n\tline-height: 1em;\n\tcolor: var(--ui-chip-label-color);\n\tborder: var(--ui-chip-border-size) solid var(--ui-chip-border-color);\n\tborder-radius: var(--ui-chip-border-radius);\n\ttransition: all var(--motion-water-duration) var(--motion-water) 0s;\n\tcursor: var(--ui-chip-cursor);\n\twhite-space: nowrap;\n\tuser-select: none;\n\t-webkit-user-select: none;\n\t&:hover {\n\t\tborder-color: var(--ui-chip-border-color-hover);\n\t\tbackground: var(--ui-chip-bg-color-hover);\n\t\tcolor: var(--ui-chip-label-color-hover);\n\t}\n}\n\n.Chip-module_icon__dtR-K {\n\theight: var(--ui-chip-icon-size);\n\tmin-height: var(--ui-chip-icon-size);\n\twidth: var(--ui-chip-icon-size);\n\tmin-width: var(--ui-chip-icon-size);\n}\n\n.Chip-module_xs__s-KNG {\n}\n\n.Chip-module_s__2KTXi {\n}\n\n.Chip-module_m__l2u3N {\n}\n\n.Chip-module_l__3MqPN {\n}\n");
|
|
14
|
-
|
|
15
|
-
const Chip = React.memo(props => {
|
|
16
|
-
const {children: children, label: label, icon: icon, tooltip: tooltip, iconSize: iconSize = 20, disabled: disabled = !1, focused: focused = !1, iconPosition: iconPosition = "left", labelSize: labelSize = "m", labelColor: labelColor = "var(--core-text-primary)", labelColorHover: labelColorHover = "var(--core-text-special)", iconColor: iconColor = "var(--core-text-primary)", iconColorHover: iconColorHover = "var(--core-text-special)", backgroundColor: backgroundColor, backgroundColorHover: backgroundColorHover, borderWidth: borderWidth, borderSize: borderSize = 1, borderColor: borderColor = "var(--core-text-primary)", borderColorHover: borderColorHover = "var(--core-text-special)", borderColorDisabled: borderColorDisabled = "var(--core-text-disabled)", bgColor: bgColor = "transparent", bgColorHover: bgColorHover = "var(--core-surface-secondary)", borderRadius: borderRadius = 8, paddingTop: paddingTop, paddingTops: paddingTops = 8, paddingSides: paddingSides = 16, gap: gap = 4, onToolTip: onToolTip = () => null, onClick: onClick = () => null} = props, divAttributes = tslib_es6.__rest(props, [ "children", "label", "icon", "tooltip", "iconSize", "disabled", "focused", "iconPosition", "labelSize", "labelColor", "labelColorHover", "iconColor", "iconColorHover", "backgroundColor", "backgroundColorHover", "borderWidth", "borderSize", "borderColor", "borderColorHover", "borderColorDisabled", "bgColor", "bgColorHover", "borderRadius", "paddingTop", "paddingTops", "paddingSides", "gap", "onToolTip", "onClick" ]), {id: divId, className: className, style: style} = divAttributes, rest = tslib_es6.__rest(divAttributes, [ "id", "className", "style" ]), divStyle = null != style ? style : {}, divClass = className ? ` ${className}` : "", [isHovered, setIsHovered] = React.useState(!1), resolvedBackgroundColor = null != backgroundColor ? backgroundColor : bgColor, resolvedBackgroundColorHover = null != backgroundColorHover ? backgroundColorHover : bgColorHover, resolvedBorderWidth = null != borderWidth ? borderWidth : borderSize, resolvedPaddingTop = null != paddingTop ? paddingTop : paddingTops, handleClick = React.useCallback(e => {
|
|
17
|
-
disabled || onClick(e);
|
|
18
|
-
}, [ disabled, onClick ]), handleMouseEnter = React.useCallback((enter, event) => {
|
|
19
|
-
if (enter) {
|
|
20
|
-
if (tooltip) {
|
|
21
|
-
const tip = {
|
|
22
|
-
type: sharedTypes.ToolTipType.button,
|
|
23
|
-
payload: {
|
|
24
|
-
label: tooltip
|
|
25
|
-
},
|
|
26
|
-
ref: null,
|
|
27
|
-
event: event
|
|
28
|
-
};
|
|
29
|
-
onToolTip(tip);
|
|
30
|
-
}
|
|
31
|
-
setIsHovered(!0);
|
|
32
|
-
} else onToolTip(null), setIsHovered(!1);
|
|
33
|
-
}, [ tooltip, onToolTip ]), padding = React.useMemo(() => {
|
|
34
|
-
if (!icon) return `${resolvedPaddingTop}px ${paddingSides}px`;
|
|
35
|
-
return `${resolvedPaddingTop}px ${"right" === iconPosition ? paddingSides - 4 : paddingSides}px ${resolvedPaddingTop}px ${"right" === iconPosition ? paddingSides : paddingSides - 4}px`;
|
|
36
|
-
}, [ icon, iconPosition, resolvedPaddingTop, paddingSides ]), computedIconColor = React.useMemo(() => disabled ? "var(--core-text-disabled)" : isHovered ? null != iconColorHover ? iconColorHover : "var(--core-text-special)" : null != iconColor ? iconColor : "var(--core-text-primary)", [ iconColor, disabled, isHovered, iconColorHover ]), cssVars = React.useMemo(() => ({
|
|
37
|
-
"--ui-chip-padding": padding,
|
|
38
|
-
"--ui-chip-gap": misc.setStyle(gap),
|
|
39
|
-
"--ui-chip-border-radius": misc.setStyle(borderRadius),
|
|
40
|
-
"--ui-chip-border-size": misc.setStyle(resolvedBorderWidth),
|
|
41
|
-
"--ui-chip-border-color": disabled ? borderColorDisabled : borderColor,
|
|
42
|
-
"--ui-chip-border-color-hover": disabled ? borderColorDisabled : borderColorHover,
|
|
43
|
-
"--ui-chip-bg-color": resolvedBackgroundColor,
|
|
44
|
-
"--ui-chip-bg-color-hover": disabled ? resolvedBackgroundColor : resolvedBackgroundColorHover,
|
|
45
|
-
"--ui-chip-label-color": disabled ? "var(--core-text-disabled)" : labelColor,
|
|
46
|
-
"--ui-chip-label-color-hover": disabled ? "var(--core-text-disabled)" : labelColorHover,
|
|
47
|
-
"--ui-chip-cursor": disabled ? "default" : "pointer"
|
|
48
|
-
}), [ padding, resolvedBackgroundColor, borderColor, borderColorDisabled, borderColorHover, resolvedBorderWidth, resolvedBackgroundColorHover, labelColorHover, labelColor, gap, borderRadius, disabled ]);
|
|
49
|
-
return jsxRuntime.jsxs("div", Object.assign({
|
|
50
|
-
id: divId,
|
|
51
|
-
className: `${css.chip}${divClass}`,
|
|
52
|
-
style: Object.assign(Object.assign({}, divStyle), cssVars),
|
|
53
|
-
onKeyDown: e => misc.accessibleKeyDown(e, () => handleClick(e)),
|
|
54
|
-
onClick: handleClick,
|
|
55
|
-
onMouseEnter: e => handleMouseEnter(!0, e),
|
|
56
|
-
onMouseLeave: e => handleMouseEnter(!1, e)
|
|
57
|
-
}, rest, {
|
|
58
|
-
children: [ icon && "right" !== iconPosition && jsxRuntime.jsx("div", {
|
|
59
|
-
className: css.icon,
|
|
60
|
-
children: jsxRuntime.jsx(Icon.Icon, {
|
|
61
|
-
name: icon,
|
|
62
|
-
size: iconSize,
|
|
63
|
-
strokeColor: computedIconColor
|
|
64
|
-
})
|
|
65
|
-
}), jsxRuntime.jsx("div", {
|
|
66
|
-
className: css[labelSize],
|
|
67
|
-
children: null != children ? children : label
|
|
68
|
-
}), icon && "right" === iconPosition && jsxRuntime.jsx("div", {
|
|
69
|
-
className: css.icon,
|
|
70
|
-
children: jsxRuntime.jsx(Icon.Icon, {
|
|
71
|
-
name: icon,
|
|
72
|
-
size: iconSize,
|
|
73
|
-
strokeColor: computedIconColor
|
|
74
|
-
})
|
|
75
|
-
}) ]
|
|
76
|
-
}));
|
|
77
|
-
});
|
|
78
|
-
|
|
79
|
-
exports.Chip = Chip;
|