@expressms/smartapp-ui 2.9.4-alpha.1 → 2.9.4-alpha.2
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/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/button-loader.svg +3 -0
- package/build/main/assets/icons/cancel-cross.svg +3 -0
- package/build/main/assets/icons/check-mark.svg +4 -0
- package/build/main/assets/icons/clear.svg +3 -0
- package/build/main/assets/icons/close-stories.svg +4 -0
- package/build/main/assets/icons/close.svg +10 -0
- package/build/main/assets/icons/contact-info.svg +12 -0
- package/build/main/assets/icons/corporate-user.svg +10 -0
- package/build/main/assets/icons/crown.svg +5 -0
- package/build/main/assets/icons/delete-chip.svg +3 -0
- package/build/main/assets/icons/distribution.svg +12 -0
- package/build/main/assets/icons/download.svg +4 -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 +10 -0
- package/build/main/assets/icons/eye.svg +10 -0
- package/build/main/assets/icons/file.svg +3 -0
- package/build/main/assets/icons/group.svg +3 -0
- package/build/main/assets/icons/info.svg +5 -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/meeting-rooms-list.svg +5 -0
- package/build/main/assets/icons/more.svg +3 -0
- package/build/main/assets/icons/my-contact-user.svg +10 -0
- package/build/main/assets/icons/notification-close.svg +3 -0
- package/build/main/assets/icons/notification-error.svg +3 -0
- package/build/main/assets/icons/notification-failure.svg +3 -0
- package/build/main/assets/icons/notification-info.svg +5 -0
- package/build/main/assets/icons/notification-success.svg +4 -0
- package/build/main/assets/icons/notification-warning.svg +5 -0
- package/build/main/assets/icons/order.svg +6 -0
- package/build/main/assets/icons/plus.svg +4 -0
- package/build/main/assets/icons/private.svg +12 -0
- package/build/main/assets/icons/refresh.svg +3 -0
- package/build/main/assets/icons/search.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/unread-mails.svg +4 -0
- package/build/main/assets/icons/warning-avatar.svg +4 -0
- package/build/main/assets/storybook/index.d.ts +22 -0
- package/build/main/assets/storybook/index.js +23 -0
- package/build/main/assets/storybook/index.js.map +1 -0
- package/build/main/constants/constants.d.ts +158 -0
- package/build/main/constants/constants.js +178 -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 +29 -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 +25 -0
- package/build/main/helpers/index.js +113 -0
- package/build/main/helpers/index.js.map +1 -0
- package/build/main/hooks/useLongTap.d.ts +12 -0
- package/build/main/hooks/useLongTap.js +29 -0
- package/build/main/hooks/useLongTap.js.map +1 -0
- package/build/main/hooks/useModal.d.ts +21 -0
- package/build/main/hooks/useModal.js +60 -0
- package/build/main/hooks/useModal.js.map +1 -0
- package/build/main/index.d.ts +36 -0
- package/build/main/index.js +37 -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 +55 -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 +24 -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 +60 -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 +25 -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 +4 -0
- package/build/main//321/201omponents/Avatar/Avatar.js +150 -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 +59 -0
- package/build/main//321/201omponents/Avatar/types.js +29 -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 +63 -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 +28 -0
- package/build/main//321/201omponents/Button/types.js +11 -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 +4 -0
- package/build/main//321/201omponents/Calendar/Calendar.js +97 -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 +13 -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 +46 -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 +41 -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 +63 -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 +46 -0
- package/build/main//321/201omponents/Charts/constants.js +43 -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 +88 -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 +4 -0
- package/build/main//321/201omponents/Checkbox/Checkbox.js +38 -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 +12 -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 +4 -0
- package/build/main//321/201omponents/Chip/Chip.js +65 -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 +21 -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/ConfirmationModal/ConfirmationModal.d.ts +4 -0
- package/build/main//321/201omponents/ConfirmationModal/ConfirmationModal.js +70 -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 +28 -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 +81 -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 +34 -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/CustomSelect/CustomSelect.d.ts +12 -0
- package/build/main//321/201omponents/CustomSelect/CustomSelect.js +243 -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 +67 -0
- package/build/main//321/201omponents/CustomSelect/selectStyles.js.map +1 -0
- package/build/main//321/201omponents/CustomSelect/types.d.ts +64 -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 +58 -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/types.d.ts +12 -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 +223 -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 +88 -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 +49 -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 +15 -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 +46 -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 +207 -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 +29 -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 +208 -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 +42 -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 +4 -0
- package/build/main//321/201omponents/Modal/Modal.js +147 -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 +36 -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 +8 -0
- package/build/main//321/201omponents/Notification/Notification.js +218 -0
- package/build/main//321/201omponents/Notification/Notification.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 +45 -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 +37 -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 +63 -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 +20 -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 +300 -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 +70 -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 +9 -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 +96 -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 +12 -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 +38 -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 +32 -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 +82 -0
- package/build/main//321/201omponents/UserDropdown/ContactInfo/ContactInfo.js.map +1 -0
- package/build/main//321/201omponents/UserDropdown/LoadingMessage/LoadingMessage.d.ts +4 -0
- package/build/main//321/201omponents/UserDropdown/LoadingMessage/LoadingMessage.js +23 -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 +132 -0
- package/build/main//321/201omponents/UserDropdown/MenuList/MenuList.js.map +1 -0
- package/build/main//321/201omponents/UserDropdown/MultiValueLabel/MultiValueLabel.d.ts +3 -0
- package/build/main//321/201omponents/UserDropdown/MultiValueLabel/MultiValueLabel.js +97 -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 +93 -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 +43 -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 +484 -0
- package/build/main//321/201omponents/UserDropdown/UserDropdown.js.map +1 -0
- package/build/main//321/201omponents/UserDropdown/constants.d.ts +7 -0
- package/build/main//321/201omponents/UserDropdown/constants.js +9 -0
- package/build/main//321/201omponents/UserDropdown/constants.js.map +1 -0
- package/build/main//321/201omponents/UserDropdown/helpers.d.ts +98 -0
- package/build/main//321/201omponents/UserDropdown/helpers.js +146 -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 +80 -0
- package/build/main//321/201omponents/UserDropdown/selectStyles.js.map +1 -0
- package/build/main//321/201omponents/UserDropdown/types.d.ts +251 -0
- package/build/main//321/201omponents/UserDropdown/types.js +9 -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 +1 -1
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { IActionModalProps } from './types';
|
|
2
|
+
import '../../styles/styles.scss';
|
|
3
|
+
declare const ActionModal: ({ isModalOpen, isClosableOutside, isCloseIconHidden, title, buttonName, confirmButtonFunction, cancelButtonFunction, platform, placeholder, defaultValue, isWaitingResponse, isButtonDisabled, popupClassName, className, popupStyles, styles, titleStyles, iconColor, buttonWidth, backgroundColor, inputFillType, }: IActionModalProps) => import("react/jsx-runtime").JSX.Element;
|
|
4
|
+
export default ActionModal;
|
|
@@ -0,0 +1,55 @@
|
|
|
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, jsxs as _jsxs } from "react/jsx-runtime";
|
|
13
|
+
import { useEffect, useRef, useState } from 'react';
|
|
14
|
+
import Popup from 'reactjs-popup';
|
|
15
|
+
import classNames from 'classnames';
|
|
16
|
+
import Button from '../Button';
|
|
17
|
+
import Input from '../Input';
|
|
18
|
+
import { checkIfContentIsCentered, generateClassNames, generateColor, generateIsCloseIconHidden } from '../../helpers';
|
|
19
|
+
import { PLATFORM } from '../../constants';
|
|
20
|
+
import { ReactComponent as CloseIcon } from '../../assets/icons/cancel-cross.svg';
|
|
21
|
+
import '../../styles/styles.scss';
|
|
22
|
+
var ActionModal = function (_a) {
|
|
23
|
+
var isModalOpen = _a.isModalOpen, _b = _a.isClosableOutside, isClosableOutside = _b === void 0 ? true : _b, isCloseIconHidden = _a.isCloseIconHidden, title = _a.title, buttonName = _a.buttonName, confirmButtonFunction = _a.confirmButtonFunction, cancelButtonFunction = _a.cancelButtonFunction, _c = _a.platform, platform = _c === void 0 ? PLATFORM.web : _c, placeholder = _a.placeholder, _d = _a.defaultValue, defaultValue = _d === void 0 ? '' : _d, isWaitingResponse = _a.isWaitingResponse, isButtonDisabled = _a.isButtonDisabled, popupClassName = _a.popupClassName, className = _a.className, popupStyles = _a.popupStyles, styles = _a.styles, titleStyles = _a.titleStyles, iconColor = _a.iconColor, _e = _a.buttonWidth, buttonWidth = _e === void 0 ? 100 : _e, backgroundColor = _a.backgroundColor, inputFillType = _a.inputFillType;
|
|
24
|
+
var isCloseIconInvisible = generateIsCloseIconHidden(platform, isCloseIconHidden);
|
|
25
|
+
var ref = useRef(null);
|
|
26
|
+
var titleRef = useRef(null);
|
|
27
|
+
var _f = useState(defaultValue), value = _f[0], setValue = _f[1];
|
|
28
|
+
var handleConfirmClick = function () {
|
|
29
|
+
confirmButtonFunction(value);
|
|
30
|
+
setValue('');
|
|
31
|
+
};
|
|
32
|
+
var handleCloseModal = function () {
|
|
33
|
+
setValue('');
|
|
34
|
+
cancelButtonFunction();
|
|
35
|
+
};
|
|
36
|
+
var handleChange = function (value) { return setValue(value); };
|
|
37
|
+
useEffect(function () {
|
|
38
|
+
document.documentElement.style.setProperty('--action-modal-background', generateColor(backgroundColor));
|
|
39
|
+
}, [backgroundColor]);
|
|
40
|
+
useEffect(function () {
|
|
41
|
+
var checkIfClickedOutside = function (e) {
|
|
42
|
+
if (isModalOpen && isClosableOutside && ref.current && !ref.current.contains(e.target) && !value.length) {
|
|
43
|
+
handleCloseModal();
|
|
44
|
+
}
|
|
45
|
+
};
|
|
46
|
+
document === null || document === void 0 ? void 0 : document.addEventListener('click', checkIfClickedOutside, true);
|
|
47
|
+
return function () {
|
|
48
|
+
document === null || document === void 0 ? void 0 : document.removeEventListener('click', checkIfClickedOutside, true);
|
|
49
|
+
};
|
|
50
|
+
// eslint-disable-next-line
|
|
51
|
+
}, [isModalOpen, isClosableOutside, cancelButtonFunction, value]);
|
|
52
|
+
return (_jsx(Popup, __assign({ className: classNames('action-modal', popupClassName), overlayStyle: popupStyles, closeOnDocumentClick: isClosableOutside, modal: true, open: isModalOpen, closeOnEscape: isClosableOutside, onClose: handleCloseModal }, { children: _jsx("div", __assign({ ref: ref, className: classNames('smartapp-action-modal', className), style: styles }, { children: _jsxs("div", __assign({ className: "smartapp-action-modal__content" }, { children: [_jsxs("div", { children: [!isCloseIconInvisible && (_jsx("div", { className: classNames('close-icon-space', { 'close-icon-space__centered': checkIfContentIsCentered(titleRef) }) })), _jsx("p", __assign({ ref: titleRef, className: generateClassNames({ className: 'smartapp-action-modal__content--title', delimiter: '__', additionalClassName: platform }), style: titleStyles }, { children: title }))] }), !isCloseIconInvisible && (_jsx("div", __assign({ onClick: handleCloseModal, className: "smartapp-action-modal__content--cancel-cross" }, { children: _jsx(CloseIcon, { style: { color: generateColor(iconColor) } }) }))), _jsx("div", __assign({ className: "smartapp-action-modal__content--input" }, { children: _jsx(Input, { defaultValue: value, placeholder: placeholder, fillType: inputFillType, disabled: isWaitingResponse, onChange: handleChange }) })), _jsx("div", __assign({ className: "smartapp-action-modal__content--buttons" }, { children: _jsx(Button, { width: buttonWidth, isWaitingResponse: isWaitingResponse, disabled: isButtonDisabled, title: buttonName, onClick: handleConfirmClick }) }))] })) })) })));
|
|
53
|
+
};
|
|
54
|
+
export default ActionModal;
|
|
55
|
+
//# sourceMappingURL=ActionModal.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ActionModal.js","sourceRoot":"","sources":["../../../../src/сomponents/ActionModal/ActionModal.tsx"],"names":[],"mappings":";;;;;;;;;;;;AAAA,OAAc,EAAE,SAAS,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAA;AAC1D,OAAO,KAAK,MAAM,eAAe,CAAA;AACjC,OAAO,UAAU,MAAM,YAAY,CAAA;AACnC,OAAO,MAAM,MAAM,WAAW,CAAA;AAC9B,OAAO,KAAK,MAAM,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../../src/сomponents/ActionModal/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,eAAe,CAAA"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { IntRange } from '../types';
|
|
2
|
+
import { ICommonProps, TStyles } from '../../constants';
|
|
3
|
+
export interface IActionModalProps extends ICommonProps {
|
|
4
|
+
isModalOpen: boolean;
|
|
5
|
+
isClosableOutside?: boolean;
|
|
6
|
+
isCloseIconHidden?: boolean;
|
|
7
|
+
title: string;
|
|
8
|
+
buttonName: string;
|
|
9
|
+
confirmButtonFunction: (str: string) => void;
|
|
10
|
+
cancelButtonFunction: () => void;
|
|
11
|
+
placeholder?: string;
|
|
12
|
+
defaultValue?: string;
|
|
13
|
+
isWaitingResponse?: boolean;
|
|
14
|
+
isButtonDisabled?: boolean;
|
|
15
|
+
popupClassName?: string;
|
|
16
|
+
className?: string;
|
|
17
|
+
popupStyles?: TStyles;
|
|
18
|
+
styles?: TStyles;
|
|
19
|
+
titleStyles?: TStyles;
|
|
20
|
+
iconColor?: string;
|
|
21
|
+
buttonWidth?: IntRange<1, 101>;
|
|
22
|
+
backgroundColor?: string;
|
|
23
|
+
inputFillType?: 'primary' | 'secondary';
|
|
24
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../../src/сomponents/ActionModal/types.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { IAttachedFileProps } from './types';
|
|
2
|
+
import '../../styles/styles.scss';
|
|
3
|
+
export declare enum DISPLAY_SIZE {
|
|
4
|
+
small = "small",
|
|
5
|
+
normal = "normal"
|
|
6
|
+
}
|
|
7
|
+
declare const AttachedFile: ({ theme, fileName, weight, weightType, isIconEnclosedWithinBorders, isSpaceBetween, isRemovable, isDownloadable, isDisabled, isLoading, width, displaySize, className, styles, fileColor, downloadColor, removeColor, fileIcon, onClick, onRemove, onDownload, }: IAttachedFileProps) => import("react/jsx-runtime").JSX.Element;
|
|
8
|
+
export default AttachedFile;
|
|
@@ -0,0 +1,60 @@
|
|
|
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, jsxs as _jsxs } from "react/jsx-runtime";
|
|
13
|
+
import classNames from 'classnames';
|
|
14
|
+
import { ReactComponent as FileIcon } from '../../assets/icons/file.svg';
|
|
15
|
+
import { ReactComponent as RemoveIcon } from '../../assets/icons/close.svg';
|
|
16
|
+
import { ReactComponent as DownloadIcon } from '../../assets/icons/download.svg';
|
|
17
|
+
import { ReactComponent as LoaderIcon } from '../../assets/icons/attachment-loader.svg';
|
|
18
|
+
import { generateColor, generateDefaultGrayColorForIcon } from '../../helpers';
|
|
19
|
+
import { COLORS, THEME } from '../../constants';
|
|
20
|
+
import '../../styles/styles.scss';
|
|
21
|
+
export var DISPLAY_SIZE;
|
|
22
|
+
(function (DISPLAY_SIZE) {
|
|
23
|
+
DISPLAY_SIZE["small"] = "small";
|
|
24
|
+
DISPLAY_SIZE["normal"] = "normal";
|
|
25
|
+
})(DISPLAY_SIZE || (DISPLAY_SIZE = {}));
|
|
26
|
+
var AttachedFile = function (_a) {
|
|
27
|
+
var _b = _a.theme, theme = _b === void 0 ? THEME.default : _b, fileName = _a.fileName, weight = _a.weight, weightType = _a.weightType, _c = _a.isIconEnclosedWithinBorders, isIconEnclosedWithinBorders = _c === void 0 ? false : _c, _d = _a.isSpaceBetween, isSpaceBetween = _d === void 0 ? false : _d, _e = _a.isRemovable, isRemovable = _e === void 0 ? false : _e, _f = _a.isDownloadable, isDownloadable = _f === void 0 ? false : _f, _g = _a.isDisabled, isDisabled = _g === void 0 ? false : _g, _h = _a.isLoading, isLoading = _h === void 0 ? false : _h, _j = _a.width, width = _j === void 0 ? 100 : _j, _k = _a.displaySize, displaySize = _k === void 0 ? DISPLAY_SIZE.normal : _k, className = _a.className, styles = _a.styles, fileColor = _a.fileColor, downloadColor = _a.downloadColor, removeColor = _a.removeColor, fileIcon = _a.fileIcon, onClick = _a.onClick, onRemove = _a.onRemove, onDownload = _a.onDownload;
|
|
28
|
+
var handleAttachmentClick = function () { return !isLoading && !isDisabled && onClick && onClick(fileName); };
|
|
29
|
+
var handleAttachmentRemove = function (event) {
|
|
30
|
+
if (onRemove) {
|
|
31
|
+
event.stopPropagation();
|
|
32
|
+
onRemove(fileName);
|
|
33
|
+
}
|
|
34
|
+
};
|
|
35
|
+
var handleAttachmentDownload = function (event) {
|
|
36
|
+
if (!isLoading && !isDisabled && onDownload) {
|
|
37
|
+
event.stopPropagation();
|
|
38
|
+
onDownload(fileName);
|
|
39
|
+
}
|
|
40
|
+
};
|
|
41
|
+
return (_jsxs("div", __assign({ style: __assign({ width: "".concat(width, "%") }, styles), className: classNames('smartapp-attached-file', "smartapp-attached-file__".concat(theme), {
|
|
42
|
+
'smartapp-attached-file__clickable': onClick,
|
|
43
|
+
'smartapp-attached-file__disabled': isDisabled,
|
|
44
|
+
'smartapp-attached-file__loading': isLoading,
|
|
45
|
+
}, className), onClick: handleAttachmentClick }, { children: [_jsxs("div", __assign({ className: classNames('smartapp-attached-file__icon', "smartapp-attached-file__icon--".concat(displaySize), {
|
|
46
|
+
'smartapp-attached-file__icon--bordered': isIconEnclosedWithinBorders,
|
|
47
|
+
'smartapp-attached-file__icon--disabled': isDisabled,
|
|
48
|
+
'smartapp-attached-file__icon--loading': isLoading && !isIconEnclosedWithinBorders,
|
|
49
|
+
}) }, { children: [fileIcon || _jsx(FileIcon, { style: { color: generateColor(fileColor, generateDefaultGrayColorForIcon(theme)) } }), isLoading && (_jsx("div", __assign({ className: classNames('smartapp-attached-file__icon--loader', "smartapp-attached-file__icon--loader__".concat(displaySize)) }, { children: _jsx(LoaderIcon, {}) })))] })), _jsxs("div", __assign({ className: classNames('smartapp-attached-file__value', { 'justify-space-between': isSpaceBetween }) }, { children: [_jsxs("div", __assign({ className: classNames('smartapp-attached-file__value--info', {
|
|
50
|
+
'smartapp-attached-file__value--info__paddings': isIconEnclosedWithinBorders && displaySize === DISPLAY_SIZE.normal,
|
|
51
|
+
}) }, { children: [_jsx("p", __assign({ className: classNames('smartapp-attached-file__value--info__name', "smartapp-attached-file__value--info__name--".concat(displaySize), {
|
|
52
|
+
'smartapp-attached-file__value--info__name--disabled': isDisabled,
|
|
53
|
+
'smartapp-attached-file__value--info__name--loading': isLoading,
|
|
54
|
+
}) }, { children: fileName })), _jsx("p", __assign({ className: "smartapp-attached-file__value--info__weight" }, { children: "".concat(weight, " ").concat(weightType) }))] })), _jsxs("div", __assign({ className: "smartapp-attached-file__value--icons" }, { children: [isRemovable && (_jsx("div", __assign({ onClick: handleAttachmentRemove, className: "smartapp-attached-file__value--icons__close" }, { children: _jsx(RemoveIcon, { style: { color: generateColor(removeColor, generateDefaultGrayColorForIcon(theme)) } }) }))), isDownloadable && (_jsx("div", __assign({ onClick: handleAttachmentDownload, className: classNames('smartapp-attached-file__value--icons__download', {
|
|
55
|
+
'smartapp-attached-file__value--icons__download--disabled': isDisabled,
|
|
56
|
+
'smartapp-attached-file__value--icons__download--loading': isLoading,
|
|
57
|
+
}) }, { children: _jsx(DownloadIcon, { style: { color: generateColor(downloadColor, COLORS.blue) } }) })))] }))] }))] }), weight));
|
|
58
|
+
};
|
|
59
|
+
export default AttachedFile;
|
|
60
|
+
//# sourceMappingURL=AttachedFile.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AttachedFile.js","sourceRoot":"","sources":["../../../../src/сomponents/AttachedFile/AttachedFile.tsx"],"names":[],"mappings":";;;;;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":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/сomponents/AttachedFile/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,gBAAgB,CAAA"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { ReactElement } from 'react';
|
|
2
|
+
import { IntRange } from '../types';
|
|
3
|
+
import { IThemeProps, TStyles } from '../../constants';
|
|
4
|
+
export interface IAttachedFileProps extends IThemeProps {
|
|
5
|
+
fileName: string;
|
|
6
|
+
weight: number;
|
|
7
|
+
weightType: string;
|
|
8
|
+
isIconEnclosedWithinBorders?: boolean;
|
|
9
|
+
isSpaceBetween?: boolean;
|
|
10
|
+
isRemovable?: boolean;
|
|
11
|
+
isDownloadable?: boolean;
|
|
12
|
+
isDisabled?: boolean;
|
|
13
|
+
isLoading?: boolean;
|
|
14
|
+
width?: IntRange<1, 101>;
|
|
15
|
+
displaySize?: 'small' | 'normal';
|
|
16
|
+
className?: string;
|
|
17
|
+
styles?: TStyles;
|
|
18
|
+
fileColor?: string;
|
|
19
|
+
downloadColor?: string;
|
|
20
|
+
removeColor?: string;
|
|
21
|
+
fileIcon?: ReactElement;
|
|
22
|
+
onClick?: (file: any) => void;
|
|
23
|
+
onRemove?: (file: any) => void;
|
|
24
|
+
onDownload?: (file: any) => void;
|
|
25
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../../src/сomponents/AttachedFile/types.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { IAvatarProps } from './types';
|
|
2
|
+
import '../../styles/styles.scss';
|
|
3
|
+
declare const Avatar: ({ theme, className, styles, avatarRef, isSelected, isHighlighted, isInactive, isSpam, isWarning, isCrown, isEye, size, username, initials, avatar, counter, icon, outlineDefaultBackground, outlineDarkBackground, onClick, onMouseDown, }: IAvatarProps) => import("react/jsx-runtime").JSX.Element;
|
|
4
|
+
export default Avatar;
|
|
@@ -0,0 +1,150 @@
|
|
|
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, jsxs as _jsxs } from "react/jsx-runtime";
|
|
13
|
+
import { isString } from 'lodash';
|
|
14
|
+
import classNames from 'classnames';
|
|
15
|
+
import { calculatePercentageOfValue, createInitials, isDarkTheme, userNameToColor } from '../../helpers';
|
|
16
|
+
import { AVATAR_SIZES, AvatarFontSizes } from './types';
|
|
17
|
+
import { COLORS, MAX_NUMBER_OF_CHARACTERS_IN_INITIALS, THEME } from '../../constants';
|
|
18
|
+
import { ReactComponent as TickIcon } from '../../assets/icons/tick.svg';
|
|
19
|
+
import { ReactComponent as InfoIcon } from '../../assets/icons/info.svg';
|
|
20
|
+
import { ReactComponent as CrownIcon } from '../../assets/icons/crown.svg';
|
|
21
|
+
import { ReactComponent as PrivateIcon } from '../../assets/icons/private.svg';
|
|
22
|
+
import { ReactComponent as AvatarWarningIcon } from '../../assets/icons/warning-avatar.svg';
|
|
23
|
+
import '../../styles/styles.scss';
|
|
24
|
+
var PERCENTS;
|
|
25
|
+
(function (PERCENTS) {
|
|
26
|
+
PERCENTS[PERCENTS["pct_5"] = 5] = "pct_5";
|
|
27
|
+
PERCENTS[PERCENTS["pct_8"] = 8] = "pct_8";
|
|
28
|
+
PERCENTS[PERCENTS["pct_10"] = 10] = "pct_10";
|
|
29
|
+
PERCENTS[PERCENTS["pct_15"] = 15] = "pct_15";
|
|
30
|
+
PERCENTS[PERCENTS["pct_25"] = 25] = "pct_25";
|
|
31
|
+
PERCENTS[PERCENTS["pct_40"] = 40] = "pct_40";
|
|
32
|
+
PERCENTS[PERCENTS["pct_50"] = 50] = "pct_50";
|
|
33
|
+
PERCENTS[PERCENTS["pct_57"] = 57] = "pct_57";
|
|
34
|
+
PERCENTS[PERCENTS["pct_60"] = 60] = "pct_60";
|
|
35
|
+
PERCENTS[PERCENTS["pct_62_5"] = 62.5] = "pct_62_5";
|
|
36
|
+
PERCENTS[PERCENTS["pct_65"] = 65] = "pct_65";
|
|
37
|
+
PERCENTS[PERCENTS["pct_75"] = 75] = "pct_75";
|
|
38
|
+
PERCENTS[PERCENTS["pct_100"] = 100] = "pct_100";
|
|
39
|
+
})(PERCENTS || (PERCENTS = {}));
|
|
40
|
+
var AVATAR_OPACITY = 0.5;
|
|
41
|
+
var USER_INITIALS_OPACITY = 0.3;
|
|
42
|
+
var WARNING_AVATAR_BACKGROUND_COLOR = 'var(--color-icon-transparent-pressed)';
|
|
43
|
+
var Avatar = function (_a) {
|
|
44
|
+
var _b = _a.theme, theme = _b === void 0 ? THEME.default : _b, 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, _c = _a.size, size = _c === void 0 ? 44 : _c, _d = _a.username, username = _d === void 0 ? '' : _d, initials = _a.initials, avatar = _a.avatar, _e = _a.counter, counter = _e === void 0 ? 0 : _e, icon = _a.icon, _f = _a.outlineDefaultBackground, outlineDefaultBackground = _f === void 0 ? COLORS.white : _f, _g = _a.outlineDarkBackground, outlineDarkBackground = _g === void 0 ? COLORS.brightBlack : _g, _h = _a.onClick, onClick = _h === void 0 ? function () { return undefined; } : _h, onMouseDown = _a.onMouseDown;
|
|
45
|
+
var inactiveOpacity = avatar ? AVATAR_OPACITY : USER_INITIALS_OPACITY;
|
|
46
|
+
var outlineBackground = isDarkTheme(theme) ? outlineDarkBackground : outlineDefaultBackground;
|
|
47
|
+
var outlineWidth = calculatePercentageOfValue({ value: size, percentage: PERCENTS.pct_5, shouldBeRounded: false });
|
|
48
|
+
var generateFontSizeAvatar = function () {
|
|
49
|
+
switch (size) {
|
|
50
|
+
case AVATAR_SIZES.size_16:
|
|
51
|
+
return AvatarFontSizes.xSmall;
|
|
52
|
+
case AVATAR_SIZES.size_20:
|
|
53
|
+
case AVATAR_SIZES.size_24:
|
|
54
|
+
return AvatarFontSizes.small;
|
|
55
|
+
case AVATAR_SIZES.size_32:
|
|
56
|
+
case AVATAR_SIZES.size_36:
|
|
57
|
+
case AVATAR_SIZES.size_40:
|
|
58
|
+
return AvatarFontSizes.normal;
|
|
59
|
+
case AVATAR_SIZES.size_44:
|
|
60
|
+
case AVATAR_SIZES.size_48:
|
|
61
|
+
return AvatarFontSizes.medium;
|
|
62
|
+
case AVATAR_SIZES.size_56:
|
|
63
|
+
case AVATAR_SIZES.size_64:
|
|
64
|
+
case AVATAR_SIZES.size_80:
|
|
65
|
+
return AvatarFontSizes.large;
|
|
66
|
+
case AVATAR_SIZES.size_100:
|
|
67
|
+
return AvatarFontSizes.xLarge;
|
|
68
|
+
case AVATAR_SIZES.size_160:
|
|
69
|
+
return AvatarFontSizes.xxLarge;
|
|
70
|
+
case AVATAR_SIZES.size_200:
|
|
71
|
+
return AvatarFontSizes.xxxLarge;
|
|
72
|
+
}
|
|
73
|
+
};
|
|
74
|
+
var renderUserInitials = function () { return (initials === null || initials === void 0 ? void 0 : initials.slice(0, MAX_NUMBER_OF_CHARACTERS_IN_INITIALS).toUpperCase()) || createInitials(username); };
|
|
75
|
+
var renderAvatarImage = function () {
|
|
76
|
+
if (avatar)
|
|
77
|
+
return isString(avatar) ? _jsx("img", { src: avatar, alt: "avatar" }) : avatar;
|
|
78
|
+
else
|
|
79
|
+
return renderUserInitials();
|
|
80
|
+
};
|
|
81
|
+
var renderContent = function () {
|
|
82
|
+
if (isWarning) {
|
|
83
|
+
var warningSize = calculatePercentageOfValue({ value: size, percentage: PERCENTS.pct_100 });
|
|
84
|
+
return _jsx(AvatarWarningIcon, { width: warningSize, height: warningSize });
|
|
85
|
+
}
|
|
86
|
+
if (isSelected) {
|
|
87
|
+
var tickSize = calculatePercentageOfValue({ value: size, percentage: PERCENTS.pct_57 });
|
|
88
|
+
return _jsx(TickIcon, { width: tickSize, height: tickSize });
|
|
89
|
+
}
|
|
90
|
+
if (isSpam) {
|
|
91
|
+
var infoSize = calculatePercentageOfValue({ value: size, percentage: PERCENTS.pct_60 });
|
|
92
|
+
return _jsx(InfoIcon, { width: infoSize, height: infoSize });
|
|
93
|
+
}
|
|
94
|
+
if (icon) {
|
|
95
|
+
var iconSize = calculatePercentageOfValue({ value: size, percentage: PERCENTS.pct_62_5 });
|
|
96
|
+
var iconSizeInPx = "".concat(iconSize, "px");
|
|
97
|
+
return (_jsx("div", __assign({ className: "smartapp-avatar__content--icon", style: { width: iconSizeInPx, height: iconSizeInPx } }, { children: icon })));
|
|
98
|
+
}
|
|
99
|
+
return renderAvatarImage();
|
|
100
|
+
};
|
|
101
|
+
var renderCounter = function () {
|
|
102
|
+
var isSingleDigitNumber = counter <= 9;
|
|
103
|
+
var counterText = isSingleDigitNumber ? counter : '9+';
|
|
104
|
+
var width = calculatePercentageOfValue({ value: size, percentage: isSingleDigitNumber ? PERCENTS.pct_40 : PERCENTS.pct_50 });
|
|
105
|
+
var height = calculatePercentageOfValue({ value: size, percentage: PERCENTS.pct_40 });
|
|
106
|
+
var fontSize = calculatePercentageOfValue({ value: height, percentage: PERCENTS.pct_75 });
|
|
107
|
+
var top = calculatePercentageOfValue({ value: size, percentage: PERCENTS.pct_10 });
|
|
108
|
+
var right = calculatePercentageOfValue({ value: size, percentage: PERCENTS.pct_15 });
|
|
109
|
+
var borderWidth = calculatePercentageOfValue({ value: size, percentage: PERCENTS.pct_5, shouldBeRounded: false });
|
|
110
|
+
var borderRadius = isSingleDigitNumber ? '50%' : "".concat(height * 1.5625, "px");
|
|
111
|
+
return (_jsx("div", __assign({ className: "smartapp-avatar__content--counter", style: {
|
|
112
|
+
width: "".concat(width, "px"),
|
|
113
|
+
height: "".concat(height, "px"),
|
|
114
|
+
top: "-".concat(top, "px"),
|
|
115
|
+
right: "-".concat(right, "px"),
|
|
116
|
+
fontSize: "".concat(fontSize, "px"),
|
|
117
|
+
border: "".concat(borderWidth, "px solid ").concat(outlineBackground),
|
|
118
|
+
borderRadius: borderRadius,
|
|
119
|
+
} }, { children: counterText })));
|
|
120
|
+
};
|
|
121
|
+
var renderEye = function () {
|
|
122
|
+
var top = calculatePercentageOfValue({ value: size, percentage: PERCENTS.pct_8 });
|
|
123
|
+
var right = calculatePercentageOfValue({ value: size, percentage: PERCENTS.pct_25 });
|
|
124
|
+
var eyeSize = calculatePercentageOfValue({ value: size, percentage: PERCENTS.pct_65 });
|
|
125
|
+
return (_jsx(PrivateIcon, { className: "smartapp-avatar__content--eye", width: eyeSize, height: eyeSize, color: outlineBackground, style: { top: "-".concat(top, "px"), right: "-".concat(right, "px") } }));
|
|
126
|
+
};
|
|
127
|
+
var renderCrown = function () {
|
|
128
|
+
var bottom = calculatePercentageOfValue({ value: size, percentage: PERCENTS.pct_10 });
|
|
129
|
+
var right = calculatePercentageOfValue({ value: size, percentage: PERCENTS.pct_15 });
|
|
130
|
+
var crownSize = calculatePercentageOfValue({ value: size, percentage: PERCENTS.pct_50 });
|
|
131
|
+
return (_jsx(CrownIcon, { className: "smartapp-avatar__content--crown", width: crownSize, height: crownSize, color: outlineBackground, style: { bottom: "-".concat(bottom, "px"), right: "-".concat(right, "px") } }));
|
|
132
|
+
};
|
|
133
|
+
var generateBackgroundValueForStyles = function () { return (isWarning ? WARNING_AVATAR_BACKGROUND_COLOR : userNameToColor(initials || username)); };
|
|
134
|
+
var generateAvatarContentStyles = function () { return ({
|
|
135
|
+
width: "".concat(size, "px"),
|
|
136
|
+
minWidth: "".concat(size, "px"),
|
|
137
|
+
height: "".concat(size, "px"),
|
|
138
|
+
fontSize: generateFontSizeAvatar(),
|
|
139
|
+
background: isInactive
|
|
140
|
+
? "linear-gradient(180deg, ".concat(COLORS.inactiveAvatarGradientStart, " 0%, ").concat(COLORS.inactiveAvatarGradientEnd, " 100%)")
|
|
141
|
+
: generateBackgroundValueForStyles(),
|
|
142
|
+
opacity: isInactive ? inactiveOpacity : 1,
|
|
143
|
+
}); };
|
|
144
|
+
return (_jsx("div", __assign({ ref: avatarRef, className: classNames('smartapp-avatar', "smartapp-avatar__".concat(theme), { 'smartapp-avatar__outline': isHighlighted }, className), style: __assign({ '--avatar-outline-width': "".concat(outlineWidth, "px") }, styles), onClick: onClick, onMouseDown: onMouseDown }, { children: _jsxs("div", __assign({ style: generateAvatarContentStyles(), className: classNames('smartapp-avatar__content', {
|
|
145
|
+
'smartapp-avatar__content--spam': isSpam,
|
|
146
|
+
'smartapp-avatar__content--inactive': isInactive,
|
|
147
|
+
}) }, { children: [!!counter && renderCounter(), isEye && renderEye(), renderContent(), isCrown && renderCrown()] })) })));
|
|
148
|
+
};
|
|
149
|
+
export default Avatar;
|
|
150
|
+
//# sourceMappingURL=Avatar.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Avatar.js","sourceRoot":"","sources":["../../../../src/сomponents/Avatar/Avatar.tsx"],"names":[],"mappings":";;;;;;;;;;;;AACA,OAAO,EAAE,QAAQ,EAAE,MAAM,QAAQ,CAAA;AACjC,OAAO,UAAU,MAAM,YAAY,CAAA;AACnC,OAAO,EAAE,0BAA0B,EAAE,cAAc,EAAE,WAAW,EAAE,eAAe,EAAE,MAAM,eAAe,CAAA;AACxG,OAAO,EAAE,YAAY,EAAE,eAAe,EAAgB,MAAM,SAAS,CAAA;AACrE,OAAO,EAAE,MAAM,EAAE,oCAAoC,EAAE,KAAK,EAAE,MAAM,iBAAiB,CAAA;AACrF,OAAO,EAAE,cAAc,IAAI,QAAQ,EAAE,MAAM,6BAA6B,CAAA;AACxE,OAAO,EAAE,cAAc,IAAI,QAAQ,EAAE,MAAM,6BA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,GAAG,EAAE,SAAS,EACd,SAAS,EAAE,UAAU,CAAC,iBAAiB,EAAE,2BAAoB,KAAK,CAAE,EAAE,EAAE,0BAA0B,EAAE,aAAa,EAAE,EAAE,SAAS,CAAC,EAC/H,KAAK,EAAE,WAAE,wBAAwB,EAAE,UAAG,YAAY,OAAI,IAAK,MAAM,CAAyB,EAC1F,OAAO,EAAE,OAAO,EAChB,WAAW,EAAE,WAAW,gBAExB,wBACE,KAAK,EAAE,2BAA2B,EAAE,EACpC,SAAS,EAAE,UAAU,CAAC,0BAA0B,EAAE;gBAChD,gCAAgC,EAAE,MAAM;gBACxC,oCAAoC,EAAE,UAAU;aACjD,CAAC,iBAED,CAAC,CAAC,OAAO,IAAI,aAAa,EAAE,EAC5B,KAAK,IAAI,SAAS,EAAE,EACpB,aAAa,EAAE,EACf,OAAO,IAAI,WAAW,EAAE,KACrB,IACF,CACP,CAAA;AACH,CAAC,CAAA;AAED,eAAe,MAAM,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from './Avatar';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/сomponents/Avatar/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,UAAU,CAAA"}
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import { ReactElement, ReactNode, RefObject } from 'react';
|
|
2
|
+
import { IThemeProps, TStyles } from '../../constants';
|
|
3
|
+
export interface IAvatarProps extends IThemeProps {
|
|
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
|
+
size?: 16 | 20 | 24 | 32 | 36 | 40 | 44 | 48 | 56 | 64 | 80 | 100 | 160 | 200;
|
|
15
|
+
username?: string;
|
|
16
|
+
initials?: string;
|
|
17
|
+
avatar?: string | ReactElement | null;
|
|
18
|
+
counter?: number;
|
|
19
|
+
icon?: ReactNode;
|
|
20
|
+
outlineDefaultBackground?: string;
|
|
21
|
+
outlineDarkBackground?: string;
|
|
22
|
+
onClick?: () => void;
|
|
23
|
+
onMouseDown?: () => void;
|
|
24
|
+
}
|
|
25
|
+
export declare enum AVATAR_SIZES {
|
|
26
|
+
size_16 = 16,
|
|
27
|
+
size_20 = 20,
|
|
28
|
+
size_24 = 24,
|
|
29
|
+
size_32 = 32,
|
|
30
|
+
size_36 = 36,
|
|
31
|
+
size_40 = 40,
|
|
32
|
+
size_44 = 44,
|
|
33
|
+
size_48 = 48,
|
|
34
|
+
size_56 = 56,
|
|
35
|
+
size_64 = 64,
|
|
36
|
+
size_80 = 80,
|
|
37
|
+
size_100 = 100,
|
|
38
|
+
size_160 = 160,
|
|
39
|
+
size_200 = 200
|
|
40
|
+
}
|
|
41
|
+
export declare enum AvatarFontSizes {
|
|
42
|
+
xSmall = "5px",
|
|
43
|
+
small = "10px",
|
|
44
|
+
normal = "14px",
|
|
45
|
+
medium = "18px",
|
|
46
|
+
large = "24px",
|
|
47
|
+
xLarge = "32px",
|
|
48
|
+
xxLarge = "42px",
|
|
49
|
+
xxxLarge = "48px"
|
|
50
|
+
}
|
|
51
|
+
export interface IUsernameAvatarColor {
|
|
52
|
+
degrees: number;
|
|
53
|
+
top: string;
|
|
54
|
+
topPercent: number;
|
|
55
|
+
middle?: string | null;
|
|
56
|
+
middlePercent?: number | null;
|
|
57
|
+
bottom: string;
|
|
58
|
+
bottomPercent: number;
|
|
59
|
+
}
|
|
@@ -0,0 +1,29 @@
|
|
|
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["xSmall"] = "5px";
|
|
21
|
+
AvatarFontSizes["small"] = "10px";
|
|
22
|
+
AvatarFontSizes["normal"] = "14px";
|
|
23
|
+
AvatarFontSizes["medium"] = "18px";
|
|
24
|
+
AvatarFontSizes["large"] = "24px";
|
|
25
|
+
AvatarFontSizes["xLarge"] = "32px";
|
|
26
|
+
AvatarFontSizes["xxLarge"] = "42px";
|
|
27
|
+
AvatarFontSizes["xxxLarge"] = "48px";
|
|
28
|
+
})(AvatarFontSizes || (AvatarFontSizes = {}));
|
|
29
|
+
//# sourceMappingURL=types.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../../src/сomponents/Avatar/types.ts"],"names":[],"mappings":"AA0BA,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,eASX;AATD,WAAY,eAAe;IACzB,iCAAc,CAAA;IACd,iCAAc,CAAA;IACd,kCAAe,CAAA;IACf,kCAAe,CAAA;IACf,iCAAc,CAAA;IACd,kCAAe,CAAA;IACf,mCAAgB,CAAA;IAChB,oCAAiB,CAAA;AACnB,CAAC,EATW,eAAe,KAAf,eAAe,QAS1B"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { IButtonProps } from './types';
|
|
2
|
+
import '../../styles/styles.scss';
|
|
3
|
+
declare const Button: ({ title, disabled, isDisabledClickable, isWaitingResponse, variant, appearance, icon, loaderIcon, width, className, styles, onClick, ...props }: IButtonProps) => import("react/jsx-runtime").JSX.Element;
|
|
4
|
+
export default Button;
|
|
@@ -0,0 +1,63 @@
|
|
|
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 { isNil } from 'lodash';
|
|
27
|
+
import { ReactComponent as DefaultLoaderIcon } from '../../assets/icons/button-loader.svg';
|
|
28
|
+
import { TButtonVariant, TButtonAppearance } from './types';
|
|
29
|
+
import '../../styles/styles.scss';
|
|
30
|
+
var Button = function (_a) {
|
|
31
|
+
var 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.variant, variant = _e === void 0 ? TButtonVariant.primary : _e, _f = _a.appearance, appearance = _f === void 0 ? TButtonAppearance.accent : _f, icon = _a.icon, loaderIcon = _a.loaderIcon, _g = _a.width, width = _g === void 0 ? 100 : _g, className = _a.className, styles = _a.styles, onClick = _a.onClick, props = __rest(_a, ["title", "disabled", "isDisabledClickable", "isWaitingResponse", "variant", "appearance", "icon", "loaderIcon", "width", "className", "styles", "onClick"]);
|
|
32
|
+
var buttonTitleRef = useRef(null);
|
|
33
|
+
var buttonTitleRefCurrent = buttonTitleRef.current;
|
|
34
|
+
var buttonIconDivRef = useRef(null);
|
|
35
|
+
var buttonIconDivRefCurrent = buttonIconDivRef.current;
|
|
36
|
+
var changeTransitionDelay = function (_a) {
|
|
37
|
+
var transitionDelay = _a.transitionDelay, titleEl = _a.titleEl, iconEl = _a.iconEl;
|
|
38
|
+
titleEl && (titleEl.style.transitionDelay = "".concat(transitionDelay, "ms"));
|
|
39
|
+
iconEl && (iconEl.style.transitionDelay = "".concat(transitionDelay, "ms"));
|
|
40
|
+
};
|
|
41
|
+
var handleButtonClick = function (event) { return (!disabled || (disabled && isDisabledClickable)) && (onClick === null || onClick === void 0 ? void 0 : onClick(event)); };
|
|
42
|
+
useEffect(function () {
|
|
43
|
+
if (isWaitingResponse) {
|
|
44
|
+
buttonTitleRefCurrent === null || buttonTitleRefCurrent === void 0 ? void 0 : buttonTitleRefCurrent.classList.add('smartapp-button__title--hidden');
|
|
45
|
+
buttonIconDivRefCurrent === null || buttonIconDivRefCurrent === void 0 ? void 0 : buttonIconDivRefCurrent.classList.add('smartapp-button__icon--hidden');
|
|
46
|
+
setTimeout(function () { return changeTransitionDelay({ transitionDelay: 300, titleEl: buttonTitleRefCurrent, iconEl: buttonIconDivRefCurrent }); }, 150);
|
|
47
|
+
}
|
|
48
|
+
else {
|
|
49
|
+
buttonTitleRefCurrent === null || buttonTitleRefCurrent === void 0 ? void 0 : buttonTitleRefCurrent.classList.remove('smartapp-button__title--hidden');
|
|
50
|
+
buttonIconDivRefCurrent === null || buttonIconDivRefCurrent === void 0 ? void 0 : buttonIconDivRefCurrent.classList.remove('smartapp-button__icon--hidden');
|
|
51
|
+
setTimeout(function () { return changeTransitionDelay({ transitionDelay: 0, titleEl: buttonTitleRefCurrent, iconEl: buttonIconDivRefCurrent }); }, 150);
|
|
52
|
+
}
|
|
53
|
+
// eslint-disable-next-line
|
|
54
|
+
}, [isWaitingResponse]);
|
|
55
|
+
return (_jsxs("div", __assign({ className: classNames('smartapp-button', "smartapp-button__".concat(appearance), className), style: { width: "".concat(width, "%") } }, { children: [_jsxs("button", __assign({ className: classNames("smartapp-button__".concat(variant), "smartapp-button__".concat(variant, "--").concat(appearance), {
|
|
56
|
+
'smartapp-button__disabled': disabled,
|
|
57
|
+
'smartapp-button__with-icon': !isNil(icon),
|
|
58
|
+
}), style: styles, disabled: disabled && !isDisabledClickable, onClick: handleButtonClick }, props, { children: [icon && (_jsx("div", __assign({ ref: buttonIconDivRef, className: "smartapp-button__icon" }, { children: icon }))), _jsx("span", __assign({ ref: buttonTitleRef, className: "smartapp-button__title" }, { children: title }))] })), _jsx("div", __assign({ className: classNames('smartapp-button__loader', "smartapp-button__loader--".concat(variant), {
|
|
59
|
+
'smartapp-button__loader--hidden': !isWaitingResponse,
|
|
60
|
+
}) }, { children: loaderIcon || _jsx(DefaultLoaderIcon, {}) }))] })));
|
|
61
|
+
};
|
|
62
|
+
export default Button;
|
|
63
|
+
//# 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,KAAK,EAAE,MAAM,QAAQ,CAAA;AAC9B,OAAO,EAAE,cAAc,IAAI,iBAAiB,EAAE,MAAM,sCAAsC,CAAA;AAC1F,OAAO,EAAgB,cAAc,EAAE,iBAAiB,EAA0B,MAAM,SAAS,CAAA;AACjG,OAAO,0BAA0B,CAAA;AAEjC,IAAM,MAAM,GAAG,UAAC,EAcD;IAbb,IAAA,KAAK,WAAA,EACL,gBAAgB,EAAhB,QAAQ,mBAAG,KAAK,KAAA,EAChB,2BAA2B,EAA3B,mBAAmB,mBAAG,KAAK,KAAA,EAC3B,yBAAyB,EAAzB,iBAAiB,mBAAG,KAAK,KAA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BAAwB,gBAC1D,KAAK,IACD,KACA,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"}
|