@edifice.io/react 2.6.7-develop-b2school.20260930103331 → 2.6.7-develop-pedago.20260930173910
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/Alert/Alert.js +23 -47
- package/dist/components/AppIcon/AppIcon.js +5 -11
- package/dist/components/Form/FormText.js +6 -11
- package/dist/components/Image/Image.js +2 -5
- package/dist/components/Input/Input.d.ts +2 -11
- package/dist/components/Input/Input.js +21 -43
- package/dist/components/Label/Label.js +4 -4
- package/dist/components/Layout/Layout.js +15 -30
- package/dist/components/PageLayout/PageLayout.d.ts +0 -4
- package/dist/components/PageLayout/PageLayout.js +14 -37
- package/dist/components/PageLayout/components/PageLayoutContent.js +1 -5
- package/dist/components/Table/components/Table.d.ts +2 -2
- package/dist/components/Table/components/TableTd.d.ts +1 -1
- package/dist/components/Table/components/TableTh.d.ts +1 -1
- package/dist/components/index.d.ts +0 -2
- package/dist/homepage.js +3 -17
- package/dist/hooks/index.d.ts +0 -2
- package/dist/hooks/useClickOutside/useClickOutside.d.ts +1 -1
- package/dist/hooks/useClickOutside/useClickOutside.js +2 -3
- package/dist/hooks/useToast/useToast.d.ts +0 -1
- package/dist/hooks/useToast/useToast.js +9 -12
- package/dist/hooks/useZendeskGuide/useZendeskGuide.d.ts +2 -16
- package/dist/hooks/useZendeskGuide/useZendeskGuide.js +24 -58
- package/dist/icons.js +402 -404
- package/dist/index.js +160 -168
- package/dist/modules/editor/components/EditorToolbar/EditorToolbar.Typography.js +3 -3
- package/dist/modules/homepage/components/Communities/Communities.d.ts +2 -1
- package/dist/modules/homepage/components/Communities/Communities.js +14 -13
- package/dist/modules/homepage/components/Communities/CommunitiesContainer.d.ts +1 -1
- package/dist/modules/homepage/components/Communities/CommunitiesContainer.js +9 -5
- package/dist/modules/homepage/components/Communities/CommunitiesSkeleton.js +4 -7
- package/dist/modules/homepage/components/Communities/useCommunities.d.ts +4 -1
- package/dist/modules/homepage/components/Communities/useCommunities.js +8 -3
- package/dist/modules/homepage/components/Favorites/Favorites.js +2 -2
- package/dist/modules/homepage/components/Header/Header.js +4 -11
- package/dist/modules/homepage/components/HomeCard/HomeCard.d.ts +1 -1
- package/dist/modules/homepage/components/HomeCard/HomeCardHeader.d.ts +1 -15
- package/dist/modules/homepage/components/HomeCard/HomeCardHeader.js +2 -3
- package/dist/modules/homepage/components/Notifications/components/NotificationFilterModal.js +26 -36
- package/dist/modules/homepage/components/Notifications/components/ReportNotificationModal.js +1 -1
- package/dist/modules/homepage/components/Notifications/services/queries/notification.js +2 -9
- package/dist/modules/homepage/components/UserSpace/UserSpace.d.ts +1 -3
- package/dist/modules/homepage/components/UserSpace/UserSpace.js +7 -13
- package/dist/modules/homepage/components/UserSpace/UserSpaceContainer.d.ts +2 -4
- package/dist/modules/homepage/components/UserSpace/UserSpaceContainer.js +2 -3
- package/dist/modules/homepage/components/UserSpace/hooks/useProfileLinks.js +8 -18
- package/dist/modules/homepage/components/index.d.ts +1 -3
- package/dist/modules/icons/components/index.d.ts +0 -1
- package/dist/modules/widgets/index.d.ts +1 -1
- package/package.json +6 -6
- package/dist/components/LinkPill/LinkPill.d.ts +0 -41
- package/dist/components/LinkPill/LinkPill.js +0 -28
- package/dist/components/LinkPill/index.d.ts +0 -2
- package/dist/components/ModalBeta/ModalBeta.d.ts +0 -47
- package/dist/components/ModalBeta/ModalBeta.js +0 -62
- package/dist/components/ModalBeta/ModalBetaBody.d.ts +0 -19
- package/dist/components/ModalBeta/ModalBetaBody.js +0 -15
- package/dist/components/ModalBeta/ModalBetaContext.d.ts +0 -7
- package/dist/components/ModalBeta/ModalBetaContext.js +0 -15
- package/dist/components/ModalBeta/ModalBetaFooter.d.ts +0 -13
- package/dist/components/ModalBeta/ModalBetaFooter.js +0 -7
- package/dist/components/ModalBeta/ModalBetaHeader.d.ts +0 -23
- package/dist/components/ModalBeta/ModalBetaHeader.js +0 -31
- package/dist/components/ModalBeta/index.d.ts +0 -2
- package/dist/components/PageLayout/components/PageLayoutHelpZone.d.ts +0 -12
- package/dist/components/PageLayout/components/PageLayoutHelpZone.js +0 -6
- package/dist/hooks/useBackground/index.d.ts +0 -1
- package/dist/hooks/useBackground/useBackground.d.ts +0 -7
- package/dist/hooks/useBackground/useBackground.js +0 -16
- package/dist/hooks/useUserPreferences/index.d.ts +0 -1
- package/dist/hooks/useUserPreferences/useUserPreferences.d.ts +0 -9
- package/dist/hooks/useUserPreferences/useUserPreferences.js +0 -40
- package/dist/modules/HelpZone/HelpZone.d.ts +0 -13
- package/dist/modules/HelpZone/HelpZone.js +0 -52
- package/dist/modules/HelpZone/HelpZoneContainer.d.ts +0 -4
- package/dist/modules/HelpZone/HelpZoneContainer.js +0 -18
- package/dist/modules/HelpZone/index.d.ts +0 -3
- package/dist/modules/homepage/components/UsefulLinks/LinkForm.d.ts +0 -13
- package/dist/modules/homepage/components/UsefulLinks/LinkForm.js +0 -67
- package/dist/modules/homepage/components/UsefulLinks/UsefulLinks.d.ts +0 -6
- package/dist/modules/homepage/components/UsefulLinks/UsefulLinks.js +0 -31
- package/dist/modules/homepage/components/UsefulLinks/UsefulLinksContainer.d.ts +0 -1
- package/dist/modules/homepage/components/UsefulLinks/UsefulLinksContainer.js +0 -40
- package/dist/modules/homepage/components/UsefulLinks/UsefulLinksModal.d.ts +0 -11
- package/dist/modules/homepage/components/UsefulLinks/UsefulLinksModal.js +0 -65
- package/dist/modules/homepage/components/UsefulLinks/hooks/useUsefulLinksContainer.d.ts +0 -19
- package/dist/modules/homepage/components/UsefulLinks/hooks/useUsefulLinksContainer.js +0 -26
- package/dist/modules/homepage/components/UsefulLinks/index.d.ts +0 -5
- package/dist/modules/homepage/components/UsefulLinks/services/api/index.d.ts +0 -6
- package/dist/modules/homepage/components/UsefulLinks/services/api/index.js +0 -5
- package/dist/modules/homepage/components/UsefulLinks/services/api/usefulLinksService.d.ts +0 -31
- package/dist/modules/homepage/components/UsefulLinks/services/api/usefulLinksService.js +0 -50
- package/dist/modules/homepage/components/UsefulLinks/services/queries/usefulLinks.d.ts +0 -20
- package/dist/modules/homepage/components/UsefulLinks/services/queries/usefulLinks.js +0 -65
- package/dist/modules/homepage/components/WidgetsPersonalizationPanel/WidgetToggle.d.ts +0 -16
- package/dist/modules/homepage/components/WidgetsPersonalizationPanel/WidgetToggle.js +0 -15
- package/dist/modules/homepage/components/WidgetsPersonalizationPanel/WidgetsPersonalizationPanel.d.ts +0 -21
- package/dist/modules/homepage/components/WidgetsPersonalizationPanel/WidgetsPersonalizationPanel.js +0 -47
- package/dist/modules/homepage/components/WidgetsPersonalizationPanel/index.d.ts +0 -2
- package/dist/modules/icons/components/IconAddWidget.d.ts +0 -7
- package/dist/modules/icons/components/IconAddWidget.js +0 -12
- package/dist/modules/icons/components/logo/IconLogoEdificeFull.d.ts +0 -7
- package/dist/modules/icons/components/logo/IconLogoEdificeFull.js +0 -26
- package/dist/modules/icons/components/logo/IconLogoEdificeSmall.d.ts +0 -7
- package/dist/modules/icons/components/logo/IconLogoEdificeSmall.js +0 -17
- package/dist/modules/icons/components/logo/index.d.ts +0 -2
|
@@ -1,14 +1,13 @@
|
|
|
1
1
|
import { jsx, Fragment, jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { forwardRef, useState, useRef, useCallback,
|
|
2
|
+
import { forwardRef, useState, useRef, useCallback, useImperativeHandle, useLayoutEffect, useEffect } from "react";
|
|
3
3
|
import clsx from "clsx";
|
|
4
4
|
import { useTranslation } from "react-i18next";
|
|
5
|
-
import
|
|
6
|
-
import SvgIconClose from "../../modules/icons/components/IconClose.js";
|
|
5
|
+
import SvgIconAlertCircle from "../../modules/icons/components/IconAlertCircle.js";
|
|
7
6
|
import SvgIconError from "../../modules/icons/components/IconError.js";
|
|
8
7
|
import SvgIconInfoCircle from "../../modules/icons/components/IconInfoCircle.js";
|
|
9
8
|
import SvgIconSuccessOutline from "../../modules/icons/components/IconSuccessOutline.js";
|
|
10
|
-
import
|
|
11
|
-
const
|
|
9
|
+
import Button from "../Button/Button.js";
|
|
10
|
+
const Alert = /* @__PURE__ */ forwardRef(({
|
|
12
11
|
type = "success",
|
|
13
12
|
className = "",
|
|
14
13
|
children,
|
|
@@ -22,53 +21,31 @@ const TOAST_EXIT_ANIMATION_DURATION = 240, getToastAnimationClass = (position, i
|
|
|
22
21
|
onClose,
|
|
23
22
|
onVisibilityChange
|
|
24
23
|
}, ref) => {
|
|
25
|
-
const [isVisible, setVisibleStatus] = useState(!0),
|
|
24
|
+
const [isVisible, setVisibleStatus] = useState(!0), refAlert = useRef(null), {
|
|
26
25
|
t
|
|
27
26
|
} = useTranslation(), hide = useCallback(() => {
|
|
28
|
-
if (isToast) {
|
|
29
|
-
setIsClosing(!0);
|
|
30
|
-
return;
|
|
31
|
-
}
|
|
32
27
|
setVisibleStatus(!1), onClose == null || onClose();
|
|
33
|
-
}, [
|
|
34
|
-
useEffect(() => {
|
|
35
|
-
if (!isClosing)
|
|
36
|
-
return;
|
|
37
|
-
const timeoutId = setTimeout(() => {
|
|
38
|
-
setVisibleStatus(!1), onClose == null || onClose();
|
|
39
|
-
}, TOAST_EXIT_ANIMATION_DURATION);
|
|
40
|
-
return () => clearTimeout(timeoutId);
|
|
41
|
-
}, [isClosing, onClose]);
|
|
42
|
-
const handleToastClick = () => {
|
|
43
|
-
isToast && !isConfirm && hide();
|
|
44
|
-
};
|
|
28
|
+
}, [onClose]);
|
|
45
29
|
useImperativeHandle(ref, () => ({
|
|
46
30
|
show,
|
|
47
31
|
hide,
|
|
48
32
|
...refAlert.current
|
|
49
33
|
})), useLayoutEffect(() => {
|
|
50
34
|
onVisibilityChange == null || onVisibilityChange(isVisible);
|
|
51
|
-
}, [isVisible, onVisibilityChange])
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
}, [shouldAutoClose, autoCloseDelay, hide, clearAutoCloseTimeout]);
|
|
59
|
-
const handleMouseEnter = () => {
|
|
60
|
-
!shouldAutoClose || isPaused || (clearAutoCloseTimeout(), remainingRef.current = Math.max(remainingRef.current - (Date.now() - startedAtRef.current), 0), setIsPaused(!0));
|
|
61
|
-
}, handleMouseLeave = () => {
|
|
62
|
-
!shouldAutoClose || !isPaused || (startedAtRef.current = Date.now(), timeoutRef.current = setTimeout(hide, remainingRef.current), setIsPaused(!1));
|
|
63
|
-
}, show = () => {
|
|
64
|
-
setIsClosing(!1), setVisibleStatus(!0);
|
|
35
|
+
}, [isVisible, onVisibilityChange]), useEffect(() => {
|
|
36
|
+
autoClose && isVisible && setTimeout(() => {
|
|
37
|
+
hide();
|
|
38
|
+
}, autoCloseDelay);
|
|
39
|
+
}, [autoClose, autoCloseDelay, hide, isVisible]);
|
|
40
|
+
const show = () => {
|
|
41
|
+
setVisibleStatus(!0);
|
|
65
42
|
}, mapping = {
|
|
66
43
|
success: {
|
|
67
44
|
icon: /* @__PURE__ */ jsx(SvgIconSuccessOutline, {}),
|
|
68
45
|
classModifier: "alert-success"
|
|
69
46
|
},
|
|
70
47
|
warning: {
|
|
71
|
-
icon: /* @__PURE__ */ jsx(
|
|
48
|
+
icon: /* @__PURE__ */ jsx(SvgIconAlertCircle, {}),
|
|
72
49
|
classModifier: "alert-warning"
|
|
73
50
|
},
|
|
74
51
|
info: {
|
|
@@ -81,22 +58,21 @@ const TOAST_EXIT_ANIMATION_DURATION = 240, getToastAnimationClass = (position, i
|
|
|
81
58
|
}
|
|
82
59
|
}, toastClasses = {
|
|
83
60
|
"is-dismissible": isDismissible,
|
|
84
|
-
"is-toast": isToast
|
|
61
|
+
"is-toast ": isToast
|
|
85
62
|
}, confirmClasses = {
|
|
86
63
|
"is-confirm": isConfirm
|
|
87
|
-
}, divContainerClasses = clsx("alert gap-12", mapping[type].classModifier, toastClasses, confirmClasses, position,
|
|
88
|
-
return /* @__PURE__ */ jsx(Fragment, { children: isVisible ? /* @__PURE__ */ jsxs("div", { ref: refAlert, className: divContainerClasses, role: "alert",
|
|
64
|
+
}, divContainerClasses = clsx("alert gap-12", mapping[type].classModifier, toastClasses, confirmClasses, position, className);
|
|
65
|
+
return /* @__PURE__ */ jsx(Fragment, { children: isVisible ? /* @__PURE__ */ jsxs("div", { ref: refAlert, className: divContainerClasses, role: "alert", children: [
|
|
89
66
|
!isConfirm && mapping[type].icon,
|
|
90
67
|
/* @__PURE__ */ jsx("div", { className: "alert-content small flex-grow-1", children }),
|
|
91
|
-
button && /* @__PURE__ */ jsxs("div", { className: "
|
|
68
|
+
button && /* @__PURE__ */ jsxs("div", { className: "ms-12", children: [
|
|
92
69
|
button,
|
|
93
|
-
|
|
70
|
+
" ",
|
|
71
|
+
isConfirm && /* @__PURE__ */ jsx(Button, { onClick: hide, children: t("close") })
|
|
94
72
|
] }),
|
|
95
|
-
(isDismissible || isConfirm) && /* @__PURE__ */ jsx("div", { className: "btn-close-container",
|
|
96
|
-
|
|
97
|
-
"
|
|
98
|
-
}), style: {
|
|
99
|
-
"--alert-progress-duration": `${autoCloseDelay}ms`
|
|
73
|
+
(isDismissible || isConfirm) && /* @__PURE__ */ jsx("div", { className: "btn-close-container", children: /* @__PURE__ */ jsx("button", { type: "button", className: "btn-close", "data-bs-dismiss": "alert", "aria-label": t("close"), onClick: hide }) }),
|
|
74
|
+
autoClose && /* @__PURE__ */ jsx("div", { className: "alert-progress", style: {
|
|
75
|
+
transform: "scaleX(0)"
|
|
100
76
|
} })
|
|
101
77
|
] }) : null });
|
|
102
78
|
});
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsx } from "react/jsx-runtime";
|
|
2
|
-
import { forwardRef
|
|
2
|
+
import { forwardRef } from "react";
|
|
3
3
|
import clsx from "clsx";
|
|
4
4
|
import * as iconsApps from "../../icons-apps.js";
|
|
5
5
|
import useEdificeIcons from "../../hooks/useEdificeIcons/useEdificeIcons.js";
|
|
@@ -15,7 +15,7 @@ const AppIcon = /* @__PURE__ */ forwardRef(({
|
|
|
15
15
|
const {
|
|
16
16
|
isIconUrl,
|
|
17
17
|
getIconCode
|
|
18
|
-
} = useEdificeIcons(),
|
|
18
|
+
} = useEdificeIcons(), isSquare = variant === "square", isRounded = variant === "rounded", isCircle = variant === "circle", isContain = iconFit === "contain", isRatio = iconFit === "ratio", iconSizes = {
|
|
19
19
|
"icon-xs": size === "24",
|
|
20
20
|
"icon-sm": size === "40",
|
|
21
21
|
"icon-md": size === "48",
|
|
@@ -28,11 +28,7 @@ const AppIcon = /* @__PURE__ */ forwardRef(({
|
|
|
28
28
|
}, iconFits = {
|
|
29
29
|
"icon-contain": isContain,
|
|
30
30
|
"icon-ratio": isRatio
|
|
31
|
-
}, icon = typeof app == "string" ? app : (app == null ? void 0 : app.icon) !== void 0 ? app.icon : "placeholder", displayName = typeof app != "string" && (
|
|
32
|
-
useEffect(() => {
|
|
33
|
-
setImageLoadFailed(!1);
|
|
34
|
-
}, [icon]);
|
|
35
|
-
const appCode = iconIsUrl ? "placeholder" : code || "placeholder", classes = clsx("app-icon", {
|
|
31
|
+
}, icon = typeof app == "string" ? app : (app == null ? void 0 : app.icon) !== void 0 ? app.icon : "placeholder", displayName = typeof app != "string" && (app == null ? void 0 : app.displayName) !== void 0 ? app.displayName : "", code = app ? getIconCode(app) : "", isIconURL = isIconUrl(icon), appCode = code || "placeholder", classes = clsx("app-icon", {
|
|
36
32
|
...iconSizes,
|
|
37
33
|
...iconVariant,
|
|
38
34
|
...iconFits,
|
|
@@ -46,14 +42,12 @@ const AppIcon = /* @__PURE__ */ forwardRef(({
|
|
|
46
42
|
const classes2 = clsx("h-full", className);
|
|
47
43
|
return /* @__PURE__ */ jsx(Image, { src: icon, alt: displayName, objectFit: "contain", width: size, height: size, className: classes2, style: {
|
|
48
44
|
minWidth: size + "px"
|
|
49
|
-
}
|
|
45
|
+
} });
|
|
50
46
|
}
|
|
51
47
|
return /* @__PURE__ */ jsx("div", { ref, className: classes, style: {
|
|
52
48
|
width: size + "px",
|
|
53
49
|
height: size + "px"
|
|
54
|
-
}, children:
|
|
55
|
-
fontSize: size + "px"
|
|
56
|
-
}, children: displayName.charAt(0).toUpperCase() }) : /* @__PURE__ */ jsx(IconComponent, { width: size, height: size }) });
|
|
50
|
+
}, children: /* @__PURE__ */ jsx(IconComponent, { width: size, height: size }) });
|
|
57
51
|
});
|
|
58
52
|
export {
|
|
59
53
|
AppIcon as default
|
|
@@ -1,21 +1,16 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
2
|
import clsx from "clsx";
|
|
3
|
-
import SvgIconError from "../../modules/icons/components/IconError.js";
|
|
4
|
-
import SvgIconSuccessOutline from "../../modules/icons/components/IconSuccessOutline.js";
|
|
5
3
|
import { useFormControl } from "./FormContext.js";
|
|
6
4
|
const FormText = ({
|
|
7
5
|
children
|
|
8
6
|
}) => {
|
|
9
7
|
const {
|
|
10
8
|
status
|
|
11
|
-
} = useFormControl(), classes = clsx("
|
|
12
|
-
"
|
|
13
|
-
|
|
14
|
-
})
|
|
15
|
-
return /* @__PURE__ */
|
|
16
|
-
Icon && /* @__PURE__ */ jsx(Icon, { className: "input-message__icon", "aria-hidden": "true" }),
|
|
17
|
-
children
|
|
18
|
-
] });
|
|
9
|
+
} = useFormControl(), classes = clsx("form-text", {
|
|
10
|
+
"is-invalid": status === "invalid",
|
|
11
|
+
valid: status === "valid"
|
|
12
|
+
});
|
|
13
|
+
return /* @__PURE__ */ jsx("p", { className: classes, children: /* @__PURE__ */ jsx("em", { children }) });
|
|
19
14
|
};
|
|
20
15
|
export {
|
|
21
16
|
FormText as default
|
|
@@ -10,7 +10,6 @@ const Image = /* @__PURE__ */ forwardRef(({
|
|
|
10
10
|
ratio,
|
|
11
11
|
objectFit,
|
|
12
12
|
className,
|
|
13
|
-
onError: onErrorProp,
|
|
14
13
|
...restProps
|
|
15
14
|
}, ref) => {
|
|
16
15
|
const placeholder = imgPlaceholder ?? commonPlaceholder, {
|
|
@@ -19,9 +18,7 @@ const Image = /* @__PURE__ */ forwardRef(({
|
|
|
19
18
|
} = useImage({
|
|
20
19
|
src,
|
|
21
20
|
placeholder
|
|
22
|
-
}),
|
|
23
|
-
onError(), onErrorProp == null || onErrorProp(event);
|
|
24
|
-
}, ratioImage = {
|
|
21
|
+
}), ratioImage = {
|
|
25
22
|
"ratio ratio-1x1": ratio === "1",
|
|
26
23
|
"ratio ratio-4x3": ratio === "4",
|
|
27
24
|
"ratio ratio-16x9": ratio === "16",
|
|
@@ -36,7 +33,7 @@ const Image = /* @__PURE__ */ forwardRef(({
|
|
|
36
33
|
...ratioImage
|
|
37
34
|
}), classes = clsx({
|
|
38
35
|
...objectImage
|
|
39
|
-
}, className), renderImage = /* @__PURE__ */ jsx("img", { alt, onError
|
|
36
|
+
}, className), renderImage = /* @__PURE__ */ jsx("img", { alt, onError, ref, src: imgSrc, className: classes, ...restProps });
|
|
40
37
|
return ratio ? /* @__PURE__ */ jsx("div", { className: ratioClasses, children: renderImage }) : renderImage;
|
|
41
38
|
});
|
|
42
39
|
export {
|
|
@@ -2,8 +2,7 @@ import { Size } from '../../types';
|
|
|
2
2
|
export type OmitInputProps = 'disabled' | 'required' | 'size' | 'id' | 'readOnly';
|
|
3
3
|
export interface InputProps extends Omit<React.ComponentPropsWithRef<'input'>, OmitInputProps> {
|
|
4
4
|
/**
|
|
5
|
-
* Control size of input
|
|
6
|
-
* ("Medium" in the design system); only `lg` ("Big") differs.
|
|
5
|
+
* Control size of input
|
|
7
6
|
*/
|
|
8
7
|
size: Size;
|
|
9
8
|
/**
|
|
@@ -19,8 +18,7 @@ export interface InputProps extends Omit<React.ComponentPropsWithRef<'input'>, O
|
|
|
19
18
|
*/
|
|
20
19
|
disabled?: boolean;
|
|
21
20
|
/**
|
|
22
|
-
*
|
|
23
|
-
* this prop has no effect and will be removed in a future major version.
|
|
21
|
+
* Remove validation icon
|
|
24
22
|
*/
|
|
25
23
|
noValidationIcon?: boolean;
|
|
26
24
|
/**
|
|
@@ -35,13 +33,6 @@ export interface InputProps extends Omit<React.ComponentPropsWithRef<'input'>, O
|
|
|
35
33
|
* Browser autocomplete feature
|
|
36
34
|
*/
|
|
37
35
|
autoComplete?: string;
|
|
38
|
-
/**
|
|
39
|
-
* Show a built-in clear (×) button while the field is focused. Opt-in:
|
|
40
|
-
* several consumers render their own clear affordance already (e.g.
|
|
41
|
-
* `SearchBar`), and a broad audit of every `Input` usage hasn't been done
|
|
42
|
-
* yet — see INPUT-MIGRATION-PLAN.md §07.
|
|
43
|
-
*/
|
|
44
|
-
clearable?: boolean;
|
|
45
36
|
}
|
|
46
37
|
/**
|
|
47
38
|
* Input Form Component
|
|
@@ -1,62 +1,40 @@
|
|
|
1
|
-
import { jsxs, jsx } from "react/jsx-runtime";
|
|
2
|
-
import { forwardRef,
|
|
1
|
+
import { jsxs, Fragment, jsx } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef, useState } from "react";
|
|
3
3
|
import clsx from "clsx";
|
|
4
|
-
import { useTranslation } from "react-i18next";
|
|
5
|
-
import SvgIconClose from "../../modules/icons/components/IconClose.js";
|
|
6
4
|
import { useFormControl } from "../Form/FormContext.js";
|
|
5
|
+
import Textcounter from "../TextCounter/TextCounter.js";
|
|
7
6
|
const Input = /* @__PURE__ */ forwardRef(({
|
|
7
|
+
noValidationIcon,
|
|
8
8
|
placeholder,
|
|
9
9
|
size = "md",
|
|
10
10
|
type = "text",
|
|
11
11
|
className,
|
|
12
12
|
showCounter = !1,
|
|
13
13
|
autoComplete = "off",
|
|
14
|
-
clearable = !1,
|
|
15
|
-
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
16
|
-
noValidationIcon,
|
|
17
14
|
...restProps
|
|
18
|
-
},
|
|
15
|
+
}, ref) => {
|
|
19
16
|
var _a;
|
|
20
17
|
const {
|
|
21
18
|
id,
|
|
22
19
|
isRequired,
|
|
23
20
|
isReadOnly,
|
|
24
21
|
status
|
|
25
|
-
} = useFormControl(), {
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
"input
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
}, handleClear = () => {
|
|
42
|
-
var _a2;
|
|
43
|
-
const node = inputRef.current;
|
|
44
|
-
if (!node) return;
|
|
45
|
-
const nativeSetter = (_a2 = Object.getOwnPropertyDescriptor(window.HTMLInputElement.prototype, "value")) == null ? void 0 : _a2.set;
|
|
46
|
-
nativeSetter == null || nativeSetter.call(node, ""), node.dispatchEvent(new Event("input", {
|
|
47
|
-
bubbles: !0
|
|
48
|
-
})), node.focus();
|
|
49
|
-
}, maxLength = restProps.maxLength ?? 0;
|
|
50
|
-
return /* @__PURE__ */ jsxs("div", { className: wrapperClasses, children: [
|
|
51
|
-
/* @__PURE__ */ jsx("input", { ref: setRefs, id, className: "input__field", type, placeholder, required: isRequired, readOnly: isReadOnly, ...restProps, onChange: handleChange, autoComplete }),
|
|
52
|
-
clearable && !isReadOnly && /* @__PURE__ */ jsx("button", { type: "button", className: "input__clear", onClick: handleClear, "aria-label": t("clear"), children: /* @__PURE__ */ jsx(SvgIconClose, {}) }),
|
|
53
|
-
showCounter && /* @__PURE__ */ jsxs("span", { className: clsx("input__counter", {
|
|
54
|
-
"input__counter--max": currentLength === maxLength
|
|
55
|
-
}), children: [
|
|
56
|
-
currentLength,
|
|
57
|
-
" / ",
|
|
58
|
-
maxLength
|
|
59
|
-
] })
|
|
22
|
+
} = useFormControl(), [currentLength, setCurrentLength] = useState(((_a = restProps.defaultValue) == null ? void 0 : _a.toString().length) || 0), classes = clsx({
|
|
23
|
+
"form-control": !isReadOnly,
|
|
24
|
+
"form-control-lg": size === "lg",
|
|
25
|
+
"form-control-sm": size === "sm",
|
|
26
|
+
"is-invalid": status === "invalid",
|
|
27
|
+
"is-valid": status === "valid",
|
|
28
|
+
"form-control-plaintext": isReadOnly,
|
|
29
|
+
"no-validation-icon": noValidationIcon,
|
|
30
|
+
"pe-64": showCounter && !status
|
|
31
|
+
}, className);
|
|
32
|
+
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
33
|
+
/* @__PURE__ */ jsx("input", { ref, id, className: classes, type, placeholder, required: isRequired, readOnly: isReadOnly, ...restProps, onChange: (e) => {
|
|
34
|
+
var _a2;
|
|
35
|
+
setCurrentLength(e.target.value.length), (_a2 = restProps.onChange) == null || _a2.call(restProps, e);
|
|
36
|
+
}, autoComplete }),
|
|
37
|
+
showCounter && !status && /* @__PURE__ */ jsx(Textcounter, { currentLength, maxLength: restProps.maxLength ?? 0 })
|
|
60
38
|
] });
|
|
61
39
|
});
|
|
62
40
|
export {
|
|
@@ -16,8 +16,8 @@ const Label = /* @__PURE__ */ forwardRef(({
|
|
|
16
16
|
isRequired
|
|
17
17
|
} = useFormControl(), {
|
|
18
18
|
t
|
|
19
|
-
} = useTranslation(), classes = clsx("
|
|
20
|
-
"
|
|
19
|
+
} = useTranslation(), classes = clsx("form-label", {
|
|
20
|
+
"has-icon": leftIcon
|
|
21
21
|
}, className), optionalState = isOptional && !isRequired, requiredState = isRequired && !isOptional;
|
|
22
22
|
return useEffect(() => {
|
|
23
23
|
if (isOptional && isRequired)
|
|
@@ -25,11 +25,11 @@ const Label = /* @__PURE__ */ forwardRef(({
|
|
|
25
25
|
}, [isOptional, isRequired]), /* @__PURE__ */ jsxs("label", { ref, htmlFor: id, className: classes, children: [
|
|
26
26
|
leftIcon,
|
|
27
27
|
children,
|
|
28
|
-
optionalState && /* @__PURE__ */ jsxs("em", { className: "
|
|
28
|
+
optionalState && /* @__PURE__ */ jsxs("em", { className: "optional", children: [
|
|
29
29
|
"- ",
|
|
30
30
|
optionalText ?? t("explorer.optional")
|
|
31
31
|
] }),
|
|
32
|
-
requiredState && /* @__PURE__ */ jsx("em", { className: "
|
|
32
|
+
requiredState && /* @__PURE__ */ jsx("em", { className: "required", children: requiredText })
|
|
33
33
|
] });
|
|
34
34
|
});
|
|
35
35
|
export {
|
|
@@ -1,68 +1,53 @@
|
|
|
1
1
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { Suspense, lazy } from "react";
|
|
3
3
|
import clsx from "clsx";
|
|
4
|
+
import { Toaster } from "react-hot-toast";
|
|
4
5
|
import { useTranslation } from "react-i18next";
|
|
5
6
|
import { useEdificeTheme } from "../../providers/EdificeThemeProvider/EdificeThemeProvider.hook.js";
|
|
6
|
-
import { useOverlay } from "../PageLayout/hook/useOverlay.js";
|
|
7
7
|
import Header from "./components/Header.js";
|
|
8
8
|
import HeaderNotificationsOverlay from "./components/HeaderNotificationsOverlay.js";
|
|
9
|
+
import { useOverlay } from "../PageLayout/hook/useOverlay.js";
|
|
9
10
|
import useUiOverride from "../../hooks/useUiOverride/useUiOverride.js";
|
|
10
|
-
import useBackground from "../../hooks/useBackground/useBackground.js";
|
|
11
|
-
import useToast from "../../hooks/useToast/useToast.js";
|
|
12
11
|
import useCookiesConsent from "../../hooks/useCookiesConsent/useCookiesConsent.js";
|
|
13
12
|
import useZendeskGuide from "../../hooks/useZendeskGuide/useZendeskGuide.js";
|
|
14
13
|
import useCantoo from "../../hooks/useCantoo/useCantoo.js";
|
|
15
14
|
import Alert from "../Alert/Alert.js";
|
|
16
|
-
import
|
|
17
|
-
|
|
18
|
-
const HeaderV2 = /* @__PURE__ */ lazy(() => import("../../modules/homepage/components/Header/Header.js"));
|
|
19
|
-
function getHeaderColor() {
|
|
20
|
-
return getComputedStyle(document.documentElement).getPropertyValue("--primitive-blue-400").trim();
|
|
21
|
-
}
|
|
22
|
-
const Layout = ({
|
|
15
|
+
import Button from "../Button/Button.js";
|
|
16
|
+
const HeaderV2 = /* @__PURE__ */ lazy(() => import("../../modules/homepage/components/Header/Header.js")), Layout = ({
|
|
23
17
|
children,
|
|
24
18
|
headless = !1,
|
|
25
19
|
whiteBg = !0,
|
|
26
20
|
className,
|
|
27
21
|
...restProps
|
|
28
22
|
}) => {
|
|
29
|
-
var _a;
|
|
30
23
|
const {
|
|
31
24
|
theme
|
|
32
|
-
} = useEdificeTheme(), override = useUiOverride("layout.header"), isHeaderV2 = (override == null ? void 0 : override.variant) === "v2",
|
|
33
|
-
productOverride,
|
|
34
|
-
background,
|
|
35
|
-
isBackgroundImageOverridden
|
|
36
|
-
} = useBackground(), {
|
|
25
|
+
} = useEdificeTheme(), override = useUiOverride("layout.header"), isHeaderV2 = (override == null ? void 0 : override.variant) === "v2", backgroundOverride = useUiOverride("layout.background"), hasBackgroundImage = (backgroundOverride == null ? void 0 : backgroundOverride.variant) === "image", {
|
|
37
26
|
toggleOverlay
|
|
38
|
-
} = useOverlay(),
|
|
27
|
+
} = useOverlay(), {
|
|
39
28
|
t
|
|
40
29
|
} = useTranslation(), {
|
|
41
30
|
showCookiesConsent,
|
|
42
31
|
handleConsultCookies,
|
|
43
32
|
handleCloseCookiesConsent
|
|
44
|
-
} = useCookiesConsent()
|
|
45
|
-
|
|
46
|
-
isOpen: isHelpZoneOpen,
|
|
47
|
-
open: openHelpZone,
|
|
48
|
-
close: closeHelpZone
|
|
49
|
-
} = useZendeskGuide(isEdificeInProductHelp ? getHeaderColor() : void 0);
|
|
50
|
-
useCantoo();
|
|
33
|
+
} = useCookiesConsent();
|
|
34
|
+
useZendeskGuide(), useCantoo();
|
|
51
35
|
const classes = clsx("d-flex flex-column", {
|
|
52
36
|
"bg-white": whiteBg,
|
|
53
37
|
"container-fluid": !headless,
|
|
54
38
|
"rounded-4 border": (theme == null ? void 0 : theme.is1d) && !headless,
|
|
55
39
|
"mt-24": (theme == null ? void 0 : theme.is1d) && !headless
|
|
56
|
-
}, className), renderHeader = headless ? null : isHeaderV2 ? /* @__PURE__ */ jsx(Suspense, { fallback: null, children: /* @__PURE__ */ jsx(HeaderV2, { src: theme == null ? void 0 : theme.basePath, dataProduct: override == null ? void 0 : override.theme, onNotificationsClick: toggleOverlay }) }) : /* @__PURE__ */ jsx(Header, { is1d: theme == null ? void 0 : theme.is1d, src: theme == null ? void 0 : theme.basePath }), renderNotificationsOverlay = !headless && isHeaderV2 && /* @__PURE__ */ jsx(HeaderNotificationsOverlay, {}), renderCookies = showCookiesConsent && /* @__PURE__ */ jsx(Alert, { type: "info", className: "m-12 rgpd", isConfirm: !0, position: "bottom-right", button: /* @__PURE__ */ jsx(
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
40
|
+
}, className), renderHeader = headless ? null : isHeaderV2 ? /* @__PURE__ */ jsx(Suspense, { fallback: null, children: /* @__PURE__ */ jsx(HeaderV2, { src: theme == null ? void 0 : theme.basePath, dataProduct: override == null ? void 0 : override.theme, onNotificationsClick: toggleOverlay }) }) : /* @__PURE__ */ jsx(Header, { is1d: theme == null ? void 0 : theme.is1d, src: theme == null ? void 0 : theme.basePath }), renderNotificationsOverlay = !headless && isHeaderV2 && /* @__PURE__ */ jsx(HeaderNotificationsOverlay, {}), 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: {
|
|
41
|
+
position: "top-right"
|
|
42
|
+
} });
|
|
43
|
+
return /* @__PURE__ */ jsxs("div", { className: clsx("layout", {
|
|
44
|
+
"layout-has-background-image": hasBackgroundImage
|
|
45
|
+
}), "data-product": hasBackgroundImage ? backgroundOverride == null ? void 0 : backgroundOverride.theme : void 0, children: [
|
|
60
46
|
renderHeader,
|
|
61
47
|
renderNotificationsOverlay,
|
|
62
48
|
/* @__PURE__ */ jsx("main", { className: classes, ...restProps, children }),
|
|
63
49
|
renderToaster,
|
|
64
|
-
renderCookies
|
|
65
|
-
isEdificeInProductHelp && /* @__PURE__ */ jsx(HelpZone, { isReady: isHelpZoneReady, isOpen: isHelpZoneOpen, onOpen: openHelpZone, onClose: closeHelpZone })
|
|
50
|
+
renderCookies
|
|
66
51
|
] });
|
|
67
52
|
};
|
|
68
53
|
export {
|
|
@@ -41,9 +41,5 @@ declare const PageLayout: {
|
|
|
41
41
|
({ children, onClose, closeButton, backdrop, className, ...props }: import('./components/PageLayoutOverlay').PageLayoutOverlayProps): import("react/jsx-runtime").JSX.Element;
|
|
42
42
|
displayName: string;
|
|
43
43
|
};
|
|
44
|
-
HelpZone: {
|
|
45
|
-
(): import("react/jsx-runtime").JSX.Element;
|
|
46
|
-
displayName: string;
|
|
47
|
-
};
|
|
48
44
|
};
|
|
49
45
|
export default PageLayout;
|
|
@@ -1,21 +1,15 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { useMemo, Children, isValidElement } from "react";
|
|
3
3
|
import clsx from "clsx";
|
|
4
|
-
import { useTranslation } from "react-i18next";
|
|
5
4
|
import PageLayoutBreadcrumb from "./components/PageLayoutBreadcrumb.js";
|
|
6
5
|
import PageLayoutContent from "./components/PageLayoutContent.js";
|
|
7
6
|
import PageLayoutHeader from "./components/PageLayoutHeader.js";
|
|
8
|
-
import PageLayoutHelpZone from "./components/PageLayoutHelpZone.js";
|
|
9
7
|
import PageLayoutOverlay from "./components/PageLayoutOverlay.js";
|
|
10
8
|
import PageLayoutSidebarLeft from "./components/PageLayoutSidebarLeft.js";
|
|
11
9
|
import PageLayoutSidebarRight from "./components/PageLayoutSidebarRight.js";
|
|
12
10
|
import { PageLayoutContext } from "./PageLayoutContext.js";
|
|
13
|
-
import useCookiesConsent from "../../hooks/useCookiesConsent/useCookiesConsent.js";
|
|
14
|
-
import useToast from "../../hooks/useToast/useToast.js";
|
|
15
|
-
import Alert from "../Alert/Alert.js";
|
|
16
|
-
import ButtonBeta from "../ButtonBeta/ButtonBeta.js";
|
|
17
11
|
function analyzeChildren(children) {
|
|
18
|
-
let hasLeftSidebar = !1, hasRightSidebar = !1, breadcrumb = null, overlay = null
|
|
12
|
+
let hasLeftSidebar = !1, hasRightSidebar = !1, breadcrumb = null, overlay = null;
|
|
19
13
|
const headerChildren = [], mainChildren = [];
|
|
20
14
|
return Children.toArray(children).forEach((child) => {
|
|
21
15
|
if (/* @__PURE__ */ isValidElement(child))
|
|
@@ -29,9 +23,6 @@ function analyzeChildren(children) {
|
|
|
29
23
|
case PageLayoutOverlay:
|
|
30
24
|
overlay = child;
|
|
31
25
|
break;
|
|
32
|
-
case PageLayoutHelpZone:
|
|
33
|
-
helpZone = child;
|
|
34
|
-
break;
|
|
35
26
|
case PageLayoutSidebarLeft:
|
|
36
27
|
hasLeftSidebar = !0, mainChildren.push(child);
|
|
37
28
|
break;
|
|
@@ -50,7 +41,6 @@ function analyzeChildren(children) {
|
|
|
50
41
|
hasRightSidebar,
|
|
51
42
|
breadcrumb,
|
|
52
43
|
overlay,
|
|
53
|
-
helpZone,
|
|
54
44
|
headerChildren,
|
|
55
45
|
mainChildren
|
|
56
46
|
};
|
|
@@ -64,22 +54,15 @@ const Root = ({
|
|
|
64
54
|
className,
|
|
65
55
|
...props
|
|
66
56
|
}) => {
|
|
67
|
-
const {
|
|
68
|
-
t
|
|
69
|
-
} = useTranslation(), {
|
|
70
|
-
showCookiesConsent,
|
|
71
|
-
handleConsultCookies,
|
|
72
|
-
handleCloseCookiesConsent
|
|
73
|
-
} = useCookiesConsent(), contextValue = useMemo(() => ({
|
|
57
|
+
const contextValue = useMemo(() => ({
|
|
74
58
|
variant,
|
|
75
59
|
scrollMode,
|
|
76
60
|
noPadding
|
|
77
|
-
}), [variant, scrollMode, noPadding]),
|
|
61
|
+
}), [variant, scrollMode, noPadding]), {
|
|
78
62
|
hasLeftSidebar,
|
|
79
63
|
hasRightSidebar,
|
|
80
64
|
breadcrumb,
|
|
81
65
|
overlay,
|
|
82
|
-
helpZone,
|
|
83
66
|
headerChildren,
|
|
84
67
|
mainChildren
|
|
85
68
|
} = analyzeChildren(children), mainAreaClasses = clsx("pagelayout-mainarea", {
|
|
@@ -88,29 +71,23 @@ const Root = ({
|
|
|
88
71
|
"has-right-sidebar-only": !hasLeftSidebar && hasRightSidebar,
|
|
89
72
|
"has-gap": withGap
|
|
90
73
|
}), isFullpage = variant === "fullpage";
|
|
91
|
-
return /* @__PURE__ */
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
mainChildren
|
|
99
|
-
] }),
|
|
100
|
-
overlay,
|
|
101
|
-
showCookiesConsent && /* @__PURE__ */ jsx(Alert, { type: "info", isConfirm: !0, position: "bottom-right", button: /* @__PURE__ */ jsx(ButtonBeta, { variant: "outline", onClick: handleConsultCookies, children: t("rgpd.cookies.banner.button.consult") }), onClose: handleCloseCookiesConsent, children: t("rgpd.cookies.banner.text1") })
|
|
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
|
|
102
81
|
] }),
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
] });
|
|
82
|
+
overlay
|
|
83
|
+
] }) });
|
|
106
84
|
}, PageLayout = Object.assign(Root, {
|
|
107
85
|
Header: PageLayoutHeader,
|
|
108
86
|
Breadcrumb: PageLayoutBreadcrumb,
|
|
109
87
|
SidebarLeft: PageLayoutSidebarLeft,
|
|
110
88
|
Content: PageLayoutContent,
|
|
111
89
|
SidebarRight: PageLayoutSidebarRight,
|
|
112
|
-
Overlay: PageLayoutOverlay
|
|
113
|
-
HelpZone: PageLayoutHelpZone
|
|
90
|
+
Overlay: PageLayoutOverlay
|
|
114
91
|
});
|
|
115
92
|
export {
|
|
116
93
|
PageLayout as default
|
|
@@ -1,19 +1,15 @@
|
|
|
1
1
|
import { jsx } from "react/jsx-runtime";
|
|
2
2
|
import clsx from "clsx";
|
|
3
3
|
import { usePageLayout } from "../PageLayoutContext.js";
|
|
4
|
-
import useBackground from "../../../hooks/useBackground/useBackground.js";
|
|
5
4
|
const PageLayoutContent = ({
|
|
6
5
|
children,
|
|
7
6
|
className,
|
|
8
7
|
...props
|
|
9
8
|
}) => {
|
|
10
9
|
const {
|
|
11
|
-
productOverride,
|
|
12
|
-
background
|
|
13
|
-
} = useBackground(), {
|
|
14
10
|
noPadding
|
|
15
11
|
} = usePageLayout();
|
|
16
|
-
return /* @__PURE__ */ jsx("main", {
|
|
12
|
+
return /* @__PURE__ */ jsx("main", { className: clsx("pagelayout-content", {
|
|
17
13
|
"pagelayout-content--no-padding": noPadding == null ? void 0 : noPadding.content
|
|
18
14
|
}, className), ...props, children });
|
|
19
15
|
};
|
|
@@ -13,7 +13,7 @@ declare const Table: import('react').ForwardRefExoticComponent<{
|
|
|
13
13
|
displayName: string;
|
|
14
14
|
};
|
|
15
15
|
Th: {
|
|
16
|
-
(props: React.
|
|
16
|
+
(props: React.HTMLAttributes<HTMLTableCellElement>): import("react/jsx-runtime").JSX.Element;
|
|
17
17
|
displayName: string;
|
|
18
18
|
};
|
|
19
19
|
Tbody: {
|
|
@@ -25,7 +25,7 @@ declare const Table: import('react').ForwardRefExoticComponent<{
|
|
|
25
25
|
displayName: string;
|
|
26
26
|
};
|
|
27
27
|
Td: {
|
|
28
|
-
(props: React.
|
|
28
|
+
(props: React.HTMLAttributes<HTMLTableCellElement>): import("react/jsx-runtime").JSX.Element;
|
|
29
29
|
displayName: string;
|
|
30
30
|
};
|
|
31
31
|
};
|