@edifice.io/react 2.6.7-develop-b2school.20261003125732 → 2.6.7-develop.20261003143000

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.
@@ -5,10 +5,8 @@ export type UserSpaceProps = {
5
5
  avatar: string;
6
6
  profile: UserProfile[number];
7
7
  children?: ReactNode;
8
- /** Renders a trigger button in the top-right corner when provided. */
9
- onCustomizeWidgetsClick?: () => void;
10
8
  };
11
- declare function UserSpace({ name, avatar, profile, children, onCustomizeWidgetsClick, }: UserSpaceProps): import("react/jsx-runtime").JSX.Element;
9
+ declare function UserSpace({ name, avatar, profile, children, }: UserSpaceProps): import("react/jsx-runtime").JSX.Element;
12
10
  declare namespace UserSpace {
13
11
  var displayName: string;
14
12
  }
@@ -1,33 +1,27 @@
1
1
  import { jsxs, jsx } from "react/jsx-runtime";
2
2
  import { useTranslation } from "react-i18next";
3
- import SvgIconAddWidget from "../../../icons/components/IconAddWidget.js";
4
3
  import SvgIconClass from "../../../icons/components/IconClass.js";
5
4
  import { useProfileLinks } from "./hooks/useProfileLinks.js";
6
5
  import HomeCard from "../HomeCard/HomeCard.js";
7
6
  import Flex from "../../../../components/Flex/Flex.js";
8
7
  import Avatar from "../../../../components/Avatar/Avatar.js";
9
- import IconButton from "../../../../components/Button/IconButton.js";
10
8
  import ButtonBeta from "../../../../components/ButtonBeta/ButtonBeta.js";
11
9
  function UserSpace({
12
10
  name,
13
11
  avatar,
14
12
  profile,
15
- children,
16
- onCustomizeWidgetsClick
13
+ children
17
14
  }) {
18
15
  const {
19
16
  t
20
17
  } = useTranslation(), links = useProfileLinks(profile);
21
18
  return /* @__PURE__ */ jsxs(HomeCard, { variant: "user", footer: !!links && /* @__PURE__ */ jsx(Flex, { children: links.map((link, index) => /* @__PURE__ */ jsx(ButtonBeta, { size: "sm", variant: "ghost", leftIcon: /* @__PURE__ */ jsx(SvgIconClass, {}), onClick: () => window.location.href = link.url, children: link.text }, `${link.url}-${index}`)) }), children: [
22
- /* @__PURE__ */ jsxs(Flex, { className: "user-space", direction: "row", justify: "between", gap: "8", children: [
23
- /* @__PURE__ */ jsxs(Flex, { direction: "row", gap: "8", children: [
24
- /* @__PURE__ */ jsx(Avatar, { className: "user-space--avatar", size: "auto", alt: name, src: avatar, variant: "circle" }),
25
- /* @__PURE__ */ jsxs(Flex, { direction: "column", children: [
26
- /* @__PURE__ */ jsx("div", { "data-testid": "user-space-name", className: "user-space--name", children: name }),
27
- /* @__PURE__ */ jsx("div", { "data-testid": "user-space-profile", className: "user-space--profile", children: t(profile) })
28
- ] })
29
- ] }),
30
- onCustomizeWidgetsClick && /* @__PURE__ */ jsx(IconButton, { className: "user-space--customize-widgets", icon: /* @__PURE__ */ jsx(SvgIconAddWidget, {}), variant: "ghost", color: "tertiary", "aria-label": t("homepage.userSpace.customizeWidgets", "Personnaliser mes widgets"), onClick: onCustomizeWidgetsClick })
19
+ /* @__PURE__ */ jsxs(Flex, { className: "user-space", direction: "row", gap: "8", children: [
20
+ /* @__PURE__ */ jsx(Avatar, { className: "user-space--avatar", size: "auto", alt: name, src: avatar, variant: "circle" }),
21
+ /* @__PURE__ */ jsxs(Flex, { direction: "column", children: [
22
+ /* @__PURE__ */ jsx("div", { "data-testid": "user-space-name", className: "user-space--name", children: name }),
23
+ /* @__PURE__ */ jsx("div", { "data-testid": "user-space-profile", className: "user-space--profile", children: t(profile) })
24
+ ] })
31
25
  ] }),
32
26
  children && /* @__PURE__ */ jsx(HomeCard.Content, { children })
33
27
  ] });
@@ -1,9 +1,7 @@
1
1
  import { ReactNode } from 'react';
2
- export interface UserSpaceContainerProps {
2
+ export declare function UserSpaceContainer({ children }: {
3
3
  children?: ReactNode;
4
- onCustomizeWidgetsClick?: () => void;
5
- }
6
- export declare function UserSpaceContainer({ children, onCustomizeWidgetsClick, }: UserSpaceContainerProps): import("react/jsx-runtime").JSX.Element | null;
4
+ }): import("react/jsx-runtime").JSX.Element | null;
7
5
  export declare namespace UserSpaceContainer {
8
6
  var displayName: string;
9
7
  }
@@ -2,8 +2,7 @@ import { jsx } from "react/jsx-runtime";
2
2
  import UserSpace from "./UserSpace.js";
3
3
  import useUser from "../../../../hooks/useUser/useUser.js";
4
4
  function UserSpaceContainer({
5
- children,
6
- onCustomizeWidgetsClick
5
+ children
7
6
  }) {
8
7
  var _a;
9
8
  const {
@@ -13,7 +12,7 @@ function UserSpaceContainer({
13
12
  } = useUser();
14
13
  if (!user || !userDescription) return null;
15
14
  const name = user.username || "", profile = ((_a = userDescription.profiles) == null ? void 0 : _a[0]) || "Guest";
16
- return /* @__PURE__ */ jsx(UserSpace, { name, profile, avatar, onCustomizeWidgetsClick, children });
15
+ return /* @__PURE__ */ jsx(UserSpace, { name, profile, avatar, children });
17
16
  }
18
17
  export {
19
18
  UserSpaceContainer
@@ -1,4 +1,3 @@
1
- export * from './Communities';
2
1
  export * from './Favorites';
3
2
  export * from './Header';
4
3
  export * from './HomeCard';
@@ -8,4 +7,4 @@ export * from './Notifications';
8
7
  export * from './SchoolSpace';
9
8
  export * from './UsefulLinks';
10
9
  export * from './UserSpace';
11
- export * from './WidgetsPersonalizationPanel';
10
+ export * from './Communities';
@@ -1,5 +1,4 @@
1
1
  export { default as IconAddUser } from './IconAddUser';
2
- export { default as IconAddWidget } from './IconAddWidget';
3
2
  export { default as IconAdd } from './IconAdd';
4
3
  export { default as IconAdjustSettings } from './IconAdjustSettings';
5
4
  export { default as IconAiFill } from './IconAiFill';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@edifice.io/react",
3
- "version": "2.6.7-develop-b2school.20261003125732",
3
+ "version": "2.6.7-develop.20261003143000",
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.7-develop-b2school.20261003125732",
144
- "@edifice.io/utilities": "2.6.7-develop-b2school.20261003125732",
145
- "@edifice.io/tiptap-extensions": "2.6.7-develop-b2school.20261003125732"
143
+ "@edifice.io/bootstrap": "2.6.7-develop.20261003143000",
144
+ "@edifice.io/tiptap-extensions": "2.6.7-develop.20261003143000",
145
+ "@edifice.io/utilities": "2.6.7-develop.20261003143000"
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.7-develop-b2school.20261003125732",
177
- "@edifice.io/config": "2.6.7-develop-b2school.20261003125732"
176
+ "@edifice.io/client": "2.6.7-develop.20261003143000",
177
+ "@edifice.io/config": "2.6.7-develop.20261003143000"
178
178
  },
179
179
  "peerDependencies": {
180
180
  "@react-spring/web": "9.7.5",
@@ -1,16 +0,0 @@
1
- import { ComponentPropsWithoutRef } from 'react';
2
- export interface WidgetToggleProps extends Omit<ComponentPropsWithoutRef<'button'>, 'onClick' | 'type' | 'role' | 'aria-checked'> {
3
- 'checked': boolean;
4
- 'onChange': () => void;
5
- 'aria-label': string;
6
- }
7
- /**
8
- * Dedicated on/off control for a widget row in `WidgetsPersonalizationPanel`.
9
- * The generic `Switch` component doesn't match this panel's design (size,
10
- * filled-vs-outlined states), so this is a small purpose-built control
11
- * rather than a `Switch` variant.
12
- */
13
- export declare function WidgetToggle({ checked, onChange, disabled, ...rest }: WidgetToggleProps): import("react/jsx-runtime").JSX.Element;
14
- export declare namespace WidgetToggle {
15
- var displayName: string;
16
- }
@@ -1,15 +0,0 @@
1
- import { jsx } from "react/jsx-runtime";
2
- import clsx from "clsx";
3
- function WidgetToggle({
4
- checked,
5
- onChange,
6
- disabled,
7
- ...rest
8
- }) {
9
- return /* @__PURE__ */ jsx("button", { type: "button", role: "switch", "aria-checked": checked, disabled, className: clsx("widget-toggle", {
10
- "widget-toggle--checked": checked
11
- }), onClick: onChange, ...rest, children: /* @__PURE__ */ jsx("span", { className: "widget-toggle__knob" }) });
12
- }
13
- export {
14
- WidgetToggle
15
- };
@@ -1,21 +0,0 @@
1
- import { ReactNode } from 'react';
2
- export interface WidgetPersonalizationItem {
3
- id: string;
4
- label: string;
5
- icon: ReactNode;
6
- checked: boolean;
7
- /** When true, the widget is pinned by an admin: no toggle, lock icon instead. */
8
- locked?: boolean;
9
- }
10
- export interface WidgetsPersonalizationPanelProps {
11
- items: WidgetPersonalizationItem[];
12
- isLoading?: boolean;
13
- onToggle: (id: string) => void;
14
- onClose: () => void;
15
- title?: string;
16
- description?: string;
17
- }
18
- export declare function WidgetsPersonalizationPanel({ items, isLoading, onToggle, onClose, title, description, }: WidgetsPersonalizationPanelProps): import("react/jsx-runtime").JSX.Element;
19
- export declare namespace WidgetsPersonalizationPanel {
20
- var displayName: string;
21
- }
@@ -1,47 +0,0 @@
1
- import { jsxs, jsx } from "react/jsx-runtime";
2
- import { useTranslation } from "react-i18next";
3
- import clsx from "clsx";
4
- import SvgIconClose from "../../../icons/components/IconClose.js";
5
- import SvgIconLock from "../../../icons/components/IconLock.js";
6
- import { WidgetToggle } from "./WidgetToggle.js";
7
- import Heading from "../../../../components/Heading/Heading.js";
8
- import IconButton from "../../../../components/Button/IconButton.js";
9
- import TextSkeleton from "../../../../components/Skeleton/TextSkeleton.js";
10
- const SKELETON_ROWS = 5;
11
- function WidgetsPersonalizationPanel({
12
- items,
13
- isLoading = !1,
14
- onToggle,
15
- onClose,
16
- title,
17
- description
18
- }) {
19
- const {
20
- t
21
- } = useTranslation();
22
- return /* @__PURE__ */ jsxs("div", { className: "widgets-personalization-panel", children: [
23
- /* @__PURE__ */ jsxs("div", { className: "widgets-personalization-panel__header", children: [
24
- /* @__PURE__ */ jsx(Heading, { level: "h2", headingStyle: "h5", className: "widgets-personalization-panel__title", children: title ?? t("homepage.widgetsPersonalization.title") }),
25
- /* @__PURE__ */ jsx(IconButton, { icon: /* @__PURE__ */ jsx(SvgIconClose, {}), variant: "ghost", color: "tertiary", "aria-label": t("close"), onClick: onClose, "data-testid": "widgetspersonalization-button-close" })
26
- ] }),
27
- /* @__PURE__ */ jsx("p", { className: "widgets-personalization-panel__description", children: description ?? t("homepage.widgetsPersonalization.description") }),
28
- isLoading ? /* @__PURE__ */ jsx("ul", { className: "widgets-personalization-panel__list", "aria-hidden": "true", children: Array.from({
29
- length: SKELETON_ROWS
30
- }).map((_, index) => /* @__PURE__ */ jsxs("li", { className: "widgets-personalization-panel__item widgets-personalization-panel__item--skeleton", children: [
31
- /* @__PURE__ */ jsx(TextSkeleton, { className: "widgets-personalization-panel__item-icon-skeleton" }),
32
- /* @__PURE__ */ jsx(TextSkeleton, { className: "widgets-personalization-panel__item-label-skeleton" })
33
- ] }, index)) }) : items.length === 0 ? /* @__PURE__ */ jsx("div", { className: "widgets-personalization-panel__empty", children: /* @__PURE__ */ jsx("p", { className: "widgets-personalization-panel__empty-text", children: t("homepage.widgetsPersonalization.empty") }) }) : /* @__PURE__ */ jsx("ul", { className: "widgets-personalization-panel__list", children: items.map((item) => /* @__PURE__ */ jsxs("li", { className: clsx("widgets-personalization-panel__item", {
34
- "widgets-personalization-panel__item--checked": item.checked && !item.locked,
35
- "widgets-personalization-panel__item--locked": item.locked
36
- }), "data-testid": `widgetspersonalization-item-${item.id}`, children: [
37
- /* @__PURE__ */ jsx("span", { className: "widgets-personalization-panel__item-icon", "aria-hidden": "true", children: item.icon }),
38
- /* @__PURE__ */ jsx("span", { className: "widgets-personalization-panel__item-label", children: item.label }),
39
- item.locked ? /* @__PURE__ */ jsx("span", { className: "widgets-personalization-panel__item-lock", role: "img", "aria-label": t("homepage.widgetsPersonalization.locked"), "data-testid": `widgetspersonalization-lock-${item.id}`, children: /* @__PURE__ */ jsx(SvgIconLock, {}) }) : /* @__PURE__ */ jsx(WidgetToggle, { checked: item.checked, onChange: () => onToggle(item.id), "aria-label": t("homepage.widgetsPersonalization.toggle", {
40
- label: item.label
41
- }), "data-testid": `widgetspersonalization-toggle-${item.id}` })
42
- ] }, item.id)) })
43
- ] });
44
- }
45
- export {
46
- WidgetsPersonalizationPanel
47
- };
@@ -1,2 +0,0 @@
1
- export * from './WidgetsPersonalizationPanel';
2
- export * from './WidgetToggle';
@@ -1,7 +0,0 @@
1
- import { SVGProps } from 'react';
2
- interface SVGRProps {
3
- title?: string;
4
- titleId?: string;
5
- }
6
- declare const SvgIconAddWidget: ({ title, titleId, ...props }: SVGProps<SVGSVGElement> & SVGRProps) => import("react/jsx-runtime").JSX.Element;
7
- export default SvgIconAddWidget;
@@ -1,12 +0,0 @@
1
- import { jsxs, jsx } from "react/jsx-runtime";
2
- const SvgIconAddWidget = ({
3
- title,
4
- titleId,
5
- ...props
6
- }) => /* @__PURE__ */ jsxs("svg", { xmlns: "http://www.w3.org/2000/svg", width: "24", height: "24", fill: "none", viewBox: "0 0 20 20", "aria-hidden": "true", "aria-labelledby": titleId, ...props, children: [
7
- title ? /* @__PURE__ */ jsx("title", { id: titleId, children: title }) : null,
8
- /* @__PURE__ */ jsx("path", { fill: "currentColor", fillRule: "evenodd", d: "M15.834 10.833c.46 0 .833.373.833.834v2.5h2.5a.833.833 0 0 1 0 1.666h-2.5v2.5a.833.833 0 0 1-1.667 0v-2.5h-2.5a.833.833 0 0 1 0-1.666H15v-2.5c0-.46.373-.834.834-.834M8.333 3.333A.833.833 0 0 0 7.5 2.5h-5a.833.833 0 0 0-.833.833v13.334c0 .46.373.833.833.833h5c.46 0 .833-.373.833-.833zM10 16.667a2.5 2.5 0 0 1-2.5 2.5h-5a2.5 2.5 0 0 1-2.5-2.5V3.333a2.5 2.5 0 0 1 2.5-2.5h5a2.5 2.5 0 0 1 2.5 2.5zM18.334 3.333A.833.833 0 0 0 17.5 2.5h-3.333a.833.833 0 0 0-.833.833v3.334c0 .46.373.833.833.833H17.5c.46 0 .834-.373.834-.833zM20 6.667a2.5 2.5 0 0 1-2.5 2.5h-3.333a2.5 2.5 0 0 1-2.5-2.5V3.333a2.5 2.5 0 0 1 2.5-2.5H17.5a2.5 2.5 0 0 1 2.5 2.5z", clipRule: "evenodd" })
9
- ] });
10
- export {
11
- SvgIconAddWidget as default
12
- };