impact-ui 3.7.25 → 4.0.0-alpha.10
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/MIGRATION_GUIDE.md +328 -0
- package/README.md +154 -15
- package/bin/migrate-image-paths.cjs +127 -0
- package/bin/migrate.js +293 -0
- package/codemods/component-map.js +153 -0
- package/codemods/image-paths-transform.js +69 -0
- package/codemods/transform.js +136 -0
- package/dist/components/Accordion/index.js +2 -1
- package/dist/components/AccordionModern/index.js +2 -1
- package/dist/components/Alert/index.js +2 -1
- package/dist/components/Avatar/index.js +2 -1
- package/dist/components/Badge/filled/filledIconLabelBadges/index.js +2 -1
- package/dist/components/Badge/filled/filledOnlyIconBadges/index.js +2 -1
- package/dist/components/Badge/filled/filledOnlyLabelBadges/index.js +2 -1
- package/dist/components/Badge/index.js +3 -2
- package/dist/components/Badge/stroke/strokeIconLabelBadges/index.js +2 -1
- package/dist/components/Badge/stroke/strokeOnlyIconBadges/index.js +2 -1
- package/dist/components/Badge/stroke/strokeOnlyLabelBadges/index.js +2 -1
- package/dist/components/Badge/subtle/subtleIOnlyIconBadges/index.js +2 -1
- package/dist/components/Badge/subtle/subtleIconLabelBadges/index.js +2 -1
- package/dist/components/Badge/subtle/subtleOnlyLabelBadges/index.js +2 -1
- package/dist/components/BottomSheet/index.js +2 -1
- package/dist/components/Breadcrumbs/index.js +2 -1
- package/dist/components/Button/index.js +2 -1
- package/dist/components/ButtonGroup/index.js +2 -1
- package/dist/components/Card/index.js +2 -1
- package/dist/components/Chart/index.js +2 -1
- package/dist/components/Chatbot/index.js +2 -1
- package/dist/components/Checkbox/index.js +2 -1
- package/dist/components/Chips/index.js +2 -1
- package/dist/components/CreateItemFlow/index.js +2 -1
- package/dist/components/DatePicker/datePickerDropdown.js +2 -1
- package/dist/components/DatePicker/index.js +3 -2
- package/dist/components/DateRangePicker/dateRangePickerDropdown.js +2 -1
- package/dist/components/DateRangePicker/index.js +3 -2
- package/dist/components/DynamicLayout/index.js +2 -1
- package/dist/components/EmptyState/EmptyStateImage.d.ts.map +1 -1
- package/dist/components/EmptyState/EmptyStateImage.js +3 -2
- package/dist/components/EmptyState/index.js +2 -1
- package/dist/components/FileUpload/index.js +2 -1
- package/dist/components/FilterPanel/index.js +2 -1
- package/dist/components/FiltersStrip/index.js +2 -1
- package/dist/components/Header/index.js +2 -1
- package/dist/components/HomePage/index.js +2 -1
- package/dist/components/Input/index.js +2 -1
- package/dist/components/Loader/index.js +2 -1
- package/dist/components/Menu/IconMenuItem.js +2 -1
- package/dist/components/Menu/MenuHeaderInfo.js +2 -1
- package/dist/components/Menu/NestedMenuItem.js +2 -1
- package/dist/components/Menu/index.js +2 -1
- package/dist/components/Menu/nestedMenuItemsFromObject.js +2 -1
- package/dist/components/Modal/index.js +2 -1
- package/dist/components/Notification/NotificationBody/NotificationList/NotificationList.js +2 -1
- package/dist/components/Notification/index.js +2 -1
- package/dist/components/Panel/index.js +2 -1
- package/dist/components/Popover/index.js +2 -1
- package/dist/components/ProgressBar/index.js +2 -1
- package/dist/components/Prompt/index.js +2 -1
- package/dist/components/RadioButtonGroup/index.js +2 -1
- package/dist/components/Select/index.js +2 -1
- package/dist/components/Sidebar/index.js +2 -1
- package/dist/components/Slider/index.js +2 -1
- package/dist/components/Stepper/index.js +2 -1
- package/dist/components/Switch/index.js +2 -1
- package/dist/components/Table/TableImpl.js +4 -3
- package/dist/components/TableChat/EmptyContainer.js +2 -1
- package/dist/components/TableChat/TableChatSidePanel.js +2 -1
- package/dist/components/TableChat/components/ChatMessageSkeleton/ChatFooterSkeleton.js +2 -1
- package/dist/components/TableChat/components/ChatMessageSkeleton/ChatHeaderSkeleton.js +2 -1
- package/dist/components/TableChat/components/ChatMessageSkeleton/ChatMessageListSkeleton.js +2 -1
- package/dist/components/TableChat/components/ChatMessageSkeleton/ChatSkeleton.js +2 -1
- package/dist/components/TableChat/components/TableChatLeftSection/AddChatContainer/AddChatContainer.js +2 -1
- package/dist/components/TableChat/components/TableChatLeftSection/TableChatChannelHeader.js +2 -1
- package/dist/components/TableChat/components/TableChatRightSection/AvatarGroup/AvatarGroup.js +2 -1
- package/dist/components/TableChat/components/TableChatRightSection/ChatDefaultMessageType/ChatDefaultMessageType.js +2 -1
- package/dist/components/TableChat/components/TableChatRightSection/ChatDeleteMessageType/ChatDeletedMessageType.js +2 -1
- package/dist/components/TableChat/components/TableChatRightSection/ChatHeader/ChatHeader.js +2 -1
- package/dist/components/TableChat/components/TableChatRightSection/ChatInput/ChatInput.js +2 -1
- package/dist/components/TableChat/components/TableChatRightSection/ChatMessageAvatar/ChatMessageAvatar.js +2 -1
- package/dist/components/TableChat/components/TableChatRightSection/ChatMessages/ChatMessage.js +2 -1
- package/dist/components/TableChat/components/TableChatRightSection/ChatNotificationSettings/ChatNotificationSettings.js +2 -1
- package/dist/components/TableChat/components/TableChatRightSection/DateSeparator/DateSeparator.js +2 -1
- package/dist/components/TableChat/components/TableChatRightSection/PinedChatPanel/PinedChatPanel.js +2 -1
- package/dist/components/TableChat/components/TableChatRightSection/TableChatRightSection.js +2 -1
- package/dist/components/TableChat/components/TextEditor/EditorToolbar.js +2 -1
- package/dist/components/TableChat/components/TextEditor/Mention.js +2 -1
- package/dist/components/TableChat/components/TextEditor/MentionList.js +2 -1
- package/dist/components/Tabs/index.js +2 -1
- package/dist/components/Tag/index.js +2 -1
- package/dist/components/TagGroup/index.js +2 -1
- package/dist/components/TextArea/index.js +2 -1
- package/dist/components/Toast/index.js +2 -1
- package/dist/components/Tooltip/index.js +2 -1
- package/dist/components/common/HelperText/index.js +2 -1
- package/dist/components/index.d.ts +0 -1
- package/dist/components/index.d.ts.map +1 -1
- package/dist/components/index.js +0 -1
- package/dist/mcp-component-registry.json +1 -1
- package/dist/styles/entry.d.ts +2 -0
- package/dist/styles/entry.d.ts.map +1 -0
- package/dist/styles/entry.js +1 -0
- package/dist/styles/style.css +1 -1
- package/eslint-plugin/index.js +91 -0
- package/eslint-plugin/rules/no-barrel-import.js +224 -0
- package/package.json +153 -89
- package/dist/0db32db10ae1525f.svg +0 -9
- package/dist/2bc76319b1fa572e.svg +0 -9
- package/dist/39d49e4daed1a992.svg +0 -9
- package/dist/44beedf64dc29d19.svg +0 -9
- package/dist/49a4f914058314f1.svg +0 -9
- package/dist/6fc8a59d621a04a1.svg +0 -13
- package/dist/78f845dcfc981491.svg +0 -9
- package/dist/b31c0c2a19c1c19a.svg +0 -9
- package/dist/index.js +0 -308
- package/dist/index.js.map +0 -1
- package/src/components/Accordion/Accordion.styles.scss +0 -118
- package/src/components/Accordion/index.js +0 -104
- package/src/components/AccordionModern/AccordionModern.styles.scss +0 -121
- package/src/components/AccordionModern/SortableAccordionComp.js +0 -156
- package/src/components/AccordionModern/index.js +0 -103
- package/src/components/Alert/Alert.styles.scss +0 -131
- package/src/components/Alert/index.js +0 -71
- package/src/components/Avatar/Avatar.styles.scss +0 -25
- package/src/components/Avatar/index.js +0 -58
- package/src/components/Badge/Badges.style.scss +0 -55
- package/src/components/Badge/filled/filledIconLabelBadges/filledIconLabelBadges.styles.scss +0 -32
- package/src/components/Badge/filled/filledIconLabelBadges/index.js +0 -38
- package/src/components/Badge/filled/filledOnlyIconBadges/filledOnlyIconBadges.styles.scss +0 -26
- package/src/components/Badge/filled/filledOnlyIconBadges/index.js +0 -31
- package/src/components/Badge/filled/filledOnlyLabelBadges/filledOnlyLabelBadges.styles.scss +0 -66
- package/src/components/Badge/filled/filledOnlyLabelBadges/index.js +0 -31
- package/src/components/Badge/filled/index.js +0 -30
- package/src/components/Badge/index.js +0 -53
- package/src/components/Badge/stroke/index.js +0 -43
- package/src/components/Badge/stroke/strokeIconLabelBadges/index.js +0 -38
- package/src/components/Badge/stroke/strokeIconLabelBadges/strokeIconLabelBadges.styles.scss +0 -33
- package/src/components/Badge/stroke/strokeOnlyIconBadges/index.js +0 -31
- package/src/components/Badge/stroke/strokeOnlyIconBadges/strokeOnlyIconBadges.styles.scss +0 -27
- package/src/components/Badge/stroke/strokeOnlyLabelBadges/index.js +0 -31
- package/src/components/Badge/stroke/strokeOnlyLabelBadges/strokeOnlyLabelBadges.styles.scss +0 -89
- package/src/components/Badge/styles.css +0 -52
- package/src/components/Badge/subtle/index.js +0 -41
- package/src/components/Badge/subtle/subtleIOnlyIconBadges/index.js +0 -31
- package/src/components/Badge/subtle/subtleIOnlyIconBadges/subtleIOnlyIconBadges.scss +0 -26
- package/src/components/Badge/subtle/subtleIconLabelBadges/index.js +0 -38
- package/src/components/Badge/subtle/subtleIconLabelBadges/subtleIconLabelBadges.scss +0 -56
- package/src/components/Badge/subtle/subtleOnlyLabelBadges/index.js +0 -31
- package/src/components/Badge/subtle/subtleOnlyLabelBadges/subtleOnlyLabelBadges.scss +0 -70
- package/src/components/BottomSheet/BottomSheet.styles.scss +0 -46
- package/src/components/BottomSheet/index.js +0 -60
- package/src/components/Breadcrumbs/Breadcrumbs.styles.scss +0 -65
- package/src/components/Breadcrumbs/index.js +0 -121
- package/src/components/Button/Button.styles.scss +0 -345
- package/src/components/Button/index.js +0 -171
- package/src/components/ButtonGroup/ButtonGroup.styles.scss +0 -125
- package/src/components/ButtonGroup/index.js +0 -84
- package/src/components/Card/Card.styles.scss +0 -33
- package/src/components/Card/index.js +0 -21
- package/src/components/Chart/Chart.style.scss +0 -142
- package/src/components/Chart/index.js +0 -752
- package/src/components/ChatBot/bookMarkPanel.js +0 -74
- package/src/components/ChatBot/chatBot.style.scss +0 -1295
- package/src/components/ChatBot/chatBotFooter.js +0 -14
- package/src/components/ChatBot/chatBotLandingScreen.js +0 -26
- package/src/components/ChatBot/chatInput.js +0 -206
- package/src/components/ChatBot/chatbotModuleMenu.js +0 -278
- package/src/components/ChatBot/constant.js +0 -32
- package/src/components/ChatBot/conversationScreen.js +0 -281
- package/src/components/ChatBot/customScreen.js +0 -69
- package/src/components/ChatBot/historyPanel.js +0 -579
- package/src/components/ChatBot/index.js +0 -473
- package/src/components/ChatBot/newChatComponent.js +0 -105
- package/src/components/ChatBot/utils.js +0 -27
- package/src/components/Checkbox/Checkbox.styles.scss +0 -232
- package/src/components/Checkbox/dashed/index.js +0 -34
- package/src/components/Checkbox/default/index.js +0 -70
- package/src/components/Checkbox/index.js +0 -50
- package/src/components/Checkbox/withDropDown/index.js +0 -96
- package/src/components/Checkbox/withoutFormLabel/index.js +0 -46
- package/src/components/Chips/Chip.style.scss +0 -134
- package/src/components/Chips/index.js +0 -34
- package/src/components/CreateItemFlow/CreateItemFlow.styles.scss +0 -37
- package/src/components/CreateItemFlow/index.js +0 -145
- package/src/components/DatePicker/DatePicker.styles.scss +0 -519
- package/src/components/DatePicker/datePickerDropdown.js +0 -282
- package/src/components/DatePicker/datePickerFooter.js +0 -76
- package/src/components/DatePicker/datePickerInput.js +0 -333
- package/src/components/DatePicker/index.js +0 -288
- package/src/components/DatePicker/showMonthYearSelect.js +0 -119
- package/src/components/DateRangePicker/DateRangePicker.styles.scss +0 -635
- package/src/components/DateRangePicker/dateRangePickerCustom.js +0 -22
- package/src/components/DateRangePicker/dateRangePickerDropdown.js +0 -320
- package/src/components/DateRangePicker/dateRangePickerFooter.js +0 -50
- package/src/components/DateRangePicker/dateRangePickerInput.js +0 -544
- package/src/components/DateRangePicker/index.js +0 -393
- package/src/components/DateRangePicker/showMonthYearSelect.js +0 -103
- package/src/components/DateRangePicker/utils.js +0 -71
- package/src/components/DynamicLayout/DynamicLayout.styles.scss +0 -153
- package/src/components/DynamicLayout/index.js +0 -73
- package/src/components/EmptyState/EmptyState.styles.scss +0 -88
- package/src/components/EmptyState/EmptyStateImageComponent.jsx +0 -36
- package/src/components/EmptyState/index.js +0 -54
- package/src/components/FileUpload/FileUpload.styles.scss +0 -449
- package/src/components/FileUpload/index.js +0 -641
- package/src/components/FilterPanel/FilterPanel.styles.scss +0 -241
- package/src/components/FilterPanel/FilterPanelHeader.js +0 -15
- package/src/components/FilterPanel/PanelFooter.js +0 -65
- package/src/components/FilterPanel/PanelSidebar.js +0 -85
- package/src/components/FilterPanel/index.js +0 -147
- package/src/components/FiltersStrip/FiltersStrip.styles.scss +0 -343
- package/src/components/FiltersStrip/Slider/FilterSlider.styles.scss +0 -85
- package/src/components/FiltersStrip/Slider/Portal.js +0 -59
- package/src/components/FiltersStrip/Slider/index.js +0 -233
- package/src/components/FiltersStrip/appliedFilter.js +0 -180
- package/src/components/FiltersStrip/filterDropDown.js +0 -96
- package/src/components/FiltersStrip/index.js +0 -127
- package/src/components/FiltersStrip/mockData.js +0 -227
- package/src/components/Header/Header.styles.scss +0 -223
- package/src/components/Header/index.js +0 -156
- package/src/components/HomePage/HomePage.styles.scss +0 -1638
- package/src/components/HomePage/constant.js +0 -331
- package/src/components/HomePage/index.js +0 -675
- package/src/components/Input/Input.styles.scss +0 -318
- package/src/components/Input/helperText.js +0 -19
- package/src/components/Input/index.js +0 -60
- package/src/components/Input/inputWithIcon.js +0 -134
- package/src/components/Input/vanilaInput.js +0 -68
- package/src/components/Loader/Loader.styles.scss +0 -90
- package/src/components/Loader/index.js +0 -69
- package/src/components/Menu/IconMenuItem.js +0 -100
- package/src/components/Menu/Menu.styles.scss +0 -190
- package/src/components/Menu/MenuHeader.jsx +0 -84
- package/src/components/Menu/MenuHeaderInfo.jsx +0 -319
- package/src/components/Menu/MenuHeaderInfo.styles.scss +0 -123
- package/src/components/Menu/NestedMenuItem.js +0 -189
- package/src/components/Menu/index.js +0 -254
- package/src/components/Menu/nestedMenuItemsFromObject.js +0 -100
- package/src/components/Modal/Modal.styles.scss +0 -129
- package/src/components/Modal/index.js +0 -141
- package/src/components/MonthPicker/MonthPicker.styles.scss +0 -255
- package/src/components/MonthPicker/constant.js +0 -1
- package/src/components/MonthPicker/index.js +0 -373
- package/src/components/MonthRangePicker/MonthRangePicker.styles.scss +0 -383
- package/src/components/MonthRangePicker/constant.js +0 -1
- package/src/components/MonthRangePicker/index.js +0 -574
- package/src/components/Notification/Notification.styles.scss +0 -594
- package/src/components/Notification/NotificationBody/NotificationInfoList/chipsLists.js +0 -144
- package/src/components/Notification/NotificationBody/NotificationInfoList/index.js +0 -128
- package/src/components/Notification/NotificationBody/NotificationInfoList/notificationList.js +0 -165
- package/src/components/Notification/NotificationBody/NotificationPanels/chipsLists.js +0 -85
- package/src/components/Notification/NotificationBody/NotificationPanels/index.js +0 -259
- package/src/components/Notification/NotificationBody/NotificationPanels/notificationList.js +0 -637
- package/src/components/Notification/NotificationBody/index.js +0 -117
- package/src/components/Notification/index.js +0 -128
- package/src/components/Notification/mockData.js +0 -389
- package/src/components/Notification/notificationFooter.js +0 -31
- package/src/components/Notification/notificationHeader.js +0 -28
- package/src/components/Panel/Panel.styles.scss +0 -71
- package/src/components/Panel/index.js +0 -144
- package/src/components/Popover/Popover.styles.scss +0 -52
- package/src/components/Popover/index.js +0 -71
- package/src/components/Portal/index.js +0 -31
- package/src/components/ProgressBar/ProgressBar.styles.scss +0 -62
- package/src/components/ProgressBar/index.js +0 -40
- package/src/components/Prompt/Prompt.styles.scss +0 -107
- package/src/components/Prompt/index.js +0 -107
- package/src/components/RadioButtonGroup/RadioButtonGroup.styles.scss +0 -136
- package/src/components/RadioButtonGroup/index.js +0 -107
- package/src/components/Select/SearchFilter.js +0 -72
- package/src/components/Select/Select.styles.scss +0 -748
- package/src/components/Select/customGroupHeading.js +0 -24
- package/src/components/Select/dropdown.js +0 -65
- package/src/components/Select/hooks/index.js +0 -2
- package/src/components/Select/hooks/useClickOutside.js +0 -61
- package/src/components/Select/hooks/useMenuPosition.js +0 -288
- package/src/components/Select/index.js +0 -1307
- package/src/components/Select/menuList.js +0 -119
- package/src/components/Select/optionList.js +0 -215
- package/src/components/Select/selected-option-tags.js +0 -99
- package/src/components/Select/utils.js +0 -232
- package/src/components/Sidebar/Menus/childMenu.js +0 -88
- package/src/components/Sidebar/Menus/index.js +0 -130
- package/src/components/Sidebar/Menus/parentMenu.js +0 -173
- package/src/components/Sidebar/Sidebar.styles.scss +0 -411
- package/src/components/Sidebar/actions.js +0 -31
- package/src/components/Sidebar/index.js +0 -84
- package/src/components/Sidebar/mock.js +0 -202
- package/src/components/Slider/Sliders.styles.scss +0 -260
- package/src/components/Slider/index.js +0 -314
- package/src/components/Stepper/Stepper.styles.scss +0 -355
- package/src/components/Stepper/index.js +0 -101
- package/src/components/Switch/Switch.styles.scss +0 -96
- package/src/components/Switch/index.js +0 -59
- package/src/components/Table/AdvanceSearchModalItem.js +0 -392
- package/src/components/Table/AdvanceSortModal.js +0 -332
- package/src/components/Table/AgGridHeader.js +0 -1009
- package/src/components/Table/CommentsPortal.js +0 -428
- package/src/components/Table/NewAdvanceSearchModal/NewAdvanceSearchModal.js +0 -323
- package/src/components/Table/NewAdvanceSearchModal/NewAdvanceSearchModalItem.js +0 -476
- package/src/components/Table/NoComments.js +0 -295
- package/src/components/Table/Table.styles.scss +0 -3859
- package/src/components/Table/actionBar.js +0 -43
- package/src/components/Table/advanceSearchModal.js +0 -797
- package/src/components/Table/commentPanel.js +0 -421
- package/src/components/Table/filterUtils.js +0 -850
- package/src/components/Table/index.js +0 -2175
- package/src/components/Table/mockData.js +0 -1344
- package/src/components/Table/tableFunctions.js +0 -1676
- package/src/components/Table/tableHeader.js +0 -476
- package/src/components/Table/tableIcons.js +0 -61
- package/src/components/Table/tableMoreOptions.js +0 -293
- package/src/components/Table/tablePagination.js +0 -63
- package/src/components/Table/tableSettings.js +0 -287
- package/src/components/Table/withCommentIcon.js +0 -107
- package/src/components/TableChat/EmptyContainer.jsx +0 -13
- package/src/components/TableChat/README.md +0 -588
- package/src/components/TableChat/TableChatSidePanel.jsx +0 -832
- package/src/components/TableChat/TableChatSidePanel.styles.scss +0 -57
- package/src/components/TableChat/components/ChatMessageSkeleton/ChatFooterSkeleton.jsx +0 -43
- package/src/components/TableChat/components/ChatMessageSkeleton/ChatHeaderSkeleton.jsx +0 -55
- package/src/components/TableChat/components/ChatMessageSkeleton/ChatMessageListSkeleton.jsx +0 -94
- package/src/components/TableChat/components/ChatMessageSkeleton/ChatSkeleton.jsx +0 -22
- package/src/components/TableChat/components/ChatMessageSkeleton/ChatSkeleton.scss +0 -179
- package/src/components/TableChat/components/SkeletonList.jsx +0 -12
- package/src/components/TableChat/components/TableChatLeftSection/AddChatContainer/AddChatContainer.jsx +0 -171
- package/src/components/TableChat/components/TableChatLeftSection/AddChatContainer/AddChatContainer.styles.scss +0 -37
- package/src/components/TableChat/components/TableChatLeftSection/ChannelCheckbox/ChannelCheckbox.jsx +0 -28
- package/src/components/TableChat/components/TableChatLeftSection/ChatChannelItem.jsx +0 -116
- package/src/components/TableChat/components/TableChatLeftSection/ChatChannelList.jsx +0 -89
- package/src/components/TableChat/components/TableChatLeftSection/ChatHeaderButton/ChatHeaderButton.jsx +0 -27
- package/src/components/TableChat/components/TableChatLeftSection/ChatHeaderNavigation.jsx +0 -191
- package/src/components/TableChat/components/TableChatLeftSection/ChatIconButton/ChatIconButton.jsx +0 -23
- package/src/components/TableChat/components/TableChatLeftSection/TableChatChannelHeader.jsx +0 -117
- package/src/components/TableChat/components/TableChatLeftSection/TableChatChannelHeader.styles.scss +0 -469
- package/src/components/TableChat/components/TableChatLeftSection/UnreadBadge/UnreadBadge.jsx +0 -16
- package/src/components/TableChat/components/TableChatRightSection/AvatarGroup/AvatarGroup.jsx +0 -119
- package/src/components/TableChat/components/TableChatRightSection/AvatarGroup/AvatarGroup.styles.scss +0 -87
- package/src/components/TableChat/components/TableChatRightSection/ChatDefaultMessageType/ChatDefaultMessageType.jsx +0 -216
- package/src/components/TableChat/components/TableChatRightSection/ChatDefaultMessageType/ChatDefaultMessageType.styles.scss +0 -291
- package/src/components/TableChat/components/TableChatRightSection/ChatDeleteMessageType/ChatDeletedMessageType.jsx +0 -19
- package/src/components/TableChat/components/TableChatRightSection/ChatDeleteMessageType/DeletedMessage.styles.scss +0 -55
- package/src/components/TableChat/components/TableChatRightSection/ChatEditedMessageType/ChatEditedMessageType.jsx +0 -61
- package/src/components/TableChat/components/TableChatRightSection/ChatEditedMessageType/ChatEditedMessageType.styles.scss +0 -13
- package/src/components/TableChat/components/TableChatRightSection/ChatHeader/ChatHeader.jsx +0 -432
- package/src/components/TableChat/components/TableChatRightSection/ChatHeader/ChatHeaderAction.jsx +0 -365
- package/src/components/TableChat/components/TableChatRightSection/ChatHeader/ChatHeaderInfo.jsx +0 -42
- package/src/components/TableChat/components/TableChatRightSection/ChatHeader/chatHeader.styles.scss +0 -323
- package/src/components/TableChat/components/TableChatRightSection/ChatInput/ChatInput.jsx +0 -793
- package/src/components/TableChat/components/TableChatRightSection/ChatInput/ChatInput.styles.scss +0 -394
- package/src/components/TableChat/components/TableChatRightSection/ChatMessageActions/ChatMessageActions.jsx +0 -61
- package/src/components/TableChat/components/TableChatRightSection/ChatMessageActions/ChatMessageActions.styles.scss +0 -28
- package/src/components/TableChat/components/TableChatRightSection/ChatMessageAvatar/ChatMessageAvatar.jsx +0 -11
- package/src/components/TableChat/components/TableChatRightSection/ChatMessageAvatar/ChatMessageAvatar.styles.scss +0 -3
- package/src/components/TableChat/components/TableChatRightSection/ChatMessages/ChatMessage.jsx +0 -220
- package/src/components/TableChat/components/TableChatRightSection/ChatMessages/ChatMessage.styles.scss +0 -128
- package/src/components/TableChat/components/TableChatRightSection/ChatNotificationSettings/ChatNotificationSettings.jsx +0 -246
- package/src/components/TableChat/components/TableChatRightSection/ChatNotificationSettings/ChatNotificationSettings.styles.scss +0 -210
- package/src/components/TableChat/components/TableChatRightSection/DateSeparator/DateSeparator.jsx +0 -52
- package/src/components/TableChat/components/TableChatRightSection/DateSeparator/DateSeparator.styles.scss +0 -34
- package/src/components/TableChat/components/TableChatRightSection/EmojiPicker/EmojiPicker.jsx +0 -31
- package/src/components/TableChat/components/TableChatRightSection/FileUploader/FileUploader.jsx +0 -170
- package/src/components/TableChat/components/TableChatRightSection/ImageUploader/ImageUploader.jsx +0 -165
- package/src/components/TableChat/components/TableChatRightSection/PinedChatPanel/PinedChat.styles.scss +0 -587
- package/src/components/TableChat/components/TableChatRightSection/PinedChatPanel/PinedChatPanel.jsx +0 -244
- package/src/components/TableChat/components/TableChatRightSection/ReplyBadge/ReplyBadge.jsx +0 -29
- package/src/components/TableChat/components/TableChatRightSection/ReplyBadge/ReplyBadge.styles.scss +0 -47
- package/src/components/TableChat/components/TableChatRightSection/TableChatRightSection.jsx +0 -1340
- package/src/components/TableChat/components/TableChatRightSection/TableChatRightSection.styles.scss +0 -147
- package/src/components/TableChat/components/TextEditor/EditorToolbar.jsx +0 -209
- package/src/components/TableChat/components/TextEditor/EditorToolbar.styles.scss +0 -61
- package/src/components/TableChat/components/TextEditor/Mention.jsx +0 -234
- package/src/components/TableChat/components/TextEditor/MentionList.jsx +0 -118
- package/src/components/TableChat/components/TextEditor/MentionList.scss +0 -146
- package/src/components/TableChat/components/TextEditor/styles.scss +0 -278
- package/src/components/TableChat/components/TextEditor/suggestion.js +0 -124
- package/src/components/TableChat/components/chatConfig.js +0 -64
- package/src/components/TableChat/hooks/useInfiniteScroll.js +0 -256
- package/src/components/TableOld/AgGridHeader.js +0 -545
- package/src/components/TableOld/Table.styles.scss +0 -2192
- package/src/components/TableOld/actionBar.js +0 -43
- package/src/components/TableOld/index.js +0 -598
- package/src/components/TableOld/mockData.js +0 -1344
- package/src/components/TableOld/tableFunctions.js +0 -1734
- package/src/components/TableOld/tableHeader.js +0 -251
- package/src/components/TableOld/tableIcons.js +0 -61
- package/src/components/TableOld/tablePagination.js +0 -64
- package/src/components/TableOld/tableSettings.js +0 -166
- package/src/components/Tabs/Tabs.styles.scss +0 -120
- package/src/components/Tabs/index.js +0 -91
- package/src/components/Tabs/tabPanel.js +0 -38
- package/src/components/Tag/Tags.styles.scss +0 -71
- package/src/components/Tag/filled.js +0 -48
- package/src/components/Tag/index.js +0 -54
- package/src/components/Tag/solid.js +0 -47
- package/src/components/Tag/stroke.js +0 -47
- package/src/components/Tag/utils.js +0 -12
- package/src/components/TagGroup/TagGroup.styles.scss +0 -7
- package/src/components/TagGroup/index.js +0 -6
- package/src/components/TextArea/TextArea.styles.scss +0 -158
- package/src/components/TextArea/index.js +0 -121
- package/src/components/Toast/Toast.styles.scss +0 -66
- package/src/components/Toast/index.js +0 -35
- package/src/components/Tooltip/Tooltips.styles.scss +0 -111
- package/src/components/Tooltip/index.js +0 -68
- package/src/components/common/HelperText/HelperText.styles.scss +0 -18
- package/src/components/common/HelperText/index.js +0 -44
- package/src/components/common/MentionEditor/MentionEditor.styles.scss +0 -301
- package/src/components/common/MentionEditor/MentionList/MentionList.styles.scss +0 -146
- package/src/components/common/MentionEditor/MentionList/index.js +0 -130
- package/src/components/common/MentionEditor/index.js +0 -246
- package/src/components/common/MentionEditor/suggestion.js +0 -124
- package/src/components/index.js +0 -53
- package/src/stories/Accordion.stories.js +0 -151
- package/src/stories/AccordionModern.stories.js +0 -263
- package/src/stories/Alert.stories.js +0 -103
- package/src/stories/Avatar.stories.js +0 -79
- package/src/stories/Badge.stories.js +0 -112
- package/src/stories/BottomSheet.stories.js +0 -224
- package/src/stories/Breadcrumbs.stories.js +0 -143
- package/src/stories/Button.stories.js +0 -190
- package/src/stories/ButtonGroup.stories.js +0 -123
- package/src/stories/Card.stories.js +0 -73
- package/src/stories/Changelog.mdx +0 -1006
- package/src/stories/Chart.stories.js +0 -2017
- package/src/stories/ChatBot.stories.js +0 -668
- package/src/stories/Checkbox.stories.js +0 -209
- package/src/stories/Chips.stories.js +0 -106
- package/src/stories/CreateItemFlow.stories.js +0 -255
- package/src/stories/DatePicker.stories.js +0 -311
- package/src/stories/DateRangePicker.stories.js +0 -364
- package/src/stories/EmptyState.stories.js +0 -110
- package/src/stories/FileUpload.stories.js +0 -169
- package/src/stories/FilterPanel.stories.js +0 -309
- package/src/stories/FiltersStrip.stories.js +0 -244
- package/src/stories/GettingStarted.mdx +0 -153
- package/src/stories/Header.stories.js +0 -185
- package/src/stories/HomePage.stories.js +0 -201
- package/src/stories/Input.stories.js +0 -165
- package/src/stories/Loader.stories.js +0 -33
- package/src/stories/Menu.stories.js +0 -309
- package/src/stories/Modal.stories.js +0 -185
- package/src/stories/MonthPicker.stories.js +0 -313
- package/src/stories/MonthRangePicker.stories.js +0 -255
- package/src/stories/Notification.stories.js +0 -500
- package/src/stories/Panel.stories.js +0 -179
- package/src/stories/Popover.stories.js +0 -125
- package/src/stories/ProgressBar.stories.js +0 -93
- package/src/stories/Prompt.stories.js +0 -120
- package/src/stories/RadioButtonGroup.stories.js +0 -83
- package/src/stories/Select.stories.js +0 -753
- package/src/stories/Sidebar.stories.js +0 -177
- package/src/stories/Slider.stories.js +0 -226
- package/src/stories/Stepper.stories.js +0 -158
- package/src/stories/Switch.stories.js +0 -72
- package/src/stories/Table.stories.js +0 -4323
- package/src/stories/TableChat.mdx +0 -992
- package/src/stories/TableChat.stories.js +0 -1712
- package/src/stories/TableOld.stories.js +0 -954
- package/src/stories/Tabs.stories.js +0 -253
- package/src/stories/Tag.stories.js +0 -92
- package/src/stories/TagGroup.stories.js +0 -39
- package/src/stories/TextArea.stories.js +0 -148
- package/src/stories/Toast.stories.js +0 -113
- package/src/stories/Tooltip.stories.js +0 -86
- package/src/stories/storybookLinks.mdx +0 -20
|
@@ -1,641 +0,0 @@
|
|
|
1
|
-
import React, { useRef, useState, useEffect, useMemo } from "react";
|
|
2
|
-
import PropTypes from "prop-types";
|
|
3
|
-
import ClearIcon from "@mui/icons-material/Clear";
|
|
4
|
-
import { Button } from "../Button";
|
|
5
|
-
import { ProgressBar } from "../ProgressBar";
|
|
6
|
-
import "./FileUpload.styles.scss";
|
|
7
|
-
import { ReactComponent as UploadDownloadIcon } from "../../assets/uploadDownloadIcon.svg";
|
|
8
|
-
import uploadDownloadIcon from "../../assets/uploadDownloadIcon.svg";
|
|
9
|
-
import downArrow from "../../assets/downArrow.svg";
|
|
10
|
-
import fileUploadDownloadIcon from "../../assets/fileUploadDownloadIcon.svg";
|
|
11
|
-
import fileUploadRetryIcon from "../../assets/fileUploadRetryIcon.svg";
|
|
12
|
-
import uploadCloseIcon from "../../assets/upload-close-icon.svg";
|
|
13
|
-
import uploadPauseIcon from "../../assets/upload-pause-icon.svg";
|
|
14
|
-
import { Menu } from "../Menu";
|
|
15
|
-
import { toCamelCase } from "../../utils/helper";
|
|
16
|
-
export const sizeConventions = [
|
|
17
|
-
"B",
|
|
18
|
-
"KB",
|
|
19
|
-
"MB",
|
|
20
|
-
"GB",
|
|
21
|
-
"TB",
|
|
22
|
-
"PB",
|
|
23
|
-
"EB",
|
|
24
|
-
"ZB",
|
|
25
|
-
"YB",
|
|
26
|
-
];
|
|
27
|
-
|
|
28
|
-
const fileTypes = {
|
|
29
|
-
pdf: ["application/pdf"],
|
|
30
|
-
image: [
|
|
31
|
-
"image/png",
|
|
32
|
-
"image/jpeg",
|
|
33
|
-
"image/jpg",
|
|
34
|
-
"image/gif",
|
|
35
|
-
"image/bmp",
|
|
36
|
-
"image/webp",
|
|
37
|
-
"image/svg+xml",
|
|
38
|
-
"image/tiff",
|
|
39
|
-
],
|
|
40
|
-
xls: [
|
|
41
|
-
"application/vnd.ms-excel",
|
|
42
|
-
"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",
|
|
43
|
-
],
|
|
44
|
-
xlsx: [
|
|
45
|
-
"application/vnd.ms-excel",
|
|
46
|
-
"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",
|
|
47
|
-
],
|
|
48
|
-
csv: ["text/csv"],
|
|
49
|
-
text: ["text/plain"],
|
|
50
|
-
html: ["text/html"],
|
|
51
|
-
audio: ["audio/mpeg", "audio/wav", "audio/ogg"],
|
|
52
|
-
video: ["video/mp4", "video/webm", "video/ogg"],
|
|
53
|
-
zip: ["application/x-zip-compressed", "application/zip"],
|
|
54
|
-
|
|
55
|
-
default: ["application/octet-stream"],
|
|
56
|
-
};
|
|
57
|
-
|
|
58
|
-
export const FileUpload = ({
|
|
59
|
-
fileList,
|
|
60
|
-
onFileListChange,
|
|
61
|
-
disabled = false,
|
|
62
|
-
numberOfFiles: numFiles = 1,
|
|
63
|
-
validFileTypes = [
|
|
64
|
-
{ fileType: "xlsx", templateDownloader: undefined, typeOverride: false },
|
|
65
|
-
{ fileType: "csv", templateDownloader: undefined, typeOverride: false },
|
|
66
|
-
],
|
|
67
|
-
primaryButtonLabel,
|
|
68
|
-
secondaryButtonLabel,
|
|
69
|
-
onPrimaryButtonClick,
|
|
70
|
-
primaryButtonProps,
|
|
71
|
-
onSecondaryButtonClick,
|
|
72
|
-
secondaryButtonProps,
|
|
73
|
-
onClose,
|
|
74
|
-
customFailedActionButton,
|
|
75
|
-
options,
|
|
76
|
-
selectedValues,
|
|
77
|
-
onMenuPrimaryButtonClick,
|
|
78
|
-
onTertiaryButtonClick,
|
|
79
|
-
}) => {
|
|
80
|
-
const wrapperRef = useRef(null);
|
|
81
|
-
const fileUploadRef = useRef(null);
|
|
82
|
-
const hiddenFileUploadRef = useRef(null);
|
|
83
|
-
const containerRef = useRef(null);
|
|
84
|
-
const [currentFileType, setCurrentFileType] = useState(
|
|
85
|
-
validFileTypes[0]?.fileType
|
|
86
|
-
);
|
|
87
|
-
const [isError, setIsError] = useState(false);
|
|
88
|
-
const [isDraggedOver, setIsDraggedOver] = useState(false);
|
|
89
|
-
const [showDownLoadMenu, setShowDownLoadMenu] = useState(false);
|
|
90
|
-
|
|
91
|
-
const numberOfFiles = numFiles >= 1 ? Math.floor(numFiles) : 1;
|
|
92
|
-
const [isOpen, setIsOpen] = useState(false);
|
|
93
|
-
const [anchorEl, setAnchorEl] = useState(null);
|
|
94
|
-
const [selected, setSelected] = useState(
|
|
95
|
-
(selectedValues || []).map((val) => toCamelCase(val))
|
|
96
|
-
);
|
|
97
|
-
|
|
98
|
-
const menuOptions = useMemo(
|
|
99
|
-
() =>
|
|
100
|
-
options?.map((item) => ({
|
|
101
|
-
label: item,
|
|
102
|
-
value: toCamelCase(item),
|
|
103
|
-
onClick: () =>
|
|
104
|
-
setSelected((prev) => {
|
|
105
|
-
const val = toCamelCase(item);
|
|
106
|
-
return prev?.includes(val)
|
|
107
|
-
? prev.filter((v) => v !== val)
|
|
108
|
-
: [...prev, val];
|
|
109
|
-
}),
|
|
110
|
-
})),
|
|
111
|
-
[options]
|
|
112
|
-
);
|
|
113
|
-
|
|
114
|
-
useEffect(() => {
|
|
115
|
-
const fileType = validFileTypes.map((file) => fileTypes[file.fileType]);
|
|
116
|
-
setCurrentFileType(fileType.join(","));
|
|
117
|
-
}, [validFileTypes]);
|
|
118
|
-
|
|
119
|
-
const onDragEnter = () => {
|
|
120
|
-
setIsDraggedOver(true);
|
|
121
|
-
wrapperRef.current.classList.add("ia-fileUpload-dragOver");
|
|
122
|
-
};
|
|
123
|
-
|
|
124
|
-
const onDragLeave = () => {
|
|
125
|
-
setIsDraggedOver(false);
|
|
126
|
-
wrapperRef.current.classList.remove("ia-fileUpload-dragOver");
|
|
127
|
-
};
|
|
128
|
-
|
|
129
|
-
const onDrop = (e) => {
|
|
130
|
-
e.preventDefault();
|
|
131
|
-
e.stopPropagation();
|
|
132
|
-
setIsDraggedOver(false);
|
|
133
|
-
wrapperRef.current.classList.remove("ia-fileUpload-dragOver");
|
|
134
|
-
onFileDrop(e, true);
|
|
135
|
-
};
|
|
136
|
-
|
|
137
|
-
const onFileDrop = (e, isDragEvent = false) => {
|
|
138
|
-
let newFiles;
|
|
139
|
-
if (isDragEvent) {
|
|
140
|
-
newFiles = e.dataTransfer && e.dataTransfer.files;
|
|
141
|
-
} else {
|
|
142
|
-
newFiles = e.target.files;
|
|
143
|
-
}
|
|
144
|
-
|
|
145
|
-
if (!newFiles || newFiles.length === 0) return;
|
|
146
|
-
|
|
147
|
-
const filesToAdd = [];
|
|
148
|
-
const maxFilesToAdd = numberOfFiles - fileList.length;
|
|
149
|
-
|
|
150
|
-
// Process up to the maximum allowed files
|
|
151
|
-
for (let i = 0; i < Math.min(newFiles.length, maxFilesToAdd); i++) {
|
|
152
|
-
const newFile = newFiles[i];
|
|
153
|
-
|
|
154
|
-
// Check if file type is valid
|
|
155
|
-
if (
|
|
156
|
-
!validFileTypes.find((vft) =>
|
|
157
|
-
vft.typeOverride
|
|
158
|
-
? vft.fileType === newFile.type
|
|
159
|
-
: fileTypes[vft.fileType]?.includes(newFile.type)
|
|
160
|
-
)
|
|
161
|
-
) {
|
|
162
|
-
setIsError(true);
|
|
163
|
-
continue;
|
|
164
|
-
}
|
|
165
|
-
|
|
166
|
-
// Check if file already exists
|
|
167
|
-
if (
|
|
168
|
-
fileList.find(
|
|
169
|
-
(f) => f.file.name === newFile.name && f.file.size === newFile.size
|
|
170
|
-
) ||
|
|
171
|
-
filesToAdd.find(
|
|
172
|
-
(f) => f.file.name === newFile.name && f.file.size === newFile.size
|
|
173
|
-
)
|
|
174
|
-
) {
|
|
175
|
-
continue;
|
|
176
|
-
}
|
|
177
|
-
|
|
178
|
-
filesToAdd.push({
|
|
179
|
-
file: newFile,
|
|
180
|
-
progress: 0,
|
|
181
|
-
isUploadRunning: false,
|
|
182
|
-
failed: false,
|
|
183
|
-
});
|
|
184
|
-
}
|
|
185
|
-
|
|
186
|
-
if (filesToAdd.length > 0) {
|
|
187
|
-
setIsError(false);
|
|
188
|
-
const updatedList = [...fileList, ...filesToAdd];
|
|
189
|
-
onFileListChange(updatedList);
|
|
190
|
-
}
|
|
191
|
-
};
|
|
192
|
-
|
|
193
|
-
const fileRemove = (file) => {
|
|
194
|
-
const updatedList = [...fileList];
|
|
195
|
-
|
|
196
|
-
updatedList.splice(fileList.indexOf(file), 1);
|
|
197
|
-
|
|
198
|
-
onFileListChange(updatedList);
|
|
199
|
-
};
|
|
200
|
-
|
|
201
|
-
const onUploadClick = () => {
|
|
202
|
-
hiddenFileUploadRef.current.click();
|
|
203
|
-
};
|
|
204
|
-
|
|
205
|
-
const templateDownloader = useMemo(() => {
|
|
206
|
-
if (!Array.isArray(validFileTypes)) return null;
|
|
207
|
-
return validFileTypes.find((vft) => vft.templateDownloader);
|
|
208
|
-
}, [validFileTypes]);
|
|
209
|
-
|
|
210
|
-
const handleTemplateDownloadMenu = () => {
|
|
211
|
-
setShowDownLoadMenu(!showDownLoadMenu);
|
|
212
|
-
};
|
|
213
|
-
|
|
214
|
-
const handleClickOutside = (event) => {
|
|
215
|
-
if (
|
|
216
|
-
!event.target.closest(".ia-fileUpload-validFileType-container") &&
|
|
217
|
-
!event.target.closest(".ia-fileUpload-validFileType-menu-item")
|
|
218
|
-
) {
|
|
219
|
-
setShowDownLoadMenu(false);
|
|
220
|
-
setIsOpen(false);
|
|
221
|
-
}
|
|
222
|
-
};
|
|
223
|
-
|
|
224
|
-
useEffect(() => {
|
|
225
|
-
if (showDownLoadMenu) {
|
|
226
|
-
document.addEventListener("click", handleClickOutside);
|
|
227
|
-
} else {
|
|
228
|
-
document.removeEventListener("click", handleClickOutside);
|
|
229
|
-
}
|
|
230
|
-
}, [showDownLoadMenu]);
|
|
231
|
-
|
|
232
|
-
const selectedFileType = useMemo(() => {
|
|
233
|
-
return (
|
|
234
|
-
validFileTypes.find((vft) => vft.fileType === "xlsx")?.fileType ||
|
|
235
|
-
validFileTypes[0]?.fileType
|
|
236
|
-
);
|
|
237
|
-
}, [validFileTypes]);
|
|
238
|
-
|
|
239
|
-
return (
|
|
240
|
-
<div ref={containerRef} className="ia-fileUpload-container">
|
|
241
|
-
<div className="ia-fileUpload-container-header">
|
|
242
|
-
<div className="ia-fileUpload-container-header-title">
|
|
243
|
-
<span className="ia-fileUpload-container-header-title-primary">
|
|
244
|
-
Upload Your File
|
|
245
|
-
</span>
|
|
246
|
-
<span className="ia-fileUpload-container-header-title-secondary">
|
|
247
|
-
You can upload up to {numberOfFiles} file
|
|
248
|
-
{numberOfFiles > 1 ? "s" : ""}
|
|
249
|
-
</span>
|
|
250
|
-
</div>
|
|
251
|
-
<ClearIcon
|
|
252
|
-
className="ia-fileUpload-container-header-closeIcon"
|
|
253
|
-
onClick={onClose}
|
|
254
|
-
/>
|
|
255
|
-
</div>
|
|
256
|
-
<input
|
|
257
|
-
ref={hiddenFileUploadRef}
|
|
258
|
-
type="file"
|
|
259
|
-
onChange={onFileDrop}
|
|
260
|
-
style={{ display: "none" }}
|
|
261
|
-
accept={currentFileType}
|
|
262
|
-
value=""
|
|
263
|
-
multiple={numberOfFiles > 1}
|
|
264
|
-
/>
|
|
265
|
-
{fileList.length >= numberOfFiles ? null : (
|
|
266
|
-
<button
|
|
267
|
-
ref={wrapperRef}
|
|
268
|
-
className={`ia-styles ia-fileUpload ${
|
|
269
|
-
isError ? "ia-fileUpload-error" : ""
|
|
270
|
-
} ${disabled ? "ia-fileUpload-disabled" : ""}`}
|
|
271
|
-
onDragEnter={onDragEnter}
|
|
272
|
-
onDragLeave={onDragLeave}
|
|
273
|
-
onDrop={onDrop}
|
|
274
|
-
onDragOver={(e) => e.preventDefault()}
|
|
275
|
-
onClick={(e) => {
|
|
276
|
-
e.preventDefault();
|
|
277
|
-
}}
|
|
278
|
-
onKeyDown={(e) => e.preventDefault()}
|
|
279
|
-
>
|
|
280
|
-
{isDraggedOver ? (
|
|
281
|
-
<div className="ia-fileUpload-dragOverLabel">
|
|
282
|
-
File drop in progress...
|
|
283
|
-
</div>
|
|
284
|
-
) : (
|
|
285
|
-
<div className="ia-fileUpload-label">
|
|
286
|
-
<div className="ia-fileUpload-label-primary">
|
|
287
|
-
{isError ? (
|
|
288
|
-
"File type not supported"
|
|
289
|
-
) : (
|
|
290
|
-
<p className="ia-fileUpload-label">Drag your files here or</p>
|
|
291
|
-
)}
|
|
292
|
-
<input
|
|
293
|
-
ref={fileUploadRef}
|
|
294
|
-
type="file"
|
|
295
|
-
onChange={onFileDrop}
|
|
296
|
-
value=""
|
|
297
|
-
accept={currentFileType}
|
|
298
|
-
title={fileList[0]?.file.name}
|
|
299
|
-
multiple={numberOfFiles > 1}
|
|
300
|
-
/>
|
|
301
|
-
<Button
|
|
302
|
-
onClick={onUploadClick}
|
|
303
|
-
variant="url"
|
|
304
|
-
label="Browse Files"
|
|
305
|
-
onDragEnter={onDragEnter}
|
|
306
|
-
disabled={isDraggedOver}
|
|
307
|
-
>
|
|
308
|
-
Choose File
|
|
309
|
-
</Button>
|
|
310
|
-
</div>
|
|
311
|
-
<p className="ia-fileUpload-label-secondary">
|
|
312
|
-
support{validFileTypes.length > 1 ? "s" : ""}{" "}
|
|
313
|
-
{validFileTypes.map((vft) => `.${vft.fileType}`).join(", ")}
|
|
314
|
-
</p>
|
|
315
|
-
</div>
|
|
316
|
-
)}
|
|
317
|
-
{/* <span className="ia-fileUpload-hr">OR</span> */}
|
|
318
|
-
</button>
|
|
319
|
-
)}
|
|
320
|
-
|
|
321
|
-
{templateDownloader ? (
|
|
322
|
-
<div className="ia-fileUpload-validFileType">
|
|
323
|
-
<p className="ia-fileUpload-label-secondary">Simplify your upload!</p>{" "}
|
|
324
|
-
<div className="ia-fileUpload-validFileType-container">
|
|
325
|
-
<div
|
|
326
|
-
onClick={(e) => {
|
|
327
|
-
setIsOpen(true);
|
|
328
|
-
setAnchorEl(e.currentTarget);
|
|
329
|
-
validFileTypes.length > 1 || options
|
|
330
|
-
? handleTemplateDownloadMenu()
|
|
331
|
-
: templateDownloader.templateDownloader();
|
|
332
|
-
}}
|
|
333
|
-
style={{ display: "flex", alignItems: "center", gap: "4px" }}
|
|
334
|
-
>
|
|
335
|
-
<Button data-fileUpload="templateDownload" variant="url">
|
|
336
|
-
{"Download template"}
|
|
337
|
-
</Button>
|
|
338
|
-
<img
|
|
339
|
-
src={
|
|
340
|
-
validFileTypes.length > 1 || options
|
|
341
|
-
? downArrow
|
|
342
|
-
: uploadDownloadIcon
|
|
343
|
-
}
|
|
344
|
-
alt="uploadDownloadIcon"
|
|
345
|
-
className={`ia-fileUpload-validFileType-arrow ${
|
|
346
|
-
(validFileTypes.length > 1 || options) && showDownLoadMenu
|
|
347
|
-
? "rotate"
|
|
348
|
-
: ""
|
|
349
|
-
}`}
|
|
350
|
-
/>
|
|
351
|
-
|
|
352
|
-
{options && isOpen && (
|
|
353
|
-
<Menu
|
|
354
|
-
anchorEl={anchorEl}
|
|
355
|
-
iconPlacement="left"
|
|
356
|
-
onClose={() => setIsOpen(false)}
|
|
357
|
-
open={isOpen}
|
|
358
|
-
options={menuOptions}
|
|
359
|
-
menuContainerClassName={"ia-fileUpload-validFileType-menu"}
|
|
360
|
-
MenuProps={{
|
|
361
|
-
anchorOrigin: {
|
|
362
|
-
vertical: "top",
|
|
363
|
-
horizontal: "left",
|
|
364
|
-
},
|
|
365
|
-
transformOrigin: {
|
|
366
|
-
vertical: "bottom",
|
|
367
|
-
horizontal: "left",
|
|
368
|
-
},
|
|
369
|
-
}}
|
|
370
|
-
selected={selected}
|
|
371
|
-
withActionButtons
|
|
372
|
-
withCheckbox
|
|
373
|
-
onPrimaryButtonClick={() =>
|
|
374
|
-
onMenuPrimaryButtonClick?.(selectedFileType, selected)
|
|
375
|
-
}
|
|
376
|
-
primaryButtonProps={{
|
|
377
|
-
label: selectedFileType,
|
|
378
|
-
icon: <UploadDownloadIcon />,
|
|
379
|
-
}}
|
|
380
|
-
{...(validFileTypes.length > 1 && {
|
|
381
|
-
tertiaryButtonLabel: validFileTypes.find(
|
|
382
|
-
(vft) => vft.fileType !== "xlsx"
|
|
383
|
-
)?.fileType,
|
|
384
|
-
tertiaryButtonProps: { icon: <UploadDownloadIcon /> },
|
|
385
|
-
onTertiaryButtonClick: () =>
|
|
386
|
-
onTertiaryButtonClick?.(selected),
|
|
387
|
-
})}
|
|
388
|
-
/>
|
|
389
|
-
)}
|
|
390
|
-
</div>
|
|
391
|
-
{showDownLoadMenu && !options && (
|
|
392
|
-
<div className="ia-fileUpload-validFileType-menu">
|
|
393
|
-
{validFileTypes.map((vft) => (
|
|
394
|
-
<span
|
|
395
|
-
key={vft.fileType}
|
|
396
|
-
className="ia-fileUpload-validFileType-menu-item"
|
|
397
|
-
onClick={() => {
|
|
398
|
-
vft.templateDownloader();
|
|
399
|
-
}}
|
|
400
|
-
>
|
|
401
|
-
{`.${vft.fileType}`}
|
|
402
|
-
</span>
|
|
403
|
-
))}
|
|
404
|
-
</div>
|
|
405
|
-
)}
|
|
406
|
-
</div>
|
|
407
|
-
</div>
|
|
408
|
-
) : null}
|
|
409
|
-
|
|
410
|
-
{options?.length > 0 && templateDownloader && (
|
|
411
|
-
<div className="ia-template-preview">
|
|
412
|
-
<h3 className="ia-template-preview__title">Template Preview</h3>
|
|
413
|
-
<div className="ia-template-preview__grid-wrapper">
|
|
414
|
-
<table className="ia-template-preview__table">
|
|
415
|
-
<thead>
|
|
416
|
-
<tr>
|
|
417
|
-
<th className="ia-template-preview__row-header"></th>
|
|
418
|
-
{Array.from({ length: 9 }, (_, i) =>
|
|
419
|
-
String.fromCharCode(65 + i)
|
|
420
|
-
).map((letter) => (
|
|
421
|
-
<th
|
|
422
|
-
key={letter}
|
|
423
|
-
className="ia-template-preview__col-header"
|
|
424
|
-
>
|
|
425
|
-
{letter}
|
|
426
|
-
</th>
|
|
427
|
-
))}
|
|
428
|
-
</tr>
|
|
429
|
-
</thead>
|
|
430
|
-
<tbody>
|
|
431
|
-
<tr>
|
|
432
|
-
<td className="ia-template-preview__row-header">1</td>
|
|
433
|
-
{Array.from({ length: 9 }, (_, i) => (
|
|
434
|
-
<td key={i} className="ia-template-preview__cell">
|
|
435
|
-
{selected[i] ? (
|
|
436
|
-
<div className="ia-template-preview__cell-value">
|
|
437
|
-
{selected[i].charAt(0).toUpperCase() +
|
|
438
|
-
selected[i].slice(1)}
|
|
439
|
-
</div>
|
|
440
|
-
) : null}
|
|
441
|
-
</td>
|
|
442
|
-
))}
|
|
443
|
-
</tr>
|
|
444
|
-
{[2, 3].map((row) => (
|
|
445
|
-
<tr key={row}>
|
|
446
|
-
<td className="ia-template-preview__row-header">{row}</td>
|
|
447
|
-
{Array.from({ length: 9 }, (_, i) => (
|
|
448
|
-
<td key={i} className="ia-template-preview__cell"></td>
|
|
449
|
-
))}
|
|
450
|
-
</tr>
|
|
451
|
-
))}
|
|
452
|
-
</tbody>
|
|
453
|
-
</table>
|
|
454
|
-
</div>
|
|
455
|
-
</div>
|
|
456
|
-
)}
|
|
457
|
-
|
|
458
|
-
{fileList.map((item) => {
|
|
459
|
-
let fileSize = item.file.size;
|
|
460
|
-
|
|
461
|
-
let i = 0;
|
|
462
|
-
while (fileSize > 1024) {
|
|
463
|
-
fileSize = fileSize / 1024;
|
|
464
|
-
i += 1;
|
|
465
|
-
}
|
|
466
|
-
|
|
467
|
-
return (
|
|
468
|
-
<div key={item.file.name} className="ia-fileUpload-previewItem">
|
|
469
|
-
<div className="ia-fileUpload-previewItem-exceptProgress">
|
|
470
|
-
<div className="ia-fileUpload-previewItem-details">
|
|
471
|
-
{item.isUploadRunning ? null : (
|
|
472
|
-
<div
|
|
473
|
-
className={`ia-fileUpload-previewItemIcon ${
|
|
474
|
-
item.failed || item.disabled
|
|
475
|
-
? "ia-fileUpload-previewItemIcon-failed"
|
|
476
|
-
: ""
|
|
477
|
-
} ${Object.keys(fileTypes).find((key) =>
|
|
478
|
-
fileTypes[key].includes(item.file.type)
|
|
479
|
-
)}`}
|
|
480
|
-
/>
|
|
481
|
-
)}
|
|
482
|
-
|
|
483
|
-
<div className="ia-fileUpload-previewItem-info">
|
|
484
|
-
<span
|
|
485
|
-
className={`ia-fileUpload-previewItem-name ${
|
|
486
|
-
item.failed || item.disabled
|
|
487
|
-
? "ia-fileUpload-previewItem-name-failed"
|
|
488
|
-
: ""
|
|
489
|
-
}`}
|
|
490
|
-
>
|
|
491
|
-
{item.file.name}
|
|
492
|
-
</span>
|
|
493
|
-
|
|
494
|
-
<span
|
|
495
|
-
className={`ia-fileUpload-previewItem-size ${
|
|
496
|
-
item.failed ? "uploadFailed" : ""
|
|
497
|
-
} ${item.isUploadRunning ? "uploading" : ""} ${
|
|
498
|
-
item.disabled ? "disabled" : ""
|
|
499
|
-
}`}
|
|
500
|
-
>
|
|
501
|
-
{item.failed
|
|
502
|
-
? item.failedMessage || "Upload failed"
|
|
503
|
-
: fileSize.toFixed(0) + sizeConventions[i]}
|
|
504
|
-
</span>
|
|
505
|
-
</div>
|
|
506
|
-
</div>
|
|
507
|
-
|
|
508
|
-
<div
|
|
509
|
-
className={`ia-fileUpload-previewItem-actions ${
|
|
510
|
-
item.failed || item.disabled
|
|
511
|
-
? "ia-fileUpload-previewItem-actions-failed"
|
|
512
|
-
: ""
|
|
513
|
-
}`}
|
|
514
|
-
>
|
|
515
|
-
{item.failed ? (
|
|
516
|
-
item.failedMessage ? (
|
|
517
|
-
customFailedActionButton
|
|
518
|
-
) : (
|
|
519
|
-
<>
|
|
520
|
-
<img
|
|
521
|
-
src={fileUploadDownloadIcon}
|
|
522
|
-
alt="fileUploadDownloadIcon"
|
|
523
|
-
className="ia-fileUpload-previewItem-action removeIcon"
|
|
524
|
-
onClick={() => fileRemove(item)}
|
|
525
|
-
style={
|
|
526
|
-
item.disabled
|
|
527
|
-
? { opacity: 0.5, pointerEvents: "none" }
|
|
528
|
-
: {}
|
|
529
|
-
}
|
|
530
|
-
/>
|
|
531
|
-
{item.onRetry ? (
|
|
532
|
-
<img
|
|
533
|
-
src={fileUploadRetryIcon}
|
|
534
|
-
alt="fileUploadRetryIcon"
|
|
535
|
-
className="ia-fileUpload-previewItem-action"
|
|
536
|
-
onClick={item.onRetry}
|
|
537
|
-
style={
|
|
538
|
-
item.disabled
|
|
539
|
-
? { opacity: 0.5, pointerEvents: "none" }
|
|
540
|
-
: {}
|
|
541
|
-
}
|
|
542
|
-
/>
|
|
543
|
-
) : null}
|
|
544
|
-
</>
|
|
545
|
-
)
|
|
546
|
-
) : (
|
|
547
|
-
<>
|
|
548
|
-
{item.onPause ? (
|
|
549
|
-
<img
|
|
550
|
-
src={uploadPauseIcon}
|
|
551
|
-
alt="uploadPauseIcon"
|
|
552
|
-
className="ia-fileUpload-previewItem-action"
|
|
553
|
-
onClick={item.onPause}
|
|
554
|
-
style={
|
|
555
|
-
item.disabled
|
|
556
|
-
? { opacity: 0.5, pointerEvents: "none" }
|
|
557
|
-
: {}
|
|
558
|
-
}
|
|
559
|
-
/>
|
|
560
|
-
) : null}
|
|
561
|
-
<img
|
|
562
|
-
src={
|
|
563
|
-
item.isUploadRunning
|
|
564
|
-
? uploadCloseIcon
|
|
565
|
-
: fileUploadDownloadIcon
|
|
566
|
-
}
|
|
567
|
-
alt="fileUploadDownloadIcon"
|
|
568
|
-
className="ia-fileUpload-previewItem-action removeIcon"
|
|
569
|
-
onClick={() => fileRemove(item)}
|
|
570
|
-
style={
|
|
571
|
-
item.disabled
|
|
572
|
-
? { opacity: 0.5, pointerEvents: "none" }
|
|
573
|
-
: {}
|
|
574
|
-
}
|
|
575
|
-
/>
|
|
576
|
-
</>
|
|
577
|
-
)}
|
|
578
|
-
</div>
|
|
579
|
-
</div>
|
|
580
|
-
|
|
581
|
-
{item.isUploadRunning ? (
|
|
582
|
-
<div className="ia-fileUpload-progress">
|
|
583
|
-
<ProgressBar
|
|
584
|
-
showTime={item.timeRemaining}
|
|
585
|
-
time={item.timeRemaining}
|
|
586
|
-
value={item.progress}
|
|
587
|
-
/>
|
|
588
|
-
</div>
|
|
589
|
-
) : null}
|
|
590
|
-
</div>
|
|
591
|
-
);
|
|
592
|
-
})}
|
|
593
|
-
|
|
594
|
-
<div className="ia-fileUpload-actions">
|
|
595
|
-
{secondaryButtonLabel && (
|
|
596
|
-
<Button
|
|
597
|
-
variant="tertiary"
|
|
598
|
-
onClick={onSecondaryButtonClick}
|
|
599
|
-
{...secondaryButtonProps}
|
|
600
|
-
>
|
|
601
|
-
{secondaryButtonLabel}
|
|
602
|
-
</Button>
|
|
603
|
-
)}
|
|
604
|
-
{primaryButtonLabel && (
|
|
605
|
-
<Button
|
|
606
|
-
variant="primary"
|
|
607
|
-
onClick={onPrimaryButtonClick}
|
|
608
|
-
disabled={fileList.length === 0}
|
|
609
|
-
{...primaryButtonProps}
|
|
610
|
-
>
|
|
611
|
-
{primaryButtonLabel}
|
|
612
|
-
</Button>
|
|
613
|
-
)}
|
|
614
|
-
</div>
|
|
615
|
-
</div>
|
|
616
|
-
);
|
|
617
|
-
};
|
|
618
|
-
|
|
619
|
-
FileUpload.propTypes = {
|
|
620
|
-
fileList: PropTypes.arrayOf(
|
|
621
|
-
PropTypes.shape({
|
|
622
|
-
file: PropTypes.object,
|
|
623
|
-
progress: PropTypes.number,
|
|
624
|
-
failed: PropTypes.bool,
|
|
625
|
-
isUploadRunning: PropTypes.bool,
|
|
626
|
-
timeRemaining: PropTypes.number,
|
|
627
|
-
onPause: PropTypes.func,
|
|
628
|
-
onRetry: PropTypes.func,
|
|
629
|
-
})
|
|
630
|
-
),
|
|
631
|
-
numberOfFiles: PropTypes.number,
|
|
632
|
-
disabled: PropTypes.bool,
|
|
633
|
-
validFileTypes: PropTypes.arrayOf(
|
|
634
|
-
PropTypes.shape({
|
|
635
|
-
fileType: PropTypes.string,
|
|
636
|
-
templateDownloader: PropTypes.func,
|
|
637
|
-
typeOverride: PropTypes.bool,
|
|
638
|
-
})
|
|
639
|
-
),
|
|
640
|
-
onFileListChange: PropTypes.func,
|
|
641
|
-
};
|