@expressms/smartapp-ui 3.0.0-alpha.22 → 3.0.0-alpha.221
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/build/main/assets/icons/accepted-invite-status.svg +4 -0
- package/build/main/assets/icons/arrow-back.svg +3 -0
- package/build/main/assets/icons/arrow-down.svg +3 -0
- package/build/main/assets/icons/arrow-up.svg +3 -0
- package/build/main/assets/icons/attachment-loader.svg +3 -0
- package/build/main/assets/icons/avatar-loader.svg +3 -0
- package/build/main/assets/icons/button-loader.svg +3 -0
- package/build/main/assets/icons/calendar-arrow-next.svg +3 -0
- package/build/main/assets/icons/calendar-arrow-prev.svg +3 -0
- package/build/main/assets/icons/check-mark-square.svg +4 -0
- package/build/main/assets/icons/check-mark.svg +4 -0
- package/build/main/assets/icons/chevron.svg +3 -0
- package/build/main/assets/icons/chip-info.svg +5 -0
- package/build/main/assets/icons/clear.svg +3 -0
- package/build/main/assets/icons/close-modal.svg +3 -0
- package/build/main/assets/icons/close-stories.svg +4 -0
- package/build/main/assets/icons/close.svg +3 -0
- package/build/main/assets/icons/contact-info.svg +5 -0
- package/build/main/assets/icons/copy.svg +3 -0
- package/build/main/assets/icons/corporate-user.svg +3 -0
- package/build/main/assets/icons/crown.svg +5 -0
- package/build/main/assets/icons/declined-invite-status.svg +4 -0
- package/build/main/assets/icons/delete-chip.svg +3 -0
- package/build/main/assets/icons/department.svg +3 -0
- package/build/main/assets/icons/distribution.svg +12 -0
- package/build/main/assets/icons/doc-small.svg +11 -0
- package/build/main/assets/icons/doc.svg +11 -0
- package/build/main/assets/icons/download.svg +3 -0
- package/build/main/assets/icons/error.svg +5 -0
- package/build/main/assets/icons/external-link.svg +3 -0
- package/build/main/assets/icons/eye-off.svg +5 -0
- package/build/main/assets/icons/eye-on.svg +4 -0
- package/build/main/assets/icons/file-small.svg +11 -0
- package/build/main/assets/icons/file.svg +11 -0
- package/build/main/assets/icons/global-address-book-user.svg +4 -0
- package/build/main/assets/icons/group.svg +3 -0
- package/build/main/assets/icons/image-no-preview-small.svg +11 -0
- package/build/main/assets/icons/image-no-preview.svg +11 -0
- package/build/main/assets/icons/indeterminate-check-mark-square.svg +4 -0
- package/build/main/assets/icons/info.svg +5 -0
- package/build/main/assets/icons/input-arrow-down.svg +3 -0
- package/build/main/assets/icons/input-arrow-up.svg +3 -0
- package/build/main/assets/icons/job-position.svg +3 -0
- package/build/main/assets/icons/loader.svg +3 -0
- package/build/main/assets/icons/logout.svg +4 -0
- package/build/main/assets/icons/magnifying-glass.svg +3 -0
- package/build/main/assets/icons/mail.svg +3 -0
- package/build/main/assets/icons/meeting-room.svg +3 -0
- package/build/main/assets/icons/more.svg +3 -0
- package/build/main/assets/icons/my-contacts-user.svg +3 -0
- package/build/main/assets/icons/needs-action-invite-status.svg +4 -0
- package/build/main/assets/icons/notification-close.svg +3 -0
- package/build/main/assets/icons/notification-error.svg +5 -0
- package/build/main/assets/icons/notification-failure-filled.svg +3 -0
- package/build/main/assets/icons/notification-failure.svg +3 -0
- package/build/main/assets/icons/notification-info-filled.svg +5 -0
- package/build/main/assets/icons/notification-info.svg +5 -0
- package/build/main/assets/icons/notification-success-filled.svg +4 -0
- package/build/main/assets/icons/notification-success.svg +4 -0
- package/build/main/assets/icons/office.svg +3 -0
- package/build/main/assets/icons/order.svg +6 -0
- package/build/main/assets/icons/pdf-small.svg +11 -0
- package/build/main/assets/icons/pdf.svg +11 -0
- package/build/main/assets/icons/play-small.svg +3 -0
- package/build/main/assets/icons/play.svg +3 -0
- package/build/main/assets/icons/plus.svg +4 -0
- package/build/main/assets/icons/ppt-small.svg +11 -0
- package/build/main/assets/icons/ppt.svg +11 -0
- package/build/main/assets/icons/private.svg +5 -0
- package/build/main/assets/icons/refresh.svg +3 -0
- package/build/main/assets/icons/remove.svg +3 -0
- package/build/main/assets/icons/search.svg +3 -0
- package/build/main/assets/icons/select-arrow-down.svg +3 -0
- package/build/main/assets/icons/select-arrow-up.svg +3 -0
- package/build/main/assets/icons/server.svg +3 -0
- package/build/main/assets/icons/story-loader.svg +3 -0
- package/build/main/assets/icons/tick.svg +10 -0
- package/build/main/assets/icons/trash.svg +3 -0
- package/build/main/assets/icons/txt-small.svg +11 -0
- package/build/main/assets/icons/txt.svg +11 -0
- package/build/main/assets/icons/video-no-preview-small.svg +11 -0
- package/build/main/assets/icons/video-no-preview.svg +11 -0
- package/build/main/assets/icons/warning-avatar.svg +4 -0
- package/build/main/assets/icons/xls-small.svg +11 -0
- package/build/main/assets/icons/xls.svg +11 -0
- package/build/main/assets/storybook/index.d.ts +27 -0
- package/build/main/assets/storybook/index.js +28 -0
- package/build/main/assets/storybook/index.js.map +1 -0
- package/build/main/constants/constants.d.ts +243 -0
- package/build/main/constants/constants.js +301 -0
- package/build/main/constants/constants.js.map +1 -0
- package/build/main/constants/index.d.ts +2 -0
- package/build/main/constants/index.js +3 -0
- package/build/main/constants/index.js.map +1 -0
- package/build/main/constants/types.d.ts +69 -0
- package/build/main/constants/types.js +2 -0
- package/build/main/constants/types.js.map +1 -0
- package/build/main/helpers/index.d.ts +33 -0
- package/build/main/helpers/index.js +204 -0
- package/build/main/helpers/index.js.map +1 -0
- package/build/main/hooks/useCharHintDisplay.d.ts +10 -0
- package/build/main/hooks/useCharHintDisplay.js +57 -0
- package/build/main/hooks/useCharHintDisplay.js.map +1 -0
- package/build/main/hooks/useMobileLongTap.d.ts +16 -0
- package/build/main/hooks/useMobileLongTap.js +65 -0
- package/build/main/hooks/useMobileLongTap.js.map +1 -0
- package/build/main/hooks/useModal.d.ts +30 -0
- package/build/main/hooks/useModal.js +275 -0
- package/build/main/hooks/useModal.js.map +1 -0
- package/build/main/index.d.ts +38 -0
- package/build/main/index.js +39 -0
- package/build/main/index.js.map +1 -0
- package/build/main/styles/index.d.ts +1 -0
- package/build/main/styles/index.js +2 -0
- package/build/main/styles/index.js.map +1 -0
- package/build/main/styles/main.js +0 -0
- package/build/main/styles/styles.scss +14 -0
- package/build/main//321/201omponents/ActionModal/ActionModal.d.ts +4 -0
- package/build/main//321/201omponents/ActionModal/ActionModal.js +53 -0
- package/build/main//321/201omponents/ActionModal/ActionModal.js.map +1 -0
- package/build/main//321/201omponents/ActionModal/index.d.ts +1 -0
- package/build/main//321/201omponents/ActionModal/index.js +2 -0
- package/build/main//321/201omponents/ActionModal/index.js.map +1 -0
- package/build/main//321/201omponents/ActionModal/types.d.ts +23 -0
- package/build/main//321/201omponents/ActionModal/types.js +2 -0
- package/build/main//321/201omponents/ActionModal/types.js.map +1 -0
- package/build/main//321/201omponents/AttachedFile/AttachedFile.d.ts +8 -0
- package/build/main//321/201omponents/AttachedFile/AttachedFile.js +201 -0
- package/build/main//321/201omponents/AttachedFile/AttachedFile.js.map +1 -0
- package/build/main//321/201omponents/AttachedFile/index.d.ts +1 -0
- package/build/main//321/201omponents/AttachedFile/index.js +2 -0
- package/build/main//321/201omponents/AttachedFile/index.js.map +1 -0
- package/build/main//321/201omponents/AttachedFile/types.d.ts +23 -0
- package/build/main//321/201omponents/AttachedFile/types.js +2 -0
- package/build/main//321/201omponents/AttachedFile/types.js.map +1 -0
- package/build/main//321/201omponents/Avatar/Avatar.d.ts +5 -0
- package/build/main//321/201omponents/Avatar/Avatar.js +254 -0
- package/build/main//321/201omponents/Avatar/Avatar.js.map +1 -0
- package/build/main//321/201omponents/Avatar/index.d.ts +1 -0
- package/build/main//321/201omponents/Avatar/index.js +2 -0
- package/build/main//321/201omponents/Avatar/index.js.map +1 -0
- package/build/main//321/201omponents/Avatar/types.d.ts +64 -0
- package/build/main//321/201omponents/Avatar/types.js +32 -0
- package/build/main//321/201omponents/Avatar/types.js.map +1 -0
- package/build/main//321/201omponents/Button/Button.d.ts +4 -0
- package/build/main//321/201omponents/Button/Button.js +68 -0
- package/build/main//321/201omponents/Button/Button.js.map +1 -0
- package/build/main//321/201omponents/Button/index.d.ts +1 -0
- package/build/main//321/201omponents/Button/index.js +2 -0
- package/build/main//321/201omponents/Button/index.js.map +1 -0
- package/build/main//321/201omponents/Button/types.d.ts +31 -0
- package/build/main//321/201omponents/Button/types.js +15 -0
- package/build/main//321/201omponents/Button/types.js.map +1 -0
- package/build/main//321/201omponents/CachedImage/CachedImage.d.ts +4 -0
- package/build/main//321/201omponents/CachedImage/CachedImage.js +59 -0
- package/build/main//321/201omponents/CachedImage/CachedImage.js.map +1 -0
- package/build/main//321/201omponents/CachedImage/helpers.d.ts +3 -0
- package/build/main//321/201omponents/CachedImage/helpers.js +40 -0
- package/build/main//321/201omponents/CachedImage/helpers.js.map +1 -0
- package/build/main//321/201omponents/CachedImage/index.d.ts +1 -0
- package/build/main//321/201omponents/CachedImage/index.js +2 -0
- package/build/main//321/201omponents/CachedImage/index.js.map +1 -0
- package/build/main//321/201omponents/CachedImage/types.d.ts +10 -0
- package/build/main//321/201omponents/CachedImage/types.js +2 -0
- package/build/main//321/201omponents/CachedImage/types.js.map +1 -0
- package/build/main//321/201omponents/Calendar/Calendar.d.ts +16 -0
- package/build/main//321/201omponents/Calendar/Calendar.js +294 -0
- package/build/main//321/201omponents/Calendar/Calendar.js.map +1 -0
- package/build/main//321/201omponents/Calendar/index.d.ts +1 -0
- package/build/main//321/201omponents/Calendar/index.js +2 -0
- package/build/main//321/201omponents/Calendar/index.js.map +1 -0
- package/build/main//321/201omponents/Calendar/types.d.ts +28 -0
- package/build/main//321/201omponents/Calendar/types.js +2 -0
- package/build/main//321/201omponents/Calendar/types.js.map +1 -0
- package/build/main//321/201omponents/Charts/ChartBar/ChartBar.d.ts +4 -0
- package/build/main//321/201omponents/Charts/ChartBar/ChartBar.js +47 -0
- package/build/main//321/201omponents/Charts/ChartBar/ChartBar.js.map +1 -0
- package/build/main//321/201omponents/Charts/ChartLegend/ChartLegend.d.ts +4 -0
- package/build/main//321/201omponents/Charts/ChartLegend/ChartLegend.js +71 -0
- package/build/main//321/201omponents/Charts/ChartLegend/ChartLegend.js.map +1 -0
- package/build/main//321/201omponents/Charts/ChartLine/ChartLine.d.ts +4 -0
- package/build/main//321/201omponents/Charts/ChartLine/ChartLine.js +42 -0
- package/build/main//321/201omponents/Charts/ChartLine/ChartLine.js.map +1 -0
- package/build/main//321/201omponents/Charts/ChartPie/ChartPie.d.ts +4 -0
- package/build/main//321/201omponents/Charts/ChartPie/ChartPie.js +64 -0
- package/build/main//321/201omponents/Charts/ChartPie/ChartPie.js.map +1 -0
- package/build/main//321/201omponents/Charts/colors.d.ts +3 -0
- package/build/main//321/201omponents/Charts/colors.js +4 -0
- package/build/main//321/201omponents/Charts/colors.js.map +1 -0
- package/build/main//321/201omponents/Charts/constants.d.ts +42 -0
- package/build/main//321/201omponents/Charts/constants.js +42 -0
- package/build/main//321/201omponents/Charts/constants.js.map +1 -0
- package/build/main//321/201omponents/Charts/helpers.d.ts +17 -0
- package/build/main//321/201omponents/Charts/helpers.js +73 -0
- package/build/main//321/201omponents/Charts/helpers.js.map +1 -0
- package/build/main//321/201omponents/Charts/index.d.ts +3 -0
- package/build/main//321/201omponents/Charts/index.js +4 -0
- package/build/main//321/201omponents/Charts/index.js.map +1 -0
- package/build/main//321/201omponents/Charts/types.d.ts +89 -0
- package/build/main//321/201omponents/Charts/types.js +2 -0
- package/build/main//321/201omponents/Charts/types.js.map +1 -0
- package/build/main//321/201omponents/Charts/useEvents.d.ts +5 -0
- package/build/main//321/201omponents/Charts/useEvents.js +45 -0
- package/build/main//321/201omponents/Charts/useEvents.js.map +1 -0
- package/build/main//321/201omponents/Charts/usePieEvents.d.ts +6 -0
- package/build/main//321/201omponents/Charts/usePieEvents.js +57 -0
- package/build/main//321/201omponents/Charts/usePieEvents.js.map +1 -0
- package/build/main//321/201omponents/Checkbox/Checkbox.d.ts +8 -0
- package/build/main//321/201omponents/Checkbox/Checkbox.js +48 -0
- package/build/main//321/201omponents/Checkbox/Checkbox.js.map +1 -0
- package/build/main//321/201omponents/Checkbox/index.d.ts +1 -0
- package/build/main//321/201omponents/Checkbox/index.js +2 -0
- package/build/main//321/201omponents/Checkbox/index.js.map +1 -0
- package/build/main//321/201omponents/Checkbox/types.d.ts +14 -0
- package/build/main//321/201omponents/Checkbox/types.js +2 -0
- package/build/main//321/201omponents/Checkbox/types.js.map +1 -0
- package/build/main//321/201omponents/Chip/Chip.d.ts +5 -0
- package/build/main//321/201omponents/Chip/Chip.js +288 -0
- package/build/main//321/201omponents/Chip/Chip.js.map +1 -0
- package/build/main//321/201omponents/Chip/index.d.ts +1 -0
- package/build/main//321/201omponents/Chip/index.js +2 -0
- package/build/main//321/201omponents/Chip/index.js.map +1 -0
- package/build/main//321/201omponents/Chip/types.d.ts +39 -0
- package/build/main//321/201omponents/Chip/types.js +2 -0
- package/build/main//321/201omponents/Chip/types.js.map +1 -0
- package/build/main//321/201omponents/ChipDndContext/ChipDndContext.d.ts +13 -0
- package/build/main//321/201omponents/ChipDndContext/ChipDndContext.js +76 -0
- package/build/main//321/201omponents/ChipDndContext/ChipDndContext.js.map +1 -0
- package/build/main//321/201omponents/ChipDndContext/index.d.ts +1 -0
- package/build/main//321/201omponents/ChipDndContext/index.js +2 -0
- package/build/main//321/201omponents/ChipDndContext/index.js.map +1 -0
- package/build/main//321/201omponents/ConfirmationModal/ConfirmationModal.d.ts +4 -0
- package/build/main//321/201omponents/ConfirmationModal/ConfirmationModal.js +64 -0
- package/build/main//321/201omponents/ConfirmationModal/ConfirmationModal.js.map +1 -0
- package/build/main//321/201omponents/ConfirmationModal/index.d.ts +1 -0
- package/build/main//321/201omponents/ConfirmationModal/index.js +2 -0
- package/build/main//321/201omponents/ConfirmationModal/index.js.map +1 -0
- package/build/main//321/201omponents/ConfirmationModal/types.d.ts +31 -0
- package/build/main//321/201omponents/ConfirmationModal/types.js +2 -0
- package/build/main//321/201omponents/ConfirmationModal/types.js.map +1 -0
- package/build/main//321/201omponents/ContextMenu/ContextMenu.d.ts +4 -0
- package/build/main//321/201omponents/ContextMenu/ContextMenu.js +122 -0
- package/build/main//321/201omponents/ContextMenu/ContextMenu.js.map +1 -0
- package/build/main//321/201omponents/ContextMenu/index.d.ts +1 -0
- package/build/main//321/201omponents/ContextMenu/index.js +2 -0
- package/build/main//321/201omponents/ContextMenu/index.js.map +1 -0
- package/build/main//321/201omponents/ContextMenu/types.d.ts +41 -0
- package/build/main//321/201omponents/ContextMenu/types.js +2 -0
- package/build/main//321/201omponents/ContextMenu/types.js.map +1 -0
- package/build/main//321/201omponents/ContextMenuItem/ContextMenuItem.d.ts +4 -0
- package/build/main//321/201omponents/ContextMenuItem/ContextMenuItem.js +49 -0
- package/build/main//321/201omponents/ContextMenuItem/ContextMenuItem.js.map +1 -0
- package/build/main//321/201omponents/ContextMenuItem/index.d.ts +1 -0
- package/build/main//321/201omponents/ContextMenuItem/index.js +2 -0
- package/build/main//321/201omponents/ContextMenuItem/index.js.map +1 -0
- package/build/main//321/201omponents/ContextMenuItem/types.d.ts +28 -0
- package/build/main//321/201omponents/ContextMenuItem/types.js +6 -0
- package/build/main//321/201omponents/ContextMenuItem/types.js.map +1 -0
- package/build/main//321/201omponents/CustomSelect/CustomSelect.d.ts +12 -0
- package/build/main//321/201omponents/CustomSelect/CustomSelect.js +281 -0
- package/build/main//321/201omponents/CustomSelect/CustomSelect.js.map +1 -0
- package/build/main//321/201omponents/CustomSelect/index.d.ts +1 -0
- package/build/main//321/201omponents/CustomSelect/index.js +2 -0
- package/build/main//321/201omponents/CustomSelect/index.js.map +1 -0
- package/build/main//321/201omponents/CustomSelect/selectStyles.d.ts +16 -0
- package/build/main//321/201omponents/CustomSelect/selectStyles.js +77 -0
- package/build/main//321/201omponents/CustomSelect/selectStyles.js.map +1 -0
- package/build/main//321/201omponents/CustomSelect/types.d.ts +86 -0
- package/build/main//321/201omponents/CustomSelect/types.js +2 -0
- package/build/main//321/201omponents/CustomSelect/types.js.map +1 -0
- package/build/main//321/201omponents/CustomSelectProfiles/CustomSelectProfiles.d.ts +4 -0
- package/build/main//321/201omponents/CustomSelectProfiles/CustomSelectProfiles.js +67 -0
- package/build/main//321/201omponents/CustomSelectProfiles/CustomSelectProfiles.js.map +1 -0
- package/build/main//321/201omponents/CustomSelectProfiles/index.d.ts +1 -0
- package/build/main//321/201omponents/CustomSelectProfiles/index.js +2 -0
- package/build/main//321/201omponents/CustomSelectProfiles/index.js.map +1 -0
- package/build/main//321/201omponents/CustomSelectProfiles/selectStyles.d.ts +12 -0
- package/build/main//321/201omponents/CustomSelectProfiles/selectStyles.js +41 -0
- package/build/main//321/201omponents/CustomSelectProfiles/selectStyles.js.map +1 -0
- package/build/main//321/201omponents/CustomSelectProfiles/types.d.ts +13 -0
- package/build/main//321/201omponents/CustomSelectProfiles/types.js +2 -0
- package/build/main//321/201omponents/CustomSelectProfiles/types.js.map +1 -0
- package/build/main//321/201omponents/DragAndDrop/DragAndDrop.d.ts +4 -0
- package/build/main//321/201omponents/DragAndDrop/DragAndDrop.js +57 -0
- package/build/main//321/201omponents/DragAndDrop/DragAndDrop.js.map +1 -0
- package/build/main//321/201omponents/DragAndDrop/index.d.ts +1 -0
- package/build/main//321/201omponents/DragAndDrop/index.js +2 -0
- package/build/main//321/201omponents/DragAndDrop/index.js.map +1 -0
- package/build/main//321/201omponents/DragAndDrop/types.d.ts +24 -0
- package/build/main//321/201omponents/DragAndDrop/types.js +2 -0
- package/build/main//321/201omponents/DragAndDrop/types.js.map +1 -0
- package/build/main//321/201omponents/DraggablePopup/DraggablePopup.d.ts +4 -0
- package/build/main//321/201omponents/DraggablePopup/DraggablePopup.js +228 -0
- package/build/main//321/201omponents/DraggablePopup/DraggablePopup.js.map +1 -0
- package/build/main//321/201omponents/DraggablePopup/index.d.ts +1 -0
- package/build/main//321/201omponents/DraggablePopup/index.js +2 -0
- package/build/main//321/201omponents/DraggablePopup/index.js.map +1 -0
- package/build/main//321/201omponents/DraggablePopup/types.d.ts +90 -0
- package/build/main//321/201omponents/DraggablePopup/types.js +2 -0
- package/build/main//321/201omponents/DraggablePopup/types.js.map +1 -0
- package/build/main//321/201omponents/Error/Error.d.ts +4 -0
- package/build/main//321/201omponents/Error/Error.js +23 -0
- package/build/main//321/201omponents/Error/Error.js.map +1 -0
- package/build/main//321/201omponents/Error/index.d.ts +1 -0
- package/build/main//321/201omponents/Error/index.js +2 -0
- package/build/main//321/201omponents/Error/index.js.map +1 -0
- package/build/main//321/201omponents/Error/types.d.ts +10 -0
- package/build/main//321/201omponents/Error/types.js +2 -0
- package/build/main//321/201omponents/Error/types.js.map +1 -0
- package/build/main//321/201omponents/Flex/Flex.d.ts +2 -0
- package/build/main//321/201omponents/Flex/Flex.js +35 -0
- package/build/main//321/201omponents/Flex/Flex.js.map +1 -0
- package/build/main//321/201omponents/Flex/HFlex/HFlex.d.ts +5 -0
- package/build/main//321/201omponents/Flex/HFlex/HFlex.js +16 -0
- package/build/main//321/201omponents/Flex/HFlex/HFlex.js.map +1 -0
- package/build/main//321/201omponents/Flex/HFlex/index.d.ts +1 -0
- package/build/main//321/201omponents/Flex/HFlex/index.js +2 -0
- package/build/main//321/201omponents/Flex/HFlex/index.js.map +1 -0
- package/build/main//321/201omponents/Flex/VFlex/VFlex.d.ts +5 -0
- package/build/main//321/201omponents/Flex/VFlex/VFlex.js +16 -0
- package/build/main//321/201omponents/Flex/VFlex/VFlex.js.map +1 -0
- package/build/main//321/201omponents/Flex/VFlex/index.d.ts +1 -0
- package/build/main//321/201omponents/Flex/VFlex/index.js +2 -0
- package/build/main//321/201omponents/Flex/VFlex/index.js.map +1 -0
- package/build/main//321/201omponents/Flex/index.d.ts +3 -0
- package/build/main//321/201omponents/Flex/index.js +4 -0
- package/build/main//321/201omponents/Flex/index.js.map +1 -0
- package/build/main//321/201omponents/Flex/types.d.ts +21 -0
- package/build/main//321/201omponents/Flex/types.js +2 -0
- package/build/main//321/201omponents/Flex/types.js.map +1 -0
- package/build/main//321/201omponents/Header/Header.d.ts +5 -0
- package/build/main//321/201omponents/Header/Header.js +125 -0
- package/build/main//321/201omponents/Header/Header.js.map +1 -0
- package/build/main//321/201omponents/Header/index.d.ts +1 -0
- package/build/main//321/201omponents/Header/index.js +2 -0
- package/build/main//321/201omponents/Header/index.js.map +1 -0
- package/build/main//321/201omponents/Header/types.d.ts +47 -0
- package/build/main//321/201omponents/Header/types.js +2 -0
- package/build/main//321/201omponents/Header/types.js.map +1 -0
- package/build/main//321/201omponents/Input/Input.d.ts +4 -0
- package/build/main//321/201omponents/Input/Input.js +256 -0
- package/build/main//321/201omponents/Input/Input.js.map +1 -0
- package/build/main//321/201omponents/Input/index.d.ts +1 -0
- package/build/main//321/201omponents/Input/index.js +2 -0
- package/build/main//321/201omponents/Input/index.js.map +1 -0
- package/build/main//321/201omponents/Input/types.d.ts +37 -0
- package/build/main//321/201omponents/Input/types.js +2 -0
- package/build/main//321/201omponents/Input/types.js.map +1 -0
- package/build/main//321/201omponents/ListItem/ListItem.d.ts +23 -0
- package/build/main//321/201omponents/ListItem/ListItem.js +214 -0
- package/build/main//321/201omponents/ListItem/ListItem.js.map +1 -0
- package/build/main//321/201omponents/ListItem/index.d.ts +1 -0
- package/build/main//321/201omponents/ListItem/index.js +2 -0
- package/build/main//321/201omponents/ListItem/index.js.map +1 -0
- package/build/main//321/201omponents/ListItem/types.d.ts +47 -0
- package/build/main//321/201omponents/ListItem/types.js +2 -0
- package/build/main//321/201omponents/ListItem/types.js.map +1 -0
- package/build/main//321/201omponents/Loader/Loader.d.ts +4 -0
- package/build/main//321/201omponents/Loader/Loader.js +44 -0
- package/build/main//321/201omponents/Loader/Loader.js.map +1 -0
- package/build/main//321/201omponents/Loader/index.d.ts +1 -0
- package/build/main//321/201omponents/Loader/index.js +2 -0
- package/build/main//321/201omponents/Loader/index.js.map +1 -0
- package/build/main//321/201omponents/Loader/types.d.ts +18 -0
- package/build/main//321/201omponents/Loader/types.js +2 -0
- package/build/main//321/201omponents/Loader/types.js.map +1 -0
- package/build/main//321/201omponents/Modal/Modal.d.ts +5 -0
- package/build/main//321/201omponents/Modal/Modal.js +397 -0
- package/build/main//321/201omponents/Modal/Modal.js.map +1 -0
- package/build/main//321/201omponents/Modal/index.d.ts +1 -0
- package/build/main//321/201omponents/Modal/index.js +2 -0
- package/build/main//321/201omponents/Modal/index.js.map +1 -0
- package/build/main//321/201omponents/Modal/types.d.ts +77 -0
- package/build/main//321/201omponents/Modal/types.js +2 -0
- package/build/main//321/201omponents/Modal/types.js.map +1 -0
- package/build/main//321/201omponents/Notification/Notification.d.ts +4 -0
- package/build/main//321/201omponents/Notification/Notification.js +208 -0
- package/build/main//321/201omponents/Notification/Notification.js.map +1 -0
- package/build/main//321/201omponents/Notification/constants.d.ts +34 -0
- package/build/main//321/201omponents/Notification/constants.js +59 -0
- package/build/main//321/201omponents/Notification/constants.js.map +1 -0
- package/build/main//321/201omponents/Notification/index.d.ts +1 -0
- package/build/main//321/201omponents/Notification/index.js +2 -0
- package/build/main//321/201omponents/Notification/index.js.map +1 -0
- package/build/main//321/201omponents/Notification/types.d.ts +64 -0
- package/build/main//321/201omponents/Notification/types.js +2 -0
- package/build/main//321/201omponents/Notification/types.js.map +1 -0
- package/build/main//321/201omponents/Profile/Profile.d.ts +4 -0
- package/build/main//321/201omponents/Profile/Profile.js +42 -0
- package/build/main//321/201omponents/Profile/Profile.js.map +1 -0
- package/build/main//321/201omponents/Profile/index.d.ts +1 -0
- package/build/main//321/201omponents/Profile/index.js +2 -0
- package/build/main//321/201omponents/Profile/index.js.map +1 -0
- package/build/main//321/201omponents/Profile/types.d.ts +14 -0
- package/build/main//321/201omponents/Profile/types.js +2 -0
- package/build/main//321/201omponents/Profile/types.js.map +1 -0
- package/build/main//321/201omponents/ProgressBar/ProgressBar.d.ts +4 -0
- package/build/main//321/201omponents/ProgressBar/ProgressBar.js +66 -0
- package/build/main//321/201omponents/ProgressBar/ProgressBar.js.map +1 -0
- package/build/main//321/201omponents/ProgressBar/index.d.ts +1 -0
- package/build/main//321/201omponents/ProgressBar/index.js +2 -0
- package/build/main//321/201omponents/ProgressBar/index.js.map +1 -0
- package/build/main//321/201omponents/ProgressBar/types.d.ts +7 -0
- package/build/main//321/201omponents/ProgressBar/types.js +2 -0
- package/build/main//321/201omponents/ProgressBar/types.js.map +1 -0
- package/build/main//321/201omponents/RadioButton/RadioButton.d.ts +4 -0
- package/build/main//321/201omponents/RadioButton/RadioButton.js +33 -0
- package/build/main//321/201omponents/RadioButton/RadioButton.js.map +1 -0
- package/build/main//321/201omponents/RadioButton/index.d.ts +1 -0
- package/build/main//321/201omponents/RadioButton/index.js +2 -0
- package/build/main//321/201omponents/RadioButton/index.js.map +1 -0
- package/build/main//321/201omponents/RadioButton/types.d.ts +12 -0
- package/build/main//321/201omponents/RadioButton/types.js +2 -0
- package/build/main//321/201omponents/RadioButton/types.js.map +1 -0
- package/build/main//321/201omponents/ScrollBar/ScrollBar.d.ts +5 -0
- package/build/main//321/201omponents/ScrollBar/ScrollBar.js +140 -0
- package/build/main//321/201omponents/ScrollBar/ScrollBar.js.map +1 -0
- package/build/main//321/201omponents/ScrollBar/index.d.ts +1 -0
- package/build/main//321/201omponents/ScrollBar/index.js +2 -0
- package/build/main//321/201omponents/ScrollBar/index.js.map +1 -0
- package/build/main//321/201omponents/ScrollBar/types.d.ts +24 -0
- package/build/main//321/201omponents/ScrollBar/types.js +2 -0
- package/build/main//321/201omponents/ScrollBar/types.js.map +1 -0
- package/build/main//321/201omponents/Skeleton/Skeleton.d.ts +4 -0
- package/build/main//321/201omponents/Skeleton/Skeleton.js +59 -0
- package/build/main//321/201omponents/Skeleton/Skeleton.js.map +1 -0
- package/build/main//321/201omponents/Skeleton/index.d.ts +1 -0
- package/build/main//321/201omponents/Skeleton/index.js +2 -0
- package/build/main//321/201omponents/Skeleton/index.js.map +1 -0
- package/build/main//321/201omponents/Skeleton/types.d.ts +17 -0
- package/build/main//321/201omponents/Skeleton/types.js +2 -0
- package/build/main//321/201omponents/Skeleton/types.js.map +1 -0
- package/build/main//321/201omponents/Stories/Stories.d.ts +4 -0
- package/build/main//321/201omponents/Stories/Stories.js +406 -0
- package/build/main//321/201omponents/Stories/Stories.js.map +1 -0
- package/build/main//321/201omponents/Stories/index.d.ts +1 -0
- package/build/main//321/201omponents/Stories/index.js +2 -0
- package/build/main//321/201omponents/Stories/index.js.map +1 -0
- package/build/main//321/201omponents/Stories/types.d.ts +71 -0
- package/build/main//321/201omponents/Stories/types.js +16 -0
- package/build/main//321/201omponents/Stories/types.js.map +1 -0
- package/build/main//321/201omponents/Switcher/Switcher.d.ts +4 -0
- package/build/main//321/201omponents/Switcher/Switcher.js +34 -0
- package/build/main//321/201omponents/Switcher/Switcher.js.map +1 -0
- package/build/main//321/201omponents/Switcher/index.d.ts +1 -0
- package/build/main//321/201omponents/Switcher/index.js +2 -0
- package/build/main//321/201omponents/Switcher/index.js.map +1 -0
- package/build/main//321/201omponents/Switcher/types.d.ts +8 -0
- package/build/main//321/201omponents/Switcher/types.js +2 -0
- package/build/main//321/201omponents/Switcher/types.js.map +1 -0
- package/build/main//321/201omponents/SyncLoader/SyncLoader.d.ts +5 -0
- package/build/main//321/201omponents/SyncLoader/SyncLoader.js +65 -0
- package/build/main//321/201omponents/SyncLoader/SyncLoader.js.map +1 -0
- package/build/main//321/201omponents/SyncLoader/index.d.ts +1 -0
- package/build/main//321/201omponents/SyncLoader/index.js +2 -0
- package/build/main//321/201omponents/SyncLoader/index.js.map +1 -0
- package/build/main//321/201omponents/SyncLoader/types.d.ts +8 -0
- package/build/main//321/201omponents/SyncLoader/types.js +2 -0
- package/build/main//321/201omponents/SyncLoader/types.js.map +1 -0
- package/build/main//321/201omponents/Textarea/Textarea.d.ts +4 -0
- package/build/main//321/201omponents/Textarea/Textarea.js +59 -0
- package/build/main//321/201omponents/Textarea/Textarea.js.map +1 -0
- package/build/main//321/201omponents/Textarea/index.d.ts +1 -0
- package/build/main//321/201omponents/Textarea/index.js +2 -0
- package/build/main//321/201omponents/Textarea/index.js.map +1 -0
- package/build/main//321/201omponents/Textarea/types.d.ts +13 -0
- package/build/main//321/201omponents/Textarea/types.js +2 -0
- package/build/main//321/201omponents/Textarea/types.js.map +1 -0
- package/build/main//321/201omponents/Toggle/Toggle.d.ts +4 -0
- package/build/main//321/201omponents/Toggle/Toggle.js +35 -0
- package/build/main//321/201omponents/Toggle/Toggle.js.map +1 -0
- package/build/main//321/201omponents/Toggle/index.d.ts +1 -0
- package/build/main//321/201omponents/Toggle/index.js +2 -0
- package/build/main//321/201omponents/Toggle/index.js.map +1 -0
- package/build/main//321/201omponents/Toggle/types.d.ts +12 -0
- package/build/main//321/201omponents/Toggle/types.js +2 -0
- package/build/main//321/201omponents/Toggle/types.js.map +1 -0
- package/build/main//321/201omponents/UserDropdown/ContactBottomSheet/ContactBottomSheet.d.ts +4 -0
- package/build/main//321/201omponents/UserDropdown/ContactBottomSheet/ContactBottomSheet.js +40 -0
- package/build/main//321/201omponents/UserDropdown/ContactBottomSheet/ContactBottomSheet.js.map +1 -0
- package/build/main//321/201omponents/UserDropdown/ContactInfo/ContactInfo.d.ts +4 -0
- package/build/main//321/201omponents/UserDropdown/ContactInfo/ContactInfo.js +98 -0
- package/build/main//321/201omponents/UserDropdown/ContactInfo/ContactInfo.js.map +1 -0
- package/build/main//321/201omponents/UserDropdown/LoadingMessage/LoadingMessage.d.ts +5 -0
- package/build/main//321/201omponents/UserDropdown/LoadingMessage/LoadingMessage.js +24 -0
- package/build/main//321/201omponents/UserDropdown/LoadingMessage/LoadingMessage.js.map +1 -0
- package/build/main//321/201omponents/UserDropdown/MenuList/MenuList.d.ts +4 -0
- package/build/main//321/201omponents/UserDropdown/MenuList/MenuList.js +104 -0
- package/build/main//321/201omponents/UserDropdown/MenuList/MenuList.js.map +1 -0
- package/build/main//321/201omponents/UserDropdown/MultiValueLabel/MultiValueLabel.d.ts +4 -0
- package/build/main//321/201omponents/UserDropdown/MultiValueLabel/MultiValueLabel.js +133 -0
- package/build/main//321/201omponents/UserDropdown/MultiValueLabel/MultiValueLabel.js.map +1 -0
- package/build/main//321/201omponents/UserDropdown/Option/Option.d.ts +4 -0
- package/build/main//321/201omponents/UserDropdown/Option/Option.js +85 -0
- package/build/main//321/201omponents/UserDropdown/Option/Option.js.map +1 -0
- package/build/main//321/201omponents/UserDropdown/SearchInCatalogButton/SearchInCatalogButton.d.ts +4 -0
- package/build/main//321/201omponents/UserDropdown/SearchInCatalogButton/SearchInCatalogButton.js +41 -0
- package/build/main//321/201omponents/UserDropdown/SearchInCatalogButton/SearchInCatalogButton.js.map +1 -0
- package/build/main//321/201omponents/UserDropdown/UserDropdown.d.ts +5 -0
- package/build/main//321/201omponents/UserDropdown/UserDropdown.js +527 -0
- package/build/main//321/201omponents/UserDropdown/UserDropdown.js.map +1 -0
- package/build/main//321/201omponents/UserDropdown/components/Delimiter.d.ts +8 -0
- package/build/main//321/201omponents/UserDropdown/components/Delimiter.js +10 -0
- package/build/main//321/201omponents/UserDropdown/components/Delimiter.js.map +1 -0
- package/build/main//321/201omponents/UserDropdown/components/Hint.d.ts +6 -0
- package/build/main//321/201omponents/UserDropdown/components/Hint.js +21 -0
- package/build/main//321/201omponents/UserDropdown/components/Hint.js.map +1 -0
- package/build/main//321/201omponents/UserDropdown/components/Input.d.ts +2 -0
- package/build/main//321/201omponents/UserDropdown/components/Input.js +24 -0
- package/build/main//321/201omponents/UserDropdown/components/Input.js.map +1 -0
- package/build/main//321/201omponents/UserDropdown/components/Mask.d.ts +8 -0
- package/build/main//321/201omponents/UserDropdown/components/Mask.js +19 -0
- package/build/main//321/201omponents/UserDropdown/components/Mask.js.map +1 -0
- package/build/main//321/201omponents/UserDropdown/components/Title.d.ts +5 -0
- package/build/main//321/201omponents/UserDropdown/components/Title.js +18 -0
- package/build/main//321/201omponents/UserDropdown/components/Title.js.map +1 -0
- package/build/main//321/201omponents/UserDropdown/constants.d.ts +65 -0
- package/build/main//321/201omponents/UserDropdown/constants.js +83 -0
- package/build/main//321/201omponents/UserDropdown/constants.js.map +1 -0
- package/build/main//321/201omponents/UserDropdown/helpers.d.ts +148 -0
- package/build/main//321/201omponents/UserDropdown/helpers.js +313 -0
- package/build/main//321/201omponents/UserDropdown/helpers.js.map +1 -0
- package/build/main//321/201omponents/UserDropdown/index.d.ts +1 -0
- package/build/main//321/201omponents/UserDropdown/index.js +2 -0
- package/build/main//321/201omponents/UserDropdown/index.js.map +1 -0
- package/build/main//321/201omponents/UserDropdown/selectStyles.d.ts +15 -0
- package/build/main//321/201omponents/UserDropdown/selectStyles.js +99 -0
- package/build/main//321/201omponents/UserDropdown/selectStyles.js.map +1 -0
- package/build/main//321/201omponents/UserDropdown/types.d.ts +356 -0
- package/build/main//321/201omponents/UserDropdown/types.js +2 -0
- package/build/main//321/201omponents/UserDropdown/types.js.map +1 -0
- package/build/main//321/201omponents/types.d.ts +2 -0
- package/build/main//321/201omponents/types.js +2 -0
- package/build/main//321/201omponents/types.js.map +1 -0
- package/package.json +13 -8
|
@@ -0,0 +1,254 @@
|
|
|
1
|
+
var __assign = (this && this.__assign) || function () {
|
|
2
|
+
__assign = Object.assign || function(t) {
|
|
3
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
4
|
+
s = arguments[i];
|
|
5
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
6
|
+
t[p] = s[p];
|
|
7
|
+
}
|
|
8
|
+
return t;
|
|
9
|
+
};
|
|
10
|
+
return __assign.apply(this, arguments);
|
|
11
|
+
};
|
|
12
|
+
var _a;
|
|
13
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
14
|
+
import { memo, useCallback, useEffect, useRef, useState } from 'react';
|
|
15
|
+
import Popup from 'reactjs-popup';
|
|
16
|
+
import classNames from 'classnames';
|
|
17
|
+
import { isNull, isString } from 'lodash';
|
|
18
|
+
import { calculatePercentageOfValue, createInitials, generateFontFamilyStyle, isDarkTheme, userNameToColor } from '../../helpers';
|
|
19
|
+
import { COLORS, LANGUAGES, MAX_NUMBER_OF_CHARACTERS_IN_INITIALS, POPUP_ON_EVENT_TYPE, POPUP_VERTICAL_POSITION, THEME, } from '../../constants';
|
|
20
|
+
import { AVATAR_SIZES, AvatarFontSizes } from './types';
|
|
21
|
+
import { ReactComponent as AcceptedInviteStatusIcon } from '../../assets/icons/accepted-invite-status.svg';
|
|
22
|
+
import { ReactComponent as CrownIcon } from '../../assets/icons/crown.svg';
|
|
23
|
+
import { ReactComponent as DeclinedInviteStatusIcon } from '../../assets/icons/declined-invite-status.svg';
|
|
24
|
+
import { ReactComponent as InfoIcon } from '../../assets/icons/info.svg';
|
|
25
|
+
import { ReactComponent as NeedsActionInviteStatusIcon } from '../../assets/icons/needs-action-invite-status.svg';
|
|
26
|
+
import { ReactComponent as PrivateIcon } from '../../assets/icons/private.svg';
|
|
27
|
+
import { ReactComponent as TickIcon } from '../../assets/icons/tick.svg';
|
|
28
|
+
import { ReactComponent as WarningIcon } from '../../assets/icons/warning-avatar.svg';
|
|
29
|
+
import '../../styles/styles.scss';
|
|
30
|
+
var PERCENTS;
|
|
31
|
+
(function (PERCENTS) {
|
|
32
|
+
PERCENTS[PERCENTS["pct_4_7"] = 4.7] = "pct_4_7";
|
|
33
|
+
PERCENTS[PERCENTS["pct_5"] = 5] = "pct_5";
|
|
34
|
+
PERCENTS[PERCENTS["pct_8"] = 8] = "pct_8";
|
|
35
|
+
PERCENTS[PERCENTS["pct_10"] = 10] = "pct_10";
|
|
36
|
+
PERCENTS[PERCENTS["pct_15"] = 15] = "pct_15";
|
|
37
|
+
PERCENTS[PERCENTS["pct_25"] = 25] = "pct_25";
|
|
38
|
+
PERCENTS[PERCENTS["pct_40"] = 40] = "pct_40";
|
|
39
|
+
PERCENTS[PERCENTS["pct_50"] = 50] = "pct_50";
|
|
40
|
+
PERCENTS[PERCENTS["pct_57"] = 57] = "pct_57";
|
|
41
|
+
PERCENTS[PERCENTS["pct_58"] = 58] = "pct_58";
|
|
42
|
+
PERCENTS[PERCENTS["pct_60"] = 60] = "pct_60";
|
|
43
|
+
PERCENTS[PERCENTS["pct_62_5"] = 62.5] = "pct_62_5";
|
|
44
|
+
PERCENTS[PERCENTS["pct_75"] = 75] = "pct_75";
|
|
45
|
+
PERCENTS[PERCENTS["pct_90"] = 90] = "pct_90";
|
|
46
|
+
PERCENTS[PERCENTS["pct_100"] = 100] = "pct_100";
|
|
47
|
+
})(PERCENTS || (PERCENTS = {}));
|
|
48
|
+
var AVATAR_OPACITY = 0.5;
|
|
49
|
+
var USER_INITIALS_OPACITY = 0.3;
|
|
50
|
+
var POPUP_APPEARANCE_DELAY = 500;
|
|
51
|
+
var POPUP_HIDDEN_CLASSNAME = 'private-icon-hidden';
|
|
52
|
+
var POPUP_PADDINGS = 16;
|
|
53
|
+
var POPUP_INDENTS = 24; // paddings + margins
|
|
54
|
+
var POPUP_LEFT_OFFSET = 36;
|
|
55
|
+
var CHIP_TOP_PADDING = 7;
|
|
56
|
+
var POPUP_VERTICAL_OFFSET = 4;
|
|
57
|
+
var POPUP_TEXT = (_a = {},
|
|
58
|
+
_a[LANGUAGES.ru] = 'Невозможно отобразить расписание участника',
|
|
59
|
+
_a[LANGUAGES.en] = 'Unable to display the schedule of participant',
|
|
60
|
+
_a[LANGUAGES.de] = 'Der Zeitplan des Teilnehmers kann nicht angezeigt werden',
|
|
61
|
+
_a[LANGUAGES.es] = 'No se puede mostrar el calendario de participantes',
|
|
62
|
+
_a[LANGUAGES.fr] = "Impossible d'afficher l'horaire du participant",
|
|
63
|
+
_a[LANGUAGES.ar] = 'غير قادر على عرض جدول المشاركين',
|
|
64
|
+
_a[LANGUAGES.ms] = 'Tidak dapat memapar jadual peserta',
|
|
65
|
+
_a[LANGUAGES.tr] = 'Katılımcının programı görüntülenemiyor',
|
|
66
|
+
_a[LANGUAGES.id] = 'Tidak dapat menampilkan jadwal peserta',
|
|
67
|
+
_a[LANGUAGES.uz] = 'Ishtirokchi jadvalini ko‘rsatib bo‘lmadi',
|
|
68
|
+
_a[LANGUAGES.kk] = 'Қатысушының кестесін көрсету мүмкін емес',
|
|
69
|
+
_a);
|
|
70
|
+
var INVITE_STATUS_ICONS = {
|
|
71
|
+
accepted: AcceptedInviteStatusIcon,
|
|
72
|
+
declined: DeclinedInviteStatusIcon,
|
|
73
|
+
needsAction: NeedsActionInviteStatusIcon,
|
|
74
|
+
};
|
|
75
|
+
var Avatar = function (_a) {
|
|
76
|
+
var _b = _a.theme, theme = _b === void 0 ? THEME.default : _b, _c = _a.language, language = _c === void 0 ? LANGUAGES.ru : _c, fontFamily = _a.fontFamily, className = _a.className, styles = _a.styles, avatarRef = _a.avatarRef, isSelected = _a.isSelected, isHighlighted = _a.isHighlighted, isInactive = _a.isInactive, isSpam = _a.isSpam, isWarning = _a.isWarning, isCrown = _a.isCrown, isEye = _a.isEye, _d = _a.isTooltipAvailableOnEye, isTooltipAvailableOnEye = _d === void 0 ? false : _d, _e = _a.size, size = _e === void 0 ? 44 : _e, _f = _a.username, username = _f === void 0 ? '' : _f, initials = _a.initials, avatar = _a.avatar, _g = _a.counter, counter = _g === void 0 ? 0 : _g, inviteStatus = _a.inviteStatus, icon = _a.icon, _h = _a.outlineDefaultBackground, outlineDefaultBackground = _h === void 0 ? COLORS.white : _h, _j = _a.outlineDarkBackground, outlineDarkBackground = _j === void 0 ? COLORS.brightBlack : _j, _k = _a.onClick, onClick = _k === void 0 ? function () { return undefined; } : _k, onMouseDown = _a.onMouseDown;
|
|
77
|
+
var popupRef = useRef(null);
|
|
78
|
+
var popupContentRef = useRef(null);
|
|
79
|
+
var avatarLocalRef = useRef(null);
|
|
80
|
+
var _l = useState(-1), popupLeft = _l[0], setPopupLeft = _l[1];
|
|
81
|
+
var _m = useState(-1), popupArrowLeft = _m[0], setPopupArrowLeft = _m[1];
|
|
82
|
+
var _o = useState(-1), popupTop = _o[0], setPopupTop = _o[1];
|
|
83
|
+
var _p = useState(POPUP_VERTICAL_POSITION.top), popupVerticalPosition = _p[0], setPopupVerticalPosition = _p[1];
|
|
84
|
+
var _q = useState(0), popupMaxWidth = _q[0], setPopupMaxWidth = _q[1];
|
|
85
|
+
var _r = useState(null), timeoutId = _r[0], setTimeoutId = _r[1];
|
|
86
|
+
var _s = useState(POPUP_HIDDEN_CLASSNAME), hiddenClassName = _s[0], setHiddenClassName = _s[1];
|
|
87
|
+
var inactiveOpacity = avatar ? AVATAR_OPACITY : USER_INITIALS_OPACITY;
|
|
88
|
+
var outlineBackground = isDarkTheme(theme) ? outlineDarkBackground : outlineDefaultBackground;
|
|
89
|
+
var outlineWidth = calculatePercentageOfValue({ value: size, percentage: PERCENTS.pct_4_7, shouldBeRounded: false });
|
|
90
|
+
var generateFontSizeAvatar = function () {
|
|
91
|
+
switch (size) {
|
|
92
|
+
case AVATAR_SIZES.size_16:
|
|
93
|
+
return AvatarFontSizes.xxxSmall;
|
|
94
|
+
case AVATAR_SIZES.size_20:
|
|
95
|
+
return AvatarFontSizes.xxSmall;
|
|
96
|
+
case AVATAR_SIZES.size_24:
|
|
97
|
+
return AvatarFontSizes.xSmall;
|
|
98
|
+
case AVATAR_SIZES.size_32:
|
|
99
|
+
return AvatarFontSizes.small;
|
|
100
|
+
case AVATAR_SIZES.size_36:
|
|
101
|
+
return AvatarFontSizes.normal;
|
|
102
|
+
case AVATAR_SIZES.size_40:
|
|
103
|
+
return AvatarFontSizes.xNormal;
|
|
104
|
+
case AVATAR_SIZES.size_44:
|
|
105
|
+
case AVATAR_SIZES.size_48:
|
|
106
|
+
return AvatarFontSizes.medium;
|
|
107
|
+
case AVATAR_SIZES.size_56:
|
|
108
|
+
case AVATAR_SIZES.size_64:
|
|
109
|
+
case AVATAR_SIZES.size_80:
|
|
110
|
+
return AvatarFontSizes.large;
|
|
111
|
+
case AVATAR_SIZES.size_100:
|
|
112
|
+
return AvatarFontSizes.xLarge;
|
|
113
|
+
case AVATAR_SIZES.size_160:
|
|
114
|
+
return AvatarFontSizes.xxLarge;
|
|
115
|
+
case AVATAR_SIZES.size_200:
|
|
116
|
+
return AvatarFontSizes.xxxLarge;
|
|
117
|
+
}
|
|
118
|
+
};
|
|
119
|
+
var renderUserInitials = function () { return (initials === null || initials === void 0 ? void 0 : initials.slice(0, MAX_NUMBER_OF_CHARACTERS_IN_INITIALS).toUpperCase()) || createInitials(username); };
|
|
120
|
+
var renderAvatarImage = function () {
|
|
121
|
+
if (avatar)
|
|
122
|
+
return isString(avatar) ? _jsx("img", { src: avatar, alt: "avatar" }) : avatar;
|
|
123
|
+
else
|
|
124
|
+
return renderUserInitials();
|
|
125
|
+
};
|
|
126
|
+
var renderContent = function () {
|
|
127
|
+
if (isWarning) {
|
|
128
|
+
var warningSize = calculatePercentageOfValue({ value: size, percentage: size === AVATAR_SIZES.size_32 ? PERCENTS.pct_90 : PERCENTS.pct_100 });
|
|
129
|
+
return _jsx(WarningIcon, { color: COLORS.iconNegative, width: warningSize, height: warningSize });
|
|
130
|
+
}
|
|
131
|
+
if (isSelected) {
|
|
132
|
+
var tickSize = calculatePercentageOfValue({ value: size, percentage: PERCENTS.pct_57 });
|
|
133
|
+
return _jsx(TickIcon, { width: tickSize, height: tickSize });
|
|
134
|
+
}
|
|
135
|
+
if (isSpam) {
|
|
136
|
+
var infoSize = calculatePercentageOfValue({ value: size, percentage: PERCENTS.pct_60 });
|
|
137
|
+
return _jsx(InfoIcon, { width: infoSize, height: infoSize });
|
|
138
|
+
}
|
|
139
|
+
if (icon) {
|
|
140
|
+
var iconSize = calculatePercentageOfValue({ value: size, percentage: PERCENTS.pct_62_5 });
|
|
141
|
+
var iconSizeInPx = "".concat(iconSize, "px");
|
|
142
|
+
return (_jsx("div", __assign({ className: "smartapp-avatar__content--icon", style: { width: iconSizeInPx, height: iconSizeInPx } }, { children: icon })));
|
|
143
|
+
}
|
|
144
|
+
return renderAvatarImage();
|
|
145
|
+
};
|
|
146
|
+
var renderCounter = function () {
|
|
147
|
+
var isSingleDigitNumber = counter <= 9;
|
|
148
|
+
var counterText = isSingleDigitNumber ? counter : '9+';
|
|
149
|
+
var width = calculatePercentageOfValue({ value: size, percentage: isSingleDigitNumber ? PERCENTS.pct_40 : PERCENTS.pct_50 });
|
|
150
|
+
var height = calculatePercentageOfValue({ value: size, percentage: PERCENTS.pct_40 });
|
|
151
|
+
var fontSize = calculatePercentageOfValue({ value: height, percentage: PERCENTS.pct_75 });
|
|
152
|
+
var top = calculatePercentageOfValue({ value: size, percentage: PERCENTS.pct_10 });
|
|
153
|
+
var right = calculatePercentageOfValue({ value: size, percentage: PERCENTS.pct_15 });
|
|
154
|
+
var borderWidth = calculatePercentageOfValue({ value: size, percentage: PERCENTS.pct_5, shouldBeRounded: false });
|
|
155
|
+
var borderRadius = isSingleDigitNumber ? '50%' : "".concat(height * 1.5625, "px");
|
|
156
|
+
return (_jsx("div", __assign({ className: "smartapp-avatar__content--counter", style: {
|
|
157
|
+
width: "".concat(width, "px"),
|
|
158
|
+
height: "".concat(height, "px"),
|
|
159
|
+
top: "-".concat(top, "px"),
|
|
160
|
+
right: "-".concat(right, "px"),
|
|
161
|
+
fontSize: "".concat(fontSize, "px"),
|
|
162
|
+
border: "".concat(borderWidth, "px solid ").concat(outlineBackground),
|
|
163
|
+
borderRadius: borderRadius,
|
|
164
|
+
} }, { children: counterText })));
|
|
165
|
+
};
|
|
166
|
+
useEffect(function () {
|
|
167
|
+
setPopupMaxWidth(window.innerWidth - POPUP_INDENTS);
|
|
168
|
+
setPopupVerticalPosition(POPUP_VERTICAL_POSITION.top);
|
|
169
|
+
setPopupLeft(-1);
|
|
170
|
+
setPopupTop(-1);
|
|
171
|
+
setPopupArrowLeft(-1);
|
|
172
|
+
setHiddenClassName(POPUP_HIDDEN_CLASSNAME);
|
|
173
|
+
}, [language, size]);
|
|
174
|
+
var calculateBorderWidth = useCallback(function () {
|
|
175
|
+
var avatarElement = (avatarRef === null || avatarRef === void 0 ? void 0 : avatarRef.current) || (avatarLocalRef === null || avatarLocalRef === void 0 ? void 0 : avatarLocalRef.current);
|
|
176
|
+
if (isNull(avatarElement))
|
|
177
|
+
return;
|
|
178
|
+
var borderWidth = window.getComputedStyle(avatarElement).borderWidth;
|
|
179
|
+
avatarElement.style.setProperty('--avatar-border-width', borderWidth);
|
|
180
|
+
}, [avatarRef]);
|
|
181
|
+
useEffect(function () {
|
|
182
|
+
if (isHighlighted)
|
|
183
|
+
calculateBorderWidth();
|
|
184
|
+
}, [calculateBorderWidth, isHighlighted, size]);
|
|
185
|
+
var handleOpenPopup = function (privateIconRight) {
|
|
186
|
+
var popupRefCurrent = popupRef.current;
|
|
187
|
+
var popupContentRefCurrent = popupContentRef.current;
|
|
188
|
+
var avatarRefCurrent = (avatarRef === null || avatarRef === void 0 ? void 0 : avatarRef.current) || avatarLocalRef.current;
|
|
189
|
+
if (popupRefCurrent && popupContentRefCurrent && avatarRefCurrent) {
|
|
190
|
+
var _a = avatarRefCurrent.getBoundingClientRect(), avatarLeft = _a.left, top_1 = _a.top, right = _a.right;
|
|
191
|
+
var _b = popupContentRefCurrent.getBoundingClientRect(), popupContentWidth = _b.width, height = _b.height;
|
|
192
|
+
var popupContentWidthWithIndents = popupContentWidth + POPUP_INDENTS;
|
|
193
|
+
var nextLeft = avatarLeft - POPUP_LEFT_OFFSET;
|
|
194
|
+
var popupContentRightmostPosition = nextLeft + popupContentWidthWithIndents;
|
|
195
|
+
var popupContentOutsideScreen = popupContentRightmostPosition - window.innerWidth;
|
|
196
|
+
var finalNextLeftValue = Math.max(nextLeft - Math.max(popupContentOutsideScreen, 0), 0);
|
|
197
|
+
var popupHeight = height + POPUP_PADDINGS;
|
|
198
|
+
var nextTop = top_1 - popupHeight - CHIP_TOP_PADDING;
|
|
199
|
+
var isBottomPosition = nextTop < 0;
|
|
200
|
+
var nextTopValue = isBottomPosition ? top_1 + size + POPUP_VERTICAL_OFFSET : nextTop;
|
|
201
|
+
var nextPopupArrowLeft = right - finalNextLeftValue - privateIconRight / 2;
|
|
202
|
+
if (popupLeft !== finalNextLeftValue || popupTop !== nextTopValue || popupMaxWidth !== popupContentWidth) {
|
|
203
|
+
popupRefCurrent.close();
|
|
204
|
+
setPopupVerticalPosition(isBottomPosition ? POPUP_VERTICAL_POSITION.bottom : POPUP_VERTICAL_POSITION.top);
|
|
205
|
+
setPopupLeft(finalNextLeftValue);
|
|
206
|
+
setPopupTop(nextTopValue);
|
|
207
|
+
setPopupArrowLeft(nextPopupArrowLeft);
|
|
208
|
+
setPopupMaxWidth(popupContentWidth);
|
|
209
|
+
var nextTimeoutId = setTimeout(function () { var _a; return (_a = popupRef.current) === null || _a === void 0 ? void 0 : _a.open(); }, 0);
|
|
210
|
+
setTimeoutId(nextTimeoutId);
|
|
211
|
+
}
|
|
212
|
+
setHiddenClassName('');
|
|
213
|
+
}
|
|
214
|
+
};
|
|
215
|
+
var handleClosePopup = function () { return timeoutId && clearTimeout(timeoutId); };
|
|
216
|
+
var generatePopupContentStyle = function () { return (__assign({ '--private-icon-content-top': "".concat(popupTop, "px"), '--private-icon-content-left': "".concat(popupLeft, "px"), '--private-icon-arrow-left': "".concat(popupArrowLeft, "px"), '--private-icon-content-max-width': "".concat(popupMaxWidth, "px") }, generateFontFamilyStyle(fontFamily))); };
|
|
217
|
+
var renderEye = function () {
|
|
218
|
+
var inset = calculatePercentageOfValue({ value: size, percentage: PERCENTS.pct_8 });
|
|
219
|
+
var right = calculatePercentageOfValue({ value: size, percentage: PERCENTS.pct_25 });
|
|
220
|
+
var eyeSize = calculatePercentageOfValue({ value: size, percentage: PERCENTS.pct_58 });
|
|
221
|
+
return (_jsx(Popup, __assign({ ref: popupRef, arrow: false, disabled: !isTooltipAvailableOnEye, onOpen: function () { return handleOpenPopup(right); }, onClose: handleClosePopup, className: classNames('private-icon', hiddenClassName), position: "".concat(popupVerticalPosition, " center"), contentStyle: generatePopupContentStyle(), on: [POPUP_ON_EVENT_TYPE.hover], mouseEnterDelay: POPUP_APPEARANCE_DELAY, trigger: function () { return (_jsx(PrivateIcon, { className: "smartapp-avatar__content--eye", width: eyeSize, height: eyeSize, color: outlineBackground, style: { top: "-".concat(inset, "px"), right: "-".concat(inset, "px") } })); } }, { children: _jsx("span", __assign({ ref: popupContentRef }, { children: POPUP_TEXT[language] })) })));
|
|
222
|
+
};
|
|
223
|
+
var renderInviteStatus = function () {
|
|
224
|
+
if (!inviteStatus)
|
|
225
|
+
return;
|
|
226
|
+
var inset = calculatePercentageOfValue({ value: size, percentage: PERCENTS.pct_8 });
|
|
227
|
+
var inviteStatusSize = calculatePercentageOfValue({ value: size, percentage: PERCENTS.pct_58 });
|
|
228
|
+
var Icon = INVITE_STATUS_ICONS[inviteStatus];
|
|
229
|
+
return (_jsx(Icon, { className: "smartapp-avatar__content--invite-status", width: inviteStatusSize, height: inviteStatusSize, color: outlineBackground, style: { bottom: "-".concat(inset, "px"), right: "-".concat(inset, "px") } }));
|
|
230
|
+
};
|
|
231
|
+
var renderCrown = function () {
|
|
232
|
+
var bottom = calculatePercentageOfValue({ value: size, percentage: PERCENTS.pct_10 });
|
|
233
|
+
var right = calculatePercentageOfValue({ value: size, percentage: PERCENTS.pct_15 });
|
|
234
|
+
var crownSize = calculatePercentageOfValue({ value: size, percentage: PERCENTS.pct_50 });
|
|
235
|
+
return (_jsx(CrownIcon, { className: "smartapp-avatar__content--crown", width: crownSize, height: crownSize, color: outlineBackground, style: { bottom: "-".concat(bottom, "px"), right: "-".concat(right, "px") } }));
|
|
236
|
+
};
|
|
237
|
+
var generateBackgroundValueForStyles = function () { return (isWarning ? COLORS.iconTransparentPressed : userNameToColor(initials || username)); };
|
|
238
|
+
var generateAvatarContentStyles = function () { return ({
|
|
239
|
+
width: "".concat(size, "px"),
|
|
240
|
+
minWidth: "".concat(size, "px"),
|
|
241
|
+
height: "".concat(size, "px"),
|
|
242
|
+
fontSize: generateFontSizeAvatar(),
|
|
243
|
+
background: isInactive
|
|
244
|
+
? "linear-gradient(180deg, ".concat(COLORS.inactiveAvatarGradientStart, " 0%, ").concat(COLORS.inactiveAvatarGradientEnd, " 100%)")
|
|
245
|
+
: generateBackgroundValueForStyles(),
|
|
246
|
+
opacity: isInactive ? inactiveOpacity : 1,
|
|
247
|
+
}); };
|
|
248
|
+
return (_jsx("div", __assign({ ref: avatarRef || avatarLocalRef, className: classNames('smartapp-avatar', "smartapp-avatar__".concat(theme), { 'smartapp-avatar__outline': isHighlighted }, className), style: __assign(__assign({ '--avatar-outline-width': "".concat(outlineWidth, "px") }, generateFontFamilyStyle(fontFamily)), styles), onClick: onClick, onMouseDown: onMouseDown }, { children: _jsxs("div", __assign({ style: generateAvatarContentStyles(), className: classNames('smartapp-avatar__content', {
|
|
249
|
+
'smartapp-avatar__content--spam': isSpam,
|
|
250
|
+
'smartapp-avatar__content--inactive': isInactive,
|
|
251
|
+
}) }, { children: [!!counter && renderCounter(), isEye && renderEye(), renderInviteStatus(), renderContent(), isCrown && renderCrown()] })) })));
|
|
252
|
+
};
|
|
253
|
+
export default memo(Avatar);
|
|
254
|
+
//# sourceMappingURL=Avatar.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Avatar.js","sourceRoot":"","sources":["../../../../src/сomponents/Avatar/Avatar.tsx"],"names":[],"mappings":";;;;;;;;;;;;;AAAA,OAAc,EAAiB,IAAI,EAAE,WAAW,EAAE,SAAS,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAA;AAC5F,OAAO,KAAK,MAAM,eAAe,CAAA;AAEjC,OAAO,UAAU,MAAM,YAAY,CAAA;AACnC,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,QAAQ,CAAA;AACzC,OAAO,EAAE,0BAA0B,EAAE,cAAc,EAAE,uBAAuB,EAAE,WAAW,EAAE,eAAe,EAAE,MAAM,eAAe,CAAA;AACjI,OAAO,EACL,MAAM,EACN,SAAS,EACT,oCAAoC,EACpC,mBAAmB,EACnB,uBAAuB,EACvB,KAAK,GAGN,MAAM,iBAAiB,CAAA;AACxB,OAAO,EAAE,YAAY,EAAE,eAAe,EAAgB,MAAM,SAAS,CAAA;AACrE,OAAO,EAAE,cAAc,IAAI,wBAAwB,EAAE,MAAM,+CAA+C,CAAA;AAC1G,OAAO,EAAE,cAAc,IAAI,SAAS,EAAE,MAAM,8BAA8B,CAAA;AAC1E,OAAO,EAAE,cAAc,I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sources":["../../../../src/сomponents/Avatar/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,UAAU,CAAA"}
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import { ReactNode, RefObject } from 'react';
|
|
2
|
+
import { IFontFamilyProps, ILanguageProps, IThemeProps, TAvatar, TStyles } from '../../constants';
|
|
3
|
+
export interface IAvatarProps extends IThemeProps, IFontFamilyProps, ILanguageProps {
|
|
4
|
+
avatarRef?: RefObject<HTMLDivElement | null>;
|
|
5
|
+
className?: string;
|
|
6
|
+
styles?: TStyles;
|
|
7
|
+
isSelected?: boolean;
|
|
8
|
+
isHighlighted?: boolean;
|
|
9
|
+
isInactive?: boolean;
|
|
10
|
+
isSpam?: boolean;
|
|
11
|
+
isCrown?: boolean;
|
|
12
|
+
isWarning?: boolean;
|
|
13
|
+
isEye?: boolean;
|
|
14
|
+
isTooltipAvailableOnEye?: boolean;
|
|
15
|
+
size?: 16 | 20 | 24 | 32 | 36 | 40 | 44 | 48 | 56 | 64 | 80 | 100 | 160 | 200;
|
|
16
|
+
username?: string;
|
|
17
|
+
initials?: string;
|
|
18
|
+
avatar?: TAvatar;
|
|
19
|
+
counter?: number;
|
|
20
|
+
inviteStatus?: 'accepted' | 'declined' | 'needsAction';
|
|
21
|
+
icon?: ReactNode;
|
|
22
|
+
outlineDefaultBackground?: string;
|
|
23
|
+
outlineDarkBackground?: string;
|
|
24
|
+
onClick?: () => void;
|
|
25
|
+
onMouseDown?: () => void;
|
|
26
|
+
}
|
|
27
|
+
export declare enum AVATAR_SIZES {
|
|
28
|
+
size_16 = 16,
|
|
29
|
+
size_20 = 20,
|
|
30
|
+
size_24 = 24,
|
|
31
|
+
size_32 = 32,
|
|
32
|
+
size_36 = 36,
|
|
33
|
+
size_40 = 40,
|
|
34
|
+
size_44 = 44,
|
|
35
|
+
size_48 = 48,
|
|
36
|
+
size_56 = 56,
|
|
37
|
+
size_64 = 64,
|
|
38
|
+
size_80 = 80,
|
|
39
|
+
size_100 = 100,
|
|
40
|
+
size_160 = 160,
|
|
41
|
+
size_200 = 200
|
|
42
|
+
}
|
|
43
|
+
export declare enum AvatarFontSizes {
|
|
44
|
+
xxxSmall = "6px",
|
|
45
|
+
xxSmall = "8px",
|
|
46
|
+
xSmall = "9px",
|
|
47
|
+
small = "12px",
|
|
48
|
+
normal = "14px",
|
|
49
|
+
xNormal = "15px",
|
|
50
|
+
medium = "18px",
|
|
51
|
+
large = "24px",
|
|
52
|
+
xLarge = "32px",
|
|
53
|
+
xxLarge = "42px",
|
|
54
|
+
xxxLarge = "48px"
|
|
55
|
+
}
|
|
56
|
+
export interface IUsernameAvatarColor {
|
|
57
|
+
degrees: number;
|
|
58
|
+
top: string;
|
|
59
|
+
topPercent: number;
|
|
60
|
+
middle?: string | null;
|
|
61
|
+
middlePercent?: number | null;
|
|
62
|
+
bottom: string;
|
|
63
|
+
bottomPercent: number;
|
|
64
|
+
}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
export var AVATAR_SIZES;
|
|
2
|
+
(function (AVATAR_SIZES) {
|
|
3
|
+
AVATAR_SIZES[AVATAR_SIZES["size_16"] = 16] = "size_16";
|
|
4
|
+
AVATAR_SIZES[AVATAR_SIZES["size_20"] = 20] = "size_20";
|
|
5
|
+
AVATAR_SIZES[AVATAR_SIZES["size_24"] = 24] = "size_24";
|
|
6
|
+
AVATAR_SIZES[AVATAR_SIZES["size_32"] = 32] = "size_32";
|
|
7
|
+
AVATAR_SIZES[AVATAR_SIZES["size_36"] = 36] = "size_36";
|
|
8
|
+
AVATAR_SIZES[AVATAR_SIZES["size_40"] = 40] = "size_40";
|
|
9
|
+
AVATAR_SIZES[AVATAR_SIZES["size_44"] = 44] = "size_44";
|
|
10
|
+
AVATAR_SIZES[AVATAR_SIZES["size_48"] = 48] = "size_48";
|
|
11
|
+
AVATAR_SIZES[AVATAR_SIZES["size_56"] = 56] = "size_56";
|
|
12
|
+
AVATAR_SIZES[AVATAR_SIZES["size_64"] = 64] = "size_64";
|
|
13
|
+
AVATAR_SIZES[AVATAR_SIZES["size_80"] = 80] = "size_80";
|
|
14
|
+
AVATAR_SIZES[AVATAR_SIZES["size_100"] = 100] = "size_100";
|
|
15
|
+
AVATAR_SIZES[AVATAR_SIZES["size_160"] = 160] = "size_160";
|
|
16
|
+
AVATAR_SIZES[AVATAR_SIZES["size_200"] = 200] = "size_200";
|
|
17
|
+
})(AVATAR_SIZES || (AVATAR_SIZES = {}));
|
|
18
|
+
export var AvatarFontSizes;
|
|
19
|
+
(function (AvatarFontSizes) {
|
|
20
|
+
AvatarFontSizes["xxxSmall"] = "6px";
|
|
21
|
+
AvatarFontSizes["xxSmall"] = "8px";
|
|
22
|
+
AvatarFontSizes["xSmall"] = "9px";
|
|
23
|
+
AvatarFontSizes["small"] = "12px";
|
|
24
|
+
AvatarFontSizes["normal"] = "14px";
|
|
25
|
+
AvatarFontSizes["xNormal"] = "15px";
|
|
26
|
+
AvatarFontSizes["medium"] = "18px";
|
|
27
|
+
AvatarFontSizes["large"] = "24px";
|
|
28
|
+
AvatarFontSizes["xLarge"] = "32px";
|
|
29
|
+
AvatarFontSizes["xxLarge"] = "42px";
|
|
30
|
+
AvatarFontSizes["xxxLarge"] = "48px";
|
|
31
|
+
})(AvatarFontSizes || (AvatarFontSizes = {}));
|
|
32
|
+
//# sourceMappingURL=types.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../../src/сomponents/Avatar/types.ts"],"names":[],"mappings":"AA4BA,MAAM,CAAN,IAAY,YAeX;AAfD,WAAY,YAAY;IACtB,sDAAY,CAAA;IACZ,sDAAY,CAAA;IACZ,sDAAY,CAAA;IACZ,sDAAY,CAAA;IACZ,sDAAY,CAAA;IACZ,sDAAY,CAAA;IACZ,sDAAY,CAAA;IACZ,sDAAY,CAAA;IACZ,sDAAY,CAAA;IACZ,sDAAY,CAAA;IACZ,sDAAY,CAAA;IACZ,yDAAc,CAAA;IACd,yDAAc,CAAA;IACd,yDAAc,CAAA;AAChB,CAAC,EAfW,YAAY,KAAZ,YAAY,QAevB;AAED,MAAM,CAAN,IAAY,eAYX;AAZD,WAAY,eAAe;IACzB,mCAAgB,CAAA;IAChB,kCAAe,CAAA;IACf,iCAAc,CAAA;IACd,iCAAc,CAAA;IACd,kCAAe,CAAA;IACf,mCAAgB,CAAA;IAChB,kCAAe,CAAA;IACf,iCAAc,CAAA;IACd,kCAAe,CAAA;IACf,mCAAgB,CAAA;IAChB,oCAAiB,CAAA;AACnB,CAAC,EAZW,eAAe,KAAf,eAAe,QAY1B"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { IButtonProps } from './types';
|
|
2
|
+
import '../../styles/styles.scss';
|
|
3
|
+
declare const Button: ({ fontFamily, title, disabled, isDisabledClickable, isWaitingResponse, isPaddingZeroed, variant, appearance, icon, iconSize, loaderIcon, width, minWidth, size, className, styles, onClick, ...props }: IButtonProps) => import("react/jsx-runtime").JSX.Element;
|
|
4
|
+
export default Button;
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
var __assign = (this && this.__assign) || function () {
|
|
2
|
+
__assign = Object.assign || function(t) {
|
|
3
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
4
|
+
s = arguments[i];
|
|
5
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
6
|
+
t[p] = s[p];
|
|
7
|
+
}
|
|
8
|
+
return t;
|
|
9
|
+
};
|
|
10
|
+
return __assign.apply(this, arguments);
|
|
11
|
+
};
|
|
12
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
13
|
+
var t = {};
|
|
14
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
15
|
+
t[p] = s[p];
|
|
16
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
17
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
18
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
19
|
+
t[p[i]] = s[p[i]];
|
|
20
|
+
}
|
|
21
|
+
return t;
|
|
22
|
+
};
|
|
23
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
24
|
+
import { useEffect, useRef } from 'react';
|
|
25
|
+
import classNames from 'classnames';
|
|
26
|
+
import { isEmpty, isNil, isNull } from 'lodash';
|
|
27
|
+
import { generateFontFamilyStyle } from '../../helpers';
|
|
28
|
+
import { FIT_CONTENT } from '../../constants';
|
|
29
|
+
import { DEFAULT_BUTTON_SIZE, TButtonAppearance, TButtonVariant } from './types';
|
|
30
|
+
import { ReactComponent as DefaultLoaderIcon } from '../../assets/icons/button-loader.svg';
|
|
31
|
+
import '../../styles/styles.scss';
|
|
32
|
+
var CONTENT_HIDDEN_CLASS_NAME = 'smartapp-button__content--hidden';
|
|
33
|
+
var Button = function (_a) {
|
|
34
|
+
var fontFamily = _a.fontFamily, title = _a.title, _b = _a.disabled, disabled = _b === void 0 ? false : _b, _c = _a.isDisabledClickable, isDisabledClickable = _c === void 0 ? false : _c, _d = _a.isWaitingResponse, isWaitingResponse = _d === void 0 ? false : _d, _e = _a.isPaddingZeroed, isPaddingZeroed = _e === void 0 ? false : _e, _f = _a.variant, variant = _f === void 0 ? TButtonVariant.primary : _f, _g = _a.appearance, appearance = _g === void 0 ? TButtonAppearance.accent : _g, icon = _a.icon, iconSize = _a.iconSize, loaderIcon = _a.loaderIcon, _h = _a.width, width = _h === void 0 ? 100 : _h, minWidth = _a.minWidth, _j = _a.size, size = _j === void 0 ? DEFAULT_BUTTON_SIZE : _j, className = _a.className, styles = _a.styles, onClick = _a.onClick, props = __rest(_a, ["fontFamily", "title", "disabled", "isDisabledClickable", "isWaitingResponse", "isPaddingZeroed", "variant", "appearance", "icon", "iconSize", "loaderIcon", "width", "minWidth", "size", "className", "styles", "onClick"]);
|
|
35
|
+
var contentRef = useRef(null);
|
|
36
|
+
var isTitleEmpty = isEmpty(title);
|
|
37
|
+
var isIconPassed = !isNil(icon);
|
|
38
|
+
var isButtonWithIconOnly = isTitleEmpty && isIconPassed;
|
|
39
|
+
var buttonWithIconOnlySize = "".concat(size, "px");
|
|
40
|
+
var iconSizeInPx = "".concat(iconSize, "px");
|
|
41
|
+
var buttonStyles = __assign(__assign({ width: isButtonWithIconOnly || !!minWidth ? FIT_CONTENT : "".concat(width, "%"), minWidth: !isButtonWithIconOnly && !!minWidth ? "".concat(minWidth, "px") : '' }, (isPaddingZeroed ? { '--button-horizontal-padding': 0 } : {})), generateFontFamilyStyle(fontFamily));
|
|
42
|
+
var iconStyles = iconSize ? { width: iconSizeInPx, height: iconSizeInPx } : {};
|
|
43
|
+
var buttonWithIconOnlyStyles = { width: buttonWithIconOnlySize, height: buttonWithIconOnlySize };
|
|
44
|
+
var changeTransitionDelay = function (transitionDelay) { return contentRef.current && (contentRef.current.style.transitionDelay = "".concat(transitionDelay, "ms")); };
|
|
45
|
+
var handleButtonClick = function (event) { return (!disabled || (disabled && isDisabledClickable)) && (onClick === null || onClick === void 0 ? void 0 : onClick(event)); };
|
|
46
|
+
useEffect(function () {
|
|
47
|
+
var contentRefCurrent = contentRef.current;
|
|
48
|
+
if (isNull(contentRefCurrent))
|
|
49
|
+
return;
|
|
50
|
+
if (isWaitingResponse) {
|
|
51
|
+
contentRefCurrent.classList.add(CONTENT_HIDDEN_CLASS_NAME);
|
|
52
|
+
setTimeout(function () { return changeTransitionDelay(300); }, 150);
|
|
53
|
+
}
|
|
54
|
+
else {
|
|
55
|
+
contentRefCurrent.classList.remove(CONTENT_HIDDEN_CLASS_NAME);
|
|
56
|
+
setTimeout(function () { return changeTransitionDelay(0); }, 150);
|
|
57
|
+
}
|
|
58
|
+
}, [isWaitingResponse]);
|
|
59
|
+
return (_jsxs("div", __assign({ className: classNames('smartapp-button', "smartapp-button__".concat(appearance), className), style: buttonStyles }, { children: [_jsx("button", __assign({ className: classNames("smartapp-button__".concat(variant), "smartapp-button__".concat(variant, "--").concat(appearance), {
|
|
60
|
+
'smartapp-button__disabled': disabled,
|
|
61
|
+
'smartapp-button__with-icon': !isTitleEmpty && isIconPassed,
|
|
62
|
+
'smartapp-button__with-icon-only': isButtonWithIconOnly,
|
|
63
|
+
}), style: styles, disabled: disabled && !isDisabledClickable, onClick: handleButtonClick }, props, { children: _jsxs("div", __assign({ ref: contentRef, className: "smartapp-button__content", style: isButtonWithIconOnly ? buttonWithIconOnlyStyles : {} }, { children: [icon && _jsx("div", __assign({ style: iconStyles }, { children: icon })), title && _jsx("span", { children: title })] })) })), _jsx("div", __assign({ className: classNames('smartapp-button__loader', "smartapp-button__loader--".concat(variant), {
|
|
64
|
+
'smartapp-button__loader--hidden': !isWaitingResponse,
|
|
65
|
+
}) }, { children: loaderIcon || _jsx(DefaultLoaderIcon, {}) }))] })));
|
|
66
|
+
};
|
|
67
|
+
export default Button;
|
|
68
|
+
//# sourceMappingURL=Button.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Button.js","sourceRoot":"","sources":["../../../../src/сomponents/Button/Button.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAAA,OAAc,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,OAAO,CAAA;AAChD,OAAO,UAAU,MAAM,YAAY,CAAA;AACnC,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAA;AAC/C,OAAO,EAAE,uBAAuB,EAAE,MAAM,eAAe,CAAA;AACvD,OAAO,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAA;AAC7C,OAAO,EAAE,mBAAmB,EAAgB,iBAAiB,EAAE,cAAc,EAAE,MAAM,SAAS,CAAA;AAC9F,OAAO,EAAE,cAAc,IAAI,iBAAiB,EAAE,MAAM,sCAAsC,CAAA;AAC1F,OAAO,0BAA0B,CAAA;AAEjC,IAAM,yBAAyB,GAAG,k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,EAAE,CAAC,iBAAiB,CAAC,CAAC,CAAA;IAEvB,OAAO,CACL,wBAAK,SAAS,EAAE,UAAU,CAAC,iBAAiB,EAAE,2BAAoB,UAAU,CAAE,EAAE,SAAS,CAAC,EAAE,KAAK,EAAE,YAAY,iBAC7G,0BACE,SAAS,EAAE,UAAU,CAAC,2BAAoB,OAAO,CAAE,EAAE,2BAAoB,OAAO,eAAK,UAAU,CAAE,EAAE;oBACjG,2BAA2B,EAAE,QAAQ;oBACrC,4BAA4B,EAAE,CAAC,YAAY,IAAI,YAAY;oBAC3D,iCAAiC,EAAE,oBAAoB;iBACxD,CAAC,EACF,KAAK,EAAE,MAAM,EACb,QAAQ,EAAE,QAAQ,IAAI,CAAC,mBAAmB,EAC1C,OAAO,EAAE,iBAAiB,IACtB,KAAK,cAET,wBAAK,GAAG,EAAE,UAAU,EAAE,SAAS,EAAC,0BAA0B,EAAC,KAAK,EAAE,oBAAoB,CAAC,CAAC,CAAC,wBAAwB,CAAC,CAAC,CAAC,EAAE,iBACnH,IAAI,IAAI,uBAAK,KAAK,EAAE,UAAU,gBAAG,IAAI,IAAO,EAC5C,KAAK,IAAI,yBAAO,KAAK,GAAQ,KAC1B,IACC,EACT,uBACE,SAAS,EAAE,UAAU,CAAC,yBAAyB,EAAE,mCAA4B,OAAO,CAAE,EAAE;oBACtF,iCAAiC,EAAE,CAAC,iBAAiB;iBACtD,CAAC,gBAED,UAAU,IAAI,KAAC,iBAAiB,KAAG,IAChC,KACF,CACP,CAAA;AACH,CAAC,CAAA;AAED,eAAe,MAAM,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from './Button';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/сomponents/Button/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,UAAU,CAAA"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { ButtonHTMLAttributes, ReactElement } from 'react';
|
|
2
|
+
import { IFontFamilyProps, TStyles } from '../../constants';
|
|
3
|
+
import { IntRange } from '../types';
|
|
4
|
+
export declare const DEFAULT_BUTTON_SIZE = 40;
|
|
5
|
+
export declare const DEFAULT_ICON_SIZE = 20;
|
|
6
|
+
export declare enum TButtonVariant {
|
|
7
|
+
primary = "primary",
|
|
8
|
+
secondary = "secondary",
|
|
9
|
+
tertiary = "tertiary"
|
|
10
|
+
}
|
|
11
|
+
export declare enum TButtonAppearance {
|
|
12
|
+
accent = "accent",
|
|
13
|
+
negative = "negative",
|
|
14
|
+
positive = "positive"
|
|
15
|
+
}
|
|
16
|
+
export interface IButtonProps extends ButtonHTMLAttributes<HTMLButtonElement>, IFontFamilyProps {
|
|
17
|
+
title?: string;
|
|
18
|
+
isDisabledClickable?: boolean;
|
|
19
|
+
isWaitingResponse?: boolean;
|
|
20
|
+
isPaddingZeroed?: boolean;
|
|
21
|
+
variant?: 'primary' | 'secondary' | 'tertiary';
|
|
22
|
+
appearance?: 'accent' | 'negative' | 'positive';
|
|
23
|
+
icon?: ReactElement;
|
|
24
|
+
iconSize?: number;
|
|
25
|
+
loaderIcon?: ReactElement;
|
|
26
|
+
width?: IntRange<1, 101>;
|
|
27
|
+
minWidth?: number;
|
|
28
|
+
size?: number;
|
|
29
|
+
className?: string;
|
|
30
|
+
styles?: TStyles;
|
|
31
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
export var DEFAULT_BUTTON_SIZE = 40;
|
|
2
|
+
export var DEFAULT_ICON_SIZE = 20;
|
|
3
|
+
export var TButtonVariant;
|
|
4
|
+
(function (TButtonVariant) {
|
|
5
|
+
TButtonVariant["primary"] = "primary";
|
|
6
|
+
TButtonVariant["secondary"] = "secondary";
|
|
7
|
+
TButtonVariant["tertiary"] = "tertiary";
|
|
8
|
+
})(TButtonVariant || (TButtonVariant = {}));
|
|
9
|
+
export var TButtonAppearance;
|
|
10
|
+
(function (TButtonAppearance) {
|
|
11
|
+
TButtonAppearance["accent"] = "accent";
|
|
12
|
+
TButtonAppearance["negative"] = "negative";
|
|
13
|
+
TButtonAppearance["positive"] = "positive";
|
|
14
|
+
})(TButtonAppearance || (TButtonAppearance = {}));
|
|
15
|
+
//# sourceMappingURL=types.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../../src/сomponents/Button/types.ts"],"names":[],"mappings":"AAIA,MAAM,CAAC,IAAM,mBAAmB,GAAG,EAAE,CAAA;AACrC,MAAM,CAAC,IAAM,iBAAiB,GAAG,EAAE,CAAA;AAEnC,MAAM,CAAN,IAAY,cAIX;AAJD,WAAY,cAAc;IACxB,qCAAmB,CAAA;IACnB,yCAAuB,CAAA;IACvB,uCAAqB,CAAA;AACvB,CAAC,EAJW,cAAc,KAAd,cAAc,QAIzB;AAED,MAAM,CAAN,IAAY,iBAIX;AAJD,WAAY,iBAAiB;IAC3B,sCAAiB,CAAA;IACjB,0CAAqB,CAAA;IACrB,0CAAqB,CAAA;AACvB,CAAC,EAJW,iBAAiB,KAAjB,iBAAiB,QAI5B"}
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
var __assign = (this && this.__assign) || function () {
|
|
2
|
+
__assign = Object.assign || function(t) {
|
|
3
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
4
|
+
s = arguments[i];
|
|
5
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
6
|
+
t[p] = s[p];
|
|
7
|
+
}
|
|
8
|
+
return t;
|
|
9
|
+
};
|
|
10
|
+
return __assign.apply(this, arguments);
|
|
11
|
+
};
|
|
12
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
13
|
+
import { useEffect, useLayoutEffect, useState } from 'react';
|
|
14
|
+
import classNames from 'classnames';
|
|
15
|
+
import { isBlobUrl, tryToLoadImageFromCache, tryToSaveImageToCache } from './helpers';
|
|
16
|
+
import '../../styles/styles.scss';
|
|
17
|
+
var IMAGE_LOADING_STATE;
|
|
18
|
+
(function (IMAGE_LOADING_STATE) {
|
|
19
|
+
IMAGE_LOADING_STATE[IMAGE_LOADING_STATE["pending"] = 0] = "pending";
|
|
20
|
+
IMAGE_LOADING_STATE[IMAGE_LOADING_STATE["success"] = 1] = "success";
|
|
21
|
+
IMAGE_LOADING_STATE[IMAGE_LOADING_STATE["error"] = -1] = "error";
|
|
22
|
+
})(IMAGE_LOADING_STATE || (IMAGE_LOADING_STATE = {}));
|
|
23
|
+
var CachedImage = function (_a) {
|
|
24
|
+
var src = _a.src, alt = _a.alt, className = _a.className, styles = _a.styles, width = _a.width, height = _a.height, borderRadius = _a.borderRadius;
|
|
25
|
+
var _b = useState(''), url = _b[0], setUrl = _b[1];
|
|
26
|
+
var _c = useState(IMAGE_LOADING_STATE.pending), loadingState = _c[0], setLoadingState = _c[1];
|
|
27
|
+
useLayoutEffect(function () {
|
|
28
|
+
setUrl(src);
|
|
29
|
+
}, [src]);
|
|
30
|
+
// Очистка URL объекта после ошибки загрузки изображения
|
|
31
|
+
useEffect(function () {
|
|
32
|
+
if (loadingState === IMAGE_LOADING_STATE.error && isBlobUrl(url))
|
|
33
|
+
URL.revokeObjectURL(url);
|
|
34
|
+
return function () { return void 0; };
|
|
35
|
+
}, [loadingState, url]);
|
|
36
|
+
var isImageLoadingStatePending = function () { return loadingState === IMAGE_LOADING_STATE.pending; };
|
|
37
|
+
// Обработчик успешной загрузки изображения
|
|
38
|
+
var handleOnLoad = function () {
|
|
39
|
+
if (!isImageLoadingStatePending())
|
|
40
|
+
return;
|
|
41
|
+
setLoadingState(IMAGE_LOADING_STATE.success);
|
|
42
|
+
tryToSaveImageToCache(src);
|
|
43
|
+
};
|
|
44
|
+
// Обработчик ошибки загрузки изображения
|
|
45
|
+
var handleOnError = function () {
|
|
46
|
+
if (!isImageLoadingStatePending())
|
|
47
|
+
return;
|
|
48
|
+
setLoadingState(IMAGE_LOADING_STATE.error);
|
|
49
|
+
tryToLoadImageFromCache(src).then(function (blobUrl) { return blobUrl && setUrl(blobUrl); });
|
|
50
|
+
};
|
|
51
|
+
var generateImageStyles = function () {
|
|
52
|
+
var widthValue = width ? "".concat(width, "px") : '100%';
|
|
53
|
+
var heightValue = height ? "".concat(height, "px") : '100%';
|
|
54
|
+
return __assign({ minWidth: widthValue, minHeight: heightValue, width: widthValue, height: heightValue, borderRadius: "".concat(borderRadius, "px") }, styles);
|
|
55
|
+
};
|
|
56
|
+
return (_jsx("img", { className: classNames('smartapp-cached-image', className), style: generateImageStyles(), src: url, alt: alt, onLoad: handleOnLoad, onError: handleOnError }));
|
|
57
|
+
};
|
|
58
|
+
export default CachedImage;
|
|
59
|
+
//# sourceMappingURL=CachedImage.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CachedImage.js","sourceRoot":"","sources":["../../../../src/сomponents/CachedImage/CachedImage.tsx"],"names":[],"mappings":";;;;;;;;;;;;AAAA,OAAc,EAAE,SAAS,EAAE,eAAe,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAA;AACnE,OAAO,UAAU,MAAM,YAAY,CAAA;AACnC,OAAO,EAAE,SAAS,EAAE,uBAAuB,EAAE,qBAAqB,EAAE,MAAM,WAAW,CAAA;AAErF,OAAO,0BAA0B,CAAA;AAEjC,IAAK,mBAIJ;AAJD,WAAK,mBAAmB;IACtB,mEAAa,CAAA;IACb,mEAAa,CAAA;IACb,gEAAY,CAAA;AACd,CAAC,EAJI,mBAAmB,KAAnB,mBAAmB,QAIvB;AAED,IAAM,WAAW,GAAG,UAAC,EAA+E;QAA7E,GAAG,SAAA,EAAE,GAAG,SAAA,EAAE,SAAS,eAAA,EAAE,MAAM,YAAA,EAAE,KAAK,WAAA,EAAE,MAAM,YAAA,EAAE,YAAY,kBAAA;IACvE,IAAA,KAAgB,QAAQ,CAAC,EAAE,CAAC,EAA3B,GAAG,QAAA,EAAE,MAAM,QAAgB,CAAA;IAC5B,IAAA,KAAkC,QAAQ,CAAC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