@edifice.io/react 2.6.6-develop-b2school.20260923094411 → 2.6.6-develop-pedago.20260923164322

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.
Files changed (82) hide show
  1. package/dist/components/Form/FormText.js +6 -11
  2. package/dist/components/Input/Input.d.ts +2 -11
  3. package/dist/components/Input/Input.js +21 -38
  4. package/dist/components/Label/Label.js +4 -4
  5. package/dist/components/Layout/Layout.js +5 -10
  6. package/dist/components/PageLayout/PageLayout.d.ts +0 -4
  7. package/dist/components/PageLayout/PageLayout.js +12 -22
  8. package/dist/components/PageLayout/components/PageLayoutContent.js +1 -5
  9. package/dist/components/Table/components/Table.d.ts +2 -2
  10. package/dist/components/Table/components/TableTd.d.ts +1 -1
  11. package/dist/components/Table/components/TableTh.d.ts +1 -1
  12. package/dist/components/index.d.ts +0 -2
  13. package/dist/homepage.js +28 -29
  14. package/dist/hooks/index.d.ts +0 -2
  15. package/dist/hooks/useClickOutside/useClickOutside.d.ts +1 -1
  16. package/dist/hooks/useClickOutside/useClickOutside.js +2 -3
  17. package/dist/hooks/useZendeskGuide/useZendeskGuide.d.ts +2 -14
  18. package/dist/hooks/useZendeskGuide/useZendeskGuide.js +24 -51
  19. package/dist/index.js +160 -168
  20. package/dist/modules/editor/components/EditorToolbar/EditorToolbar.Typography.js +3 -3
  21. package/dist/modules/homepage/components/Communities/Communities.js +35 -0
  22. package/dist/modules/homepage/components/Communities/CommunitiesContainer.d.ts +4 -2
  23. package/dist/modules/homepage/components/Communities/CommunitiesContainer.js +31 -0
  24. package/dist/modules/homepage/components/Communities/CommunitiesSkeleton.js +32 -0
  25. package/dist/modules/homepage/components/Communities/CommunityItem.d.ts +2 -1
  26. package/dist/modules/homepage/components/Communities/CommunityItem.js +28 -0
  27. package/dist/modules/homepage/components/Communities/useCommunities.d.ts +1 -4
  28. package/dist/modules/homepage/components/Communities/useCommunities.js +25 -0
  29. package/dist/modules/homepage/components/Header/Header.js +4 -11
  30. package/dist/modules/homepage/components/UserSpace/hooks/useProfileLinks.js +8 -18
  31. package/dist/modules/homepage/components/index.d.ts +1 -1
  32. package/dist/modules/widgets/index.d.ts +1 -1
  33. package/package.json +6 -6
  34. package/dist/components/LinkPill/LinkPill.d.ts +0 -45
  35. package/dist/components/LinkPill/LinkPill.js +0 -27
  36. package/dist/components/LinkPill/index.d.ts +0 -2
  37. package/dist/components/ModalBeta/ModalBeta.d.ts +0 -47
  38. package/dist/components/ModalBeta/ModalBeta.js +0 -62
  39. package/dist/components/ModalBeta/ModalBetaBody.d.ts +0 -19
  40. package/dist/components/ModalBeta/ModalBetaBody.js +0 -15
  41. package/dist/components/ModalBeta/ModalBetaContext.d.ts +0 -7
  42. package/dist/components/ModalBeta/ModalBetaContext.js +0 -15
  43. package/dist/components/ModalBeta/ModalBetaFooter.d.ts +0 -13
  44. package/dist/components/ModalBeta/ModalBetaFooter.js +0 -7
  45. package/dist/components/ModalBeta/ModalBetaHeader.d.ts +0 -23
  46. package/dist/components/ModalBeta/ModalBetaHeader.js +0 -31
  47. package/dist/components/ModalBeta/index.d.ts +0 -2
  48. package/dist/components/PageLayout/components/PageLayoutHelpZone.d.ts +0 -12
  49. package/dist/components/PageLayout/components/PageLayoutHelpZone.js +0 -6
  50. package/dist/hooks/useBackground/index.d.ts +0 -1
  51. package/dist/hooks/useBackground/useBackground.d.ts +0 -7
  52. package/dist/hooks/useBackground/useBackground.js +0 -16
  53. package/dist/hooks/useUserPreferences/index.d.ts +0 -1
  54. package/dist/hooks/useUserPreferences/useUserPreferences.d.ts +0 -9
  55. package/dist/hooks/useUserPreferences/useUserPreferences.js +0 -40
  56. package/dist/modules/HelpZone/HelpZone.d.ts +0 -13
  57. package/dist/modules/HelpZone/HelpZone.js +0 -52
  58. package/dist/modules/HelpZone/HelpZoneContainer.d.ts +0 -4
  59. package/dist/modules/HelpZone/HelpZoneContainer.js +0 -18
  60. package/dist/modules/HelpZone/index.d.ts +0 -3
  61. package/dist/modules/homepage/components/UsefulLinks/LinkForm.d.ts +0 -13
  62. package/dist/modules/homepage/components/UsefulLinks/LinkForm.js +0 -67
  63. package/dist/modules/homepage/components/UsefulLinks/UsefulLinks.d.ts +0 -6
  64. package/dist/modules/homepage/components/UsefulLinks/UsefulLinks.js +0 -29
  65. package/dist/modules/homepage/components/UsefulLinks/UsefulLinksContainer.d.ts +0 -1
  66. package/dist/modules/homepage/components/UsefulLinks/UsefulLinksContainer.js +0 -40
  67. package/dist/modules/homepage/components/UsefulLinks/UsefulLinksModal.d.ts +0 -11
  68. package/dist/modules/homepage/components/UsefulLinks/UsefulLinksModal.js +0 -65
  69. package/dist/modules/homepage/components/UsefulLinks/hooks/useUsefulLinksContainer.d.ts +0 -19
  70. package/dist/modules/homepage/components/UsefulLinks/hooks/useUsefulLinksContainer.js +0 -26
  71. package/dist/modules/homepage/components/UsefulLinks/index.d.ts +0 -5
  72. package/dist/modules/homepage/components/UsefulLinks/services/api/index.d.ts +0 -6
  73. package/dist/modules/homepage/components/UsefulLinks/services/api/index.js +0 -5
  74. package/dist/modules/homepage/components/UsefulLinks/services/api/usefulLinksService.d.ts +0 -31
  75. package/dist/modules/homepage/components/UsefulLinks/services/api/usefulLinksService.js +0 -50
  76. package/dist/modules/homepage/components/UsefulLinks/services/queries/usefulLinks.d.ts +0 -20
  77. package/dist/modules/homepage/components/UsefulLinks/services/queries/usefulLinks.js +0 -65
  78. package/dist/modules/icons/components/logo/IconLogoEdificeFull.d.ts +0 -7
  79. package/dist/modules/icons/components/logo/IconLogoEdificeFull.js +0 -26
  80. package/dist/modules/icons/components/logo/IconLogoEdificeSmall.d.ts +0 -7
  81. package/dist/modules/icons/components/logo/IconLogoEdificeSmall.js +0 -17
  82. package/dist/modules/icons/components/logo/index.d.ts +0 -2
@@ -6,7 +6,6 @@ import { Navbar } from "../../../../components/Layout/components/Navbar.js";
6
6
  import { NavItem } from "../../../../components/Layout/components/NavItem.js";
7
7
  import { NavLink } from "../../../../components/Layout/components/NavLink.js";
8
8
  import useHeader from "../../../../components/Layout/hooks/useHeader.js";
9
- import SvgIconSetBackground from "../../../icons/components/IconSetBackground.js";
10
9
  import SvgIconCommunitiesBeta from "../../../icons/components/nav/IconCommunitiesBeta.js";
11
10
  import SvgIconDisconnect from "../../../icons/components/nav/IconDisconnect.js";
12
11
  import SvgIconHomeBeta from "../../../icons/components/nav/IconHomeBeta.js";
@@ -87,16 +86,10 @@ const Header = ({
87
86
  ] }),
88
87
  /* @__PURE__ */ jsxs(NavItem, { className: "position-relative", ref: userRef, id: popoverUserId, "aria-haspopup": "true", "aria-expanded": isUserHovered, "data-testid": "header-user-menu-button", children: [
89
88
  /* @__PURE__ */ jsx(NavLink, { link: "/userbook/mon-compte", translate: t("navbar.myaccount"), "data-testid": "header-user-profile-button", children: /* @__PURE__ */ jsx(Avatar, { alt: userName, size: "sm", src: userAvatar, variant: "circle", className: "bg-white", width: "32", height: "32" }) }),
90
- /* @__PURE__ */ jsx(Popover, { align: "end", className: "widget", id: popoverUserId, isVisible: isUserHovered, children: /* @__PURE__ */ jsxs(PopoverBody, { children: [
91
- /* @__PURE__ */ jsxs("a", { href: "/timeline/customize", className: "nav-link customize d-flex align-items-center gap-8", "data-testid": "header-customize-button", children: [
92
- /* @__PURE__ */ jsx(SvgIconSetBackground, { className: "icon" }),
93
- /* @__PURE__ */ jsx("span", { id: "cutomize-label", className: "nav-text", children: t("navbar.customize") })
94
- ] }),
95
- /* @__PURE__ */ jsxs("a", { href: "/auth/logout?callback=" + ((theme == null ? void 0 : theme.logoutCallback) ?? ""), className: "nav-link logout d-flex align-items-center gap-8", "data-testid": "header-logout-button", children: [
96
- /* @__PURE__ */ jsx(SvgIconDisconnect, { className: "icon logout" }),
97
- /* @__PURE__ */ jsx("span", { id: "logout-label", className: "nav-text", children: t("navbar.disconnect") })
98
- ] })
99
- ] }) })
89
+ /* @__PURE__ */ jsx(Popover, { align: "end", className: "widget", id: popoverUserId, isVisible: isUserHovered, children: /* @__PURE__ */ jsx(PopoverBody, { children: /* @__PURE__ */ jsxs("a", { href: "/auth/logout?callback=" + ((theme == null ? void 0 : theme.logoutCallback) ?? ""), className: "nav-link logout d-flex align-items-center gap-8", "data-testid": "header-logout-button", children: [
90
+ /* @__PURE__ */ jsx(SvgIconDisconnect, { className: "icon logout" }),
91
+ /* @__PURE__ */ jsx("span", { id: "logout-label", className: "nav-text", children: t("navbar.disconnect") })
92
+ ] }) }) })
100
93
  ] })
101
94
  ] })
102
95
  ] }) });
@@ -17,20 +17,18 @@ function useProfileLinks(profile) {
17
17
  structure: structureId
18
18
  });
19
19
  return `${baseUrl}?${params.toString()}`;
20
- }, buildClassesUrl = (parameters, classIds = []) => {
21
- const params = new URLSearchParams(parameters);
20
+ }, buildClassesUrl = (classIds = []) => {
21
+ const params = new URLSearchParams({
22
+ filters: "groups",
23
+ structure: structureId
24
+ });
22
25
  return classIds.forEach((c) => params.append("class", String(c))), `${baseUrl}?${params.toString()}`;
23
26
  };
24
27
  switch (profile) {
25
28
  case "Teacher":
26
29
  return [{
27
30
  text: t("homepage.userspace.teacher.link.classes"),
28
- url: buildClassesUrl(
29
- {
30
- filters: "groups"
31
- }
32
- /* Do not explicitely add classes ids, because none <=> see all*/
33
- )
31
+ url: buildClassesUrl(user.classes)
34
32
  }];
35
33
  case "Student":
36
34
  return [{
@@ -38,12 +36,7 @@ function useProfileLinks(profile) {
38
36
  url: "/userbook/annuaire#/search?filters=groups&profile=Teacher"
39
37
  }, {
40
38
  text: t("homepage.userspace.student.link.classes"),
41
- url: buildClassesUrl(
42
- {
43
- filters: "groups"
44
- }
45
- /* Do not explicitely add classes ids, because none <=> see all*/
46
- )
39
+ url: buildClassesUrl(user.classes)
47
40
  }];
48
41
  case "Relative":
49
42
  return children != null && children.length ? children.map((child) => {
@@ -52,10 +45,7 @@ function useProfileLinks(profile) {
52
45
  text: t("homepage.userspace.relative.link.classes", {
53
46
  childName: child.firstName
54
47
  }),
55
- url: buildClassesUrl({
56
- filters: "groups",
57
- structure: structureId
58
- }, (_a2 = child.classes) == null ? void 0 : _a2.map(({
48
+ url: buildClassesUrl((_a2 = child.classes) == null ? void 0 : _a2.map(({
59
49
  id
60
50
  }) => id))
61
51
  };
@@ -5,5 +5,5 @@ export * from './LastInfos';
5
5
  export * from './MessageFlashList';
6
6
  export * from './Notifications';
7
7
  export * from './SchoolSpace';
8
- export * from './UsefulLinks';
9
8
  export * from './UserSpace';
9
+ export * from './Communities';
@@ -1,2 +1,2 @@
1
- export * from './BookmarkedApps';
2
1
  export * from './Widget';
2
+ export * from './BookmarkedApps';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@edifice.io/react",
3
- "version": "2.6.6-develop-b2school.20260923094411",
3
+ "version": "2.6.6-develop-pedago.20260923164322",
4
4
  "description": "Edifice React Library",
5
5
  "keywords": [
6
6
  "react",
@@ -140,9 +140,9 @@
140
140
  "swiper": "10.1.0",
141
141
  "ua-parser-js": "1.0.36",
142
142
  "zustand": "4.5.7",
143
- "@edifice.io/bootstrap": "2.6.6-develop-b2school.20260923094411",
144
- "@edifice.io/tiptap-extensions": "2.6.6-develop-b2school.20260923094411",
145
- "@edifice.io/utilities": "2.6.6-develop-b2school.20260923094411"
143
+ "@edifice.io/utilities": "2.6.6-develop-pedago.20260923164322",
144
+ "@edifice.io/bootstrap": "2.6.6-develop-pedago.20260923164322",
145
+ "@edifice.io/tiptap-extensions": "2.6.6-develop-pedago.20260923164322"
146
146
  },
147
147
  "devDependencies": {
148
148
  "@babel/plugin-transform-react-pure-annotations": "7.27.1",
@@ -173,8 +173,8 @@
173
173
  "vite": "5.4.14",
174
174
  "vite-plugin-dts": "4.5.4",
175
175
  "vite-tsconfig-paths": "5.1.4",
176
- "@edifice.io/client": "2.6.6-develop-b2school.20260923094411",
177
- "@edifice.io/config": "2.6.6-develop-b2school.20260923094411"
176
+ "@edifice.io/client": "2.6.6-develop-pedago.20260923164322",
177
+ "@edifice.io/config": "2.6.6-develop-pedago.20260923164322"
178
178
  },
179
179
  "peerDependencies": {
180
180
  "@react-spring/web": "9.7.5",
@@ -1,45 +0,0 @@
1
- import { ReactNode } from 'react';
2
- export type LinkPillIllustrationType = 'icon' | 'img';
3
- export type LinkPillIllustrationPosition = 'left' | 'right';
4
- export interface LinkPillProps {
5
- /**
6
- * URL opened in a new tab when the pill is clicked.
7
- */
8
- href: string;
9
- /**
10
- * Text displayed inside the pill (single line, ellipsis on overflow).
11
- */
12
- label: string;
13
- /**
14
- * Optional second line displayed below the label (single line, ellipsis
15
- * on overflow). Does not affect the label's font size.
16
- */
17
- subtitle?: string;
18
- /**
19
- * Illustration node. Defaults to `<IconLink />` for the `icon` type.
20
- * For the `img` type, the caller must provide an `<img>` element.
21
- */
22
- illustration?: ReactNode;
23
- /**
24
- * `icon` (default): illustration wrapped in a small rounded box.
25
- * `img`: illustration rendered as a 36x36 rounded square (e.g. a favicon).
26
- */
27
- illustrationType?: LinkPillIllustrationType;
28
- /**
29
- * Side the illustration is displayed on.
30
- */
31
- illustrationPosition?: LinkPillIllustrationPosition;
32
- /**
33
- * Optional class for styling purpose
34
- */
35
- className?: string;
36
- }
37
- /**
38
- * LinkPill – design system component used to display a link to an
39
- * external resource as a small rounded pill.
40
- */
41
- declare const LinkPill: {
42
- ({ href, label, subtitle, illustration, illustrationType, illustrationPosition, className, }: LinkPillProps): import("react/jsx-runtime").JSX.Element;
43
- displayName: string;
44
- };
45
- export default LinkPill;
@@ -1,27 +0,0 @@
1
- import { jsx, jsxs, Fragment } from "react/jsx-runtime";
2
- import clsx from "clsx";
3
- import SvgIconLink from "../../modules/icons/components/IconLink.js";
4
- const LinkPill = ({
5
- href,
6
- label,
7
- subtitle,
8
- illustration,
9
- illustrationType = "icon",
10
- illustrationPosition = "left",
11
- className
12
- }) => {
13
- const illustrationNode = illustrationType === "icon" ? /* @__PURE__ */ jsx("span", { className: "link-pill-icon", children: illustration ?? /* @__PURE__ */ jsx(SvgIconLink, {}) }) : /* @__PURE__ */ jsx("span", { className: "link-pill-image", children: illustration }), contentNode = /* @__PURE__ */ jsxs("span", { className: "link-pill-content", children: [
14
- /* @__PURE__ */ jsx("span", { className: "link-pill-label", title: label, children: label }),
15
- subtitle && /* @__PURE__ */ jsx("span", { className: "link-pill-subtitle", title: subtitle, children: subtitle })
16
- ] });
17
- return /* @__PURE__ */ jsx("a", { href, target: "_blank", rel: "noopener noreferrer", "data-testid": "link-pill", className: clsx("link-pill", `link-pill--illustration-${illustrationPosition}`, className), children: illustrationPosition === "left" ? /* @__PURE__ */ jsxs(Fragment, { children: [
18
- illustrationNode,
19
- contentNode
20
- ] }) : /* @__PURE__ */ jsxs(Fragment, { children: [
21
- contentNode,
22
- illustrationNode
23
- ] }) });
24
- };
25
- export {
26
- LinkPill as default
27
- };
@@ -1,2 +0,0 @@
1
- export { default as LinkPill } from './LinkPill';
2
- export * from './LinkPill';
@@ -1,47 +0,0 @@
1
- export type ModalBetaElement = HTMLDivElement;
2
- export type ModalBetaSize = 's' | 'm' | 'l' | 'xl';
3
- export interface ModalBetaProps {
4
- /**
5
- * Modal id (useful when multiple modal on the same page)
6
- */
7
- id: string;
8
- /**
9
- * Modal testid
10
- */
11
- ['data-testid']?: string;
12
- /**
13
- * Is Modal Open
14
- */
15
- isOpen: boolean;
16
- /**
17
- * Function to call when closing modal
18
- */
19
- onModalClose: () => void;
20
- /**
21
- * Size of the modal (width, padding and corner radius)
22
- */
23
- size?: ModalBetaSize;
24
- /**
25
- * ID of the HTML element to receive focus when modal is active.
26
- */
27
- focusId?: string;
28
- /**
29
- * Children
30
- */
31
- children: React.ReactNode;
32
- }
33
- declare const ModalBeta: import('react').ForwardRefExoticComponent<ModalBetaProps & import('react').RefAttributes<HTMLDivElement>> & {
34
- Header: {
35
- ({ onModalClose, children, subtitle, }: import('./ModalBetaHeader').ModalBetaHeaderProps): import("react/jsx-runtime").JSX.Element;
36
- displayName: string;
37
- };
38
- Body: {
39
- ({ children, className }: import('./ModalBetaBody').ModalBetaBodyProps): import("react/jsx-runtime").JSX.Element;
40
- displayName: string;
41
- };
42
- Footer: {
43
- ({ children }: import('./ModalBetaFooter').ModalBetaFooterProps): import("react/jsx-runtime").JSX.Element;
44
- displayName: string;
45
- };
46
- };
47
- export default ModalBeta;
@@ -1,62 +0,0 @@
1
- import { jsx, jsxs, Fragment } from "react/jsx-runtime";
2
- import { forwardRef, useCallback, useEffect } from "react";
3
- import { useTransition, animated } from "@react-spring/web";
4
- import clsx from "clsx";
5
- import ModalBetaBody from "./ModalBetaBody.js";
6
- import { ModalBetaContext } from "./ModalBetaContext.js";
7
- import ModalBetaFooter from "./ModalBetaFooter.js";
8
- import ModalBetaHeader from "./ModalBetaHeader.js";
9
- import useClickOutside from "../../hooks/useClickOutside/useClickOutside.js";
10
- import useTrapFocus from "../../hooks/useTrapFocus/useTrapFocus.js";
11
- import useKeyPress from "../../hooks/useKeyPress/useKeyPress.js";
12
- const Root = /* @__PURE__ */ forwardRef(({
13
- id,
14
- isOpen,
15
- onModalClose,
16
- size = "m",
17
- focusId,
18
- children,
19
- ...otherDivProps
20
- }, ref) => {
21
- const ariaLabelId = `aria_label_${id}`, ariaDescriptionId = `aria_desc_${id}`, modalRef = useClickOutside(onModalClose, void 0, void 0, isOpen), trapRef = useTrapFocus(isOpen), setDialogRef = useCallback((node) => {
22
- modalRef.current = node, trapRef.current = node;
23
- }, [modalRef, trapRef]);
24
- useKeyPress(onModalClose, ["Escape"]), useEffect(() => {
25
- if (isOpen && (document.body.style.overflow = "hidden", focusId)) {
26
- const elem = document.getElementById(focusId);
27
- elem == null || elem.focus();
28
- }
29
- return () => {
30
- document.body.style.overflow = "";
31
- };
32
- }, [focusId, isOpen]);
33
- const modalClasses = clsx("modal-beta", `modal-beta--${size}`), modalContextValue = {
34
- ariaLabelId,
35
- ariaDescriptionId,
36
- focusId
37
- }, transition = useTransition(isOpen, {
38
- from: {
39
- y: -20,
40
- opacity: 0
41
- },
42
- enter: {
43
- y: 0,
44
- opacity: 1
45
- },
46
- leave: {
47
- y: 20,
48
- opacity: 0
49
- }
50
- });
51
- return /* @__PURE__ */ jsx(ModalBetaContext.Provider, { value: modalContextValue, children: transition((style, isOpen2) => /* @__PURE__ */ jsxs(Fragment, { children: [
52
- isOpen2 && /* @__PURE__ */ jsx(animated.div, { id, ref, role: "dialog", "aria-modal": "true", "aria-labelledby": ariaLabelId, "aria-describedby": ariaDescriptionId, className: modalClasses, style, tabIndex: -1, ...otherDivProps, children: /* @__PURE__ */ jsx("div", { id: `${id}_ref`, ref: setDialogRef, className: "modal-beta-dialog", children: /* @__PURE__ */ jsx("div", { className: "modal-beta-content", children }) }) }),
53
- isOpen2 && /* @__PURE__ */ jsx("div", { className: "modal-beta-backdrop" })
54
- ] })) });
55
- }), ModalBeta = Object.assign(Root, {
56
- Header: ModalBetaHeader,
57
- Body: ModalBetaBody,
58
- Footer: ModalBetaFooter
59
- });
60
- export {
61
- ModalBeta as default
62
- };
@@ -1,19 +0,0 @@
1
- import { ReactNode } from 'react';
2
- export interface ModalBetaBodyProps {
3
- /**
4
- * Children
5
- */
6
- children: ReactNode;
7
- /**
8
- * Optional class for styling purpose
9
- */
10
- className?: string;
11
- }
12
- /**
13
- * ModalBeta Body
14
- */
15
- declare const ModalBetaBody: {
16
- ({ children, className }: ModalBetaBodyProps): import("react/jsx-runtime").JSX.Element;
17
- displayName: string;
18
- };
19
- export default ModalBetaBody;
@@ -1,15 +0,0 @@
1
- import { jsx } from "react/jsx-runtime";
2
- import clsx from "clsx";
3
- import { useModalBetaContext } from "./ModalBetaContext.js";
4
- const ModalBetaBody = ({
5
- children,
6
- className
7
- }) => {
8
- const {
9
- ariaDescriptionId
10
- } = useModalBetaContext();
11
- return /* @__PURE__ */ jsx("div", { id: ariaDescriptionId, className: clsx("modal-beta-body", className), children });
12
- };
13
- export {
14
- ModalBetaBody as default
15
- };
@@ -1,7 +0,0 @@
1
- export interface ModalBetaContextProps {
2
- ariaLabelId: string;
3
- ariaDescriptionId: string;
4
- focusId: string | undefined;
5
- }
6
- export declare const ModalBetaContext: import('react').Context<ModalBetaContextProps>;
7
- export declare const useModalBetaContext: () => ModalBetaContextProps;
@@ -1,15 +0,0 @@
1
- import { createContext, useContext } from "react";
2
- const ModalBetaContext = /* @__PURE__ */ createContext({
3
- ariaLabelId: "",
4
- ariaDescriptionId: "",
5
- focusId: ""
6
- }), useModalBetaContext = () => {
7
- const context = useContext(ModalBetaContext);
8
- if (!context)
9
- throw new Error("Cannot be rendered outside the ModalBeta component");
10
- return context;
11
- };
12
- export {
13
- ModalBetaContext,
14
- useModalBetaContext
15
- };
@@ -1,13 +0,0 @@
1
- import { ReactNode } from 'react';
2
- export interface ModalBetaFooterProps {
3
- children: ReactNode;
4
- }
5
- /**
6
- * ModalBeta Footer — right-aligns its children, typically two ButtonBeta
7
- * (a ghost/tertiary action followed by the primary filled action).
8
- */
9
- declare const ModalBetaFooter: {
10
- ({ children }: ModalBetaFooterProps): import("react/jsx-runtime").JSX.Element;
11
- displayName: string;
12
- };
13
- export default ModalBetaFooter;
@@ -1,7 +0,0 @@
1
- import { jsx } from "react/jsx-runtime";
2
- const ModalBetaFooter = ({
3
- children
4
- }) => /* @__PURE__ */ jsx("div", { className: "modal-beta-footer", children });
5
- export {
6
- ModalBetaFooter as default
7
- };
@@ -1,23 +0,0 @@
1
- import { ReactNode } from 'react';
2
- export interface ModalBetaHeaderProps {
3
- /**
4
- * Method called on modal close
5
- */
6
- onModalClose: () => void;
7
- /**
8
- * Modal title
9
- */
10
- children: ReactNode;
11
- /**
12
- * Optional text displayed below the title
13
- */
14
- subtitle?: ReactNode;
15
- }
16
- /**
17
- * ModalBeta Header
18
- */
19
- declare const ModalBetaHeader: {
20
- ({ onModalClose, children, subtitle, }: ModalBetaHeaderProps): import("react/jsx-runtime").JSX.Element;
21
- displayName: string;
22
- };
23
- export default ModalBetaHeader;
@@ -1,31 +0,0 @@
1
- import { jsxs, jsx } from "react/jsx-runtime";
2
- import { useRef, useEffect } from "react";
3
- import { useTranslation } from "react-i18next";
4
- import SvgIconClose from "../../modules/icons/components/IconClose.js";
5
- import ButtonBeta from "../ButtonBeta/ButtonBeta.js";
6
- import { useModalBetaContext } from "./ModalBetaContext.js";
7
- const ModalBetaHeader = ({
8
- onModalClose,
9
- children,
10
- subtitle
11
- }) => {
12
- const {
13
- ariaLabelId,
14
- focusId
15
- } = useModalBetaContext(), closeButtonRef = useRef(null), {
16
- t
17
- } = useTranslation();
18
- return useEffect(() => {
19
- var _a;
20
- focusId || (_a = closeButtonRef.current) == null || _a.focus();
21
- }, [focusId]), /* @__PURE__ */ jsxs("div", { className: "modal-beta-header", children: [
22
- /* @__PURE__ */ jsxs("div", { className: "modal-beta-title-row", children: [
23
- /* @__PURE__ */ jsx("h2", { id: ariaLabelId, className: "modal-beta-title", tabIndex: -1, children }),
24
- /* @__PURE__ */ jsx(ButtonBeta, { ref: closeButtonRef, "aria-label": t("close"), title: t("close"), type: "button", variant: "ghost", color: "tertiary", leftIcon: /* @__PURE__ */ jsx(SvgIconClose, {}), onClick: onModalClose })
25
- ] }),
26
- subtitle && /* @__PURE__ */ jsx("p", { className: "modal-beta-subtitle", children: subtitle })
27
- ] });
28
- };
29
- export {
30
- ModalBetaHeader as default
31
- };
@@ -1,2 +0,0 @@
1
- export { default as ModalBeta } from './ModalBeta';
2
- export * from './ModalBeta';
@@ -1,12 +0,0 @@
1
- /**
2
- * Opt-in slot: renders the floating Edifice help zone (badge + support
3
- * button). Requires `EdificeClientProvider` and `EdificeThemeProvider`
4
- * higher in the tree (used internally by `useZendeskGuide`) — kept opt-in
5
- * rather than baked into `PageLayout` itself so standalone consumers
6
- * without those providers don't crash at render.
7
- */
8
- declare const PageLayoutHelpZone: {
9
- (): import("react/jsx-runtime").JSX.Element;
10
- displayName: string;
11
- };
12
- export default PageLayoutHelpZone;
@@ -1,6 +0,0 @@
1
- import { jsx } from "react/jsx-runtime";
2
- import { HelpZoneContainer } from "../../../modules/HelpZone/HelpZoneContainer.js";
3
- const PageLayoutHelpZone = () => /* @__PURE__ */ jsx(HelpZoneContainer, {});
4
- export {
5
- PageLayoutHelpZone as default
6
- };
@@ -1 +0,0 @@
1
- export { default as useBackground, type Background } from './useBackground';
@@ -1,7 +0,0 @@
1
- export type Background = 'default' | 'pink-200' | 'yellow-200' | 'orange-200' | 'blue-200' | 'green-200';
2
- declare const _default: () => {
3
- background: Background;
4
- isBackgroundImageOverridden: boolean;
5
- productOverride: string | undefined;
6
- };
7
- export default _default;
@@ -1,16 +0,0 @@
1
- import useUiOverride from "../useUiOverride/useUiOverride.js";
2
- import useUserPreferences from "../useUserPreferences/useUserPreferences.js";
3
- const useBackground = () => {
4
- const backgroundOverride = useUiOverride("layout.background"), backgroundDefault = useUiOverride("background.default"), {
5
- preferences
6
- } = useUserPreferences(), isBackgroundImageOverridden = (backgroundOverride == null ? void 0 : backgroundOverride.variant) === "image";
7
- return {
8
- /* Actual background is either : user's prefered value, theme-conf overriden value or 'default' */
9
- background: (preferences == null ? void 0 : preferences.background) ?? (backgroundDefault == null ? void 0 : backgroundDefault.variant) ?? "default",
10
- isBackgroundImageOverridden,
11
- productOverride: backgroundOverride == null ? void 0 : backgroundOverride.theme
12
- };
13
- };
14
- export {
15
- useBackground as default
16
- };
@@ -1 +0,0 @@
1
- export { default, useUserPreferences } from './useUserPreferences';
@@ -1,9 +0,0 @@
1
- export declare const USER_PREFERENCES_QUERY_KEY: string[];
2
- export declare function useUserPreferences<T extends Record<string, any> = Record<string, any>>(): {
3
- preferences: T | undefined;
4
- isLoading: boolean;
5
- isError: boolean;
6
- refetch: (options?: import('@tanstack/react-query').RefetchOptions) => Promise<import('@tanstack/react-query').QueryObserverResult<T, Error>>;
7
- savePreferences: (preferences: T) => Promise<T>;
8
- };
9
- export default useUserPreferences;
@@ -1,40 +0,0 @@
1
- import { odeServices } from "@edifice.io/client";
2
- import { useQueryClient, useQuery, queryOptions, useMutation } from "@tanstack/react-query";
3
- const USER_PREFERENCES_QUERY_KEY = ["user", "preferences"];
4
- function useUserPreferences() {
5
- const queryClient = useQueryClient(), {
6
- data: preferences,
7
- isLoading,
8
- isError,
9
- refetch
10
- } = useQuery(queryOptions({
11
- queryKey: USER_PREFERENCES_QUERY_KEY,
12
- queryFn: () => odeServices.conf().getUserPreferences(),
13
- staleTime: 15e3
14
- })), mutation = useMutation({
15
- mutationFn: (preferences2) => odeServices.conf().saveUserPreferences(preferences2),
16
- onMutate: async (preferences2) => {
17
- queryClient.setQueryData(USER_PREFERENCES_QUERY_KEY, preferences2);
18
- },
19
- onError: () => {
20
- queryClient.invalidateQueries({
21
- queryKey: USER_PREFERENCES_QUERY_KEY
22
- });
23
- },
24
- onSuccess: (preferences2) => {
25
- queryClient.setQueryData(USER_PREFERENCES_QUERY_KEY, preferences2);
26
- }
27
- });
28
- return {
29
- preferences,
30
- isLoading,
31
- isError,
32
- refetch,
33
- savePreferences: (preferences2) => mutation.mutateAsync(preferences2)
34
- };
35
- }
36
- export {
37
- USER_PREFERENCES_QUERY_KEY,
38
- useUserPreferences as default,
39
- useUserPreferences
40
- };
@@ -1,13 +0,0 @@
1
- export interface HelpZoneProps {
2
- /** True once the support widget is loaded and can be opened. */
3
- isReady: boolean;
4
- /** True while the support panel is open. */
5
- isOpen: boolean;
6
- onOpen: () => void;
7
- onClose: () => void;
8
- }
9
- declare const HelpZone: {
10
- ({ isReady, isOpen, onOpen, onClose }: HelpZoneProps): import('react').ReactPortal | null;
11
- displayName: string;
12
- };
13
- export default HelpZone;
@@ -1,52 +0,0 @@
1
- import { jsxs, jsx } from "react/jsx-runtime";
2
- import { useState, useRef, useEffect } from "react";
3
- import clsx from "clsx";
4
- import { createPortal } from "react-dom";
5
- import { useTranslation } from "react-i18next";
6
- import SvgIconQuestion from "../icons/components/IconQuestion.js";
7
- import Tooltip from "../../components/Tooltip/Tooltip.js";
8
- import SvgIconLogoEdificeSmall from "../icons/components/logo/IconLogoEdificeSmall.js";
9
- import SvgIconLogoEdificeFull from "../icons/components/logo/IconLogoEdificeFull.js";
10
- import ButtonBeta from "../../components/ButtonBeta/ButtonBeta.js";
11
- const HelpZone = ({
12
- isReady,
13
- isOpen,
14
- onOpen,
15
- onClose
16
- }) => {
17
- const {
18
- t
19
- } = useTranslation(), [portalRoot, setPortalRoot] = useState(null), [isCompact, setIsCompact] = useState(!1), questionButtonRef = useRef(null);
20
- if (useEffect(() => (document.body.classList.add("help-zone-active"), setPortalRoot(document.getElementById("portal")), () => {
21
- document.body.classList.remove("help-zone-active");
22
- }), []), useEffect(() => {
23
- if (isCompact)
24
- return;
25
- const goCompact = () => setIsCompact(!0), handleClick = (event) => {
26
- questionButtonRef.current && event.target instanceof Node && questionButtonRef.current.contains(event.target) || goCompact();
27
- };
28
- return document.addEventListener("scroll", goCompact, {
29
- capture: !0,
30
- passive: !0
31
- }), document.addEventListener("click", handleClick), () => {
32
- document.removeEventListener("scroll", goCompact, {
33
- capture: !0
34
- }), document.removeEventListener("click", handleClick);
35
- };
36
- }, [isCompact]), !isReady || !portalRoot)
37
- return null;
38
- const handleOpenHelpZone = () => isOpen ? onClose() : onOpen();
39
- return /* @__PURE__ */ createPortal(/* @__PURE__ */ jsxs("div", { className: clsx("help-zone", {
40
- "help-zone--open": isOpen
41
- }), "aria-hidden": isOpen, children: [
42
- /* @__PURE__ */ jsx("a", { className: "help-zone-badge", href: "https://edifice.io/releases/", target: "_blank", rel: "noopener noreferrer", "aria-label": t("help-zone.edifice-releases-notes"), children: /* @__PURE__ */ jsx(Tooltip, { message: t("help-zone.edifice-releases-notes"), placement: "top", className: "help-zone-tooltip", children: /* @__PURE__ */ jsx("span", { className: clsx("help-zone-logo", {
43
- "help-zone-logo--compact": isCompact,
44
- "help-zone-logo--full": !isCompact
45
- }), children: isCompact ? /* @__PURE__ */ jsx(SvgIconLogoEdificeSmall, { width: 18, height: 18 }) : /* @__PURE__ */ jsx(SvgIconLogoEdificeFull, { width: 81, height: 18 }) }) }) }),
46
- /* @__PURE__ */ jsx("span", { className: "help-zone-divider" }),
47
- /* @__PURE__ */ jsx(ButtonBeta, { ref: questionButtonRef, className: "help-zone-question", "aria-label": t("help-zone.support.open"), color: "tertiary", variant: "ghost", onClick: handleOpenHelpZone, children: /* @__PURE__ */ jsx(Tooltip, { message: t("help-zone.support.open"), placement: "top", children: /* @__PURE__ */ jsx(SvgIconQuestion, { width: 24, height: 24, color: "white" }) }) })
48
- ] }), portalRoot);
49
- };
50
- export {
51
- HelpZone as default
52
- };
@@ -1,4 +0,0 @@
1
- export declare function HelpZoneContainer(): import("react/jsx-runtime").JSX.Element;
2
- export declare namespace HelpZoneContainer {
3
- var displayName: string;
4
- }