@edifice.io/react 2.5.21-develop.20260526135535 → 2.5.21-epic-homepage.20260601163426
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/dist/components/AppIcon/AppIcon.js +4 -1
- package/dist/components/BetaSwitch/BetaSwitch.d.ts +13 -0
- package/dist/components/BetaSwitch/BetaSwitch.js +27 -0
- package/dist/components/BetaSwitch/index.d.ts +1 -0
- package/dist/components/ButtonBeta/ButtonBeta.d.ts +47 -0
- package/dist/components/ButtonBeta/ButtonBeta.js +34 -0
- package/dist/components/ButtonBeta/index.d.ts +2 -0
- package/dist/components/Logo/index.d.ts +1 -1
- package/dist/components/LogoBeta/LogoBeta.d.ts +7 -0
- package/dist/components/LogoBeta/LogoBeta.js +14 -0
- package/dist/components/LogoBeta/index.d.ts +2 -0
- package/dist/components/PageLayout/PageLayout.d.ts +45 -0
- package/dist/components/PageLayout/PageLayout.js +94 -0
- package/dist/components/PageLayout/PageLayoutContext.d.ts +14 -0
- package/dist/components/PageLayout/PageLayoutContext.js +8 -0
- package/dist/components/PageLayout/components/PageLayoutBreadcrumb.d.ts +9 -0
- package/dist/components/PageLayout/components/PageLayoutBreadcrumb.js +10 -0
- package/dist/components/PageLayout/components/PageLayoutContent.d.ts +9 -0
- package/dist/components/PageLayout/components/PageLayoutContent.js +18 -0
- package/dist/components/PageLayout/components/PageLayoutHeader.d.ts +9 -0
- package/dist/components/PageLayout/components/PageLayoutHeader.js +17 -0
- package/dist/components/PageLayout/components/PageLayoutOverlay.d.ts +15 -0
- package/dist/components/PageLayout/components/PageLayoutOverlay.js +34 -0
- package/dist/components/PageLayout/components/PageLayoutSidebarLeft.d.ts +9 -0
- package/dist/components/PageLayout/components/PageLayoutSidebarLeft.js +18 -0
- package/dist/components/PageLayout/components/PageLayoutSidebarRight.d.ts +9 -0
- package/dist/components/PageLayout/components/PageLayoutSidebarRight.js +18 -0
- package/dist/components/PageLayout/index.d.ts +3 -0
- package/dist/components/index.d.ts +4 -0
- package/dist/homepage.js +24 -0
- package/dist/hooks/index.d.ts +1 -1
- package/dist/hooks/useEdificeIcons/useEdificeIcons.js +10 -9
- package/dist/icons-nav.js +38 -28
- package/dist/index.js +213 -202
- package/dist/modules/homepage/components/Header/Header.d.ts +8 -0
- package/dist/modules/homepage/components/Header/Header.js +74 -0
- package/dist/modules/homepage/components/Header/index.d.ts +2 -0
- package/dist/modules/homepage/components/HomeCard/HomeCard.d.ts +37 -0
- package/dist/modules/homepage/components/HomeCard/HomeCard.js +17 -0
- package/dist/modules/homepage/components/HomeCard/HomeCardContent.d.ts +7 -0
- package/dist/modules/homepage/components/HomeCard/HomeCardContent.js +10 -0
- package/dist/modules/homepage/components/HomeCard/HomeCardHeader.d.ts +18 -0
- package/dist/modules/homepage/components/HomeCard/HomeCardHeader.js +22 -0
- package/dist/modules/homepage/components/HomeCard/index.d.ts +4 -0
- package/dist/modules/homepage/components/LastInfos/LastInfos.d.ts +49 -0
- package/dist/modules/homepage/components/LastInfos/LastInfos.js +58 -0
- package/dist/modules/homepage/components/LastInfos/LastInfosContainer.d.ts +4 -0
- package/dist/modules/homepage/components/LastInfos/LastInfosContainer.js +37 -0
- package/dist/modules/homepage/components/LastInfos/LastInfosList.d.ts +13 -0
- package/dist/modules/homepage/components/LastInfos/LastInfosList.js +31 -0
- package/dist/modules/homepage/components/LastInfos/index.d.ts +4 -0
- package/dist/modules/homepage/components/LastInfos/useLastInfos.d.ts +18 -0
- package/dist/modules/homepage/components/LastInfos/useLastInfos.js +25 -0
- package/dist/modules/homepage/components/MessageFlashList/MessageFlash.d.ts +12 -0
- package/dist/modules/homepage/components/MessageFlashList/MessageFlash.js +62 -0
- package/dist/modules/homepage/components/MessageFlashList/MessageFlashList.d.ts +12 -0
- package/dist/modules/homepage/components/MessageFlashList/MessageFlashList.js +10 -0
- package/dist/modules/homepage/components/MessageFlashList/MessageFlashListContainer.d.ts +5 -0
- package/dist/modules/homepage/components/MessageFlashList/MessageFlashListContainer.js +14 -0
- package/dist/modules/homepage/components/MessageFlashList/hooks/useMessageFlashList.d.ts +16 -0
- package/dist/modules/homepage/components/MessageFlashList/hooks/useMessageFlashList.js +19 -0
- package/dist/modules/homepage/components/MessageFlashList/index.d.ts +4 -0
- package/dist/modules/homepage/components/MessageFlashList/services/api/index.d.ts +4 -0
- package/dist/modules/homepage/components/MessageFlashList/services/api/index.js +5 -0
- package/dist/modules/homepage/components/MessageFlashList/services/api/messagesFlashService.d.ts +20 -0
- package/dist/modules/homepage/components/MessageFlashList/services/api/messagesFlashService.js +21 -0
- package/dist/modules/homepage/components/MessageFlashList/services/queries/messagesFlash.d.ts +13 -0
- package/dist/modules/homepage/components/MessageFlashList/services/queries/messagesFlash.js +31 -0
- package/dist/modules/homepage/components/Notifications/Notification.d.ts +9 -0
- package/dist/modules/homepage/components/Notifications/Notification.js +7 -0
- package/dist/modules/homepage/components/Notifications/NotificationList.d.ts +18 -0
- package/dist/modules/homepage/components/Notifications/NotificationList.js +44 -0
- package/dist/modules/homepage/components/Notifications/NotificationListContainer.d.ts +9 -0
- package/dist/modules/homepage/components/Notifications/NotificationListContainer.js +20 -0
- package/dist/modules/homepage/components/Notifications/NotificationSkeleton.d.ts +3 -0
- package/dist/modules/homepage/components/Notifications/NotificationSkeleton.js +6 -0
- package/dist/modules/homepage/components/Notifications/hooks/useNotificationList.d.ts +20 -0
- package/dist/modules/homepage/components/Notifications/hooks/useNotificationList.js +26 -0
- package/dist/modules/homepage/components/Notifications/index.d.ts +4 -0
- package/dist/modules/homepage/components/Notifications/services/api/index.d.ts +4 -0
- package/dist/modules/homepage/components/Notifications/services/api/index.js +5 -0
- package/dist/modules/homepage/components/Notifications/services/api/notificationService.d.ts +15 -0
- package/dist/modules/homepage/components/Notifications/services/api/notificationService.js +22 -0
- package/dist/modules/homepage/components/Notifications/services/queries/notification.d.ts +20 -0
- package/dist/modules/homepage/components/Notifications/services/queries/notification.js +40 -0
- package/dist/modules/homepage/components/SchoolSpace/SchoolSpace.d.ts +15 -0
- package/dist/modules/homepage/components/SchoolSpace/SchoolSpace.js +29 -0
- package/dist/modules/homepage/components/SchoolSpace/SchoolSpaceContainer.d.ts +4 -0
- package/dist/modules/homepage/components/SchoolSpace/SchoolSpaceContainer.js +13 -0
- package/dist/modules/homepage/components/SchoolSpace/index.d.ts +3 -0
- package/dist/modules/homepage/components/SchoolSpace/useUserSchools.d.ts +6 -0
- package/dist/modules/homepage/components/SchoolSpace/useUserSchools.js +39 -0
- package/dist/modules/homepage/components/index.d.ts +6 -0
- package/dist/modules/homepage/hooks/useWidget.d.ts +6 -0
- package/dist/modules/homepage/hooks/useWidget.js +83 -0
- package/dist/modules/homepage/hooks/useWidgetPreferences.d.ts +6 -0
- package/dist/modules/homepage/hooks/useWidgetPreferences.js +34 -0
- package/dist/modules/homepage/index.d.ts +1 -0
- package/dist/modules/icons/components/nav/IconCommunitiesBeta.d.ts +7 -0
- package/dist/modules/icons/components/nav/IconCommunitiesBeta.js +18 -0
- package/dist/modules/icons/components/nav/IconHomeBeta.d.ts +7 -0
- package/dist/modules/icons/components/nav/IconHomeBeta.js +13 -0
- package/dist/modules/icons/components/nav/IconMessagesBeta.d.ts +7 -0
- package/dist/modules/icons/components/nav/IconMessagesBeta.js +18 -0
- package/dist/modules/icons/components/nav/IconMyAppsBeta.d.ts +7 -0
- package/dist/modules/icons/components/nav/IconMyAppsBeta.js +13 -0
- package/dist/modules/icons/components/nav/IconNotificationBeta.d.ts +7 -0
- package/dist/modules/icons/components/nav/IconNotificationBeta.js +14 -0
- package/dist/modules/icons/components/nav/IconNotificationsBeta.d.ts +7 -0
- package/dist/modules/icons/components/nav/index.d.ts +5 -0
- package/dist/modules/modals/OnboardingModal/index.d.ts +1 -1
- package/dist/providers/EdificeClientProvider/EdificeClientProvider.d.ts +0 -7
- package/package.json +10 -6
|
@@ -33,7 +33,10 @@ const AppIcon = /* @__PURE__ */ forwardRef(({
|
|
|
33
33
|
...iconVariant,
|
|
34
34
|
...iconFits,
|
|
35
35
|
[`bg-light-${appCode}`]: !isContain,
|
|
36
|
-
[`color-app-${appCode}`]: appCode
|
|
36
|
+
[`color-app-${appCode}`]: appCode,
|
|
37
|
+
"bg-app-light": !isContain,
|
|
38
|
+
"color-app": appCode,
|
|
39
|
+
[`app-${appCode}`]: appCode
|
|
37
40
|
}, className), IconComponent = iconsApps[`Icon${appCode.split("-").map((part) => part.charAt(0).toUpperCase() + part.slice(1)).join("")}`] ?? SvgIconPlaceholder;
|
|
38
41
|
if (isIconURL) {
|
|
39
42
|
const classes2 = clsx("h-full", className);
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* BetaSwitch component displays a banner allowing the user to opt-out
|
|
3
|
+
* from the beta version of the homepage and switch back to the legacy one.
|
|
4
|
+
*/
|
|
5
|
+
export interface BetaSwitchProps {
|
|
6
|
+
isSwitching?: boolean;
|
|
7
|
+
onSwitchClick?: () => void;
|
|
8
|
+
}
|
|
9
|
+
export declare const BetaSwitch: {
|
|
10
|
+
({ isSwitching, onSwitchClick, }: BetaSwitchProps): import("react/jsx-runtime").JSX.Element;
|
|
11
|
+
displayName: string;
|
|
12
|
+
};
|
|
13
|
+
export default BetaSwitch;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { jsxs, jsx } from "react/jsx-runtime";
|
|
2
|
+
import { useTranslation } from "react-i18next";
|
|
3
|
+
import SvgIconArrowRight from "../../modules/icons/components/IconArrowRight.js";
|
|
4
|
+
import useBreakpoint from "../../hooks/useBreakpoint/useBreakpoint.js";
|
|
5
|
+
import Flex from "../Flex/Flex.js";
|
|
6
|
+
import ButtonBeta from "../ButtonBeta/ButtonBeta.js";
|
|
7
|
+
const BetaSwitch = ({
|
|
8
|
+
isSwitching = !1,
|
|
9
|
+
onSwitchClick
|
|
10
|
+
}) => {
|
|
11
|
+
const {
|
|
12
|
+
t
|
|
13
|
+
} = useTranslation(), {
|
|
14
|
+
md
|
|
15
|
+
} = useBreakpoint();
|
|
16
|
+
return /* @__PURE__ */ jsxs(Flex, { direction: md ? "row" : "column", gap: "8", className: "beta-switch", children: [
|
|
17
|
+
/* @__PURE__ */ jsxs("p", { children: [
|
|
18
|
+
/* @__PURE__ */ jsx("strong", { children: t("betaSwitch.title") }),
|
|
19
|
+
" ",
|
|
20
|
+
/* @__PURE__ */ jsx("span", { children: t("betaSwitch.description") })
|
|
21
|
+
] }),
|
|
22
|
+
/* @__PURE__ */ jsx(ButtonBeta, { "data-testid": "beta-switch-button", isLoading: isSwitching, disabled: isSwitching, onClick: onSwitchClick, rightIcon: /* @__PURE__ */ jsx(SvgIconArrowRight, {}), children: t("betaSwitch.button") })
|
|
23
|
+
] });
|
|
24
|
+
};
|
|
25
|
+
export {
|
|
26
|
+
BetaSwitch
|
|
27
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { BetaSwitch } from './BetaSwitch';
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
export type ButtonBetaRef = HTMLButtonElement;
|
|
3
|
+
export type ButtonBetaColor = 'default' | 'destructive' | 'secondary' | 'tertiary';
|
|
4
|
+
export type ButtonBetaVariant = 'filled' | 'outline' | 'ghost';
|
|
5
|
+
export interface ButtonBetaProps extends React.ComponentPropsWithRef<'button'> {
|
|
6
|
+
/**
|
|
7
|
+
* `button`, `submit` or `reset`
|
|
8
|
+
*/
|
|
9
|
+
type?: 'button' | 'submit' | 'reset';
|
|
10
|
+
/**
|
|
11
|
+
* `default`, `destructive`, `secondary` or `tertiary`
|
|
12
|
+
*/
|
|
13
|
+
color?: ButtonBetaColor;
|
|
14
|
+
/**
|
|
15
|
+
* `filled`, `outline` or `ghost`
|
|
16
|
+
*/
|
|
17
|
+
variant?: ButtonBetaVariant;
|
|
18
|
+
/**
|
|
19
|
+
* Does it has a text ?
|
|
20
|
+
*/
|
|
21
|
+
children?: ReactNode;
|
|
22
|
+
/**
|
|
23
|
+
* Display Icon Component to the left
|
|
24
|
+
*/
|
|
25
|
+
leftIcon?: ReactNode;
|
|
26
|
+
/**
|
|
27
|
+
* Display Icon Component to the right
|
|
28
|
+
*/
|
|
29
|
+
rightIcon?: ReactNode;
|
|
30
|
+
/**
|
|
31
|
+
* Is it loading ?
|
|
32
|
+
*/
|
|
33
|
+
isLoading?: boolean;
|
|
34
|
+
/**
|
|
35
|
+
* Disabled status
|
|
36
|
+
*/
|
|
37
|
+
disabled?: boolean;
|
|
38
|
+
/**
|
|
39
|
+
* Optional class for styling purpose
|
|
40
|
+
*/
|
|
41
|
+
className?: string;
|
|
42
|
+
}
|
|
43
|
+
/**
|
|
44
|
+
* Primary UI component for user interaction (edifice2d design system)
|
|
45
|
+
*/
|
|
46
|
+
declare const ButtonBeta: import('react').ForwardRefExoticComponent<Omit<ButtonBetaProps, "ref"> & import('react').RefAttributes<HTMLButtonElement>>;
|
|
47
|
+
export default ButtonBeta;
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { jsxs, jsx } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef } from "react";
|
|
3
|
+
import clsx from "clsx";
|
|
4
|
+
import Loading from "../Loading/Loading.js";
|
|
5
|
+
const ButtonBeta = /* @__PURE__ */ forwardRef(({
|
|
6
|
+
color = "default",
|
|
7
|
+
type = "button",
|
|
8
|
+
variant = "filled",
|
|
9
|
+
children,
|
|
10
|
+
isLoading,
|
|
11
|
+
leftIcon,
|
|
12
|
+
rightIcon,
|
|
13
|
+
className,
|
|
14
|
+
...restProps
|
|
15
|
+
}, ref) => {
|
|
16
|
+
const hasIcon = !!(leftIcon || rightIcon), classes = clsx("btn-beta", `btn-beta-${color}`, {
|
|
17
|
+
"btn-beta--outline": variant === "outline",
|
|
18
|
+
"btn-beta--ghost": variant === "ghost",
|
|
19
|
+
"btn-beta--icon-only": !children,
|
|
20
|
+
"btn-beta--with-icon": hasIcon && !!children,
|
|
21
|
+
"btn-beta--loading": isLoading
|
|
22
|
+
}, className);
|
|
23
|
+
return /* @__PURE__ */ jsxs("button", { ref, "data-testid": "button-beta", className: classes, type, ...restProps, children: [
|
|
24
|
+
isLoading && /* @__PURE__ */ jsx(Loading, { isLoading: !0 }),
|
|
25
|
+
/* @__PURE__ */ jsxs("span", { children: [
|
|
26
|
+
leftIcon,
|
|
27
|
+
children,
|
|
28
|
+
rightIcon
|
|
29
|
+
] })
|
|
30
|
+
] });
|
|
31
|
+
});
|
|
32
|
+
export {
|
|
33
|
+
ButtonBeta as default
|
|
34
|
+
};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef } from "react";
|
|
3
|
+
import clsx from "clsx";
|
|
4
|
+
const LogoBeta = /* @__PURE__ */ forwardRef(({
|
|
5
|
+
src,
|
|
6
|
+
is1d,
|
|
7
|
+
translate = "Retour accueil"
|
|
8
|
+
}, ref) => {
|
|
9
|
+
const classes = clsx("navbar-brand");
|
|
10
|
+
return /* @__PURE__ */ jsx("a", { ref, className: classes, href: "/timeline/timeline", "aria-label": translate, children: /* @__PURE__ */ jsx("img", { className: "logo", src, alt: `logo ${is1d ? "ONE" : "NEO"}`, width: "300", height: "52" }) });
|
|
11
|
+
});
|
|
12
|
+
export {
|
|
13
|
+
LogoBeta as default
|
|
14
|
+
};
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { ComponentPropsWithoutRef, ReactNode } from 'react';
|
|
2
|
+
import { NoPaddingConfig, PageLayoutScrollMode, PageLayoutVariant } from './PageLayoutContext';
|
|
3
|
+
export interface PageLayoutProps extends ComponentPropsWithoutRef<'div'> {
|
|
4
|
+
children: ReactNode;
|
|
5
|
+
/** Layout variant: "centered" (default) centers everything in a max-width container,
|
|
6
|
+
* "fullpage" extends sidebars to screen edges with centered content */
|
|
7
|
+
variant?: PageLayoutVariant;
|
|
8
|
+
/** Add a gap between sidebars and content */
|
|
9
|
+
withGap?: boolean;
|
|
10
|
+
/** Scroll mode: "columns" — each column scrolls independently (header not fixed),
|
|
11
|
+
* "page" — normal page scroll with sticky breadcrumb (header not fixed) */
|
|
12
|
+
scrollMode?: PageLayoutScrollMode;
|
|
13
|
+
/** Disable padding on specific columns */
|
|
14
|
+
noPadding?: NoPaddingConfig;
|
|
15
|
+
}
|
|
16
|
+
declare const PageLayout: {
|
|
17
|
+
({ children, variant, withGap, scrollMode, noPadding, className, ...props }: PageLayoutProps): import("react/jsx-runtime").JSX.Element;
|
|
18
|
+
displayName: string;
|
|
19
|
+
} & {
|
|
20
|
+
Header: {
|
|
21
|
+
({ children, className, ...props }: import('./components/PageLayoutHeader').PageLayoutHeaderProps): import("react/jsx-runtime").JSX.Element;
|
|
22
|
+
displayName: string;
|
|
23
|
+
};
|
|
24
|
+
Breadcrumb: {
|
|
25
|
+
({ children, className, ...props }: import('./components/PageLayoutBreadcrumb').PageLayoutBreadcrumbProps): import("react/jsx-runtime").JSX.Element;
|
|
26
|
+
displayName: string;
|
|
27
|
+
};
|
|
28
|
+
SidebarLeft: {
|
|
29
|
+
({ children, className, ...props }: import('./components/PageLayoutSidebarLeft').PageLayoutSidebarLeftProps): import("react/jsx-runtime").JSX.Element;
|
|
30
|
+
displayName: string;
|
|
31
|
+
};
|
|
32
|
+
Content: {
|
|
33
|
+
({ children, className, ...props }: import('./components/PageLayoutContent').PageLayoutContentProps): import("react/jsx-runtime").JSX.Element;
|
|
34
|
+
displayName: string;
|
|
35
|
+
};
|
|
36
|
+
SidebarRight: {
|
|
37
|
+
({ children, className, ...props }: import('./components/PageLayoutSidebarRight').PageLayoutSidebarRightProps): import("react/jsx-runtime").JSX.Element;
|
|
38
|
+
displayName: string;
|
|
39
|
+
};
|
|
40
|
+
Overlay: {
|
|
41
|
+
({ children, open, onClose, backdrop, className, ...props }: import('./components/PageLayoutOverlay').PageLayoutOverlayProps): import("react/jsx-runtime").JSX.Element;
|
|
42
|
+
displayName: string;
|
|
43
|
+
};
|
|
44
|
+
};
|
|
45
|
+
export default PageLayout;
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { useMemo, Children, isValidElement } from "react";
|
|
3
|
+
import clsx from "clsx";
|
|
4
|
+
import PageLayoutBreadcrumb from "./components/PageLayoutBreadcrumb.js";
|
|
5
|
+
import PageLayoutContent from "./components/PageLayoutContent.js";
|
|
6
|
+
import PageLayoutHeader from "./components/PageLayoutHeader.js";
|
|
7
|
+
import PageLayoutOverlay from "./components/PageLayoutOverlay.js";
|
|
8
|
+
import PageLayoutSidebarLeft from "./components/PageLayoutSidebarLeft.js";
|
|
9
|
+
import PageLayoutSidebarRight from "./components/PageLayoutSidebarRight.js";
|
|
10
|
+
import { PageLayoutContext } from "./PageLayoutContext.js";
|
|
11
|
+
function analyzeChildren(children) {
|
|
12
|
+
let hasLeftSidebar = !1, hasRightSidebar = !1, breadcrumb = null, overlay = null;
|
|
13
|
+
const headerChildren = [], mainChildren = [];
|
|
14
|
+
return Children.toArray(children).forEach((child) => {
|
|
15
|
+
if (/* @__PURE__ */ isValidElement(child))
|
|
16
|
+
switch (child.type) {
|
|
17
|
+
case PageLayoutHeader:
|
|
18
|
+
headerChildren.push(child);
|
|
19
|
+
break;
|
|
20
|
+
case PageLayoutBreadcrumb:
|
|
21
|
+
breadcrumb = child;
|
|
22
|
+
break;
|
|
23
|
+
case PageLayoutOverlay:
|
|
24
|
+
overlay = child;
|
|
25
|
+
break;
|
|
26
|
+
case PageLayoutSidebarLeft:
|
|
27
|
+
hasLeftSidebar = !0, mainChildren.push(child);
|
|
28
|
+
break;
|
|
29
|
+
case PageLayoutSidebarRight:
|
|
30
|
+
hasRightSidebar = !0, mainChildren.push(child);
|
|
31
|
+
break;
|
|
32
|
+
case PageLayoutContent:
|
|
33
|
+
mainChildren.push(child);
|
|
34
|
+
break;
|
|
35
|
+
default:
|
|
36
|
+
mainChildren.push(child);
|
|
37
|
+
break;
|
|
38
|
+
}
|
|
39
|
+
}), {
|
|
40
|
+
hasLeftSidebar,
|
|
41
|
+
hasRightSidebar,
|
|
42
|
+
breadcrumb,
|
|
43
|
+
overlay,
|
|
44
|
+
headerChildren,
|
|
45
|
+
mainChildren
|
|
46
|
+
};
|
|
47
|
+
}
|
|
48
|
+
const Root = ({
|
|
49
|
+
children,
|
|
50
|
+
variant = "centered",
|
|
51
|
+
withGap = !1,
|
|
52
|
+
scrollMode,
|
|
53
|
+
noPadding,
|
|
54
|
+
className,
|
|
55
|
+
...props
|
|
56
|
+
}) => {
|
|
57
|
+
const contextValue = useMemo(() => ({
|
|
58
|
+
variant,
|
|
59
|
+
scrollMode,
|
|
60
|
+
noPadding
|
|
61
|
+
}), [variant, scrollMode, noPadding]), {
|
|
62
|
+
hasLeftSidebar,
|
|
63
|
+
hasRightSidebar,
|
|
64
|
+
breadcrumb,
|
|
65
|
+
overlay,
|
|
66
|
+
headerChildren,
|
|
67
|
+
mainChildren
|
|
68
|
+
} = analyzeChildren(children), mainAreaClasses = clsx("pagelayout-mainarea", {
|
|
69
|
+
"has-both-sidebars": hasLeftSidebar && hasRightSidebar,
|
|
70
|
+
"has-left-sidebar-only": hasLeftSidebar && !hasRightSidebar,
|
|
71
|
+
"has-right-sidebar-only": !hasLeftSidebar && hasRightSidebar,
|
|
72
|
+
"has-gap": withGap
|
|
73
|
+
}), isFullpage = variant === "fullpage";
|
|
74
|
+
return /* @__PURE__ */ jsx(PageLayoutContext.Provider, { value: contextValue, children: /* @__PURE__ */ jsxs("div", { className: clsx("pagelayout", `pagelayout-${variant}`, scrollMode && `pagelayout-scroll-${scrollMode}`, className), ...props, children: [
|
|
75
|
+
headerChildren,
|
|
76
|
+
headerChildren.length > 0 && /* @__PURE__ */ jsx("div", { className: "pagelayout-headerspacer" }),
|
|
77
|
+
!isFullpage && breadcrumb,
|
|
78
|
+
/* @__PURE__ */ jsxs("div", { className: mainAreaClasses, children: [
|
|
79
|
+
isFullpage && breadcrumb,
|
|
80
|
+
mainChildren
|
|
81
|
+
] }),
|
|
82
|
+
overlay
|
|
83
|
+
] }) });
|
|
84
|
+
}, PageLayout = Object.assign(Root, {
|
|
85
|
+
Header: PageLayoutHeader,
|
|
86
|
+
Breadcrumb: PageLayoutBreadcrumb,
|
|
87
|
+
SidebarLeft: PageLayoutSidebarLeft,
|
|
88
|
+
Content: PageLayoutContent,
|
|
89
|
+
SidebarRight: PageLayoutSidebarRight,
|
|
90
|
+
Overlay: PageLayoutOverlay
|
|
91
|
+
});
|
|
92
|
+
export {
|
|
93
|
+
PageLayout as default
|
|
94
|
+
};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export type PageLayoutVariant = 'centered' | 'fullpage';
|
|
2
|
+
export type PageLayoutScrollMode = 'columns' | 'page';
|
|
3
|
+
export interface NoPaddingConfig {
|
|
4
|
+
sidebarLeft?: boolean;
|
|
5
|
+
content?: boolean;
|
|
6
|
+
sidebarRight?: boolean;
|
|
7
|
+
}
|
|
8
|
+
export interface PageLayoutContextValue {
|
|
9
|
+
variant: PageLayoutVariant;
|
|
10
|
+
scrollMode?: PageLayoutScrollMode;
|
|
11
|
+
noPadding?: NoPaddingConfig;
|
|
12
|
+
}
|
|
13
|
+
export declare const PageLayoutContext: import('react').Context<PageLayoutContextValue>;
|
|
14
|
+
export declare const usePageLayout: () => PageLayoutContextValue;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { ComponentPropsWithoutRef, ReactNode } from 'react';
|
|
2
|
+
export interface PageLayoutBreadcrumbProps extends ComponentPropsWithoutRef<'div'> {
|
|
3
|
+
children: ReactNode;
|
|
4
|
+
}
|
|
5
|
+
declare const PageLayoutBreadcrumb: {
|
|
6
|
+
({ children, className, ...props }: PageLayoutBreadcrumbProps): import("react/jsx-runtime").JSX.Element;
|
|
7
|
+
displayName: string;
|
|
8
|
+
};
|
|
9
|
+
export default PageLayoutBreadcrumb;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
|
+
import clsx from "clsx";
|
|
3
|
+
const PageLayoutBreadcrumb = ({
|
|
4
|
+
children,
|
|
5
|
+
className,
|
|
6
|
+
...props
|
|
7
|
+
}) => /* @__PURE__ */ jsx("div", { className: clsx("pagelayout-breadcrumb", className), ...props, children });
|
|
8
|
+
export {
|
|
9
|
+
PageLayoutBreadcrumb as default
|
|
10
|
+
};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { ComponentPropsWithoutRef, ReactNode } from 'react';
|
|
2
|
+
export interface PageLayoutContentProps extends ComponentPropsWithoutRef<'main'> {
|
|
3
|
+
children: ReactNode;
|
|
4
|
+
}
|
|
5
|
+
declare const PageLayoutContent: {
|
|
6
|
+
({ children, className, ...props }: PageLayoutContentProps): import("react/jsx-runtime").JSX.Element;
|
|
7
|
+
displayName: string;
|
|
8
|
+
};
|
|
9
|
+
export default PageLayoutContent;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
|
+
import clsx from "clsx";
|
|
3
|
+
import { usePageLayout } from "../PageLayoutContext.js";
|
|
4
|
+
const PageLayoutContent = ({
|
|
5
|
+
children,
|
|
6
|
+
className,
|
|
7
|
+
...props
|
|
8
|
+
}) => {
|
|
9
|
+
const {
|
|
10
|
+
noPadding
|
|
11
|
+
} = usePageLayout();
|
|
12
|
+
return /* @__PURE__ */ jsx("main", { className: clsx("pagelayout-content", {
|
|
13
|
+
"pagelayout-content--no-padding": noPadding == null ? void 0 : noPadding.content
|
|
14
|
+
}, className), ...props, children });
|
|
15
|
+
};
|
|
16
|
+
export {
|
|
17
|
+
PageLayoutContent as default
|
|
18
|
+
};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { ComponentPropsWithoutRef, ReactNode } from 'react';
|
|
2
|
+
export interface PageLayoutHeaderProps extends ComponentPropsWithoutRef<'header'> {
|
|
3
|
+
children?: ReactNode;
|
|
4
|
+
}
|
|
5
|
+
declare const PageLayoutHeader: {
|
|
6
|
+
({ children, className, ...props }: PageLayoutHeaderProps): import("react/jsx-runtime").JSX.Element;
|
|
7
|
+
displayName: string;
|
|
8
|
+
};
|
|
9
|
+
export default PageLayoutHeader;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
|
+
import clsx from "clsx";
|
|
3
|
+
import Header from "../../../modules/homepage/components/Header/Header.js";
|
|
4
|
+
import { useEdificeTheme } from "../../../providers/EdificeThemeProvider/EdificeThemeProvider.hook.js";
|
|
5
|
+
const PageLayoutHeader = ({
|
|
6
|
+
children,
|
|
7
|
+
className,
|
|
8
|
+
...props
|
|
9
|
+
}) => {
|
|
10
|
+
const {
|
|
11
|
+
theme
|
|
12
|
+
} = useEdificeTheme();
|
|
13
|
+
return /* @__PURE__ */ jsx("header", { className: clsx("pagelayout-header", className), ...props, children: children ?? /* @__PURE__ */ jsx(Header, { src: theme == null ? void 0 : theme.basePath }) });
|
|
14
|
+
};
|
|
15
|
+
export {
|
|
16
|
+
PageLayoutHeader as default
|
|
17
|
+
};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { ComponentPropsWithoutRef, ReactNode } from 'react';
|
|
2
|
+
export interface PageLayoutOverlayProps extends ComponentPropsWithoutRef<'aside'> {
|
|
3
|
+
children: ReactNode;
|
|
4
|
+
/** Whether the overlay panel is open */
|
|
5
|
+
open: boolean;
|
|
6
|
+
/** Called when the overlay requests to be closed (e.g. clicking the backdrop) */
|
|
7
|
+
onClose?: () => void;
|
|
8
|
+
/** Show a backdrop behind the overlay. Defaults to false. */
|
|
9
|
+
backdrop?: boolean;
|
|
10
|
+
}
|
|
11
|
+
declare const PageLayoutOverlay: {
|
|
12
|
+
({ children, open, onClose, backdrop, className, ...props }: PageLayoutOverlayProps): import("react/jsx-runtime").JSX.Element;
|
|
13
|
+
displayName: string;
|
|
14
|
+
};
|
|
15
|
+
export default PageLayoutOverlay;
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { jsxs, Fragment, jsx } from "react/jsx-runtime";
|
|
2
|
+
import { useEffect } from "react";
|
|
3
|
+
import clsx from "clsx";
|
|
4
|
+
const PageLayoutOverlay = ({
|
|
5
|
+
children,
|
|
6
|
+
open,
|
|
7
|
+
onClose,
|
|
8
|
+
backdrop = !1,
|
|
9
|
+
className,
|
|
10
|
+
...props
|
|
11
|
+
}) => (useEffect(() => {
|
|
12
|
+
if (!open) return;
|
|
13
|
+
const handleKeyDown = (e) => {
|
|
14
|
+
e.key === "Escape" && (onClose == null || onClose());
|
|
15
|
+
};
|
|
16
|
+
return document.addEventListener("keydown", handleKeyDown), () => document.removeEventListener("keydown", handleKeyDown);
|
|
17
|
+
}, [open, onClose]), /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
18
|
+
open && backdrop && /* @__PURE__ */ jsx("div", { className: "pagelayout-overlaybackdrop", "aria-hidden": "true", onClick: onClose }),
|
|
19
|
+
/* @__PURE__ */ jsx(
|
|
20
|
+
"aside",
|
|
21
|
+
{
|
|
22
|
+
className: clsx("pagelayout-overlay", {
|
|
23
|
+
"pagelayout-overlay-open": open
|
|
24
|
+
}, className),
|
|
25
|
+
"aria-hidden": !open,
|
|
26
|
+
inert: open ? void 0 : "",
|
|
27
|
+
...props,
|
|
28
|
+
children
|
|
29
|
+
}
|
|
30
|
+
)
|
|
31
|
+
] }));
|
|
32
|
+
export {
|
|
33
|
+
PageLayoutOverlay as default
|
|
34
|
+
};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { ComponentPropsWithoutRef, ReactNode } from 'react';
|
|
2
|
+
export interface PageLayoutSidebarLeftProps extends ComponentPropsWithoutRef<'aside'> {
|
|
3
|
+
children: ReactNode;
|
|
4
|
+
}
|
|
5
|
+
declare const PageLayoutSidebarLeft: {
|
|
6
|
+
({ children, className, ...props }: PageLayoutSidebarLeftProps): import("react/jsx-runtime").JSX.Element;
|
|
7
|
+
displayName: string;
|
|
8
|
+
};
|
|
9
|
+
export default PageLayoutSidebarLeft;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
|
+
import clsx from "clsx";
|
|
3
|
+
import { usePageLayout } from "../PageLayoutContext.js";
|
|
4
|
+
const PageLayoutSidebarLeft = ({
|
|
5
|
+
children,
|
|
6
|
+
className,
|
|
7
|
+
...props
|
|
8
|
+
}) => {
|
|
9
|
+
const {
|
|
10
|
+
noPadding
|
|
11
|
+
} = usePageLayout();
|
|
12
|
+
return /* @__PURE__ */ jsx("aside", { className: clsx("pagelayout-sidebarleft", {
|
|
13
|
+
"pagelayout-sidebarleft--no-padding": noPadding == null ? void 0 : noPadding.sidebarLeft
|
|
14
|
+
}, className), ...props, children });
|
|
15
|
+
};
|
|
16
|
+
export {
|
|
17
|
+
PageLayoutSidebarLeft as default
|
|
18
|
+
};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { ComponentPropsWithoutRef, ReactNode } from 'react';
|
|
2
|
+
export interface PageLayoutSidebarRightProps extends ComponentPropsWithoutRef<'aside'> {
|
|
3
|
+
children: ReactNode;
|
|
4
|
+
}
|
|
5
|
+
declare const PageLayoutSidebarRight: {
|
|
6
|
+
({ children, className, ...props }: PageLayoutSidebarRightProps): import("react/jsx-runtime").JSX.Element;
|
|
7
|
+
displayName: string;
|
|
8
|
+
};
|
|
9
|
+
export default PageLayoutSidebarRight;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
|
+
import clsx from "clsx";
|
|
3
|
+
import { usePageLayout } from "../PageLayoutContext.js";
|
|
4
|
+
const PageLayoutSidebarRight = ({
|
|
5
|
+
children,
|
|
6
|
+
className,
|
|
7
|
+
...props
|
|
8
|
+
}) => {
|
|
9
|
+
const {
|
|
10
|
+
noPadding
|
|
11
|
+
} = usePageLayout();
|
|
12
|
+
return /* @__PURE__ */ jsx("aside", { className: clsx("pagelayout-sidebarright", {
|
|
13
|
+
"pagelayout-sidebarright--no-padding": noPadding == null ? void 0 : noPadding.sidebarRight
|
|
14
|
+
}, className), ...props, children: /* @__PURE__ */ jsx("div", { className: "pagelayout-sidebarright-inner", children }) });
|
|
15
|
+
};
|
|
16
|
+
export {
|
|
17
|
+
PageLayoutSidebarRight as default
|
|
18
|
+
};
|
|
@@ -7,8 +7,10 @@ export * from './Attachment';
|
|
|
7
7
|
export * from './Avatar';
|
|
8
8
|
export * from './AvatarGroup';
|
|
9
9
|
export * from './Badge';
|
|
10
|
+
export * from './BetaSwitch';
|
|
10
11
|
export * from './Breadcrumb';
|
|
11
12
|
export * from './Button';
|
|
13
|
+
export * from './ButtonBeta';
|
|
12
14
|
export * from './Card';
|
|
13
15
|
export * from './Checkbox';
|
|
14
16
|
export * from './ColorPicker';
|
|
@@ -30,9 +32,11 @@ export * from './List';
|
|
|
30
32
|
export * from './Loading';
|
|
31
33
|
export * from './LoadingScreen';
|
|
32
34
|
export * from './Logo';
|
|
35
|
+
export * from './LogoBeta';
|
|
33
36
|
export * from './MediaViewer';
|
|
34
37
|
export * from './Menu';
|
|
35
38
|
export * from './Modal';
|
|
39
|
+
export * from './PageLayout';
|
|
36
40
|
export * from './Pagination';
|
|
37
41
|
export * from './Popover';
|
|
38
42
|
export * from './PreventPropagation';
|
package/dist/homepage.js
ADDED
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { default as default2 } from "./modules/homepage/components/Header/Header.js";
|
|
2
|
+
import { default as default3 } from "./modules/homepage/components/HomeCard/HomeCard.js";
|
|
3
|
+
import { default as default4 } from "./modules/homepage/components/LastInfos/LastInfos.js";
|
|
4
|
+
import { default as default5 } from "./modules/homepage/components/MessageFlashList/MessageFlashList.js";
|
|
5
|
+
import { default as default6 } from "./modules/homepage/components/Notifications/NotificationList.js";
|
|
6
|
+
import { default as default7 } from "./modules/homepage/components/SchoolSpace/SchoolSpace.js";
|
|
7
|
+
import { LastInfosContainer } from "./modules/homepage/components/LastInfos/LastInfosContainer.js";
|
|
8
|
+
import { LastInfosList } from "./modules/homepage/components/LastInfos/LastInfosList.js";
|
|
9
|
+
import { MessageFlashListContainer } from "./modules/homepage/components/MessageFlashList/MessageFlashListContainer.js";
|
|
10
|
+
import { NotificationListContainer } from "./modules/homepage/components/Notifications/NotificationListContainer.js";
|
|
11
|
+
import { SchoolSpaceContainer } from "./modules/homepage/components/SchoolSpace/SchoolSpaceContainer.js";
|
|
12
|
+
export {
|
|
13
|
+
default2 as Header,
|
|
14
|
+
default3 as HomeCard,
|
|
15
|
+
default4 as LastInfos,
|
|
16
|
+
LastInfosContainer,
|
|
17
|
+
LastInfosList,
|
|
18
|
+
default5 as MessageFlashList,
|
|
19
|
+
MessageFlashListContainer,
|
|
20
|
+
default6 as NotificationList,
|
|
21
|
+
NotificationListContainer,
|
|
22
|
+
default7 as SchoolSpace,
|
|
23
|
+
SchoolSpaceContainer
|
|
24
|
+
};
|
package/dist/hooks/index.d.ts
CHANGED
|
@@ -16,8 +16,8 @@ export * from './useHover';
|
|
|
16
16
|
export * from './useHttpErrorToast';
|
|
17
17
|
export * from './useImage';
|
|
18
18
|
export * from './useInfiniteScroll';
|
|
19
|
-
export * from './useIsAdml';
|
|
20
19
|
export * from './useIsAdmc';
|
|
20
|
+
export * from './useIsAdml';
|
|
21
21
|
export * from './useIsAdmlcOrAdmc';
|
|
22
22
|
export * from './useKeyPress';
|
|
23
23
|
export * from './useLibraryUrl';
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
const PLACEHOLDER_ICON = "placeholder";
|
|
1
2
|
function useEdificeIcons() {
|
|
2
3
|
const iconOfWidget = {
|
|
3
4
|
"last-infos-widget": "ic-widget-actualites",
|
|
@@ -21,7 +22,7 @@ function useEdificeIcons() {
|
|
|
21
22
|
};
|
|
22
23
|
function getIconCode(app) {
|
|
23
24
|
let appCode = "";
|
|
24
|
-
switch (typeof app == "string" ? appCode = app : appCode = (app == null ? void 0 : app.icon) !== void 0 ? app == null ? void 0 : app.icon.trim().toLowerCase() :
|
|
25
|
+
switch (typeof app == "string" ? appCode = app : appCode = (app == null ? void 0 : app.icon) !== void 0 ? app == null ? void 0 : app.icon.trim().toLowerCase() : PLACEHOLDER_ICON, appCode && appCode.length > 0 ? appCode.endsWith("-large") && (appCode = appCode.replace("-large", "")) : typeof app == "object" && (appCode = (app == null ? void 0 : app.displayName) !== void 0 ? app == null ? void 0 : app.displayName.trim().toLowerCase() : ""), appCode) {
|
|
25
26
|
case "admin.title":
|
|
26
27
|
appCode = "admin";
|
|
27
28
|
break;
|
|
@@ -67,20 +68,20 @@ function useEdificeIcons() {
|
|
|
67
68
|
return icon && (icon.startsWith("/") || icon.startsWith("http://") || icon.startsWith("https://"));
|
|
68
69
|
}
|
|
69
70
|
function getIconClass(app) {
|
|
70
|
-
const appCode = getIconCode(app);
|
|
71
|
-
return
|
|
71
|
+
const appCode = getIconCode(app) || PLACEHOLDER_ICON;
|
|
72
|
+
return `color-app-${appCode} color-app app-${appCode}`;
|
|
72
73
|
}
|
|
73
74
|
function getBackgroundIconClass(app) {
|
|
74
|
-
const appCode = getIconCode(app);
|
|
75
|
-
return
|
|
75
|
+
const appCode = getIconCode(app) || PLACEHOLDER_ICON;
|
|
76
|
+
return `bg-app-${appCode} bg-app app-${appCode}`;
|
|
76
77
|
}
|
|
77
78
|
function getBackgroundLightIconClass(app) {
|
|
78
|
-
const appCode = getIconCode(app);
|
|
79
|
-
return
|
|
79
|
+
const appCode = getIconCode(app) || PLACEHOLDER_ICON;
|
|
80
|
+
return `bg-light-${appCode} bg-app-light app-${appCode}`;
|
|
80
81
|
}
|
|
81
82
|
function getBorderIconClass(app) {
|
|
82
|
-
const appCode = getIconCode(app);
|
|
83
|
-
return
|
|
83
|
+
const appCode = getIconCode(app) || PLACEHOLDER_ICON;
|
|
84
|
+
return `border-app-${appCode} border-app app-${appCode}`;
|
|
84
85
|
}
|
|
85
86
|
function getWidgetIconClass(widget) {
|
|
86
87
|
return iconOfWidget[widget.platformConf.name];
|