@edifice.io/react 2.6.0-develop-b2school.20260724115233 → 2.6.0-develop-pedago.20260730111054

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.
@@ -6,6 +6,11 @@ export type NotificationBadgeVariant = {
6
6
  type: 'notification';
7
7
  level: 'success' | 'warning' | 'danger' | 'info';
8
8
  };
9
+ /** Badge variant : status */
10
+ export type StatusBadgeVariant = {
11
+ type: 'status';
12
+ level: 'validate' | 'success' | 'warning' | 'danger' | 'info';
13
+ };
9
14
  /** Badge variant : content */
10
15
  export type ContentBadgeVariant = {
11
16
  type: 'content';
@@ -27,22 +32,29 @@ export type LinkBadgeVariant = {
27
32
  type: 'link';
28
33
  };
29
34
  /**
30
- * Badge variant : beta.
31
- * Beta Badge is used to indicate that a feature is in beta phase.
32
- * The color prop allows to customize the badge color to match the app color.
33
- * Defaults to black if not provided.
34
- * Beta Badge has a fixed text 'BÊTA' unless children is provided.
35
- * If app is provided, the color of the Beta Badge is derived from the application colors.
36
- * Example:
37
- * <Badge variant={{ type: 'beta', color: '#823AA1', app: myApp }} />
38
- * where myApp is of type IWebApp.
35
+ * Badge variant : App Version.
36
+ *
37
+ * Displays a badge showing the app version, for example: BÊTA, ALPHA, NEW or a custom version label.
38
+ *
39
+ * Default label is BÊTA unless a label is provided as a children of the component.
40
+ * Example of usage:
41
+ * <Badge variant={{ type: 'appVersion', app: myApp }}>NEW</Badge>
42
+ *
43
+ * The color prop allows to customize the badge color to match the app color (Defaults to black if not provided).
44
+ * Example of usage:
45
+ * <Badge variant={{ type: 'appVersion', color: '#823AA1' }} />
46
+ *
47
+ * If app prop is provided, the color of the App Version Badge is derived from the application colors,
48
+ * for example if the app provided is Blog then the Badge will have the same color as Blog app.
49
+ * Example of usage:
50
+ * <Badge variant={{ type: 'appVersion', app: blog }} />
39
51
  */
40
- export type BetaBadgeVariant = {
41
- type: 'beta';
52
+ export type AppVersionBadgeVariant = {
53
+ type: 'appVersion';
42
54
  color?: string;
43
55
  app?: IWebApp;
44
56
  };
45
- export type BadgeVariants = NotificationBadgeVariant | ContentBadgeVariant | ProfileBadgeVariant | ChipBadgeVariant | LinkBadgeVariant | BetaBadgeVariant;
57
+ export type BadgeVariants = NotificationBadgeVariant | StatusBadgeVariant | ContentBadgeVariant | ProfileBadgeVariant | ChipBadgeVariant | LinkBadgeVariant | AppVersionBadgeVariant;
46
58
  export interface BadgeProps extends React.ComponentPropsWithRef<'span'> {
47
59
  /**
48
60
  * Badge variant : notification, link or profile (Teacher|Student|Relative|Personnel)
@@ -51,7 +63,6 @@ export interface BadgeProps extends React.ComponentPropsWithRef<'span'> {
51
63
  variant?: BadgeVariants;
52
64
  /**
53
65
  * Text or icon (or whatever) to render as children elements.
54
- * Defaults to 'BÊTA' for beta variant.
55
66
  */
56
67
  children?: ReactNode;
57
68
  /**
@@ -16,16 +16,16 @@ const Badge = /* @__PURE__ */ forwardRef(({
16
16
  getBackgroundLightIconClass,
17
17
  getBorderIconClass
18
18
  } = useEdificeIcons();
19
- let badgeColorClassName = "";
20
- if (variant.type === "beta" && variant.app) {
19
+ let appVersionBadgeColorClassName = "";
20
+ if (variant.type === "appVersion" && variant.app) {
21
21
  const colorAppClassName = getIconClass(variant.app), backgroundLightAppClassName = getBackgroundLightIconClass(variant.app), borderAppClassName = getBorderIconClass(variant.app);
22
- badgeColorClassName = `${colorAppClassName} ${backgroundLightAppClassName} ${borderAppClassName}`;
22
+ appVersionBadgeColorClassName = `${colorAppClassName} ${backgroundLightAppClassName} ${borderAppClassName}`;
23
23
  }
24
- const classes = clsx("badge rounded-pill", (variant.type === "content" || variant.type === "user") && "background" in variant ? "bg-gray-200" : (variant.type === "content" || variant.type === "user") && !("background" in variant) ? "border border-0" : "", variant.type === "content" && `text-${variant.level}`, variant.type === "notification" && `badge-notification bg-${variant.level} text-light border border-0`, variant.type === "user" && `badge-profile-${variant.profile.toLowerCase()}`, variant.type === "link" && "badge-link border border-0", variant.type === "chip" && "bg-gray-200", variant.type === "beta" && badgeColorClassName, className);
24
+ const classes = clsx("badge rounded-pill", (variant.type === "content" || variant.type === "user") && "background" in variant ? "bg-gray-200" : (variant.type === "content" || variant.type === "user") && !("background" in variant) ? "border border-0" : "", variant.type === "content" && `text-${variant.level}`, variant.type === "notification" && `badge-notification bg-${variant.level} text-light border border-0`, variant.type === "status" && `badge-status badge-status-${variant.level} caption fw-normal`, variant.type === "user" && `badge-profile-${variant.profile.toLowerCase()}`, variant.type === "link" && "badge-link border border-0", variant.type === "chip" && "bg-gray-200", variant.type === "appVersion" && appVersionBadgeColorClassName, className);
25
25
  return /* @__PURE__ */ jsxs("span", { ref, className: classes, ...restProps, children: [
26
26
  variant.type === "chip" && /* @__PURE__ */ jsx("div", { className: "d-flex fw-800 align-items-center", children }),
27
- variant.type === "beta" && (children ?? "BÊTA"),
28
- variant.type !== "chip" && variant.type !== "beta" && children
27
+ variant.type === "appVersion" && (children ?? "BÊTA"),
28
+ variant.type !== "chip" && variant.type !== "appVersion" && children
29
29
  ] });
30
30
  });
31
31
  export {
@@ -1,7 +1,6 @@
1
1
  import { ReactNode } from 'react';
2
2
  export type ButtonBetaRef = HTMLButtonElement;
3
3
  export type ButtonBetaColor = 'default' | 'destructive' | 'secondary' | 'tertiary';
4
- export type ButtonBetaSizes = 'sm' | 'md';
5
4
  export type ButtonBetaVariant = 'filled' | 'outline' | 'ghost';
6
5
  export interface ButtonBetaProps extends React.ComponentPropsWithRef<'button'> {
7
6
  /**
@@ -16,10 +15,6 @@ export interface ButtonBetaProps extends React.ComponentPropsWithRef<'button'> {
16
15
  * `filled`, `outline` or `ghost`
17
16
  */
18
17
  variant?: ButtonBetaVariant;
19
- /**
20
- * `sm` or `md`
21
- */
22
- size?: ButtonBetaSizes;
23
18
  /**
24
19
  * Does it has a text ?
25
20
  */
@@ -5,7 +5,6 @@ import Loading from "../Loading/Loading.js";
5
5
  const ButtonBeta = /* @__PURE__ */ forwardRef(({
6
6
  color = "default",
7
7
  type = "button",
8
- size = "md",
9
8
  variant = "filled",
10
9
  children,
11
10
  isLoading,
@@ -14,13 +13,11 @@ const ButtonBeta = /* @__PURE__ */ forwardRef(({
14
13
  className,
15
14
  ...restProps
16
15
  }, ref) => {
17
- const classes = clsx("btn-beta", `btn-beta-${color}`, {
16
+ const hasIcon = !!(leftIcon || rightIcon), classes = clsx("btn-beta", `btn-beta-${color}`, {
18
17
  "btn-beta--outline": variant === "outline",
19
18
  "btn-beta--ghost": variant === "ghost",
20
- "btn-beta--small": size === "sm",
21
19
  "btn-beta--icon-only": !children,
22
- "btn-beta--with-left-icon": !!(leftIcon && children),
23
- "btn-beta--with-right-icon": !!(rightIcon && children),
20
+ "btn-beta--with-icon": hasIcon && !!children,
24
21
  "btn-beta--loading": isLoading
25
22
  }, className);
26
23
  return /* @__PURE__ */ jsxs("button", { ref, "data-testid": "button-beta", className: classes, type, ...restProps, children: [
@@ -5,7 +5,6 @@ import { useEdificeClient } from "../../../providers/EdificeClientProvider/Edifi
5
5
  import { useEdificeTheme } from "../../../providers/EdificeThemeProvider/EdificeThemeProvider.hook.js";
6
6
  import SvgIconRafterDown from "../../../modules/icons/components/IconRafterDown.js";
7
7
  import SvgIconCommunities from "../../../modules/icons/components/nav/IconCommunities.js";
8
- import SvgIconCommunity from "../../../modules/icons/components/nav/IconCommunity.js";
9
8
  import SvgIconDisconnect from "../../../modules/icons/components/nav/IconDisconnect.js";
10
9
  import SvgIconHome from "../../../modules/icons/components/nav/IconHome.js";
11
10
  import SvgIconMyApps from "../../../modules/icons/components/nav/IconMyApps.js";
@@ -67,7 +66,6 @@ const Header = ({
67
66
  userAvatar,
68
67
  userName,
69
68
  welcomeUser,
70
- communityWorkflow,
71
69
  communitiesWorkflow,
72
70
  conversationWorflow,
73
71
  searchWorkflow,
@@ -176,10 +174,6 @@ const Header = ({
176
174
  /* @__PURE__ */ jsx(NavItem, { children: /* @__PURE__ */ jsxs("div", { className: "dropdown", children: [
177
175
  /* @__PURE__ */ jsx("button", { className: "nav-link btn btn-naked d-md-none", type: "button", "aria-controls": "dropdown-navbar", "aria-expanded": !isCollapsed, "aria-label": t("navbar.open.menu"), onClick: toggleCollapsedNav, children: /* @__PURE__ */ jsx(SvgIconRafterDown, { className: "icon rafter-down", width: "20", height: "20", color: "#fff" }) }),
178
176
  /* @__PURE__ */ jsxs("ul", { className: `dropdown-menu dropdown-menu-end ${isCollapsed ? "" : "show"}`, id: "dropdown-navbar", children: [
179
- communityWorkflow && /* @__PURE__ */ jsx(NavItem, { children: /* @__PURE__ */ jsxs("a", { href: "/community", className: "nav-link dropdown-item", children: [
180
- /* @__PURE__ */ jsx(SvgIconCommunity, { className: "icon community" }),
181
- /* @__PURE__ */ jsx("span", { className: "nav-text", children: t("navbar.community") })
182
- ] }) }),
183
177
  communitiesWorkflow && /* @__PURE__ */ jsx(NavItem, { children: /* @__PURE__ */ jsxs("a", { href: "/communities", className: "nav-link dropdown-item", children: [
184
178
  /* @__PURE__ */ jsx(SvgIconCommunities, { className: "icon communities" }),
185
179
  /* @__PURE__ */ jsx("span", { className: "nav-text", children: t("navbar.community") })
@@ -14,7 +14,7 @@ function useHeader({
14
14
  t
15
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", {
16
16
  username: user == null ? void 0 : user.firstName
17
- }), bookmarkedApps = useBookmark(), communityWorkflow = useHasWorkflow("net.atos.entng.community.controllers.CommunityController|view"), communitiesWorkflow = useHasWorkflow("community.access"), conversationWorflow = useHasWorkflow("org.entcore.conversation.controllers.ConversationController|view"), searchWorkflow = useHasWorkflow("fr.openent.searchengine.controllers.SearchEngineController|view"), toggleCollapsedNav = useCallback(() => {
17
+ }), bookmarkedApps = useBookmark(), communitiesWorkflow = useHasWorkflow("community.access"), conversationWorflow = useHasWorkflow("org.entcore.conversation.controllers.ConversationController|view"), searchWorkflow = useHasWorkflow("fr.openent.searchengine.controllers.SearchEngineController|view"), toggleCollapsedNav = useCallback(() => {
18
18
  setIsCollapsed(!isCollapsed);
19
19
  }, [isCollapsed]);
20
20
  return useMemo(() => ({
@@ -27,13 +27,12 @@ function useHeader({
27
27
  userAvatar,
28
28
  userName,
29
29
  welcomeUser,
30
- communityWorkflow,
31
30
  communitiesWorkflow,
32
31
  conversationWorflow,
33
32
  searchWorkflow,
34
33
  isCollapsed,
35
34
  toggleCollapsedNav
36
- }), [appsRef, bookmarkedApps, communitiesWorkflow, communityWorkflow, conversationWorflow, isAppsHovered, isCollapsed, popoverAppsId, popoverSearchId, searchWorkflow, title, toggleCollapsedNav, userAvatar, userName, welcomeUser]);
35
+ }), [appsRef, bookmarkedApps, communitiesWorkflow, conversationWorflow, isAppsHovered, isCollapsed, popoverAppsId, popoverSearchId, searchWorkflow, title, toggleCollapsedNav, userAvatar, userName, welcomeUser]);
37
36
  }
38
37
  export {
39
38
  useHeader as default
@@ -14,7 +14,7 @@ const HomeCardHeader = ({
14
14
  const hasAction = !!actionLabel && !!onActionClick;
15
15
  return /* @__PURE__ */ jsxs(Flex, { align: "center", justify: "between", gap: "8", className: clsx("home-card-header", className), ...rest, children: [
16
16
  /* @__PURE__ */ jsx("h3", { className: "home-card-header-title", children: title }),
17
- hasAction && /* @__PURE__ */ jsx(ButtonBeta, { color: "tertiary", size: "sm", variant: "ghost", onClick: onActionClick, leftIcon: actionLeftIcon, rightIcon: actionRightIcon, "data-testid": "home-card-header-action", children: actionLabel })
17
+ hasAction && /* @__PURE__ */ jsx(ButtonBeta, { color: "default", variant: "ghost", onClick: onActionClick, leftIcon: actionLeftIcon, rightIcon: actionRightIcon, "data-testid": "home-card-header-action", children: actionLabel })
18
18
  ] });
19
19
  };
20
20
  export {
@@ -20,7 +20,7 @@ const MessageFlash = ({
20
20
  } = useEdificeClient(), [isCollapsed, setIsCollapsed] = useState(!0), [hasOverflow, setHasOverflow] = useState(!1), contentRef = useRef(null), checkContentTimeoutRef = useRef(void 0), {
21
21
  t
22
22
  } = useTranslation(), {
23
- lg
23
+ md
24
24
  } = useBreakpoint();
25
25
  let content = "";
26
26
  message.contents && (currentLanguage && message.contents[currentLanguage] ? content = message.contents[currentLanguage] : message.contents.fr ? content = message.contents.fr : content = Object.keys(message.contents).map((key) => message.contents[key]).filter((cont) => cont !== null)[0]), useEffect(() => {
@@ -53,7 +53,7 @@ const MessageFlash = ({
53
53
  /* @__PURE__ */ jsx("div", { ref: contentRef, className: classesContent, dangerouslySetInnerHTML: {
54
54
  __html: content
55
55
  } }),
56
- /* @__PURE__ */ jsxs(Flex, { direction: lg ? "row" : "column", justify: "between", className: "message-flash-footer", children: [
56
+ /* @__PURE__ */ jsxs(Flex, { direction: md ? "row" : "column", justify: "between", className: "message-flash-footer", children: [
57
57
  /* @__PURE__ */ jsx("div", { className: "fst-italic", children: message.signature || "" }),
58
58
  hasOverflow && /* @__PURE__ */ jsx(ButtonBeta, { "data-testid": isCollapsed ? "message-flash-view-more-button" : "message-flash-view-less-button", color: "default", variant: "ghost", onClick: handleCollapse, "aria-controls": `message-flash-${message.id}-content`, "aria-expanded": !isCollapsed, className: "message-flash-collapse-button", children: t(isCollapsed ? "read.more" : "read.less") })
59
59
  ] })
@@ -6,7 +6,8 @@ const createNotificationService = (baseURL) => ({
6
6
  */
7
7
  getNotifications(types, page) {
8
8
  const searchParams = new URLSearchParams({
9
- page: page.toString()
9
+ page: page.toString(),
10
+ mine: "1"
10
11
  });
11
12
  return types.forEach((type) => {
12
13
  searchParams.append("type", type);
@@ -13,13 +13,13 @@ function UserSpace({
13
13
  t
14
14
  } = useTranslation();
15
15
  return /* @__PURE__ */ jsxs(HomeCard, { variant: "user", children: [
16
- /* @__PURE__ */ jsxs(Flex, { className: "user-space", direction: "row", gap: "8", children: [
16
+ /* @__PURE__ */ jsx(HomeCard.Header, { title: /* @__PURE__ */ jsxs(Flex, { className: "user-space", direction: "row", gap: "8", children: [
17
17
  /* @__PURE__ */ jsx(Avatar, { className: "user-space--avatar", size: "auto", alt: name, src: avatar, variant: "circle" }),
18
18
  /* @__PURE__ */ jsxs(Flex, { direction: "column", children: [
19
19
  /* @__PURE__ */ jsx("div", { "data-testid": "user-space-name", className: "user-space--name", children: name }),
20
20
  /* @__PURE__ */ jsx("div", { "data-testid": "user-space-profile", className: "user-space--profile", children: t(profile) })
21
21
  ] })
22
- ] }),
22
+ ] }) }),
23
23
  children && /* @__PURE__ */ jsx(HomeCard.Content, { children })
24
24
  ] });
25
25
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@edifice.io/react",
3
- "version": "2.6.0-develop-b2school.20260724115233",
3
+ "version": "2.6.0-develop-pedago.20260730111054",
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.0-develop-b2school.20260724115233",
144
- "@edifice.io/tiptap-extensions": "2.6.0-develop-b2school.20260724115233",
145
- "@edifice.io/utilities": "2.6.0-develop-b2school.20260724115233"
143
+ "@edifice.io/bootstrap": "2.6.0-develop-pedago.20260730111054",
144
+ "@edifice.io/tiptap-extensions": "2.6.0-develop-pedago.20260730111054",
145
+ "@edifice.io/utilities": "2.6.0-develop-pedago.20260730111054"
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.0-develop-b2school.20260724115233",
177
- "@edifice.io/config": "2.6.0-develop-b2school.20260724115233"
176
+ "@edifice.io/client": "2.6.0-develop-pedago.20260730111054",
177
+ "@edifice.io/config": "2.6.0-develop-pedago.20260730111054"
178
178
  },
179
179
  "peerDependencies": {
180
180
  "@react-spring/web": "9.7.5",
@@ -1,10 +0,0 @@
1
- import { CommunityItemProps } from './CommunityItem';
2
- export interface CommunitiesProps {
3
- communitiesList?: CommunityItemProps[];
4
- handleActionClick: () => void;
5
- }
6
- declare const Communities: {
7
- ({ communitiesList, handleActionClick, }: CommunitiesProps): import("react/jsx-runtime").JSX.Element;
8
- displayName: string;
9
- };
10
- export default Communities;
@@ -1,9 +0,0 @@
1
- import { CommunitiesModel } from './useCommunities';
2
- export type CommunitiesContainerProps = {
3
- onCommunityClick?: (community: CommunitiesModel) => void;
4
- onHeaderActionClick: () => void;
5
- };
6
- export declare function CommunitiesContainer({ onCommunityClick, onHeaderActionClick, }: CommunitiesContainerProps): import("react/jsx-runtime").JSX.Element | "An error occurred while loading communities.";
7
- export declare namespace CommunitiesContainer {
8
- var displayName: string;
9
- }
@@ -1,5 +0,0 @@
1
- declare const CommunitiesSkeleton: {
2
- (): import("react/jsx-runtime").JSX.Element;
3
- displayName: string;
4
- };
5
- export default CommunitiesSkeleton;
@@ -1,11 +0,0 @@
1
- export interface CommunityItemProps {
2
- title: string;
3
- communityImage: string;
4
- onActionClick: () => void;
5
- nbNotifications?: number;
6
- }
7
- declare const CommunityItem: {
8
- ({ title, communityImage, nbNotifications, onActionClick, }: CommunityItemProps): import("react/jsx-runtime").JSX.Element;
9
- displayName: string;
10
- };
11
- export default CommunityItem;
@@ -1,8 +0,0 @@
1
- export * from './Communities';
2
- export { default as Communities } from './Communities';
3
- export * from './CommunitiesContainer';
4
- export * from './CommunitiesSkeleton';
5
- export { default as CommunitiesSkeleton } from './CommunitiesSkeleton';
6
- export * from './CommunityItem';
7
- export { default as CommunitiesItem } from './CommunityItem';
8
- export * from './useCommunities';
@@ -1,13 +0,0 @@
1
- export interface CommunitiesModel {
2
- id: number | string;
3
- title: string;
4
- communityImage?: string;
5
- icon?: string;
6
- nbNotifications?: number;
7
- notifications?: number;
8
- }
9
- export declare function useCommunities(): {
10
- communities: CommunitiesModel[];
11
- isLoading: boolean;
12
- error: Error | null;
13
- };