@edifice.io/react 2.6.0-develop-pedago.20260723150135 → 2.6.0-develop-b2school.20260724115233
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/Badge/Badge.d.ts +13 -24
- package/dist/components/Badge/Badge.js +6 -6
- package/dist/components/ButtonBeta/ButtonBeta.d.ts +5 -0
- package/dist/components/ButtonBeta/ButtonBeta.js +5 -2
- package/dist/modules/homepage/components/Communities/Communities.d.ts +10 -0
- package/dist/modules/homepage/components/Communities/CommunitiesContainer.d.ts +9 -0
- package/dist/modules/homepage/components/Communities/CommunitiesSkeleton.d.ts +5 -0
- package/dist/modules/homepage/components/Communities/CommunityItem.d.ts +11 -0
- package/dist/modules/homepage/components/Communities/index.d.ts +8 -0
- package/dist/modules/homepage/components/Communities/useCommunities.d.ts +13 -0
- package/dist/modules/homepage/components/HomeCard/HomeCardHeader.js +1 -1
- package/dist/modules/homepage/components/MessageFlashList/MessageFlash.js +2 -2
- package/dist/modules/homepage/components/Notifications/services/api/notificationService.js +1 -2
- package/dist/modules/homepage/components/UserSpace/UserSpace.js +2 -2
- package/package.json +6 -6
|
@@ -6,11 +6,6 @@ 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
|
-
};
|
|
14
9
|
/** Badge variant : content */
|
|
15
10
|
export type ContentBadgeVariant = {
|
|
16
11
|
type: 'content';
|
|
@@ -32,29 +27,22 @@ export type LinkBadgeVariant = {
|
|
|
32
27
|
type: 'link';
|
|
33
28
|
};
|
|
34
29
|
/**
|
|
35
|
-
* Badge variant :
|
|
36
|
-
*
|
|
37
|
-
*
|
|
38
|
-
*
|
|
39
|
-
*
|
|
40
|
-
*
|
|
41
|
-
*
|
|
42
|
-
*
|
|
43
|
-
*
|
|
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 }} />
|
|
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.
|
|
51
39
|
*/
|
|
52
|
-
export type
|
|
53
|
-
type: '
|
|
40
|
+
export type BetaBadgeVariant = {
|
|
41
|
+
type: 'beta';
|
|
54
42
|
color?: string;
|
|
55
43
|
app?: IWebApp;
|
|
56
44
|
};
|
|
57
|
-
export type BadgeVariants = NotificationBadgeVariant |
|
|
45
|
+
export type BadgeVariants = NotificationBadgeVariant | ContentBadgeVariant | ProfileBadgeVariant | ChipBadgeVariant | LinkBadgeVariant | BetaBadgeVariant;
|
|
58
46
|
export interface BadgeProps extends React.ComponentPropsWithRef<'span'> {
|
|
59
47
|
/**
|
|
60
48
|
* Badge variant : notification, link or profile (Teacher|Student|Relative|Personnel)
|
|
@@ -63,6 +51,7 @@ export interface BadgeProps extends React.ComponentPropsWithRef<'span'> {
|
|
|
63
51
|
variant?: BadgeVariants;
|
|
64
52
|
/**
|
|
65
53
|
* Text or icon (or whatever) to render as children elements.
|
|
54
|
+
* Defaults to 'BÊTA' for beta variant.
|
|
66
55
|
*/
|
|
67
56
|
children?: ReactNode;
|
|
68
57
|
/**
|
|
@@ -16,16 +16,16 @@ const Badge = /* @__PURE__ */ forwardRef(({
|
|
|
16
16
|
getBackgroundLightIconClass,
|
|
17
17
|
getBorderIconClass
|
|
18
18
|
} = useEdificeIcons();
|
|
19
|
-
let
|
|
20
|
-
if (variant.type === "
|
|
19
|
+
let badgeColorClassName = "";
|
|
20
|
+
if (variant.type === "beta" && variant.app) {
|
|
21
21
|
const colorAppClassName = getIconClass(variant.app), backgroundLightAppClassName = getBackgroundLightIconClass(variant.app), borderAppClassName = getBorderIconClass(variant.app);
|
|
22
|
-
|
|
22
|
+
badgeColorClassName = `${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 === "
|
|
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);
|
|
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 === "
|
|
28
|
-
variant.type !== "chip" && variant.type !== "
|
|
27
|
+
variant.type === "beta" && (children ?? "BÊTA"),
|
|
28
|
+
variant.type !== "chip" && variant.type !== "beta" && children
|
|
29
29
|
] });
|
|
30
30
|
});
|
|
31
31
|
export {
|
|
@@ -1,6 +1,7 @@
|
|
|
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';
|
|
4
5
|
export type ButtonBetaVariant = 'filled' | 'outline' | 'ghost';
|
|
5
6
|
export interface ButtonBetaProps extends React.ComponentPropsWithRef<'button'> {
|
|
6
7
|
/**
|
|
@@ -15,6 +16,10 @@ export interface ButtonBetaProps extends React.ComponentPropsWithRef<'button'> {
|
|
|
15
16
|
* `filled`, `outline` or `ghost`
|
|
16
17
|
*/
|
|
17
18
|
variant?: ButtonBetaVariant;
|
|
19
|
+
/**
|
|
20
|
+
* `sm` or `md`
|
|
21
|
+
*/
|
|
22
|
+
size?: ButtonBetaSizes;
|
|
18
23
|
/**
|
|
19
24
|
* Does it has a text ?
|
|
20
25
|
*/
|
|
@@ -5,6 +5,7 @@ import Loading from "../Loading/Loading.js";
|
|
|
5
5
|
const ButtonBeta = /* @__PURE__ */ forwardRef(({
|
|
6
6
|
color = "default",
|
|
7
7
|
type = "button",
|
|
8
|
+
size = "md",
|
|
8
9
|
variant = "filled",
|
|
9
10
|
children,
|
|
10
11
|
isLoading,
|
|
@@ -13,11 +14,13 @@ const ButtonBeta = /* @__PURE__ */ forwardRef(({
|
|
|
13
14
|
className,
|
|
14
15
|
...restProps
|
|
15
16
|
}, ref) => {
|
|
16
|
-
const
|
|
17
|
+
const classes = clsx("btn-beta", `btn-beta-${color}`, {
|
|
17
18
|
"btn-beta--outline": variant === "outline",
|
|
18
19
|
"btn-beta--ghost": variant === "ghost",
|
|
20
|
+
"btn-beta--small": size === "sm",
|
|
19
21
|
"btn-beta--icon-only": !children,
|
|
20
|
-
"btn-beta--with-icon":
|
|
22
|
+
"btn-beta--with-left-icon": !!(leftIcon && children),
|
|
23
|
+
"btn-beta--with-right-icon": !!(rightIcon && children),
|
|
21
24
|
"btn-beta--loading": isLoading
|
|
22
25
|
}, className);
|
|
23
26
|
return /* @__PURE__ */ jsxs("button", { ref, "data-testid": "button-beta", className: classes, type, ...restProps, children: [
|
|
@@ -0,0 +1,10 @@
|
|
|
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;
|
|
@@ -0,0 +1,9 @@
|
|
|
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
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
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;
|
|
@@ -0,0 +1,8 @@
|
|
|
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';
|
|
@@ -0,0 +1,13 @@
|
|
|
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
|
+
};
|
|
@@ -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: "
|
|
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 })
|
|
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
|
-
|
|
23
|
+
lg
|
|
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:
|
|
56
|
+
/* @__PURE__ */ jsxs(Flex, { direction: lg ? "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,8 +6,7 @@ const createNotificationService = (baseURL) => ({
|
|
|
6
6
|
*/
|
|
7
7
|
getNotifications(types, page) {
|
|
8
8
|
const searchParams = new URLSearchParams({
|
|
9
|
-
page: page.toString()
|
|
10
|
-
mine: "1"
|
|
9
|
+
page: page.toString()
|
|
11
10
|
});
|
|
12
11
|
return types.forEach((type) => {
|
|
13
12
|
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__ */
|
|
16
|
+
/* @__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-
|
|
3
|
+
"version": "2.6.0-develop-b2school.20260724115233",
|
|
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-
|
|
144
|
-
"@edifice.io/tiptap-extensions": "2.6.0-develop-
|
|
145
|
-
"@edifice.io/utilities": "2.6.0-develop-
|
|
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"
|
|
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/
|
|
177
|
-
"@edifice.io/
|
|
176
|
+
"@edifice.io/client": "2.6.0-develop-b2school.20260724115233",
|
|
177
|
+
"@edifice.io/config": "2.6.0-develop-b2school.20260724115233"
|
|
178
178
|
},
|
|
179
179
|
"peerDependencies": {
|
|
180
180
|
"@react-spring/web": "9.7.5",
|