@edifice.io/react 2.3.2 → 2.4.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/dist/components/Avatar/Avatar.d.ts +5 -0
- package/dist/components/Avatar/Avatar.js +8 -2
- package/dist/components/AvatarGroup/AvatarGroup.d.ts +10 -0
- package/dist/components/AvatarGroup/AvatarGroup.js +5 -5
- package/dist/components/Dropdown/Dropdown.d.ts +10 -4
- package/dist/components/Dropdown/Dropdown.js +24 -8
- package/dist/components/Flex/Flex.d.ts +2 -1
- package/dist/components/Flex/Flex.js +8 -6
- package/dist/components/Layout/Layout.d.ts +5 -1
- package/dist/components/Layout/Layout.js +5 -2
- package/dist/components/Layout/components/Header.js +3 -4
- package/dist/components/Layout/components/WidgetApps.js +1 -1
- package/dist/components/Layout/hooks/useHeader.js +4 -11
- package/dist/components/RadioCard/RadioCard.d.ts +37 -0
- package/dist/components/RadioCard/index.d.ts +2 -0
- package/dist/components/StackedGroup/StackedGroup.d.ts +5 -0
- package/dist/components/StackedGroup/StackedGroup.js +10 -8
- package/dist/components/Stepper/Stepper.d.ts +18 -0
- package/dist/components/Stepper/Stepper.js +15 -0
- package/dist/components/Stepper/index.d.ts +1 -0
- package/dist/components/Tabs/components/Tabs.d.ts +27 -3
- package/dist/components/Tabs/components/Tabs.js +9 -3
- package/dist/components/Tabs/components/TabsList.d.ts +15 -1
- package/dist/components/Tabs/components/TabsList.js +15 -5
- package/dist/components/Tabs/components/TabsPanel.d.ts +9 -1
- package/dist/components/Tabs/components/TabsPanel.js +8 -3
- package/dist/components/index.d.ts +1 -0
- package/dist/editor.js +18 -16
- package/dist/hooks/index.d.ts +2 -0
- package/dist/hooks/useDropdown/useDropdown.d.ts +2 -0
- package/dist/hooks/useDropdown/useDropdown.js +2 -0
- package/dist/hooks/useIsAdmc/index.d.ts +1 -0
- package/dist/hooks/useIsAdmc/useIsAdmc.d.ts +3 -0
- package/dist/hooks/useIsAdmc/useIsAdmc.js +22 -0
- package/dist/hooks/useIsAdmlcOrAdmc/index.d.ts +1 -0
- package/dist/hooks/useIsAdmlcOrAdmc/useIsAdmlcOrAdmc.d.ts +3 -0
- package/dist/hooks/useIsAdmlcOrAdmc/useIsAdmlcOrAdmc.js +16 -0
- package/dist/icons-nav.js +28 -26
- package/dist/icons.js +190 -184
- package/dist/index.js +128 -120
- package/dist/modules/editor/components/MathsModal/MathsModal.js +1 -1
- package/dist/modules/editor/components/NodeView/IframeNodeView.d.ts +2 -0
- package/dist/modules/editor/components/NodeView/IframeNodeView.js +10 -0
- package/dist/modules/editor/components/NodeView/index.d.ts +1 -0
- package/dist/modules/editor/components/Renderer/MediaRenderer.js +20 -6
- package/dist/modules/editor/components/Toolbar/TableToolbar.AddMenu.js +1 -1
- package/dist/modules/editor/components/Toolbar/TableToolbar.DelMenu.js +1 -1
- package/dist/modules/editor/hooks/useResizeMedia.d.ts +4 -1
- package/dist/modules/editor/hooks/useResizeMedia.js +33 -21
- package/dist/modules/editor/hooks/useTipTapEditor.js +4 -4
- package/dist/modules/icons/components/IconMegaphone.d.ts +7 -0
- package/dist/modules/icons/components/IconMegaphone.js +12 -0
- package/dist/modules/icons/components/IconNotes.d.ts +7 -0
- package/dist/modules/icons/components/IconNotes.js +13 -0
- package/dist/modules/icons/components/IconUnion.d.ts +7 -0
- package/dist/modules/icons/components/IconUnion.js +15 -0
- package/dist/modules/icons/components/apps/IconCommunities.js +2 -2
- package/dist/modules/icons/components/index.d.ts +3 -0
- package/dist/modules/icons/components/nav/IconCommunities.d.ts +7 -0
- package/dist/modules/icons/components/nav/IconCommunities.js +12 -0
- package/dist/modules/icons/components/nav/index.d.ts +1 -0
- package/dist/modules/modals/OnboardingModal/OnboardingModal.js +1 -1
- package/dist/modules/modals/ResourceModal/ResourceModal.d.ts +57 -2
- package/dist/modules/modals/ResourceModal/ResourceModal.js +20 -16
- package/dist/modules/modals/ShareModal/ShareBookmarkLine.d.ts +1 -1
- package/dist/modules/modals/ShareModal/ShareBookmarkLine.js +12 -6
- package/dist/modules/modals/ShareModal/ShareModal.js +2 -0
- package/dist/modules/modals/ShareModal/hooks/useShareRightDisabled.d.ts +8 -0
- package/dist/modules/modals/ShareModal/hooks/useShareRightDisabled.js +11 -0
- package/dist/modules/modals/ShareModal/hooks/useShareRightVisible.d.ts +11 -0
- package/dist/modules/modals/ShareModal/hooks/useShareRightVisible.js +11 -0
- package/dist/modules/multimedia/FileCard/FileCard.d.ts +13 -2
- package/dist/modules/multimedia/FileCard/FileCard.js +15 -5
- package/dist/modules/multimedia/FileCard/FileIcon.d.ts +5 -1
- package/dist/modules/multimedia/FileCard/FileIcon.js +2 -2
- package/dist/modules/multimedia/Linker/InternalLinker/InternalLinker.d.ts +3 -1
- package/dist/modules/multimedia/Linker/InternalLinker/InternalLinker.js +7 -6
- package/dist/modules/multimedia/MediaLibrary/MediaLibrary.d.ts +3 -1
- package/dist/modules/multimedia/MediaLibrary/MediaLibrary.js +7 -2
- package/dist/modules/multimedia/index.d.ts +1 -0
- package/dist/multimedia.js +12 -10
- package/package.json +7 -9
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
1
2
|
import { Color } from 'src/types/color';
|
|
2
3
|
export type AvatarVariants = 'square' | 'rounded' | 'circle';
|
|
3
4
|
export type AvatarSizes = 'xs' | 'sm' | 'md' | 'lg' | 'xl';
|
|
@@ -47,6 +48,10 @@ export interface AvatarProps extends React.ComponentPropsWithRef<'img'> {
|
|
|
47
48
|
* Outer border offset in pixels
|
|
48
49
|
*/
|
|
49
50
|
outerBorderOffset?: number;
|
|
51
|
+
/**
|
|
52
|
+
* Cover content for the avatar
|
|
53
|
+
*/
|
|
54
|
+
cover?: ReactNode;
|
|
50
55
|
}
|
|
51
56
|
declare const Avatar: import('react').ForwardRefExoticComponent<Omit<AvatarProps, "ref"> & import('react').RefAttributes<HTMLDivElement>>;
|
|
52
57
|
export default Avatar;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { jsx } from "react/jsx-runtime";
|
|
1
|
+
import { jsxs, jsx } from "react/jsx-runtime";
|
|
2
2
|
import { forwardRef } from "react";
|
|
3
3
|
import clsx from "clsx";
|
|
4
4
|
import noAvatar from "@edifice.io/bootstrap/dist/images/avatar/no-avatar.svg";
|
|
@@ -15,6 +15,7 @@ const Avatar = /* @__PURE__ */ forwardRef(({
|
|
|
15
15
|
outerBorderColor,
|
|
16
16
|
outerBorderWidth,
|
|
17
17
|
outerBorderOffset,
|
|
18
|
+
cover,
|
|
18
19
|
...restProps
|
|
19
20
|
}, ref) => {
|
|
20
21
|
const placeholder = imgPlaceholder || noAvatar, classes = clsx("avatar", {
|
|
@@ -30,6 +31,8 @@ const Avatar = /* @__PURE__ */ forwardRef(({
|
|
|
30
31
|
rounded: variant === "rounded",
|
|
31
32
|
"rounded-circle": variant === "circle"
|
|
32
33
|
}
|
|
34
|
+
}, {
|
|
35
|
+
"avatar-with-cover": cover
|
|
33
36
|
}, className), style = {
|
|
34
37
|
...outerBorderColor && {
|
|
35
38
|
outline: `${outerBorderWidth}px solid var(--edifice-${outerBorderColor})`,
|
|
@@ -39,7 +42,10 @@ const Avatar = /* @__PURE__ */ forwardRef(({
|
|
|
39
42
|
border: `${innerBorderWidth}px solid var(--edifice-${innerBorderColor})`
|
|
40
43
|
}
|
|
41
44
|
};
|
|
42
|
-
return /* @__PURE__ */
|
|
45
|
+
return /* @__PURE__ */ jsxs("div", { ref, className: classes, style, children: [
|
|
46
|
+
/* @__PURE__ */ jsx(Image, { src: src || placeholder, alt, imgPlaceholder: placeholder, ...restProps }),
|
|
47
|
+
cover && /* @__PURE__ */ jsx("div", { className: "avatar-cover", children: cover })
|
|
48
|
+
] });
|
|
43
49
|
});
|
|
44
50
|
export {
|
|
45
51
|
Avatar as default
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
1
2
|
import { AvatarProps } from '../Avatar';
|
|
2
3
|
export interface AvatarGroupProps extends Omit<AvatarProps, 'src'> {
|
|
3
4
|
/**
|
|
@@ -19,6 +20,15 @@ export interface AvatarGroupProps extends Omit<AvatarProps, 'src'> {
|
|
|
19
20
|
* @default 'leftFirst'
|
|
20
21
|
*/
|
|
21
22
|
stackingOrder?: 'leftFirst' | 'rightFirst';
|
|
23
|
+
/**
|
|
24
|
+
* Whether to wrap avatars to the next line
|
|
25
|
+
* @default false
|
|
26
|
+
*/
|
|
27
|
+
wrap?: boolean;
|
|
28
|
+
/**
|
|
29
|
+
* Cover content for the last avatar
|
|
30
|
+
*/
|
|
31
|
+
lastItemCover?: ReactNode;
|
|
22
32
|
}
|
|
23
33
|
declare const AvatarGroup: import('react').ForwardRefExoticComponent<Omit<AvatarGroupProps, "ref"> & import('react').RefAttributes<HTMLDivElement>>;
|
|
24
34
|
export default AvatarGroup;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsx } from "react/jsx-runtime";
|
|
2
|
-
import { forwardRef } from "react";
|
|
3
2
|
import clsx from "clsx";
|
|
3
|
+
import { forwardRef } from "react";
|
|
4
4
|
import StackedGroup from "../StackedGroup/StackedGroup.js";
|
|
5
5
|
import Avatar from "../Avatar/Avatar.js";
|
|
6
6
|
const AvatarGroup = /* @__PURE__ */ forwardRef(({
|
|
@@ -12,12 +12,12 @@ const AvatarGroup = /* @__PURE__ */ forwardRef(({
|
|
|
12
12
|
variant = "circle",
|
|
13
13
|
alt,
|
|
14
14
|
stackingOrder = "leftFirst",
|
|
15
|
+
wrap = !1,
|
|
16
|
+
lastItemCover,
|
|
15
17
|
...restProps
|
|
16
18
|
}, ref) => {
|
|
17
|
-
const visibleAvatars = src.slice(0, maxAvatars), classes = clsx("avatar-group", className);
|
|
18
|
-
return /* @__PURE__ */ jsx("div", { ref, className: classes,
|
|
19
|
-
display: "flex"
|
|
20
|
-
}, children: /* @__PURE__ */ jsx(StackedGroup, { overlap, stackingOrder, children: visibleAvatars.map((avatarSrc, index) => /* @__PURE__ */ jsx(Avatar, { src: avatarSrc, size, variant, alt: `${alt} ${index + 1}`, ...restProps })) }) });
|
|
19
|
+
const visibleAvatars = src.slice(0, maxAvatars), classes = clsx("avatar-group d-flex", className);
|
|
20
|
+
return /* @__PURE__ */ jsx("div", { ref, className: classes, children: /* @__PURE__ */ jsx(StackedGroup, { overlap, stackingOrder, wrap, children: visibleAvatars.map((avatarSrc, index) => /* @__PURE__ */ jsx(Avatar, { src: avatarSrc, size, variant, alt: `${alt} ${index + 1}`, cover: index === maxAvatars - 1 ? lastItemCover : void 0, ...restProps }, index)) }) });
|
|
21
21
|
});
|
|
22
22
|
export {
|
|
23
23
|
AvatarGroup as default
|
|
@@ -1,6 +1,15 @@
|
|
|
1
1
|
import { ReactNode } from 'react';
|
|
2
2
|
import { Placement } from '@floating-ui/react';
|
|
3
3
|
import { default as DropdownCheckboxItem } from './DropdownCheckboxItem';
|
|
4
|
+
export interface DropdownApi {
|
|
5
|
+
visible: boolean;
|
|
6
|
+
isFocused: string | null;
|
|
7
|
+
menuRef: React.MutableRefObject<HTMLUListElement | null>;
|
|
8
|
+
triggerRef: React.MutableRefObject<HTMLButtonElement | null>;
|
|
9
|
+
setVisible: (visible: boolean) => void;
|
|
10
|
+
openDropdown: () => void;
|
|
11
|
+
closeDropdown: () => void;
|
|
12
|
+
}
|
|
4
13
|
export interface DropdownProps {
|
|
5
14
|
/** Children Props */
|
|
6
15
|
children: ReactNode | ((...props: any) => ReactNode);
|
|
@@ -68,10 +77,7 @@ export type DropdownMenuOptions = {
|
|
|
68
77
|
*/
|
|
69
78
|
type: 'divider';
|
|
70
79
|
};
|
|
71
|
-
declare const Dropdown: {
|
|
72
|
-
({ children, block, overflow, noWrap, placement, extraTriggerKeyDownHandler, onToggle, isTriggerHovered, focusOnVisible, openOnSpace, focusOnMouseEnter, }: DropdownProps): import("react/jsx-runtime").JSX.Element;
|
|
73
|
-
displayName: string;
|
|
74
|
-
} & {
|
|
80
|
+
declare const Dropdown: import('react').ForwardRefExoticComponent<DropdownProps & import('react').RefAttributes<DropdownApi>> & {
|
|
75
81
|
Trigger: import('react').ForwardRefExoticComponent<Omit<import('./DropdownTrigger').DropdownTriggerProps, "ref"> & import('react').RefAttributes<HTMLButtonElement>>;
|
|
76
82
|
Menu: import('react').ForwardRefExoticComponent<Omit<import('./DropdownMenu').DropdownMenuProps, "ref"> & import('react').RefAttributes<HTMLDivElement>>;
|
|
77
83
|
Item: {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsx } from "react/jsx-runtime";
|
|
2
|
-
import { useMemo, useEffect } from "react";
|
|
2
|
+
import { forwardRef, useImperativeHandle, useMemo, useEffect } from "react";
|
|
3
3
|
import clsx from "clsx";
|
|
4
4
|
import useDropdown from "../../hooks/useDropdown/useDropdown.js";
|
|
5
5
|
import DropdownCheckboxItem from "./DropdownCheckboxItem.js";
|
|
@@ -11,7 +11,7 @@ import DropdownRadioItem from "./DropdownRadioItem.js";
|
|
|
11
11
|
import DropdownSeparator from "./DropdownSeparator.js";
|
|
12
12
|
import DropdownTrigger from "./DropdownTrigger.js";
|
|
13
13
|
import useClickOutside from "../../hooks/useClickOutside/useClickOutside.js";
|
|
14
|
-
const Root = ({
|
|
14
|
+
const Root = /* @__PURE__ */ forwardRef(({
|
|
15
15
|
children,
|
|
16
16
|
block,
|
|
17
17
|
overflow = !0,
|
|
@@ -23,7 +23,7 @@ const Root = ({
|
|
|
23
23
|
focusOnVisible = !0,
|
|
24
24
|
openOnSpace = !0,
|
|
25
25
|
focusOnMouseEnter = !0
|
|
26
|
-
}) => {
|
|
26
|
+
}, refDropdown) => {
|
|
27
27
|
const {
|
|
28
28
|
visible,
|
|
29
29
|
isFocused,
|
|
@@ -31,8 +31,22 @@ const Root = ({
|
|
|
31
31
|
menuProps,
|
|
32
32
|
itemProps,
|
|
33
33
|
itemRefs,
|
|
34
|
-
setVisible
|
|
35
|
-
|
|
34
|
+
setVisible,
|
|
35
|
+
menuRef,
|
|
36
|
+
triggerRef,
|
|
37
|
+
closeDropdown,
|
|
38
|
+
openDropdown
|
|
39
|
+
} = useDropdown(placement, extraTriggerKeyDownHandler, isTriggerHovered, focusOnVisible, openOnSpace, focusOnMouseEnter);
|
|
40
|
+
useImperativeHandle(refDropdown, () => ({
|
|
41
|
+
visible,
|
|
42
|
+
setVisible,
|
|
43
|
+
isFocused,
|
|
44
|
+
menuRef,
|
|
45
|
+
triggerRef,
|
|
46
|
+
closeDropdown,
|
|
47
|
+
openDropdown
|
|
48
|
+
}));
|
|
49
|
+
const ref = useClickOutside(() => {
|
|
36
50
|
setVisible(!1);
|
|
37
51
|
}), value = useMemo(() => ({
|
|
38
52
|
visible,
|
|
@@ -42,8 +56,10 @@ const Root = ({
|
|
|
42
56
|
itemProps,
|
|
43
57
|
itemRefs,
|
|
44
58
|
block,
|
|
45
|
-
setVisible
|
|
46
|
-
|
|
59
|
+
setVisible,
|
|
60
|
+
openDropdown,
|
|
61
|
+
closeDropdown
|
|
62
|
+
}), [visible, isFocused, triggerProps, menuProps, itemProps, itemRefs, block, setVisible, openDropdown, closeDropdown]), dropdown = clsx("dropdown", {
|
|
47
63
|
"w-100": block,
|
|
48
64
|
"dropdown-nowrap": noWrap,
|
|
49
65
|
overflow
|
|
@@ -51,7 +67,7 @@ const Root = ({
|
|
|
51
67
|
return useEffect(() => {
|
|
52
68
|
onToggle == null || onToggle(visible);
|
|
53
69
|
}, [visible]), /* @__PURE__ */ jsx(DropdownContext.Provider, { value, children: /* @__PURE__ */ jsx("div", { ref, className: dropdown, children: typeof children == "function" ? children(triggerProps, itemRefs, setVisible) : children }) });
|
|
54
|
-
}, Dropdown = /* @__PURE__ */ Object.assign(Root, {
|
|
70
|
+
}), Dropdown = /* @__PURE__ */ Object.assign(Root, {
|
|
55
71
|
Trigger: DropdownTrigger,
|
|
56
72
|
Menu: DropdownMenu,
|
|
57
73
|
Item: DropdownItem,
|
|
@@ -5,8 +5,9 @@ interface FlexProps extends React.HTMLAttributes<HTMLElement> {
|
|
|
5
5
|
align?: 'start' | 'end' | 'center' | 'baseline' | 'stretch';
|
|
6
6
|
justify?: 'start' | 'end' | 'center' | 'between' | 'around' | 'evenly';
|
|
7
7
|
gap?: string;
|
|
8
|
+
fill?: boolean;
|
|
8
9
|
wrap?: 'wrap' | 'nowrap' | 'reverse';
|
|
9
10
|
className?: string;
|
|
10
11
|
}
|
|
11
|
-
declare const Flex: React.
|
|
12
|
+
declare const Flex: React.ForwardRefExoticComponent<FlexProps & React.RefAttributes<HTMLElement>>;
|
|
12
13
|
export default Flex;
|
|
@@ -1,19 +1,21 @@
|
|
|
1
1
|
import { jsx } from "react/jsx-runtime";
|
|
2
2
|
import clsx from "clsx";
|
|
3
|
-
|
|
3
|
+
import { forwardRef } from "react";
|
|
4
|
+
const Flex = /* @__PURE__ */ forwardRef(({
|
|
4
5
|
as: Component = "div",
|
|
5
6
|
direction,
|
|
6
7
|
align,
|
|
7
8
|
justify,
|
|
8
9
|
gap,
|
|
9
|
-
|
|
10
|
+
fill,
|
|
11
|
+
wrap,
|
|
10
12
|
className,
|
|
11
13
|
children,
|
|
12
14
|
...restProps
|
|
13
|
-
}) => {
|
|
14
|
-
const classes = clsx("d-flex", direction &&
|
|
15
|
-
return /* @__PURE__ */ jsx(Component, { className: classes, ...restProps, children });
|
|
16
|
-
};
|
|
15
|
+
}, ref) => {
|
|
16
|
+
const classes = clsx("d-flex", direction && `flex-${direction}`, fill && "flex-fill", align && `align-items-${align}`, justify && `justify-content-${justify}`, gap && `gap-${gap}`, wrap && `flex-${wrap}`, className);
|
|
17
|
+
return /* @__PURE__ */ jsx(Component, { ref, className: classes, ...restProps, children });
|
|
18
|
+
});
|
|
17
19
|
export {
|
|
18
20
|
Flex as default
|
|
19
21
|
};
|
|
@@ -4,9 +4,13 @@ export interface LayoutProps extends ComponentPropsWithoutRef<any> {
|
|
|
4
4
|
children: ReactNode;
|
|
5
5
|
/** Full screen mode without header component */
|
|
6
6
|
headless?: boolean;
|
|
7
|
+
/** Control white background - defaults to true */
|
|
8
|
+
whiteBg?: boolean;
|
|
9
|
+
/** Additional class name */
|
|
10
|
+
className?: string;
|
|
7
11
|
}
|
|
8
12
|
export declare const Layout: {
|
|
9
|
-
({ children, headless, ...restProps }: LayoutProps): import("react/jsx-runtime").JSX.Element;
|
|
13
|
+
({ children, headless, whiteBg, className, ...restProps }: LayoutProps): import("react/jsx-runtime").JSX.Element;
|
|
10
14
|
displayName: string;
|
|
11
15
|
};
|
|
12
16
|
export default Layout;
|
|
@@ -12,6 +12,8 @@ import Button from "../Button/Button.js";
|
|
|
12
12
|
const Layout = ({
|
|
13
13
|
children,
|
|
14
14
|
headless = !1,
|
|
15
|
+
whiteBg = !0,
|
|
16
|
+
className,
|
|
15
17
|
...restProps
|
|
16
18
|
}) => {
|
|
17
19
|
const {
|
|
@@ -24,11 +26,12 @@ const Layout = ({
|
|
|
24
26
|
handleCloseCookiesConsent
|
|
25
27
|
} = useCookiesConsent();
|
|
26
28
|
useZendeskGuide(), useCantoo();
|
|
27
|
-
const classes = clsx("d-flex flex-column
|
|
29
|
+
const classes = clsx("d-flex flex-column", {
|
|
30
|
+
"bg-white": whiteBg,
|
|
28
31
|
"container-fluid": !headless,
|
|
29
32
|
"rounded-4 border": (theme == null ? void 0 : theme.is1d) && !headless,
|
|
30
33
|
"mt-24": (theme == null ? void 0 : theme.is1d) && !headless
|
|
31
|
-
}), renderHeader = headless ? null : /* @__PURE__ */ jsx(Header, { is1d: theme == null ? void 0 : theme.is1d, src: theme == null ? void 0 : theme.basePath }), renderCookies = showCookiesConsent && /* @__PURE__ */ jsx(Alert, { type: "info", className: "m-12 rgpd", isConfirm: !0, position: "bottom-right", button: /* @__PURE__ */ jsx(Button, { color: "tertiary", variant: "ghost", onClick: handleConsultCookies, children: t("rgpd.cookies.banner.button.consult") }), onClose: handleCloseCookiesConsent, children: t("rgpd.cookies.banner.text1") }), renderToaster = /* @__PURE__ */ jsx(Toaster, { containerClassName: "toaster-container", toastOptions: {
|
|
34
|
+
}, className), renderHeader = headless ? null : /* @__PURE__ */ jsx(Header, { is1d: theme == null ? void 0 : theme.is1d, src: theme == null ? void 0 : theme.basePath }), renderCookies = showCookiesConsent && /* @__PURE__ */ jsx(Alert, { type: "info", className: "m-12 rgpd", isConfirm: !0, position: "bottom-right", button: /* @__PURE__ */ jsx(Button, { color: "tertiary", variant: "ghost", onClick: handleConsultCookies, children: t("rgpd.cookies.banner.button.consult") }), onClose: handleCloseCookiesConsent, children: t("rgpd.cookies.banner.text1") }), renderToaster = /* @__PURE__ */ jsx(Toaster, { containerClassName: "toaster-container", toastOptions: {
|
|
32
35
|
position: "top-right"
|
|
33
36
|
} });
|
|
34
37
|
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
@@ -70,8 +70,7 @@ const Header = ({
|
|
|
70
70
|
conversationWorflow,
|
|
71
71
|
searchWorkflow,
|
|
72
72
|
isCollapsed,
|
|
73
|
-
toggleCollapsedNav
|
|
74
|
-
handleLogout
|
|
73
|
+
toggleCollapsedNav
|
|
75
74
|
} = useHeader({
|
|
76
75
|
user,
|
|
77
76
|
avatar
|
|
@@ -104,7 +103,7 @@ const Header = ({
|
|
|
104
103
|
] }),
|
|
105
104
|
/* @__PURE__ */ jsx(Help, { isHelpOpen, setIsHelpOpen, parsedContent, parsedHeadline, error })
|
|
106
105
|
] }) : null,
|
|
107
|
-
/* @__PURE__ */ jsx(NavItem, { children: /* @__PURE__ */ jsxs("
|
|
106
|
+
/* @__PURE__ */ jsx(NavItem, { children: /* @__PURE__ */ jsxs("a", { href: "/auth/logout?callback=" + ((theme == null ? void 0 : theme.logoutCallback) ?? ""), className: "nav-link", children: [
|
|
108
107
|
/* @__PURE__ */ jsx(SvgIconDisconnect, { className: "icon logout" }),
|
|
109
108
|
/* @__PURE__ */ jsx(VisuallyHidden, { children: t("navbar.disconnect") })
|
|
110
109
|
] }) }),
|
|
@@ -176,7 +175,7 @@ const Header = ({
|
|
|
176
175
|
/* @__PURE__ */ jsx("span", { className: "nav-text", children: t("navbar.myaccount") })
|
|
177
176
|
] }) }),
|
|
178
177
|
/* @__PURE__ */ jsx(NavItem, { children: /* @__PURE__ */ jsx("hr", { className: "dropdown-divider" }) }),
|
|
179
|
-
/* @__PURE__ */ jsx(NavItem, { children: /* @__PURE__ */ jsxs("a", { href: "/auth/logout?callback=" + ((theme == null ? void 0 : theme.logoutCallback) ?? "
|
|
178
|
+
/* @__PURE__ */ jsx(NavItem, { children: /* @__PURE__ */ jsxs("a", { href: "/auth/logout?callback=" + ((theme == null ? void 0 : theme.logoutCallback) ?? ""), className: "nav-link dropdown-item", children: [
|
|
180
179
|
/* @__PURE__ */ jsx(SvgIconDisconnect, { className: "icon logout" }),
|
|
181
180
|
/* @__PURE__ */ jsx("span", { id: "logout-label", className: "nav-text", children: t("navbar.disconnect") })
|
|
182
181
|
] }) })
|
|
@@ -14,7 +14,7 @@ const WidgetAppsFooter = () => {
|
|
|
14
14
|
} = useTranslation();
|
|
15
15
|
return /* @__PURE__ */ jsxs("div", { className: "widget-body d-flex flex-wrap", children: [
|
|
16
16
|
!bookmarkedApps.length && /* @__PURE__ */ jsx("div", { className: "text-dark", children: t("navbar.myapps.more") }),
|
|
17
|
-
bookmarkedApps.slice(0, 6).map((app, index) => /* @__PURE__ */ jsx("a", { href: app.address, className: "bookmarked-app", children: /* @__PURE__ */ jsx(AppIcon, { app, size: "32" }) }, index))
|
|
17
|
+
bookmarkedApps.slice(0, 6).map((app, index) => /* @__PURE__ */ jsx("a", { href: app.address, className: "bookmarked-app", target: app.isExternal || app.category === "connector" ? "_blank" : void 0, children: /* @__PURE__ */ jsx(AppIcon, { app, size: "32" }) }, index))
|
|
18
18
|
] });
|
|
19
19
|
};
|
|
20
20
|
export {
|
|
@@ -1,9 +1,7 @@
|
|
|
1
1
|
import { useState, useId, useCallback, useMemo } from "react";
|
|
2
|
-
import { odeServices } from "@edifice.io/client";
|
|
3
2
|
import { useHover } from "@uidotdev/usehooks";
|
|
4
3
|
import { useTranslation } from "react-i18next";
|
|
5
4
|
import { useEdificeClient } from "../../../providers/EdificeClientProvider/EdificeClientProvider.hook.js";
|
|
6
|
-
import { useEdificeTheme } from "../../../providers/EdificeThemeProvider/EdificeThemeProvider.hook.js";
|
|
7
5
|
import useBookmark from "../../../hooks/useBookmark/useBookmark.js";
|
|
8
6
|
import useHasWorkflow from "../../../hooks/useHasWorkflow/useHasWorkflow.js";
|
|
9
7
|
function useHeader({
|
|
@@ -14,15 +12,11 @@ function useHeader({
|
|
|
14
12
|
appCode
|
|
15
13
|
} = useEdificeClient(), {
|
|
16
14
|
t
|
|
17
|
-
} = useTranslation(), {
|
|
18
|
-
theme
|
|
19
|
-
} = useEdificeTheme(), title = t(appCode), [isCollapsed, setIsCollapsed] = useState(!0), [appsRef, isAppsHovered] = useHover(), popoverAppsId = useId(), popoverSearchId = useId(), userAvatar = avatar, userName = user == null ? void 0 : user.username, welcomeUser = t("welcome", {
|
|
15
|
+
} = useTranslation(), title = t(appCode), [isCollapsed, setIsCollapsed] = useState(!0), [appsRef, isAppsHovered] = useHover(), popoverAppsId = useId(), popoverSearchId = useId(), userAvatar = avatar, userName = user == null ? void 0 : user.username, welcomeUser = t("welcome", {
|
|
20
16
|
username: user == null ? void 0 : user.firstName
|
|
21
17
|
}), bookmarkedApps = useBookmark(), communityWorkflow = useHasWorkflow("net.atos.entng.community.controllers.CommunityController|view"), conversationWorflow = useHasWorkflow("org.entcore.conversation.controllers.ConversationController|view"), searchWorkflow = useHasWorkflow("fr.openent.searchengine.controllers.SearchEngineController|view"), toggleCollapsedNav = useCallback(() => {
|
|
22
18
|
setIsCollapsed(!isCollapsed);
|
|
23
|
-
}, [isCollapsed])
|
|
24
|
-
await odeServices.session().logout(), window.location.href = (theme == null ? void 0 : theme.logoutCallback) ?? "/auth/login";
|
|
25
|
-
};
|
|
19
|
+
}, [isCollapsed]);
|
|
26
20
|
return useMemo(() => ({
|
|
27
21
|
title,
|
|
28
22
|
bookmarkedApps,
|
|
@@ -37,9 +31,8 @@ function useHeader({
|
|
|
37
31
|
conversationWorflow,
|
|
38
32
|
searchWorkflow,
|
|
39
33
|
isCollapsed,
|
|
40
|
-
toggleCollapsedNav
|
|
41
|
-
|
|
42
|
-
}), [appsRef, bookmarkedApps, communityWorkflow, conversationWorflow, handleLogout, isAppsHovered, isCollapsed, popoverAppsId, popoverSearchId, searchWorkflow, title, toggleCollapsedNav, userAvatar, userName, welcomeUser]);
|
|
34
|
+
toggleCollapsedNav
|
|
35
|
+
}), [appsRef, bookmarkedApps, communityWorkflow, conversationWorflow, isAppsHovered, isCollapsed, popoverAppsId, popoverSearchId, searchWorkflow, title, toggleCollapsedNav, userAvatar, userName, welcomeUser]);
|
|
43
36
|
}
|
|
44
37
|
export {
|
|
45
38
|
useHeader as default
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { ChangeEvent } from 'react';
|
|
2
|
+
export interface RadioCardProps {
|
|
3
|
+
/**
|
|
4
|
+
* The currently selected value in the radio group.
|
|
5
|
+
*/
|
|
6
|
+
selectedValue: string;
|
|
7
|
+
/**
|
|
8
|
+
* The value associated with this specific radio card.
|
|
9
|
+
*/
|
|
10
|
+
value: string;
|
|
11
|
+
/**
|
|
12
|
+
* The main label text for the radio card.
|
|
13
|
+
*/
|
|
14
|
+
label: string;
|
|
15
|
+
/**
|
|
16
|
+
* Callback function triggered when the radio card selection changes.
|
|
17
|
+
*/
|
|
18
|
+
onChange: (e: ChangeEvent<HTMLInputElement>) => void;
|
|
19
|
+
/**
|
|
20
|
+
* Optional additional CSS class names to apply to the radio card.
|
|
21
|
+
*/
|
|
22
|
+
className?: string;
|
|
23
|
+
/**
|
|
24
|
+
* Optional description text displayed below the label.
|
|
25
|
+
*/
|
|
26
|
+
description?: string;
|
|
27
|
+
/**
|
|
28
|
+
* Optional model value associated with the radio card, can be a string, boolean, or number.
|
|
29
|
+
*/
|
|
30
|
+
model?: string | boolean | number;
|
|
31
|
+
/**
|
|
32
|
+
* Optional name for the radio group, used to group radio cards together.
|
|
33
|
+
*/
|
|
34
|
+
groupName?: string;
|
|
35
|
+
}
|
|
36
|
+
declare const RadioCard: import('react').ForwardRefExoticComponent<RadioCardProps & import('react').RefAttributes<HTMLLabelElement>>;
|
|
37
|
+
export default RadioCard;
|
|
@@ -18,6 +18,11 @@ export interface StackedGroupProps {
|
|
|
18
18
|
* Additional CSS class
|
|
19
19
|
*/
|
|
20
20
|
className?: string;
|
|
21
|
+
/**
|
|
22
|
+
* Whether to wrap items to the next line
|
|
23
|
+
* @default false
|
|
24
|
+
*/
|
|
25
|
+
wrap?: boolean;
|
|
21
26
|
}
|
|
22
27
|
declare const StackedGroup: import('react').ForwardRefExoticComponent<StackedGroupProps & import('react').RefAttributes<HTMLDivElement>>;
|
|
23
28
|
export default StackedGroup;
|
|
@@ -1,18 +1,20 @@
|
|
|
1
1
|
import { jsx } from "react/jsx-runtime";
|
|
2
|
-
import { forwardRef } from "react";
|
|
3
2
|
import clsx from "clsx";
|
|
3
|
+
import { forwardRef } from "react";
|
|
4
4
|
const StackedGroup = /* @__PURE__ */ forwardRef(({
|
|
5
5
|
children,
|
|
6
6
|
overlap = 20,
|
|
7
7
|
className,
|
|
8
|
-
stackingOrder = "leftFirst"
|
|
8
|
+
stackingOrder = "leftFirst",
|
|
9
|
+
wrap = !1
|
|
9
10
|
}, ref) => {
|
|
10
|
-
const classes = clsx("stacked-group", className
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
11
|
+
const classes = clsx("stacked-group d-flex align-items-center", className, {
|
|
12
|
+
"flex-wrap": wrap
|
|
13
|
+
});
|
|
14
|
+
return /* @__PURE__ */ jsx("div", { ref, className: classes, style: wrap ? {
|
|
15
|
+
paddingLeft: `${overlap}px`
|
|
16
|
+
} : void 0, children: children.map((child, index) => /* @__PURE__ */ jsx("div", { style: {
|
|
17
|
+
marginLeft: index === 0 && !wrap ? 0 : `-${overlap}px`,
|
|
16
18
|
zIndex: stackingOrder === "rightFirst" ? children.length - index : index + 1
|
|
17
19
|
}, children: child }, index)) });
|
|
18
20
|
});
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
export type StepperColors = 'primary' | 'secondary';
|
|
2
|
+
export interface StepperProps {
|
|
3
|
+
/**
|
|
4
|
+
* Index of the currently active step in the Stepper.
|
|
5
|
+
*/
|
|
6
|
+
currentStep: number;
|
|
7
|
+
/**
|
|
8
|
+
* Number of steps in the Stepper.
|
|
9
|
+
*/
|
|
10
|
+
nbSteps: number;
|
|
11
|
+
/**
|
|
12
|
+
* Gap between steps in the Stepper.
|
|
13
|
+
*/
|
|
14
|
+
gap?: '4' | '8' | '12' | '16' | '24' | '32';
|
|
15
|
+
color?: StepperColors;
|
|
16
|
+
}
|
|
17
|
+
declare const Stepper: import('react').ForwardRefExoticComponent<StepperProps & import('react').RefAttributes<HTMLDivElement>>;
|
|
18
|
+
export default Stepper;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef } from "react";
|
|
3
|
+
import Flex from "../Flex/Flex.js";
|
|
4
|
+
const Stepper = /* @__PURE__ */ forwardRef(({
|
|
5
|
+
currentStep,
|
|
6
|
+
nbSteps,
|
|
7
|
+
gap = "8",
|
|
8
|
+
color = "secondary",
|
|
9
|
+
...props
|
|
10
|
+
}, ref) => /* @__PURE__ */ jsx(Flex, { gap, ref, ...props, children: Array.from({
|
|
11
|
+
length: nbSteps
|
|
12
|
+
}).map((_, index) => /* @__PURE__ */ jsx("div", { className: `rounded step ${index === currentStep ? `bg-${color} step-active` : `bg-${color}-300`}` }, `step-${index}`)) }));
|
|
13
|
+
export {
|
|
14
|
+
Stepper as default
|
|
15
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as Stepper } from './Stepper';
|
|
@@ -17,12 +17,36 @@ export interface TabsProps {
|
|
|
17
17
|
* Children Props
|
|
18
18
|
*/
|
|
19
19
|
children?: (...props: any) => ReactNode;
|
|
20
|
+
/**
|
|
21
|
+
* Whether tabs should take full available width
|
|
22
|
+
*/
|
|
23
|
+
fullWidth?: boolean;
|
|
24
|
+
/**
|
|
25
|
+
* Whether tabs should take full available height
|
|
26
|
+
*/
|
|
27
|
+
fullHeight?: boolean;
|
|
28
|
+
/**
|
|
29
|
+
* Whether the tab list should be sticky
|
|
30
|
+
*/
|
|
31
|
+
isSticky?: boolean;
|
|
32
|
+
/**
|
|
33
|
+
* The top offset for the sticky tab list
|
|
34
|
+
*/
|
|
35
|
+
stickyTop?: number;
|
|
36
|
+
/**
|
|
37
|
+
* Additional class name for the tab header
|
|
38
|
+
*/
|
|
39
|
+
headerClassName?: string;
|
|
40
|
+
/**
|
|
41
|
+
* Additional class name for the content area
|
|
42
|
+
*/
|
|
43
|
+
contentClassName?: string;
|
|
20
44
|
}
|
|
21
45
|
/**
|
|
22
46
|
* Tab Content displayed one at a time when a Tab Item is selected
|
|
23
47
|
*/
|
|
24
48
|
export declare const Tabs: {
|
|
25
|
-
({ defaultId, items, onChange, children }: TabsProps): import("react/jsx-runtime").JSX.Element;
|
|
49
|
+
({ defaultId, items, fullWidth, fullHeight, onChange, children, isSticky, stickyTop, headerClassName, contentClassName, }: TabsProps): import("react/jsx-runtime").JSX.Element;
|
|
26
50
|
Item: {
|
|
27
51
|
({ icon, badge, label, id, order, }: TabsItemProps & {
|
|
28
52
|
order: number;
|
|
@@ -30,11 +54,11 @@ export declare const Tabs: {
|
|
|
30
54
|
displayName: string;
|
|
31
55
|
};
|
|
32
56
|
Panel: {
|
|
33
|
-
({ children, currentItem }: import('./TabsPanel').TabsPanelProps): import("react/jsx-runtime").JSX.Element;
|
|
57
|
+
({ children, currentItem, fullHeight, className, }: import('./TabsPanel').TabsPanelProps): import("react/jsx-runtime").JSX.Element;
|
|
34
58
|
displayName: string;
|
|
35
59
|
};
|
|
36
60
|
List: {
|
|
37
|
-
(props: import('
|
|
61
|
+
(props: import('./TabsList').TabsListProps): import("react/jsx-runtime").JSX.Element;
|
|
38
62
|
displayName: string;
|
|
39
63
|
};
|
|
40
64
|
displayName: string;
|
|
@@ -8,8 +8,14 @@ import TabsPanel from "./TabsPanel.js";
|
|
|
8
8
|
const Tabs = ({
|
|
9
9
|
defaultId,
|
|
10
10
|
items,
|
|
11
|
+
fullWidth = !1,
|
|
12
|
+
fullHeight = !1,
|
|
11
13
|
onChange,
|
|
12
|
-
children
|
|
14
|
+
children,
|
|
15
|
+
isSticky = !1,
|
|
16
|
+
stickyTop = 0,
|
|
17
|
+
headerClassName,
|
|
18
|
+
contentClassName
|
|
13
19
|
}) => {
|
|
14
20
|
const {
|
|
15
21
|
activeTab,
|
|
@@ -32,8 +38,8 @@ const Tabs = ({
|
|
|
32
38
|
onKeyDown
|
|
33
39
|
}), [activeTab, items, onKeyDown, setSelectedTab, tabUnderlineLeft, tabUnderlineWidth, tabsRef]), currentItem = items.find((item) => item.id === activeTab);
|
|
34
40
|
return /* @__PURE__ */ jsx(TabsContext.Provider, { value, children: typeof children == "function" ? children(currentItem) : /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
35
|
-
/* @__PURE__ */ jsx(Tabs.List, {}),
|
|
36
|
-
/* @__PURE__ */ jsx(Tabs.Panel, { currentItem, children: currentItem == null ? void 0 : currentItem.content })
|
|
41
|
+
/* @__PURE__ */ jsx(Tabs.List, { fullWidth, isSticky, stickyTop, className: headerClassName }),
|
|
42
|
+
/* @__PURE__ */ jsx(Tabs.Panel, { currentItem, fullHeight, className: contentClassName, children: currentItem == null ? void 0 : currentItem.content })
|
|
37
43
|
] }) });
|
|
38
44
|
};
|
|
39
45
|
Tabs.Item = TabsItem;
|
|
@@ -1,6 +1,20 @@
|
|
|
1
1
|
import { ComponentPropsWithoutRef } from 'react';
|
|
2
|
+
export interface TabsListProps extends ComponentPropsWithoutRef<'div'> {
|
|
3
|
+
/**
|
|
4
|
+
* Whether tabs should take full available width
|
|
5
|
+
*/
|
|
6
|
+
fullWidth?: boolean;
|
|
7
|
+
/**
|
|
8
|
+
* Whether the tab list should be sticky
|
|
9
|
+
*/
|
|
10
|
+
isSticky?: boolean;
|
|
11
|
+
/**
|
|
12
|
+
* The top offset for the sticky tab list
|
|
13
|
+
*/
|
|
14
|
+
stickyTop?: number;
|
|
15
|
+
}
|
|
2
16
|
declare const TabsList: {
|
|
3
|
-
(props:
|
|
17
|
+
(props: TabsListProps): import("react/jsx-runtime").JSX.Element;
|
|
4
18
|
displayName: string;
|
|
5
19
|
};
|
|
6
20
|
export default TabsList;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
2
|
import clsx from "clsx";
|
|
3
3
|
import { useTabsContext } from "../context/TabsContext.js";
|
|
4
4
|
import { Tabs } from "./Tabs.js";
|
|
@@ -9,15 +9,25 @@ const TabsList = (props) => {
|
|
|
9
9
|
tabUnderlineWidth
|
|
10
10
|
} = useTabsContext(), {
|
|
11
11
|
className,
|
|
12
|
+
fullWidth,
|
|
13
|
+
isSticky,
|
|
14
|
+
stickyTop,
|
|
12
15
|
...restProps
|
|
13
|
-
} = props,
|
|
14
|
-
|
|
15
|
-
|
|
16
|
+
} = props, ulClasses = clsx("nav nav-tabs flex-nowrap", {
|
|
17
|
+
"w-100": fullWidth
|
|
18
|
+
}), tabslist = clsx(" flex-shrink-0 overflow-x-auto", {
|
|
19
|
+
"position-sticky z-1": isSticky,
|
|
20
|
+
"position-relative": !isSticky
|
|
21
|
+
}, className);
|
|
22
|
+
return /* @__PURE__ */ jsx("div", { className: tabslist, ...restProps, style: isSticky ? {
|
|
23
|
+
top: stickyTop
|
|
24
|
+
} : void 0, children: /* @__PURE__ */ jsxs("ul", { className: ulClasses, role: "tablist", children: [
|
|
25
|
+
items.map((item, order) => /* @__PURE__ */ jsx(Tabs.Item, { order, ...item }, item.id)),
|
|
16
26
|
/* @__PURE__ */ jsx("span", { className: "nav-slide", style: {
|
|
17
27
|
left: tabUnderlineLeft,
|
|
18
28
|
width: tabUnderlineWidth
|
|
19
29
|
} })
|
|
20
|
-
] });
|
|
30
|
+
] }) });
|
|
21
31
|
};
|
|
22
32
|
export {
|
|
23
33
|
TabsList as default
|
|
@@ -9,9 +9,17 @@ export interface TabsPanelProps {
|
|
|
9
9
|
* Current Item
|
|
10
10
|
*/
|
|
11
11
|
currentItem: TabsItemProps | undefined;
|
|
12
|
+
/**
|
|
13
|
+
* Whether tabs should take full available height
|
|
14
|
+
*/
|
|
15
|
+
fullHeight?: boolean;
|
|
16
|
+
/**
|
|
17
|
+
* Additional class name for the content area
|
|
18
|
+
*/
|
|
19
|
+
className?: string;
|
|
12
20
|
}
|
|
13
21
|
declare const TabsPanel: {
|
|
14
|
-
({ children, currentItem }: TabsPanelProps): import("react/jsx-runtime").JSX.Element;
|
|
22
|
+
({ children, currentItem, fullHeight, className, }: TabsPanelProps): import("react/jsx-runtime").JSX.Element;
|
|
15
23
|
displayName: string;
|
|
16
24
|
};
|
|
17
25
|
export default TabsPanel;
|