@lnco-ai/ui 1.0.0
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/CHANGELOG.md +1323 -0
- package/LICENSE +661 -0
- package/README.md +60 -0
- package/dist/Authorization/PreventGuestWrapper.d.ts +19 -0
- package/dist/Authorization/PreventGuestWrapper.js +15 -0
- package/dist/Authorization/RedirectionContent.d.ts +9 -0
- package/dist/Authorization/RedirectionContent.js +24 -0
- package/dist/Authorization/SignedInWrapper.d.ts +10 -0
- package/dist/Authorization/SignedInWrapper.js +21 -0
- package/dist/Avatar/Avatar.d.ts +24 -0
- package/dist/Avatar/Avatar.js +22 -0
- package/dist/Avatar/stringToColor.d.ts +12 -0
- package/dist/Avatar/stringToColor.js +31 -0
- package/dist/Avatar/stringToColor.test.d.ts +1 -0
- package/dist/Avatar/stringToColor.test.js +8 -0
- package/dist/Card/Card.d.ts +39 -0
- package/dist/Card/Card.js +76 -0
- package/dist/Card/CardHeader.d.ts +12 -0
- package/dist/Card/CardHeader.js +8 -0
- package/dist/Card/CardThumbnail.d.ts +10 -0
- package/dist/Card/CardThumbnail.js +14 -0
- package/dist/Card/FolderCard.d.ts +14 -0
- package/dist/Card/FolderCard.js +44 -0
- package/dist/Card/LinkCard.d.ts +11 -0
- package/dist/Card/LinkCard.js +41 -0
- package/dist/Card/components/CardThumbnail.d.ts +8 -0
- package/dist/Card/components/CardThumbnail.js +15 -0
- package/dist/Card/constants.d.ts +1 -0
- package/dist/Card/constants.js +1 -0
- package/dist/Collapse/Collapse.d.ts +10 -0
- package/dist/Collapse/Collapse.js +48 -0
- package/dist/Collapse/withCollapse.d.ts +7 -0
- package/dist/Collapse/withCollapse.js +8 -0
- package/dist/CookiesBanner/CookiesBanner.d.ts +10 -0
- package/dist/CookiesBanner/CookiesBanner.js +60 -0
- package/dist/CreativeCommons/CreativeCommons.d.ts +14 -0
- package/dist/CreativeCommons/CreativeCommons.js +75 -0
- package/dist/CreativeCommons/icons/By.d.ts +3 -0
- package/dist/CreativeCommons/icons/By.js +3 -0
- package/dist/CreativeCommons/icons/CCIconsProps.d.ts +3 -0
- package/dist/CreativeCommons/icons/CCIconsProps.js +1 -0
- package/dist/CreativeCommons/icons/Cc.d.ts +3 -0
- package/dist/CreativeCommons/icons/Cc.js +3 -0
- package/dist/CreativeCommons/icons/Cc0.d.ts +3 -0
- package/dist/CreativeCommons/icons/Cc0.js +3 -0
- package/dist/CreativeCommons/icons/Nc.d.ts +3 -0
- package/dist/CreativeCommons/icons/Nc.js +3 -0
- package/dist/CreativeCommons/icons/Nd.d.ts +3 -0
- package/dist/CreativeCommons/icons/Nd.js +3 -0
- package/dist/CreativeCommons/icons/Sa.d.ts +3 -0
- package/dist/CreativeCommons/icons/Sa.js +3 -0
- package/dist/CustomInitialLoader/CustomInitialLoader.d.ts +5 -0
- package/dist/CustomInitialLoader/CustomInitialLoader.js +25 -0
- package/dist/DrawerHeader/DrawerHeader.d.ts +7 -0
- package/dist/DrawerHeader/DrawerHeader.js +16 -0
- package/dist/GraaspLogo/EpflLogo.d.ts +5 -0
- package/dist/GraaspLogo/EpflLogo.js +3 -0
- package/dist/GraaspLogo/GraaspLogo.d.ts +8 -0
- package/dist/GraaspLogo/GraaspLogo.js +5 -0
- package/dist/Header/Header.d.ts +21 -0
- package/dist/Header/Header.js +33 -0
- package/dist/HeaderUserInformation/HeaderUserInformation.d.ts +22 -0
- package/dist/HeaderUserInformation/HeaderUserInformation.js +23 -0
- package/dist/ItemBadges/ItemBadges.d.ts +17 -0
- package/dist/ItemBadges/ItemBadges.js +10 -0
- package/dist/ItemFlag/ItemFlagButton.d.ts +9 -0
- package/dist/ItemFlag/ItemFlagButton.js +11 -0
- package/dist/ItemFlag/ItemFlagDialog.d.ts +14 -0
- package/dist/ItemFlag/ItemFlagDialog.js +25 -0
- package/dist/Loader/Loader.d.ts +7 -0
- package/dist/Loader/Loader.js +4 -0
- package/dist/Main/LogoHeader.d.ts +2 -0
- package/dist/Main/LogoHeader.js +5 -0
- package/dist/Main/Main.d.ts +59 -0
- package/dist/Main/Main.js +82 -0
- package/dist/MainMenu/MainMenu.d.ts +10 -0
- package/dist/MainMenu/MainMenu.js +6 -0
- package/dist/MainMenu/MenuItem/MenuItem.d.ts +16 -0
- package/dist/MainMenu/MenuItem/MenuItem.js +16 -0
- package/dist/MainMenu/hooks.d.ts +10 -0
- package/dist/MainMenu/hooks.js +21 -0
- package/dist/Navigation/CurrentItemNavigation.d.ts +15 -0
- package/dist/Navigation/CurrentItemNavigation.js +12 -0
- package/dist/Navigation/ExtraItemsMenu.d.ts +10 -0
- package/dist/Navigation/ExtraItemsMenu.js +24 -0
- package/dist/Navigation/ExtraItemsNavigation.d.ts +11 -0
- package/dist/Navigation/ExtraItemsNavigation.js +11 -0
- package/dist/Navigation/HomeMenu.d.ts +17 -0
- package/dist/Navigation/HomeMenu.js +28 -0
- package/dist/Navigation/ItemMenu.d.ts +16 -0
- package/dist/Navigation/ItemMenu.js +32 -0
- package/dist/Navigation/Navigation.d.ts +26 -0
- package/dist/Navigation/Navigation.js +15 -0
- package/dist/Navigation/ParentsNavigation.d.ts +10 -0
- package/dist/Navigation/ParentsNavigation.js +8 -0
- package/dist/Navigation/common/CenterAlignWrapper.d.ts +3 -0
- package/dist/Navigation/common/CenterAlignWrapper.js +7 -0
- package/dist/Navigation/common/NavigationLink.d.ts +8 -0
- package/dist/Navigation/common/NavigationLink.js +7 -0
- package/dist/Navigation/common/constants.d.ts +1 -0
- package/dist/Navigation/common/constants.js +1 -0
- package/dist/PlatformSwitch/PlatformSwitch.d.ts +57 -0
- package/dist/PlatformSwitch/PlatformSwitch.js +66 -0
- package/dist/PlatformSwitch/hooks.d.ts +30 -0
- package/dist/PlatformSwitch/hooks.js +49 -0
- package/dist/SearchInput/SearchInput.d.ts +20 -0
- package/dist/SearchInput/SearchInput.js +14 -0
- package/dist/Select/Select.d.ts +24 -0
- package/dist/Select/Select.js +7 -0
- package/dist/Sidebar/Sidebar.d.ts +11 -0
- package/dist/Sidebar/Sidebar.js +25 -0
- package/dist/StyledComponents/StyledBaseComponents.d.ts +11 -0
- package/dist/StyledComponents/StyledBaseComponents.js +11 -0
- package/dist/TextDisplay/TextDisplay.d.ts +5 -0
- package/dist/TextDisplay/TextDisplay.js +24 -0
- package/dist/TextDisplay/fixtures.d.ts +3 -0
- package/dist/TextDisplay/fixtures.js +84 -0
- package/dist/TextDisplay/withFlavor.d.ts +8 -0
- package/dist/TextDisplay/withFlavor.js +25 -0
- package/dist/TextEditor/TextEditor.d.ts +16 -0
- package/dist/TextEditor/TextEditor.js +74 -0
- package/dist/ThemeContext/LanguageSelect.d.ts +15 -0
- package/dist/ThemeContext/LanguageSelect.js +19 -0
- package/dist/ThemeContext/ThemeContext.d.ts +22 -0
- package/dist/ThemeContext/ThemeContext.js +31 -0
- package/dist/Thumbnail/Thumbnail.d.ts +28 -0
- package/dist/Thumbnail/Thumbnail.js +27 -0
- package/dist/Tree/Breadcrumbs.d.ts +14 -0
- package/dist/Tree/Breadcrumbs.js +30 -0
- package/dist/Tree/RowMenu.d.ts +12 -0
- package/dist/Tree/RowMenu.js +37 -0
- package/dist/Tree/RowMenus.d.ts +18 -0
- package/dist/Tree/RowMenus.js +7 -0
- package/dist/Tree/types.d.ts +6 -0
- package/dist/Tree/types.js +1 -0
- package/dist/UserSwitch/UserSwitch.d.ts +17 -0
- package/dist/UserSwitch/UserSwitch.js +46 -0
- package/dist/UserSwitch/UserSwitchWrapper.d.ts +37 -0
- package/dist/UserSwitch/UserSwitchWrapper.js +74 -0
- package/dist/appComponents/ErrorFallback.d.ts +57 -0
- package/dist/appComponents/ErrorFallback.js +72 -0
- package/dist/appComponents/QuestionLabel.d.ts +9 -0
- package/dist/appComponents/QuestionLabel.js +4 -0
- package/dist/appComponents/index.d.ts +6 -0
- package/dist/appComponents/index.js +5 -0
- package/dist/appComponents/statusChips/RequiredChip.d.ts +3 -0
- package/dist/appComponents/statusChips/RequiredChip.js +5 -0
- package/dist/appComponents/statusChips/SavedChip.d.ts +3 -0
- package/dist/appComponents/statusChips/SavedChip.js +5 -0
- package/dist/appComponents/statusChips/SubmittedChip.d.ts +3 -0
- package/dist/appComponents/statusChips/SubmittedChip.js +5 -0
- package/dist/appComponents/statusChips/types.d.ts +5 -0
- package/dist/appComponents/statusChips/types.js +1 -0
- package/dist/appComponents/types.d.ts +8 -0
- package/dist/appComponents/types.js +1 -0
- package/dist/apps.d.ts +1 -0
- package/dist/apps.js +1 -0
- package/dist/buttons/BookmarkButton/BookmarkButton.d.ts +24 -0
- package/dist/buttons/BookmarkButton/BookmarkButton.js +24 -0
- package/dist/buttons/Button/Button.d.ts +37 -0
- package/dist/buttons/Button/Button.js +4 -0
- package/dist/buttons/ChatboxButton/ChatboxButton.d.ts +15 -0
- package/dist/buttons/ChatboxButton/ChatboxButton.js +21 -0
- package/dist/buttons/CopyButton/CopyButton.d.ts +13 -0
- package/dist/buttons/CopyButton/CopyButton.js +14 -0
- package/dist/buttons/DeleteButton/DeleteButton.d.ts +12 -0
- package/dist/buttons/DeleteButton/DeleteButton.js +17 -0
- package/dist/buttons/DownloadButton/DownloadButton.d.ts +30 -0
- package/dist/buttons/DownloadButton/DownloadButton.js +20 -0
- package/dist/buttons/EditButton/EditButton.d.ts +13 -0
- package/dist/buttons/EditButton/EditButton.js +17 -0
- package/dist/buttons/LikeButton/LikeButton.d.ts +28 -0
- package/dist/buttons/LikeButton/LikeButton.js +10 -0
- package/dist/buttons/MenuItemButton.d.ts +11 -0
- package/dist/buttons/MenuItemButton.js +12 -0
- package/dist/buttons/MoveButton/MoveButton.d.ts +13 -0
- package/dist/buttons/MoveButton/MoveButton.js +19 -0
- package/dist/buttons/PinButton/PinButton.d.ts +15 -0
- package/dist/buttons/PinButton/PinButton.js +21 -0
- package/dist/buttons/SaveButton/SaveButton.d.ts +24 -0
- package/dist/buttons/SaveButton/SaveButton.js +4 -0
- package/dist/buttons/ShareButton/ShareButton.d.ts +14 -0
- package/dist/buttons/ShareButton/ShareButton.js +17 -0
- package/dist/buttons/hooks.d.ts +5 -0
- package/dist/buttons/hooks.js +14 -0
- package/dist/buttons/index.d.ts +12 -0
- package/dist/buttons/index.js +12 -0
- package/dist/constants.d.ts +11 -0
- package/dist/constants.js +12 -0
- package/dist/draggable/DraggableElement.d.ts +11 -0
- package/dist/draggable/DraggableElement.js +42 -0
- package/dist/draggable/DraggingWrapper.d.ts +23 -0
- package/dist/draggable/DraggingWrapper.js +20 -0
- package/dist/draggable/InBetween.d.ts +10 -0
- package/dist/draggable/InBetween.js +34 -0
- package/dist/draggable/types.d.ts +10 -0
- package/dist/draggable/types.js +1 -0
- package/dist/enums/errors.d.ts +3 -0
- package/dist/enums/errors.js +3 -0
- package/dist/hooks/useFullscreen.d.ts +5 -0
- package/dist/hooks/useFullscreen.js +37 -0
- package/dist/hooks/useMobileView.d.ts +4 -0
- package/dist/hooks/useMobileView.js +6 -0
- package/dist/icons/AnalyticsIcon.d.ts +15 -0
- package/dist/icons/AnalyticsIcon.js +7 -0
- package/dist/icons/BuildIcon.d.ts +15 -0
- package/dist/icons/BuildIcon.js +7 -0
- package/dist/icons/EtherpadIcon.d.ts +7 -0
- package/dist/icons/EtherpadIcon.js +7 -0
- package/dist/icons/H5PIcon.d.ts +6 -0
- package/dist/icons/H5PIcon.js +6 -0
- package/dist/icons/ItemIcon.d.ts +23 -0
- package/dist/icons/ItemIcon.js +75 -0
- package/dist/icons/LibraryIcon.d.ts +16 -0
- package/dist/icons/LibraryIcon.js +7 -0
- package/dist/icons/PlayIcon.d.ts +15 -0
- package/dist/icons/PlayIcon.js +7 -0
- package/dist/icons/ResizingIcon.d.ts +2 -0
- package/dist/icons/ResizingIcon.js +21 -0
- package/dist/icons/StyledSVGComponents.d.ts +35 -0
- package/dist/icons/StyledSVGComponents.js +53 -0
- package/dist/icons/index.d.ts +6 -0
- package/dist/icons/index.js +6 -0
- package/dist/index.d.ts +61 -0
- package/dist/index.js +60 -0
- package/dist/itemLogin/ForbiddenContent.d.ts +20 -0
- package/dist/itemLogin/ForbiddenContent.js +4 -0
- package/dist/itemLogin/ForbiddenText.d.ts +8 -0
- package/dist/itemLogin/ForbiddenText.js +6 -0
- package/dist/itemLogin/ItemLoginScreen.d.ts +26 -0
- package/dist/itemLogin/ItemLoginScreen.js +72 -0
- package/dist/itemLogin/ItemLoginWrapper.d.ts +23 -0
- package/dist/itemLogin/ItemLoginWrapper.js +43 -0
- package/dist/itemLogin/constants.d.ts +1 -0
- package/dist/itemLogin/constants.js +1 -0
- package/dist/items/AppItem.d.ts +60 -0
- package/dist/items/AppItem.js +69 -0
- package/dist/items/DocumentItem.d.ts +19 -0
- package/dist/items/DocumentItem.js +25 -0
- package/dist/items/DownloadButtonFileItem.d.ts +9 -0
- package/dist/items/DownloadButtonFileItem.js +10 -0
- package/dist/items/EtherpadItem.d.ts +26 -0
- package/dist/items/EtherpadItem.js +15 -0
- package/dist/items/FileAudio.d.ts +9 -0
- package/dist/items/FileAudio.js +10 -0
- package/dist/items/FileImage.d.ts +7 -0
- package/dist/items/FileImage.js +10 -0
- package/dist/items/FileItem.d.ts +25 -0
- package/dist/items/FileItem.js +81 -0
- package/dist/items/FilePdf.d.ts +14 -0
- package/dist/items/FilePdf.js +29 -0
- package/dist/items/FileVideo.d.ts +8 -0
- package/dist/items/FileVideo.js +9 -0
- package/dist/items/H5PItem.d.ts +20 -0
- package/dist/items/H5PItem.js +80 -0
- package/dist/items/ItemSkeleton/ItemSkeleton.d.ts +12 -0
- package/dist/items/ItemSkeleton/ItemSkeleton.js +35 -0
- package/dist/items/LinkItem.d.ts +43 -0
- package/dist/items/LinkItem.js +97 -0
- package/dist/items/SizingWrapper.d.ts +6 -0
- package/dist/items/SizingWrapper.js +23 -0
- package/dist/items/appItemHooks.d.ts +27 -0
- package/dist/items/appItemHooks.js +124 -0
- package/dist/items/constants.d.ts +1 -0
- package/dist/items/constants.js +1 -0
- package/dist/items/iframeStyles.d.ts +4 -0
- package/dist/items/iframeStyles.js +5 -0
- package/dist/items/index.d.ts +5 -0
- package/dist/items/index.js +5 -0
- package/dist/items/withCaption.d.ts +19 -0
- package/dist/items/withCaption.js +58 -0
- package/dist/items/withResizing.d.ts +9 -0
- package/dist/items/withResizing.js +42 -0
- package/dist/text-editor.d.ts +2 -0
- package/dist/text-editor.js +2 -0
- package/dist/theme.d.ts +108 -0
- package/dist/theme.js +214 -0
- package/dist/types.d.ts +43 -0
- package/dist/types.js +32 -0
- package/dist/upload/FileDropper/FileDropper.d.ts +50 -0
- package/dist/upload/FileDropper/FileDropper.js +43 -0
- package/dist/upload/UploadFileButton/UploadFileButton.d.ts +35 -0
- package/dist/upload/UploadFileButton/UploadFileButton.js +17 -0
- package/dist/utils/fixtures.d.ts +3 -0
- package/dist/utils/fixtures.js +7 -0
- package/dist/utils/storybook.d.ts +5 -0
- package/dist/utils/storybook.js +5 -0
- package/package.json +172 -0
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
// we could replace dnd with this https://docs.dndkit.com
|
|
3
|
+
import { Grid2 as Grid } from '@mui/material';
|
|
4
|
+
import { DndProvider } from 'react-dnd';
|
|
5
|
+
import { HTML5Backend } from 'react-dnd-html5-backend';
|
|
6
|
+
import DraggableElement from './DraggableElement.js';
|
|
7
|
+
import InBetween from './InBetween.js';
|
|
8
|
+
const DraggingWrapper = ({ id, rows = [], getRowId, onDropInRow: onDropInRowFn, onDropBetweenRow: onDropBetweenRowFn, renderComponent, isMovable, enableMoveInBetween = true, allowFiles = true, canDrop, nbColumns = 1, }) => {
|
|
9
|
+
const onDropInRow = (draggedRow, targetRow) => {
|
|
10
|
+
onDropInRowFn?.(draggedRow, targetRow);
|
|
11
|
+
};
|
|
12
|
+
const onDropBetweenRow = (draggedRow, previousRow) => {
|
|
13
|
+
onDropBetweenRowFn?.(draggedRow, previousRow);
|
|
14
|
+
};
|
|
15
|
+
return (
|
|
16
|
+
// we need context={window} to use multiple times in the document
|
|
17
|
+
// https://github.com/react-dnd/react-dnd/issues/3257#issuecomment-1239254032
|
|
18
|
+
_jsx(DndProvider, { backend: HTML5Backend, context: window, children: _jsxs(Grid, { container: true, id: id, width: '100%', children: [_jsx(Grid, { size: 12, children: _jsx(InBetween, { onDrop: onDropBetweenRow, enableMoveInBetween: enableMoveInBetween, renderComponent: renderComponent }) }), rows.map((row) => (_jsxs(Grid, { size: Math.floor(12 / nbColumns), children: [_jsx(DraggableElement, { canDrop: canDrop, allowFiles: allowFiles, isMovable: isMovable, row: row, renderComponent: renderComponent, onDrop: onDropInRow }, getRowId?.(row)), _jsx(InBetween, { allowFiles: allowFiles, renderComponent: renderComponent, enableMoveInBetween: enableMoveInBetween, previousRow: row, onDrop: onDropBetweenRow })] })))] }) }));
|
|
19
|
+
};
|
|
20
|
+
export default DraggingWrapper;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { DraggableAndDroppableProps, DroppedFile } from './types.js';
|
|
2
|
+
export type InBetweenProps<T> = {
|
|
3
|
+
previousRow?: T;
|
|
4
|
+
enableMoveInBetween: boolean;
|
|
5
|
+
onDrop: (draggedRow: T | DroppedFile, previous?: T) => void;
|
|
6
|
+
renderComponent: (el: T | DroppedFile, args: DraggableAndDroppableProps) => JSX.Element;
|
|
7
|
+
allowFiles?: boolean;
|
|
8
|
+
};
|
|
9
|
+
declare const InBetween: <T extends object>({ previousRow, onDrop, enableMoveInBetween, renderComponent, allowFiles, }: InBetweenProps<T>) => JSX.Element;
|
|
10
|
+
export default InBetween;
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
// we could replace dnd with this https://docs.dndkit.com
|
|
3
|
+
import { Box } from '@mui/material';
|
|
4
|
+
import { useDrop } from 'react-dnd';
|
|
5
|
+
import { NativeTypes } from 'react-dnd-html5-backend';
|
|
6
|
+
const InBetween = ({ previousRow, onDrop, enableMoveInBetween, renderComponent, allowFiles = true, }) => {
|
|
7
|
+
const accept = ['row'];
|
|
8
|
+
if (allowFiles) {
|
|
9
|
+
accept.push(NativeTypes.FILE);
|
|
10
|
+
}
|
|
11
|
+
const [{ isOver, data }, drop] = useDrop(() => ({
|
|
12
|
+
accept,
|
|
13
|
+
drop: (draggedRow) => {
|
|
14
|
+
return onDrop(draggedRow, previousRow);
|
|
15
|
+
},
|
|
16
|
+
canDrop: () => enableMoveInBetween,
|
|
17
|
+
collect: (monitor) => ({
|
|
18
|
+
isOver: !!monitor.isOver(),
|
|
19
|
+
canDrop: !!monitor.canDrop(),
|
|
20
|
+
data: monitor.getItem(),
|
|
21
|
+
}),
|
|
22
|
+
}), [onDrop]);
|
|
23
|
+
const spacing = 12;
|
|
24
|
+
return (_jsxs(Box, { ref: drop, children: [(!isOver || !enableMoveInBetween) && (_jsx(Box, { style: { padding: 0, height: spacing, width: '100%' } })), isOver && enableMoveInBetween && (_jsx(Box, { sx: {
|
|
25
|
+
opacity: 0.5,
|
|
26
|
+
paddingTop: spacing / 8,
|
|
27
|
+
paddingBottom: spacing / 8,
|
|
28
|
+
}, children: renderComponent(data, {
|
|
29
|
+
isOver: false,
|
|
30
|
+
isDragging: false,
|
|
31
|
+
isMovable: false,
|
|
32
|
+
}) }))] }));
|
|
33
|
+
};
|
|
34
|
+
export default InBetween;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { useEffect, useState } from 'react';
|
|
2
|
+
export const useFullscreen = () => {
|
|
3
|
+
const [isFullscreen, setIsFullscreen] = useState(false);
|
|
4
|
+
const toggleFullscreen = () => {
|
|
5
|
+
if (document) {
|
|
6
|
+
const bodyElem = document.body;
|
|
7
|
+
if (!document.fullscreenElement) {
|
|
8
|
+
bodyElem
|
|
9
|
+
.requestFullscreen()
|
|
10
|
+
.then(() => setIsFullscreen(true))
|
|
11
|
+
.catch((err) => {
|
|
12
|
+
console.error(`Error attempting to enable fullscreen mode: ${err.message} (${err.name})`);
|
|
13
|
+
});
|
|
14
|
+
}
|
|
15
|
+
else {
|
|
16
|
+
document.exitFullscreen();
|
|
17
|
+
setIsFullscreen(false);
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
};
|
|
21
|
+
// listen to fullscreen changes happening when pressing "ESC" etc ...
|
|
22
|
+
useEffect(() => {
|
|
23
|
+
const fullScreenChangeHandler = () => {
|
|
24
|
+
if (!document.fullscreenElement) {
|
|
25
|
+
// exits fullScreen
|
|
26
|
+
setIsFullscreen(false);
|
|
27
|
+
}
|
|
28
|
+
else {
|
|
29
|
+
// enters fullScreen
|
|
30
|
+
setIsFullscreen(true);
|
|
31
|
+
}
|
|
32
|
+
};
|
|
33
|
+
window.addEventListener('fullscreenchange', fullScreenChangeHandler);
|
|
34
|
+
return () => window.removeEventListener('fullscreenchange', fullScreenChangeHandler);
|
|
35
|
+
}, []);
|
|
36
|
+
return { isFullscreen, toggleFullscreen };
|
|
37
|
+
};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { SxProps } from '@mui/material';
|
|
2
|
+
export type AnalyticsIconProps = {
|
|
3
|
+
sx?: SxProps;
|
|
4
|
+
size?: number;
|
|
5
|
+
primaryColor?: string;
|
|
6
|
+
primaryOpacity?: number;
|
|
7
|
+
secondaryColor?: string;
|
|
8
|
+
secondaryOpacity?: number;
|
|
9
|
+
selected?: boolean;
|
|
10
|
+
disabled?: boolean;
|
|
11
|
+
disabledColor?: string;
|
|
12
|
+
disableHover?: boolean;
|
|
13
|
+
};
|
|
14
|
+
declare const AnalyticsIcon: ({ size, sx, primaryColor, primaryOpacity, secondaryColor, secondaryOpacity, disabledColor, disabled, selected, disableHover, }: AnalyticsIconProps) => JSX.Element;
|
|
15
|
+
export default AnalyticsIcon;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { PRIMARY_COLOR, SECONDARY_COLOR } from '../theme.js';
|
|
3
|
+
import { SVGWrapper, StyledG } from './StyledSVGComponents.js';
|
|
4
|
+
const AnalyticsIcon = ({ size = 50, sx, primaryColor = PRIMARY_COLOR, primaryOpacity = 1, secondaryColor = SECONDARY_COLOR, secondaryOpacity = 1, disabledColor, disabled = false, selected, disableHover = true, }) => {
|
|
5
|
+
return (_jsx(SVGWrapper, { sx: sx, size: size, viewBox: '0 0 1080 1080', children: _jsxs(StyledG, { primaryColor: primaryColor, primaryOpacity: primaryOpacity, secondaryColor: secondaryColor, secondaryOpacity: secondaryOpacity, selected: selected, disabledColor: disabledColor, disabled: disabled, disableHover: disableHover, children: [_jsx("circle", { cx: '540', cy: '540', r: '540' }), _jsx("path", { d: 'M795.03,549.17h-243.54c-8,0-14.51-6.51-14.51-14.51V274.34c0-9.43-7.88-17.04-17.45-16.48-51.86,3.03-102.08,22.79-145.22,57.14-41.37,32.94-73.48,76.78-92.88,126.79-18.62,48.02-24.05,98.9-15.7,147.15,9.26,53.51,34.51,101.73,75.06,143.34,50.92,52.25,114.66,79.86,184.32,79.86,33.65,0,67.41-6.41,100.37-19.05,32.02-12.28,61.69-29.81,88.19-52.1,55.32-46.54,90.03-108.1,97.74-173.34,.55-4.69-.93-9.41-4.06-12.93-3.13-3.52-7.62-5.54-12.33-5.54Zm-243.54,58.61h189.73c-13.08,32.89-35.62,63.42-65.26,88.36-43.36,36.47-98.33,57.39-150.83,57.39-25.61,0-50.29-4.86-73.36-14.45-25.08-10.42-48.29-26.47-68.99-47.71-32.13-32.97-52.08-70.8-59.29-112.43-6.54-37.76-2.18-77.86,12.6-115.96,15.42-39.77,41.96-76.04,74.74-102.13,20.84-16.59,43.56-28.8,67.55-36.29v210.11c0,40.32,32.8,73.12,73.12,73.12Z' }), _jsx("path", { d: 'M584.11,228.53c-9.53-.57-17.53,7.05-17.53,16.48V505.34c0,9.1,7.41,16.51,16.51,16.51h245.52c9.01,0,16.35-7.3,16.35-16.26v-.16c0-146.67-114.58-268.3-260.85-276.89Zm198.16,234.71h-157.08v-168.94c79.71,21.68,141.18,87.79,157.08,168.94Z' })] }) }));
|
|
6
|
+
};
|
|
7
|
+
export default AnalyticsIcon;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { SxProps } from '@mui/material';
|
|
2
|
+
export type BuildIconProps = {
|
|
3
|
+
size?: number;
|
|
4
|
+
sx?: SxProps;
|
|
5
|
+
primaryColor?: string;
|
|
6
|
+
primaryOpacity?: number;
|
|
7
|
+
secondaryColor?: string;
|
|
8
|
+
secondaryOpacity?: number;
|
|
9
|
+
selected?: boolean;
|
|
10
|
+
disabled?: boolean;
|
|
11
|
+
disabledColor?: string;
|
|
12
|
+
disableHover?: boolean;
|
|
13
|
+
};
|
|
14
|
+
declare const BuildIcon: ({ size, primaryColor, primaryOpacity, secondaryColor, secondaryOpacity, disabledColor, disabled, sx, selected, disableHover, }: BuildIconProps) => JSX.Element;
|
|
15
|
+
export default BuildIcon;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { PRIMARY_COLOR, SECONDARY_COLOR } from '../theme.js';
|
|
3
|
+
import { SVGWrapper, StyledG } from './StyledSVGComponents.js';
|
|
4
|
+
const BuildIcon = ({ size = 50, primaryColor = PRIMARY_COLOR, primaryOpacity = 1, secondaryColor = SECONDARY_COLOR, secondaryOpacity = 1, disabledColor, disabled = false, sx, selected, disableHover = true, }) => {
|
|
5
|
+
return (_jsx(SVGWrapper, { size: size, viewBox: '0 0 1080 1080', sx: sx, children: _jsxs(StyledG, { selected: selected, primaryColor: primaryColor, primaryOpacity: primaryOpacity, secondaryColor: secondaryColor, secondaryOpacity: secondaryOpacity, disabledColor: disabledColor, disabled: disabled, disableHover: disableHover, children: [_jsx("circle", { cx: '540', cy: '540', r: '540' }), _jsx("path", { d: 'M656.39,481.93h-228.19c-30.88,0-56-25.12-56-56V250.47c0-30.88,25.12-56,56-56h228.19c30.88,0,56,25.12,56,56v175.46c0,30.88-25.12,56-56,56Zm-228.19-236.33c-2.69,0-4.87,2.18-4.87,4.87v175.46c0,2.69,2.18,4.87,4.87,4.87h228.19c2.69,0,4.87-2.18,4.87-4.87V250.47c0-2.69-2.18-4.87-4.87-4.87h-228.19Z' }), _jsx("path", { d: 'M845.1,805.78h-228.19c-30.88,0-56-25.12-56-56v-175.46c0-30.88,25.12-56,56-56h228.19c30.88,0,56,25.12,56,56v175.46c0,30.88-25.12,56-56,56Zm-228.19-236.33c-2.69,0-4.87,2.18-4.87,4.87v175.46c0,2.69,2.18,4.87,4.87,4.87h228.19c2.69,0,4.87-2.18,4.87-4.87v-175.46c0-2.69-2.18-4.87-4.87-4.87h-228.19Z' }), _jsx("path", { d: 'M467.68,805.78H239.48c-30.88,0-56-25.12-56-56v-175.46c0-30.88,25.12-56,56-56h228.19c30.88,0,56,25.12,56,56v175.46c0,30.88-25.12,56-56,56Zm-228.19-236.33c-2.69,0-4.87,2.18-4.87,4.87v175.46c0,2.69,2.18,4.87,4.87,4.87h228.19c2.69,0,4.87-2.18,4.87-4.87v-175.46c0-2.69-2.18-4.87-4.87-4.87H239.48Z' })] }) }));
|
|
6
|
+
};
|
|
7
|
+
export default BuildIcon;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { SvgIcon } from '@mui/material';
|
|
3
|
+
const EtherpadIcon = ({ color: initialColor, sx }) => {
|
|
4
|
+
const color = initialColor ?? 'currentcolor';
|
|
5
|
+
return (_jsxs(SvgIcon, { viewBox: '0 0 420 420', version: '1.1', id: 'svg148', xmlnsXlink: 'http://www.w3.org/1999/xlink', xmlns: 'http://www.w3.org/2000/svg', sx: sx, children: [_jsxs("defs", { children: [_jsx("rect", { id: 'c', x: '42', y: '167', width: '168', height: '27', rx: '13.5' }), _jsxs("filter", { id: 'f', x: '-.0571', y: '-.356', width: '1.11', height: '2.01', children: [_jsx("feOffset", { dx: '0', dy: '8', in: 'SourceAlpha', result: 'shadowOffsetOuter1' }), _jsx("feGaussianBlur", { in: 'shadowOffsetOuter1', result: 'shadowBlurOuter1', stdDeviation: '4' }), _jsx("feColorMatrix", { in: 'shadowBlurOuter1', values: '0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.0568181818 0' })] }), _jsx("rect", { id: 'b', x: '41', y: '110', width: '142', height: '25', rx: '12.5' }), _jsxs("filter", { id: 'e', x: '-.0676', y: '-.384', width: '1.14', height: '2.09', children: [_jsx("feOffset", { dx: '0', dy: '8', in: 'SourceAlpha', result: 'shadowOffsetOuter1' }), _jsx("feGaussianBlur", { in: 'shadowOffsetOuter1', result: 'shadowBlurOuter1', stdDeviation: '4' }), _jsx("feColorMatrix", { in: 'shadowBlurOuter1', values: '0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.0568181818 0' })] }), _jsx("rect", { id: 'a', x: '41', y: '226', width: '105', height: '25', rx: '12.5' }), _jsxs("filter", { id: 'd', x: '-.0914', y: '-.384', width: '1.18', height: '2.09', children: [_jsx("feOffset", { dx: '0', dy: '8', in: 'SourceAlpha', result: 'shadowOffsetOuter1' }), _jsx("feGaussianBlur", { in: 'shadowOffsetOuter1', result: 'shadowBlurOuter1', stdDeviation: '4' }), _jsx("feColorMatrix", { in: 'shadowBlurOuter1', values: '0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.0568181818 0' })] })] }), _jsx("g", { transform: 'translate(40,25)', fill: 'none', fillRule: 'evenodd', children: _jsx("g", { transform: 'translate(-415,-351)', children: _jsx("g", { transform: 'translate(415,351)', children: _jsxs("g", { transform: 'translate(0,15)', children: [_jsx("rect", { width: '340', height: '340', rx: '70', fill: color }), _jsx("path", { d: 'm238 138c-2.89-2.88-7.56-2.88-10.4 0s-2.89 7.54 0 10.4c7.78 7.75 12.1 18 12.1 28.9s-4.28 21.2-12.1 28.9c-2.89 2.88-2.89 7.54 0 10.4 1.44 1.44 3.33 2.16 5.22 2.16s3.78-0.72 5.22-2.16c10.6-10.5 16.4-24.5 16.4-39.3s-5.82-28.8-16.4-39.3z', fill: '#fff', fillRule: 'nonzero', opacity: '.754' }), _jsx("path", { d: 'm267 113c-2.82-2.88-7.39-2.88-10.2 0-2.82 2.88-2.82 7.55 0 10.4 28.6 29.2 28.6 76.7 0 106-2.82 2.88-2.82 7.55 0 10.4 1.41 1.44 3.26 2.16 5.11 2.16s3.7-0.72 5.11-2.16c34.2-34.9 34.2-91.8 0-127z', fill: '#fff', fillRule: 'nonzero', opacity: '.754' }), _jsx("use", { width: '100%', height: '100%', fill: '#000000', filter: 'url(#f)', xlinkHref: '#c' }), _jsx("use", { width: '100%', height: '100%', fill: '#ffffff', fillRule: 'evenodd', xlinkHref: '#c' }), _jsx("use", { width: '100%', height: '100%', fill: '#000000', filter: 'url(#e)', xlinkHref: '#b' }), _jsx("use", { width: '100%', height: '100%', fill: '#ffffff', fillRule: 'evenodd', xlinkHref: '#b' }), _jsx("use", { width: '100%', height: '100%', fill: '#000000', filter: 'url(#d)', xlinkHref: '#a' }), _jsx("use", { width: '100%', height: '100%', fill: '#ffffff', fillRule: 'evenodd', xlinkHref: '#a' })] }) }) }) })] }));
|
|
6
|
+
};
|
|
7
|
+
export default EtherpadIcon;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
const H5PIcon = ({ size, color }) => {
|
|
3
|
+
const fillColor = color ?? 'currentColor';
|
|
4
|
+
return (_jsxs("svg", { width: size, height: size, version: '1.1', viewBox: '0 0 1300 1300', xmlns: 'http://www.w3.org/2000/svg', children: [_jsx("path", { d: 'M 95.74,650.3 V 406.99 H 246.59 V 616.24 H 409.61 V 406.99 h 121.75 l -1.307,5.4745 c -2.5392,10.635 -47.071,207.77 -52.49,232.36 -3.0226,13.718 -4.9042,25.533 -4.1815,26.256 0.7227,0.723 30.515,5.3399 66.205,10.26 l 64.891,8.9462 9.8954,-11.577 c 27.937,-32.684 75.421,-33.24 102.84,-1.2047 35.938,41.985 4.7303,107.54 -51.078,107.29 -19.803,-0.087 -35.659,-7.3743 -50.547,-23.231 l -11.784,-12.551 -64.806,9.1844 c -35.644,5.0515 -65.351,9.7291 -66.017,10.395 -2.5401,2.5401 10.5,34.529 20.974,51.451 19.244,31.091 42.436,50.852 76.365,65.064 8.6293,3.6149 16.146,7.0049 16.703,7.5333 0.55756,0.5285 -39.132,0.9609 -88.2,0.9609 h -89.213 v -180.05 h -163.02 v 180.05 h -150.85 z', fill: fillColor, id: 'path2' }), _jsx("path", { d: 'm 763.7,891.5 c 1.2712,-1.1737 7.9008,-3.9462 14.732,-6.1611 58.229,-18.879 103.08,-90.97 103.13,-165.77 0.03,-43.193 -12.994,-76.78 -41.351,-106.63 -19.256,-20.271 -39.728,-33.177 -66.904,-42.178 -17.859,-5.9149 -22.878,-6.4619 -60.827,-6.6287 -38.795,-0.17059 -42.686,0.23875 -62.676,6.5945 -11.722,3.727 -22.957,7.4073 -24.967,8.1784 -2.3603,0.90573 -3.2737,0.22951 -2.5802,-1.9102 0.59044,-1.8218 4.5292,-18.367 8.7528,-36.767 l 7.6793,-33.455 h 220.99 v -100.35 l 113.75,1.2124 c 106.04,1.1303 115.07,1.5628 133.21,6.383 50.455,13.403 80.167,40.402 95.377,86.669 5.6162,17.083 6.4237,23.632 6.601,53.528 0.1509,25.428 -0.8842,38.073 -4.0828,49.878 -13.928,51.405 -51.002,87.442 -103.98,101.07 -19.479,5.0099 -65.583,8.1775 -121.05,8.3168 l -41.971,0.1053 v 180.05 h -88.078 c -50.624,0 -87.095,-0.9075 -85.766,-2.1341 z m 261.63,-281.61 c 16.962,-5.037 32.185,-19.719 36.303,-35.012 7.7315,-28.713 -8.2767,-57.752 -36.215,-65.695 -4.8411,-1.3763 -26.594,-3.2014 -48.34,-4.0558 l -39.538,-1.5534 v 113.44 l 37.321,-1.6092 c 22.552,-0.97241 42.524,-3.1542 50.468,-5.5133 z', fill: fillColor, id: 'path3' })] }));
|
|
5
|
+
};
|
|
6
|
+
export default H5PIcon;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { ItemType, LocalFileItemExtra, S3FileItemExtra, UnionOfConst } from '@lnco-ai/sdk';
|
|
2
|
+
export type ItemIconProps = {
|
|
3
|
+
alt: string;
|
|
4
|
+
/**
|
|
5
|
+
* item type
|
|
6
|
+
*/
|
|
7
|
+
type: UnionOfConst<typeof ItemType> | 'upload';
|
|
8
|
+
/**
|
|
9
|
+
* An HTML Color to use for the foreground of the icon
|
|
10
|
+
*/
|
|
11
|
+
color?: string;
|
|
12
|
+
/**
|
|
13
|
+
* @deprecated Use the `mimetype` prop.
|
|
14
|
+
* To extract the mimetype from the item extra use the `getMimetype` function exported from @lnco-ai/sdk
|
|
15
|
+
* Item extra used to define the mimetype
|
|
16
|
+
*/
|
|
17
|
+
extra?: LocalFileItemExtra | S3FileItemExtra;
|
|
18
|
+
mimetype?: string;
|
|
19
|
+
iconSrc?: string;
|
|
20
|
+
size?: string;
|
|
21
|
+
};
|
|
22
|
+
declare const ItemIcon: ({ color, extra, mimetype: defaultMimetype, iconSrc, alt, size, type, }: ItemIconProps) => JSX.Element;
|
|
23
|
+
export default ItemIcon;
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { ItemType, MimeTypes, getMimetype, } from '@lnco-ai/sdk';
|
|
3
|
+
import { AppWindowIcon, CableIcon, ClapperboardIcon, FileIcon, FileTextIcon, FileUpIcon, FolderArchiveIcon, FolderIcon, ImageIcon, LinkIcon, Music2Icon, TextIcon, } from 'lucide-react';
|
|
4
|
+
import { StyledImage } from '../StyledComponents/StyledBaseComponents.js';
|
|
5
|
+
const MAX_ICON_SIZE = '25px';
|
|
6
|
+
const ItemIcon = ({ color, extra, mimetype: defaultMimetype, iconSrc, alt = '', size = MAX_ICON_SIZE, type, }) => {
|
|
7
|
+
const mimetype = extra ? getMimetype(extra) : defaultMimetype;
|
|
8
|
+
if (iconSrc) {
|
|
9
|
+
return (_jsx(StyledImage, { sx: {
|
|
10
|
+
// icons should be squared
|
|
11
|
+
maxHeight: size,
|
|
12
|
+
maxWidth: size,
|
|
13
|
+
height: size,
|
|
14
|
+
width: size,
|
|
15
|
+
objectFit: 'cover',
|
|
16
|
+
borderRadius: 1,
|
|
17
|
+
}, alt: alt, src: iconSrc }));
|
|
18
|
+
}
|
|
19
|
+
let Icon = FileIcon;
|
|
20
|
+
switch (type) {
|
|
21
|
+
case ItemType.FOLDER:
|
|
22
|
+
Icon = FolderIcon;
|
|
23
|
+
break;
|
|
24
|
+
case ItemType.SHORTCUT:
|
|
25
|
+
Icon = CableIcon;
|
|
26
|
+
break;
|
|
27
|
+
case ItemType.DOCUMENT: {
|
|
28
|
+
Icon = TextIcon;
|
|
29
|
+
break;
|
|
30
|
+
}
|
|
31
|
+
case ItemType.LOCAL_FILE:
|
|
32
|
+
case ItemType.S3_FILE: {
|
|
33
|
+
if (mimetype) {
|
|
34
|
+
if (MimeTypes.isImage(mimetype)) {
|
|
35
|
+
Icon = ImageIcon;
|
|
36
|
+
break;
|
|
37
|
+
}
|
|
38
|
+
if (MimeTypes.isVideo(mimetype)) {
|
|
39
|
+
Icon = ClapperboardIcon;
|
|
40
|
+
break;
|
|
41
|
+
}
|
|
42
|
+
if (MimeTypes.isAudio(mimetype)) {
|
|
43
|
+
Icon = Music2Icon;
|
|
44
|
+
break;
|
|
45
|
+
}
|
|
46
|
+
if (MimeTypes.isPdf(mimetype)) {
|
|
47
|
+
Icon = FileTextIcon;
|
|
48
|
+
break;
|
|
49
|
+
}
|
|
50
|
+
if (MimeTypes.isZip(mimetype)) {
|
|
51
|
+
Icon = FolderArchiveIcon;
|
|
52
|
+
break;
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
Icon = FileIcon;
|
|
56
|
+
break;
|
|
57
|
+
}
|
|
58
|
+
case ItemType.LINK: {
|
|
59
|
+
Icon = LinkIcon;
|
|
60
|
+
break;
|
|
61
|
+
}
|
|
62
|
+
case ItemType.APP: {
|
|
63
|
+
Icon = AppWindowIcon;
|
|
64
|
+
break;
|
|
65
|
+
}
|
|
66
|
+
case 'upload': {
|
|
67
|
+
Icon = FileUpIcon;
|
|
68
|
+
break;
|
|
69
|
+
}
|
|
70
|
+
default:
|
|
71
|
+
break;
|
|
72
|
+
}
|
|
73
|
+
return _jsx(Icon, { color: color, size: size });
|
|
74
|
+
};
|
|
75
|
+
export default ItemIcon;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { SxProps } from '@mui/material';
|
|
2
|
+
export type LibraryIconProps = {
|
|
3
|
+
disabled?: boolean;
|
|
4
|
+
disabledColor?: string;
|
|
5
|
+
primaryColor?: string;
|
|
6
|
+
primaryOpacity?: number;
|
|
7
|
+
secondaryColor?: string;
|
|
8
|
+
secondaryOpacity?: number;
|
|
9
|
+
selected?: boolean;
|
|
10
|
+
showSetting?: boolean;
|
|
11
|
+
size?: number;
|
|
12
|
+
sx?: SxProps;
|
|
13
|
+
disableHover?: boolean;
|
|
14
|
+
};
|
|
15
|
+
declare const LibraryIcon: ({ size, primaryColor, primaryOpacity, secondaryColor, disabledColor, secondaryOpacity, sx, showSetting, selected, disableHover, }: LibraryIconProps) => JSX.Element;
|
|
16
|
+
export default LibraryIcon;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { PRIMARY_COLOR, SECONDARY_COLOR } from '../theme.js';
|
|
3
|
+
import { SVGWrapper, StyledG } from './StyledSVGComponents.js';
|
|
4
|
+
const LibraryIcon = ({ size = 50, primaryColor = PRIMARY_COLOR, primaryOpacity = 1, secondaryColor = SECONDARY_COLOR, disabledColor = '#CCC', secondaryOpacity = 1, sx, showSetting = false, selected, disableHover = true, }) => {
|
|
5
|
+
return (_jsxs(SVGWrapper, { sx: sx, size: size, viewBox: '0 0 1080 1080', children: [_jsxs(StyledG, { primaryColor: primaryColor, primaryOpacity: primaryOpacity, secondaryColor: secondaryColor, secondaryOpacity: secondaryOpacity, selected: selected, disabledColor: disabledColor, disableHover: disableHover, children: [_jsx("circle", { fill: primaryColor, cx: '540', cy: '540', r: '540' }), _jsx("path", { d: 'M368.54,261.87h-106.6c-12.21,0-22.15,9.94-22.15,22.15v503.58c0,12.22,9.94,22.15,22.15,22.15h106.6c12.21,0,22.15-9.94,22.15-22.15V284.02c0-12.21-9.94-22.15-22.15-22.15Zm-22.15,44.3v459.28h-62.3V306.17h62.3Z' }), _jsx("path", { d: 'M548.76,261.87h-106.6c-12.22,0-22.15,9.94-22.15,22.15v503.58c0,12.22,9.94,22.15,22.15,22.15h106.6c12.21,0,22.15-9.94,22.15-22.15V284.02c0-12.21-9.94-22.15-22.15-22.15Zm-84.45,503.58V306.17h62.3v459.28h-62.3Z' }), _jsx("path", { d: 'M919.72,741.33l-187.72-467.29c-2.21-5.49-6.42-9.8-11.86-12.12-5.44-2.32-11.46-2.39-16.95-.18l-98.92,39.74c-5.49,2.21-9.79,6.42-12.12,11.86s-2.39,11.46-.18,16.95l187.72,467.29c2.21,5.49,6.42,9.79,11.86,12.11,2.76,1.18,5.69,1.78,8.7,1.78,2.84,0,5.62-.54,8.26-1.6l98.92-39.74c5.49-2.21,9.79-6.42,12.12-11.86,2.32-5.44,2.39-11.46,.18-16.95Zm-49.36-4.04l-57.81,23.22-171.21-426.18,57.81-23.22,171.21,426.18Z' })] }), showSetting && (_jsx("g", { id: 'SVGRepo_iconCarrier', transform: 'translate(-14.742 50.121)', children: _jsx("path", { transform: 'matrix(9,0,0,9,550,550)', d: 'm56.74 20.89-1-2.31c3.33-7.53 3.11-7.75 2.46-8.41l-4.2-4.17-0.42-0.35h-0.49c-0.26 0-1 0-7.51 2.93l-2.38-1c-3.11-7.58-3.43-7.58-4.33-7.58h-6c-0.9 0-1.25 0-4.1 7.66l-2.37 1c-4.4-1.88-6.95-2.82-7.65-2.82h-0.56l-4.58 4.49c-0.7 0.65-0.94 0.88 2.58 8.3l-1 2.3c-7.79 3-7.79 3.3-7.79 4.23v5.89c0 0.92 0 1.25 7.82 4l1 2.29c-3.33 7.53-3.11 7.76-2.46 8.41l4.24 4.25 0.42 0.37h0.5c0.25 0 1 0 7.5-3l2.38 1c3.1 7.63 3.41 7.63 4.32 7.63h6c0.92 0 1.25 0 4.11-7.66l2.39-1c4.37 1.85 6.93 2.79 7.61 2.79h0.57l4.62-4.52c0.66-0.66 0.89-0.89-2.62-8.28l1-2.3c7.81-3 7.81-3.33 7.81-4.23v-5.87c-0.04-0.93-0.04-1.25-7.87-4.04zm-20.74 16.91a9.8 9.8 0 1 1 10-9.8 9.91 9.91 0 0 1-10 9.8z', fill: primaryColor, stroke: secondaryColor, strokeWidth: '5' }) }))] }));
|
|
6
|
+
};
|
|
7
|
+
export default LibraryIcon;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { SxProps } from '@mui/material';
|
|
2
|
+
export type PlayIconProps = {
|
|
3
|
+
size?: number;
|
|
4
|
+
sx?: SxProps;
|
|
5
|
+
primaryColor?: string;
|
|
6
|
+
primaryOpacity?: number;
|
|
7
|
+
secondaryColor?: string;
|
|
8
|
+
secondaryOpacity?: number;
|
|
9
|
+
selected?: boolean;
|
|
10
|
+
disabled?: boolean;
|
|
11
|
+
disabledColor?: string;
|
|
12
|
+
disableHover?: boolean;
|
|
13
|
+
};
|
|
14
|
+
declare const PlayIcon: ({ size, primaryColor, primaryOpacity, secondaryColor, secondaryOpacity, sx, disabledColor, disabled, selected, disableHover, }: PlayIconProps) => JSX.Element;
|
|
15
|
+
export default PlayIcon;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { PRIMARY_COLOR, SECONDARY_COLOR } from '../theme.js';
|
|
3
|
+
import { SVGWrapper, StyledG } from './StyledSVGComponents.js';
|
|
4
|
+
const PlayIcon = ({ size = 50, primaryColor = PRIMARY_COLOR, primaryOpacity = 1, secondaryColor = SECONDARY_COLOR, secondaryOpacity = 1, sx, disabledColor, disabled = false, selected, disableHover = true, }) => {
|
|
5
|
+
return (_jsx(SVGWrapper, { sx: sx, size: size, viewBox: '0 0 1080 1080', children: _jsxs(StyledG, { selected: selected, primaryColor: primaryColor, primaryOpacity: primaryOpacity, secondaryColor: secondaryColor, secondaryOpacity: secondaryOpacity, disabledColor: disabledColor, disabled: disabled, disableHover: disableHover, children: [_jsx("circle", { cx: '540', cy: '540', r: '540' }), _jsx("path", { d: 'M439.21,340.8l292.95,195.48-292.95,195.48V340.8m-29.63-92.75c-19.29,0-37.21,15.34-37.21,37.16v502.13c0,21.83,17.92,37.16,37.21,37.16,6.91,0,13.99-1.97,20.49-6.3l376.25-251.07c22.01-14.69,22.01-47.03,0-61.72L430.07,254.35c-6.5-4.34-13.58-6.3-20.49-6.3h0Z' })] }) }));
|
|
6
|
+
};
|
|
7
|
+
export default PlayIcon;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { UnfoldVerticalIcon } from 'lucide-react';
|
|
3
|
+
import { Box, styled, useTheme } from '@mui/material';
|
|
4
|
+
const RESIZING_ICON_LEVEL_BACKGROUND_COLOR = 300;
|
|
5
|
+
const RESIZING_ICON_LEVEL_BACKGROUND_COLOR_FOCUS = 500;
|
|
6
|
+
const StyledIcon = styled(UnfoldVerticalIcon)(({ theme }) => ({
|
|
7
|
+
backgroundColor: theme.palette.grey[RESIZING_ICON_LEVEL_BACKGROUND_COLOR],
|
|
8
|
+
padding: theme.spacing(0.5),
|
|
9
|
+
'&:hover': {
|
|
10
|
+
backgroundColor: theme.palette.grey[RESIZING_ICON_LEVEL_BACKGROUND_COLOR_FOCUS],
|
|
11
|
+
transition: 'all 0.3s ease-in-out',
|
|
12
|
+
},
|
|
13
|
+
'&:focus': {
|
|
14
|
+
backgroundColor: theme.palette.grey[RESIZING_ICON_LEVEL_BACKGROUND_COLOR_FOCUS],
|
|
15
|
+
},
|
|
16
|
+
}));
|
|
17
|
+
const ResizingIcon = () => {
|
|
18
|
+
const theme = useTheme();
|
|
19
|
+
return (_jsx(Box, { display: 'flex', justifyContent: 'center', alignItems: 'center', children: _jsx(StyledIcon, { color: theme.palette.primary.main }) }));
|
|
20
|
+
};
|
|
21
|
+
export default ResizingIcon;
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { SxProps } from '@mui/material';
|
|
2
|
+
import { ReactNode } from 'react';
|
|
3
|
+
type SVGWrapperProps = {
|
|
4
|
+
children: ReactNode;
|
|
5
|
+
viewBox?: string;
|
|
6
|
+
size?: number;
|
|
7
|
+
sx?: SxProps;
|
|
8
|
+
} & React.SVGProps<SVGElement>;
|
|
9
|
+
declare const SVGWrapper: ({ children, viewBox, size, sx, }: SVGWrapperProps) => JSX.Element;
|
|
10
|
+
type SVGPathProps = {
|
|
11
|
+
sx?: SxProps;
|
|
12
|
+
} & React.SVGProps<SVGPathProps>;
|
|
13
|
+
declare const SVGPath: ({ d, sx }: SVGPathProps) => JSX.Element;
|
|
14
|
+
type StyledGProps = {
|
|
15
|
+
/** if true, apply selected styles (default: false). Circles get primary color/opacity and paths get secondary color/opacity. */
|
|
16
|
+
selected?: boolean;
|
|
17
|
+
/** color of circle when selected. Color of path when not selected. */
|
|
18
|
+
primaryColor?: string;
|
|
19
|
+
/** opacity of circle when selected. Opacity of path when not selected. */
|
|
20
|
+
primaryOpacity?: number;
|
|
21
|
+
/** color of path when selected. Color of circle when not selected. */
|
|
22
|
+
secondaryColor?: string;
|
|
23
|
+
/** opacity of path when selected. Opacity of circle when not selected. */
|
|
24
|
+
secondaryOpacity?: number;
|
|
25
|
+
/** if true, apply disabled styles (default: false) */
|
|
26
|
+
disabled?: boolean;
|
|
27
|
+
/** if true, does not apply hover styles (default: false). On hover, circles get primary color/opacity and paths get secondary color/opacity. */
|
|
28
|
+
disableHover?: boolean;
|
|
29
|
+
/** color of path when disabled. */
|
|
30
|
+
disabledColor?: string;
|
|
31
|
+
};
|
|
32
|
+
declare const StyledG: (props: StyledGProps & {
|
|
33
|
+
children: ReactNode;
|
|
34
|
+
}) => ReactNode;
|
|
35
|
+
export { SVGWrapper, SVGPath, StyledG };
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { styled } from '@mui/material';
|
|
3
|
+
const SVGWrapper = ({ children, viewBox, size, sx, }) => {
|
|
4
|
+
const StyledSVG = styled('svg')({
|
|
5
|
+
width: size,
|
|
6
|
+
height: size,
|
|
7
|
+
});
|
|
8
|
+
return (_jsx(StyledSVG, { viewBox: viewBox, sx: sx, children: children }));
|
|
9
|
+
};
|
|
10
|
+
const SVGPath = ({ d, sx }) => {
|
|
11
|
+
const StyledPath = styled('path')();
|
|
12
|
+
return _jsx(StyledPath, { d: d, sx: sx });
|
|
13
|
+
};
|
|
14
|
+
const StyledG = styled('g')(({ selected = false, primaryColor, primaryOpacity, secondaryColor, secondaryOpacity, disabled = false, disabledColor = '#CCC', disableHover = true, }) => {
|
|
15
|
+
if (disabled) {
|
|
16
|
+
return {
|
|
17
|
+
path: {
|
|
18
|
+
fill: disabledColor,
|
|
19
|
+
fillOpacity: 0.6,
|
|
20
|
+
},
|
|
21
|
+
circle: {
|
|
22
|
+
fill: 'transparent',
|
|
23
|
+
fillOpacity: 1,
|
|
24
|
+
},
|
|
25
|
+
};
|
|
26
|
+
}
|
|
27
|
+
const hoverStyles = disableHover
|
|
28
|
+
? {}
|
|
29
|
+
: {
|
|
30
|
+
'&:hover': {
|
|
31
|
+
circle: {
|
|
32
|
+
fill: primaryColor,
|
|
33
|
+
fillOpacity: primaryOpacity,
|
|
34
|
+
},
|
|
35
|
+
path: {
|
|
36
|
+
fill: secondaryColor,
|
|
37
|
+
fillOpacity: secondaryOpacity,
|
|
38
|
+
},
|
|
39
|
+
},
|
|
40
|
+
};
|
|
41
|
+
return {
|
|
42
|
+
path: {
|
|
43
|
+
fill: selected ? secondaryColor : primaryColor,
|
|
44
|
+
fillOpacity: selected ? secondaryOpacity : primaryOpacity,
|
|
45
|
+
},
|
|
46
|
+
circle: {
|
|
47
|
+
fill: selected ? primaryColor : 'transparent',
|
|
48
|
+
fillOpacity: selected ? primaryOpacity : secondaryOpacity,
|
|
49
|
+
},
|
|
50
|
+
...hoverStyles,
|
|
51
|
+
};
|
|
52
|
+
});
|
|
53
|
+
export { SVGWrapper, SVGPath, StyledG };
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export { default as AnalyticsIcon } from './AnalyticsIcon.js';
|
|
2
|
+
export { default as BuildIcon } from './BuildIcon.js';
|
|
3
|
+
export { default as EtherpadIcon } from './EtherpadIcon.js';
|
|
4
|
+
export { default as ItemIcon } from './ItemIcon.js';
|
|
5
|
+
export { default as LibraryIcon } from './LibraryIcon.js';
|
|
6
|
+
export { default as PlayIcon } from './PlayIcon.js';
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export { default as AnalyticsIcon } from './AnalyticsIcon.js';
|
|
2
|
+
export { default as BuildIcon } from './BuildIcon.js';
|
|
3
|
+
export { default as EtherpadIcon } from './EtherpadIcon.js';
|
|
4
|
+
export { default as ItemIcon } from './ItemIcon.js';
|
|
5
|
+
export { default as LibraryIcon } from './LibraryIcon.js';
|
|
6
|
+
export { default as PlayIcon } from './PlayIcon.js';
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
export * from './theme.js';
|
|
2
|
+
export * from './constants.js';
|
|
3
|
+
export * from './items/index.js';
|
|
4
|
+
export * from './hooks/useFullscreen.js';
|
|
5
|
+
export * from './hooks/useMobileView.js';
|
|
6
|
+
export * from './buttons/hooks.js';
|
|
7
|
+
export * from './icons/index.js';
|
|
8
|
+
export * from './buttons/index.js';
|
|
9
|
+
export { default as Loader } from './Loader/Loader.js';
|
|
10
|
+
export { default as TextDisplay } from './TextDisplay/TextDisplay.js';
|
|
11
|
+
export { withFlavor } from './TextDisplay/withFlavor.js';
|
|
12
|
+
export { default as Header } from './Header/Header.js';
|
|
13
|
+
export { default as Sidebar } from './Sidebar/Sidebar.js';
|
|
14
|
+
export { default as DrawerHeader } from './DrawerHeader/DrawerHeader.js';
|
|
15
|
+
export { default as MainMenu } from './MainMenu/MainMenu.js';
|
|
16
|
+
export { useMainMenuOpenContext } from './MainMenu/hooks.js';
|
|
17
|
+
export * from './MainMenu/MainMenu.js';
|
|
18
|
+
export * from './MainMenu/MenuItem/MenuItem.js';
|
|
19
|
+
export { default as Navigation } from './Navigation/Navigation.js';
|
|
20
|
+
export { default as HomeMenu } from './Navigation/HomeMenu.js';
|
|
21
|
+
export { default as ItemMenu } from './Navigation/ItemMenu.js';
|
|
22
|
+
export { default as Main } from './Main/Main.js';
|
|
23
|
+
export { default as withCollapse } from './Collapse/withCollapse.js';
|
|
24
|
+
export { default as GraaspLogo } from './GraaspLogo/GraaspLogo.js';
|
|
25
|
+
export { default as EpflLogo } from './GraaspLogo/EpflLogo.js';
|
|
26
|
+
export { default as ItemLoginWrapper } from './itemLogin/ItemLoginWrapper.js';
|
|
27
|
+
export { default as ForbiddenContent } from './itemLogin/ForbiddenContent.js';
|
|
28
|
+
export { default as Card } from './Card/Card.js';
|
|
29
|
+
export { default as FolderCard } from './Card/FolderCard.js';
|
|
30
|
+
export { default as LinkCard } from './Card/LinkCard.js';
|
|
31
|
+
export { default as Thumbnail } from './Thumbnail/Thumbnail.js';
|
|
32
|
+
export { default as Avatar } from './Avatar/Avatar.js';
|
|
33
|
+
export * from './Avatar/stringToColor.js';
|
|
34
|
+
export { default as ItemBadges } from './ItemBadges/ItemBadges.js';
|
|
35
|
+
export { default as ItemFlagDialog } from './ItemFlag/ItemFlagDialog.js';
|
|
36
|
+
export { default as ItemFlagButton } from './ItemFlag/ItemFlagButton.js';
|
|
37
|
+
export { default as CreativeCommons } from './CreativeCommons/CreativeCommons.js';
|
|
38
|
+
export { default as CookiesBanner } from './CookiesBanner/CookiesBanner.js';
|
|
39
|
+
export { default as SignedInWrapper } from './Authorization/SignedInWrapper.js';
|
|
40
|
+
export { default as PreventGuestWrapper } from './Authorization/PreventGuestWrapper.js';
|
|
41
|
+
export { default as RedirectionContent } from './Authorization/RedirectionContent.js';
|
|
42
|
+
export { UserSwitch } from './UserSwitch/UserSwitch.js';
|
|
43
|
+
export { UserSwitchWrapper } from './UserSwitch/UserSwitchWrapper.js';
|
|
44
|
+
export { default as CustomInitialLoader } from './CustomInitialLoader/CustomInitialLoader.js';
|
|
45
|
+
export { default as Select } from './Select/Select.js';
|
|
46
|
+
export { default as ItemSkeleton } from './items/ItemSkeleton/ItemSkeleton.js';
|
|
47
|
+
export { default as SearchInput } from './SearchInput/SearchInput.js';
|
|
48
|
+
export * from './SearchInput/SearchInput.js';
|
|
49
|
+
export { default as PlatformSwitch } from './PlatformSwitch/PlatformSwitch.js';
|
|
50
|
+
export * from './PlatformSwitch/PlatformSwitch.js';
|
|
51
|
+
export * from './PlatformSwitch/hooks.js';
|
|
52
|
+
export { default as FileDropper, type FileDropperProps, } from './upload/FileDropper/FileDropper.js';
|
|
53
|
+
export { default as UploadFileButton, type UploadFileButtonProps, } from './upload/UploadFileButton/UploadFileButton.js';
|
|
54
|
+
export { default as RowMenu, type RowMenuProps } from './Tree/RowMenu.js';
|
|
55
|
+
export { default as RowMenus, type RowMenusProps } from './Tree/RowMenus.js';
|
|
56
|
+
export { default as Breadcrumbs, type BreadcrumbsProps, } from './Tree/Breadcrumbs.js';
|
|
57
|
+
export type { NavigationElement } from './Tree/types.js';
|
|
58
|
+
export * from './ThemeContext/ThemeContext.js';
|
|
59
|
+
export * from './types.js';
|
|
60
|
+
export { default as DraggingWrapper } from './draggable/DraggingWrapper.js';
|
|
61
|
+
export * from './draggable/types.js';
|