@edifice.io/react 2.6.10-develop-b2school.20261021144055 → 2.6.10-develop-integration.20261021201512

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 (164) hide show
  1. package/dist/components/Checkbox/Checkbox.js +1 -1
  2. package/dist/components/Layout/Layout.js +4 -12
  3. package/dist/components/Layout/components/Header.js +4 -4
  4. package/dist/components/Layout/components/NavLink.d.ts +3 -3
  5. package/dist/components/Layout/components/NavLink.js +3 -5
  6. package/dist/homepage.js +24 -74
  7. package/dist/hooks/index.d.ts +1 -0
  8. package/dist/hooks/useGoogleDriveSearch/index.d.ts +1 -0
  9. package/dist/hooks/useGoogleDriveSearch/useGoogleDriveSearch.d.ts +19 -0
  10. package/dist/hooks/useGoogleDriveSearch/useGoogleDriveSearch.js +60 -0
  11. package/dist/hooks/useZendeskGuide/useZendeskGuide.d.ts +6 -2
  12. package/dist/hooks/useZendeskGuide/useZendeskGuide.js +8 -11
  13. package/dist/icons-apps.js +184 -182
  14. package/dist/icons.js +402 -406
  15. package/dist/index.js +198 -192
  16. package/dist/modules/HelpZone/HelpZone.js +8 -6
  17. package/dist/modules/HelpZone/HelpZoneContainer.js +5 -2
  18. package/dist/modules/homepage/components/Communities/Communities.js +4 -4
  19. package/dist/modules/homepage/components/Header/Header.js +22 -28
  20. package/dist/modules/homepage/components/HomeCard/HomeCardHeader.d.ts +1 -5
  21. package/dist/modules/homepage/components/HomeCard/HomeCardHeader.js +1 -1
  22. package/dist/modules/homepage/components/MessageFlashList/MessageFlash.js +1 -1
  23. package/dist/modules/homepage/components/Notifications/NotificationList.js +8 -7
  24. package/dist/modules/homepage/components/Notifications/NotificationListSkeleton.js +12 -7
  25. package/dist/modules/homepage/components/Notifications/NotificationSkeleton.js +4 -7
  26. package/dist/modules/homepage/components/Notifications/components/CommonNotificationItem.js +9 -9
  27. package/dist/modules/homepage/components/Notifications/components/NotificationFilterMenu.js +5 -1
  28. package/dist/modules/homepage/components/Notifications/components/NotificationFilterModal.js +12 -10
  29. package/dist/modules/homepage/components/Notifications/components/NotificationOptionsMenu.js +9 -3
  30. package/dist/modules/homepage/components/Notifications/components/ReportNotificationModal.js +12 -6
  31. package/dist/modules/homepage/components/Notifications/components/notificationAdapter.d.ts +2 -1
  32. package/dist/modules/homepage/components/Notifications/components/notificationAdapter.js +12 -14
  33. package/dist/modules/homepage/components/Notifications/hooks/useNotificationList.js +10 -9
  34. package/dist/modules/homepage/components/SchoolSpace/SchoolSpaceContainer.js +1 -1
  35. package/dist/modules/homepage/{hooks → components/SchoolSpace}/useUserSchools.d.ts +2 -2
  36. package/dist/modules/homepage/{hooks → components/SchoolSpace}/useUserSchools.js +4 -4
  37. package/dist/modules/homepage/components/UsefulLinks/UsefulLinks.js +2 -2
  38. package/dist/modules/homepage/components/UsefulLinks/UsefulLinksModal.js +2 -2
  39. package/dist/modules/homepage/components/UserSpace/UserSpace.d.ts +1 -3
  40. package/dist/modules/homepage/components/UserSpace/UserSpace.js +7 -13
  41. package/dist/modules/homepage/components/UserSpace/UserSpaceContainer.d.ts +2 -4
  42. package/dist/modules/homepage/components/UserSpace/UserSpaceContainer.js +2 -3
  43. package/dist/modules/homepage/components/index.d.ts +1 -9
  44. package/dist/modules/icons/components/apps/IconElea.d.ts +7 -0
  45. package/dist/modules/icons/components/apps/IconElea.js +23 -0
  46. package/dist/modules/icons/components/apps/index.d.ts +1 -0
  47. package/dist/modules/icons/components/index.d.ts +0 -2
  48. package/dist/modules/multimedia/FileCard/GoogleDriveFileCard.d.ts +25 -0
  49. package/dist/modules/multimedia/FileCard/GoogleDriveFileCard.js +102 -0
  50. package/dist/modules/multimedia/FileCard/index.d.ts +2 -0
  51. package/dist/modules/multimedia/GoogleDrive/GoogleDrive.d.ts +24 -0
  52. package/dist/modules/multimedia/GoogleDrive/GoogleDrive.js +103 -0
  53. package/dist/modules/multimedia/GoogleDrive/index.d.ts +2 -0
  54. package/dist/modules/multimedia/Linker/InternalLinker/InternalLinker.d.ts +7 -1
  55. package/dist/modules/multimedia/Linker/InternalLinker/InternalLinker.js +2 -0
  56. package/dist/modules/multimedia/MediaLibrary/MediaLibrary.js +16 -5
  57. package/dist/modules/multimedia/MediaLibrary/innertabs/GoogleDrive.d.ts +1 -0
  58. package/dist/modules/multimedia/MediaLibrary/innertabs/GoogleDrive.js +61 -0
  59. package/dist/modules/multimedia/MediaLibrary/innertabs/index.d.ts +1 -0
  60. package/dist/modules/multimedia/MediaLibrary/innertabs/index.js +2 -0
  61. package/dist/modules/multimedia/index.d.ts +1 -0
  62. package/dist/multimedia.js +26 -22
  63. package/package.json +6 -6
  64. package/dist/modules/homepage/components/Agenda/Agenda.d.ts +0 -10
  65. package/dist/modules/homepage/components/Agenda/Agenda.js +0 -54
  66. package/dist/modules/homepage/components/Agenda/AgendaContainer.d.ts +0 -1
  67. package/dist/modules/homepage/components/Agenda/AgendaContainer.js +0 -14
  68. package/dist/modules/homepage/components/Agenda/AgendaEventCard.d.ts +0 -10
  69. package/dist/modules/homepage/components/Agenda/AgendaEventCard.js +0 -30
  70. package/dist/modules/homepage/components/Agenda/hooks/useAgendaContainer.d.ts +0 -14
  71. package/dist/modules/homepage/components/Agenda/hooks/useAgendaContainer.js +0 -27
  72. package/dist/modules/homepage/components/Agenda/index.d.ts +0 -3
  73. package/dist/modules/homepage/components/Agenda/services/api/agendaService.d.ts +0 -24
  74. package/dist/modules/homepage/components/Agenda/services/api/agendaService.js +0 -45
  75. package/dist/modules/homepage/components/Agenda/services/api/index.d.ts +0 -4
  76. package/dist/modules/homepage/components/Agenda/services/api/index.js +0 -5
  77. package/dist/modules/homepage/components/Agenda/services/queries/agenda.d.ts +0 -19
  78. package/dist/modules/homepage/components/Agenda/services/queries/agenda.js +0 -26
  79. package/dist/modules/homepage/components/BriefMe/BriefMe.d.ts +0 -9
  80. package/dist/modules/homepage/components/BriefMe/BriefMe.js +0 -59
  81. package/dist/modules/homepage/components/BriefMe/BriefMeContainer.d.ts +0 -4
  82. package/dist/modules/homepage/components/BriefMe/BriefMeContainer.js +0 -17
  83. package/dist/modules/homepage/components/BriefMe/index.d.ts +0 -4
  84. package/dist/modules/homepage/components/BriefMe/types.d.ts +0 -17
  85. package/dist/modules/homepage/components/BriefMe/types.js +0 -8
  86. package/dist/modules/homepage/components/BriefMe/useBriefMe.d.ts +0 -31
  87. package/dist/modules/homepage/components/BriefMe/useBriefMe.js +0 -51
  88. package/dist/modules/homepage/components/Cantine/Cantine.d.ts +0 -7
  89. package/dist/modules/homepage/components/Cantine/Cantine.js +0 -44
  90. package/dist/modules/homepage/components/Cantine/CantineContainer.d.ts +0 -4
  91. package/dist/modules/homepage/components/Cantine/CantineContainer.js +0 -18
  92. package/dist/modules/homepage/components/Cantine/CantineModal.d.ts +0 -24
  93. package/dist/modules/homepage/components/Cantine/CantineModal.js +0 -88
  94. package/dist/modules/homepage/components/Cantine/CantineModalContainer.d.ts +0 -7
  95. package/dist/modules/homepage/components/Cantine/CantineModalContainer.js +0 -12
  96. package/dist/modules/homepage/components/Cantine/components/CantineLegend.d.ts +0 -5
  97. package/dist/modules/homepage/components/Cantine/components/CantineLegend.js +0 -22
  98. package/dist/modules/homepage/components/Cantine/components/CantineMenuSection.d.ts +0 -6
  99. package/dist/modules/homepage/components/Cantine/components/CantineMenuSection.js +0 -28
  100. package/dist/modules/homepage/components/Cantine/components/cantineLabels.d.ts +0 -12
  101. package/dist/modules/homepage/components/Cantine/components/cantineLabels.js +0 -60
  102. package/dist/modules/homepage/components/Cantine/hooks/useCantine.d.ts +0 -11
  103. package/dist/modules/homepage/components/Cantine/hooks/useCantine.js +0 -20
  104. package/dist/modules/homepage/components/Cantine/hooks/useCantineMenu.d.ts +0 -24
  105. package/dist/modules/homepage/components/Cantine/hooks/useCantineMenu.js +0 -65
  106. package/dist/modules/homepage/components/Cantine/hooks/useCantineModal.d.ts +0 -23
  107. package/dist/modules/homepage/components/Cantine/hooks/useCantineModal.js +0 -43
  108. package/dist/modules/homepage/components/Cantine/index.d.ts +0 -7
  109. package/dist/modules/homepage/components/Cantine/types.d.ts +0 -42
  110. package/dist/modules/homepage/components/GenerationHdf/GenerationHdf.d.ts +0 -16
  111. package/dist/modules/homepage/components/GenerationHdf/GenerationHdf.js +0 -48
  112. package/dist/modules/homepage/components/GenerationHdf/GenerationHdfContainer.d.ts +0 -4
  113. package/dist/modules/homepage/components/GenerationHdf/GenerationHdfContainer.js +0 -12
  114. package/dist/modules/homepage/components/GenerationHdf/formatSolde.d.ts +0 -1
  115. package/dist/modules/homepage/components/GenerationHdf/formatSolde.js +0 -6
  116. package/dist/modules/homepage/components/GenerationHdf/index.d.ts +0 -3
  117. package/dist/modules/homepage/components/GenerationHdf/useGenerationHdf.d.ts +0 -10
  118. package/dist/modules/homepage/components/GenerationHdf/useGenerationHdf.js +0 -68
  119. package/dist/modules/homepage/components/Header/AccountActionListPopover.d.ts +0 -13
  120. package/dist/modules/homepage/components/Header/AccountActionListPopover.js +0 -26
  121. package/dist/modules/homepage/components/Header/ActionItem.d.ts +0 -38
  122. package/dist/modules/homepage/components/Header/ActionItem.js +0 -34
  123. package/dist/modules/homepage/components/Header/MyAppsPopover.d.ts +0 -5
  124. package/dist/modules/homepage/components/Header/MyAppsPopover.js +0 -28
  125. package/dist/modules/homepage/components/Header/useSafeHoverPopover.js +0 -32
  126. package/dist/modules/homepage/components/Qwant/Qwant.d.ts +0 -4
  127. package/dist/modules/homepage/components/Qwant/Qwant.js +0 -41
  128. package/dist/modules/homepage/components/Qwant/QwantContainer.d.ts +0 -1
  129. package/dist/modules/homepage/components/Qwant/QwantContainer.js +0 -10
  130. package/dist/modules/homepage/components/Qwant/index.d.ts +0 -3
  131. package/dist/modules/homepage/components/Rss/Rss.d.ts +0 -11
  132. package/dist/modules/homepage/components/Rss/Rss.js +0 -64
  133. package/dist/modules/homepage/components/Rss/RssContainer.d.ts +0 -1
  134. package/dist/modules/homepage/components/Rss/RssContainer.js +0 -45
  135. package/dist/modules/homepage/components/Rss/RssFeedForm.d.ts +0 -13
  136. package/dist/modules/homepage/components/Rss/RssFeedForm.js +0 -69
  137. package/dist/modules/homepage/components/Rss/RssFeedsModal.d.ts +0 -11
  138. package/dist/modules/homepage/components/Rss/RssFeedsModal.js +0 -58
  139. package/dist/modules/homepage/components/Rss/hooks/useRssContainer.d.ts +0 -25
  140. package/dist/modules/homepage/components/Rss/hooks/useRssContainer.js +0 -43
  141. package/dist/modules/homepage/components/Rss/index.d.ts +0 -6
  142. package/dist/modules/homepage/components/Rss/services/api/index.d.ts +0 -5
  143. package/dist/modules/homepage/components/Rss/services/api/index.js +0 -5
  144. package/dist/modules/homepage/components/Rss/services/api/rssService.d.ts +0 -38
  145. package/dist/modules/homepage/components/Rss/services/api/rssService.js +0 -51
  146. package/dist/modules/homepage/components/Rss/services/queries/rss.d.ts +0 -28
  147. package/dist/modules/homepage/components/Rss/services/queries/rss.js +0 -71
  148. package/dist/modules/homepage/components/Rss/types.d.ts +0 -25
  149. package/dist/modules/homepage/components/Rss/utils.d.ts +0 -7
  150. package/dist/modules/homepage/components/Rss/utils.js +0 -19
  151. package/dist/modules/homepage/components/Universalis/Universalis.d.ts +0 -8
  152. package/dist/modules/homepage/components/Universalis/Universalis.js +0 -62
  153. package/dist/modules/homepage/components/Universalis/UniversalisContainer.d.ts +0 -1
  154. package/dist/modules/homepage/components/Universalis/UniversalisContainer.js +0 -16
  155. package/dist/modules/homepage/components/Universalis/index.d.ts +0 -3
  156. package/dist/modules/homepage/components/WidgetsPersonalizationPanel/WidgetToggle.d.ts +0 -16
  157. package/dist/modules/homepage/components/WidgetsPersonalizationPanel/WidgetToggle.js +0 -15
  158. package/dist/modules/homepage/components/WidgetsPersonalizationPanel/WidgetsPersonalizationPanel.d.ts +0 -21
  159. package/dist/modules/homepage/components/WidgetsPersonalizationPanel/WidgetsPersonalizationPanel.js +0 -47
  160. package/dist/modules/homepage/components/WidgetsPersonalizationPanel/index.d.ts +0 -2
  161. package/dist/modules/icons/components/IconAddWidget.d.ts +0 -7
  162. package/dist/modules/icons/components/IconAddWidget.js +0 -12
  163. package/dist/modules/icons/components/IconLogout.d.ts +0 -7
  164. package/dist/modules/icons/components/IconLogout.js +0 -13
@@ -1,48 +0,0 @@
1
- import { jsxs, jsx } from "react/jsx-runtime";
2
- import illuGenerationHdf from "@edifice.io/bootstrap/dist/images/homepage/illu-generation-hdf.svg";
3
- import { useTranslation } from "react-i18next";
4
- import SvgIconExternalLink from "../../../icons/components/IconExternalLink.js";
5
- import HomeCard from "../HomeCard/HomeCard.js";
6
- import ButtonBeta from "../../../../components/ButtonBeta/ButtonBeta.js";
7
- import Image from "../../../../components/Image/Image.js";
8
- import FormControl from "../../../../components/Form/FormControl.js";
9
- import Input from "../../../../components/Input/Input.js";
10
- function GenerationHdf({
11
- handleActionClick,
12
- status,
13
- cardNumber,
14
- onCardNumberChange,
15
- onSubmit,
16
- onEdit,
17
- wallets
18
- }) {
19
- const {
20
- t
21
- } = useTranslation(), isAccount = status === "account", isLoading = status === "loading", isError = status === "error";
22
- return /* @__PURE__ */ jsxs(HomeCard, { variant: "primary", children: [
23
- /* @__PURE__ */ jsxs("div", { className: "generation-hdf__header", children: [
24
- /* @__PURE__ */ jsx("h3", { className: "generation-hdf__title", children: t("homepage.widget.generation-hdf.title") }),
25
- /* @__PURE__ */ jsx(ButtonBeta, { "data-testid": "generation-hdf-button-open", "aria-label": t("homepage.widget.generation-hdf.open"), onClick: handleActionClick, leftIcon: /* @__PURE__ */ jsx(SvgIconExternalLink, {}), variant: "ghost", color: "tertiary" })
26
- ] }),
27
- /* @__PURE__ */ jsx(HomeCard.Content, { children: /* @__PURE__ */ jsxs("div", { className: "generation-hdf", children: [
28
- /* @__PURE__ */ jsx(Image, { src: illuGenerationHdf, alt: "Génération #HDF", className: "generation-hdf__logo" }),
29
- isAccount ? /* @__PURE__ */ jsxs("div", { className: "generation-hdf__account", children: [
30
- /* @__PURE__ */ jsx("h4", { className: "generation-hdf__account-title", children: t("homepage.widget.generation-hdf.wallets-title") }),
31
- /* @__PURE__ */ jsx("ul", { className: "generation-hdf__wallets", children: wallets.map((wallet, index) => /* @__PURE__ */ jsxs("li", { className: "generation-hdf__wallet", children: [
32
- /* @__PURE__ */ jsx("span", { className: "generation-hdf__wallet-label", children: wallet.label }),
33
- /* @__PURE__ */ jsx("span", { className: "generation-hdf__wallet-amount", children: wallet.amount })
34
- ] }, index)) })
35
- ] }) : /* @__PURE__ */ jsx("p", { className: "generation-hdf__description", children: t("homepage.widget.generation-hdf.description") }),
36
- /* @__PURE__ */ jsxs("form", { className: "generation-hdf__form", onSubmit, children: [
37
- /* @__PURE__ */ jsxs(FormControl, { id: "generationHdfCardNumber", className: "generation-hdf__field", status: isError ? "invalid" : void 0, children: [
38
- /* @__PURE__ */ jsx(Input, { size: "md", type: "text", inputMode: "numeric", placeholder: t("homepage.widget.generation-hdf.placeholder"), value: cardNumber, onChange: (event) => onCardNumberChange(event.target.value), disabled: isAccount, maxLength: 50 }),
39
- isError && /* @__PURE__ */ jsx(FormControl.Text, { children: t("homepage.widget.generation-hdf.error") })
40
- ] }),
41
- isAccount ? /* @__PURE__ */ jsx(ButtonBeta, { type: "button", variant: "outline", color: "default", onClick: onEdit, children: t("homepage.widget.generation-hdf.edit") }) : /* @__PURE__ */ jsx(ButtonBeta, { type: "submit", variant: "outline", color: "default", isLoading, disabled: !cardNumber.trim(), children: t("homepage.widget.generation-hdf.submit") })
42
- ] })
43
- ] }) })
44
- ] });
45
- }
46
- export {
47
- GenerationHdf as default
48
- };
@@ -1,4 +0,0 @@
1
- export declare function GenerationHdfContainer(): import("react/jsx-runtime").JSX.Element;
2
- export declare namespace GenerationHdfContainer {
3
- var displayName: string;
4
- }
@@ -1,12 +0,0 @@
1
- import { jsx } from "react/jsx-runtime";
2
- import GenerationHdf from "./GenerationHdf.js";
3
- import { useGenerationHdf } from "./useGenerationHdf.js";
4
- function GenerationHdfContainer() {
5
- const generationHdf = useGenerationHdf();
6
- return /* @__PURE__ */ jsx(GenerationHdf, { handleActionClick: () => {
7
- window.open("https://generation.hautsdefrance.fr", "_blank", "noopener,noreferrer");
8
- }, ...generationHdf });
9
- }
10
- export {
11
- GenerationHdfContainer
12
- };
@@ -1 +0,0 @@
1
- export declare function formatSolde(soldeStr: string): string;
@@ -1,6 +0,0 @@
1
- function formatSolde(soldeStr) {
2
- return typeof soldeStr != "string" || soldeStr.length === 0 ? soldeStr : soldeStr.length === 1 ? `0,0${soldeStr}` : soldeStr.length === 2 ? `0,${soldeStr}` : `${soldeStr.substring(0, soldeStr.length - 2)},${soldeStr.substring(soldeStr.length - 2)}`;
3
- }
4
- export {
5
- formatSolde
6
- };
@@ -1,3 +0,0 @@
1
- export * from './GenerationHdf';
2
- export { default as GenerationHdf } from './GenerationHdf';
3
- export * from './GenerationHdfContainer';
@@ -1,10 +0,0 @@
1
- import { FormEvent } from 'react';
2
- import { GenerationHdfStatus, GenerationHdfWallet } from './GenerationHdf';
3
- export declare function useGenerationHdf(): {
4
- status: GenerationHdfStatus;
5
- cardNumber: string;
6
- onCardNumberChange: import('react').Dispatch<import('react').SetStateAction<string>>;
7
- onSubmit: (event: FormEvent<HTMLFormElement>) => void;
8
- onEdit: () => void;
9
- wallets: GenerationHdfWallet[];
10
- };
@@ -1,68 +0,0 @@
1
- import { odeServices, USER_PREFS } from "@edifice.io/client";
2
- import { useQuery, useMutation } from "@tanstack/react-query";
3
- import { useState, useRef, useEffect } from "react";
4
- import { formatSolde } from "./formatSolde.js";
5
- function mapSalesToWallets(data) {
6
- return (data.sales ?? []).map((sale) => {
7
- var _a;
8
- const wallet = (_a = data.wallets) == null ? void 0 : _a.find((w) => w.code === sale.numPM);
9
- return {
10
- label: (wallet == null ? void 0 : wallet.libelle) ?? "",
11
- amount: `${formatSolde(sale.solde)} €`
12
- };
13
- });
14
- }
15
- async function fetchSales(cardNb) {
16
- const http = odeServices.http(), data = await http.get("/cursus/sales", {
17
- queryParams: {
18
- cardNb
19
- }
20
- });
21
- if (http.isResponseError())
22
- throw new Error(http.latestResponse.statusText);
23
- return data;
24
- }
25
- function useGenerationHdf() {
26
- const [cardNumber, setCardNumber] = useState(""), autoLoadTriggered = useRef(!1), preferenceQuery = useQuery({
27
- queryKey: ["cursus", "preference"],
28
- queryFn: () => odeServices.conf().getPreference(USER_PREFS.CURSUS)
29
- }), salesMutation = useMutation({
30
- mutationFn: async ({
31
- cardNb,
32
- persist
33
- }) => {
34
- const data = await fetchSales(cardNb);
35
- return persist && await odeServices.conf().savePreference(USER_PREFS.CURSUS, {
36
- cardNb
37
- }), data;
38
- }
39
- });
40
- useEffect(() => {
41
- if (autoLoadTriggered.current || !preferenceQuery.data) return;
42
- autoLoadTriggered.current = !0;
43
- const storedCardNb = preferenceQuery.data.cardNb;
44
- storedCardNb && (setCardNumber(storedCardNb), salesMutation.mutate({
45
- cardNb: storedCardNb,
46
- persist: !1
47
- }));
48
- }, [preferenceQuery.data, salesMutation]);
49
- const status = preferenceQuery.data ? salesMutation.isPending ? "loading" : salesMutation.isError ? "error" : salesMutation.isSuccess ? "account" : "idle" : "loading", wallets = salesMutation.data ? mapSalesToWallets(salesMutation.data) : [];
50
- return {
51
- status,
52
- cardNumber,
53
- onCardNumberChange: setCardNumber,
54
- onSubmit: (event) => {
55
- event.preventDefault(), !salesMutation.isPending && salesMutation.mutate({
56
- cardNb: cardNumber,
57
- persist: !0
58
- });
59
- },
60
- onEdit: () => {
61
- odeServices.conf().savePreference(USER_PREFS.CURSUS, {}), setCardNumber(""), salesMutation.reset();
62
- },
63
- wallets
64
- };
65
- }
66
- export {
67
- useGenerationHdf
68
- };
@@ -1,13 +0,0 @@
1
- import { PopoverProps } from '../../../../components';
2
- export interface AccountActionListPopoverProps extends Omit<PopoverProps, 'children'> {
3
- /**
4
- * Callback appended to the logout URL (from the theme configuration)
5
- */
6
- logoutCallback?: string;
7
- }
8
- /**
9
- * "Mon compte" popover of the Header v2: a white box listing the account
10
- * actions (my account, customize, logout).
11
- */
12
- export declare const AccountActionListPopover: import('react').ForwardRefExoticComponent<AccountActionListPopoverProps & import('react').RefAttributes<HTMLDivElement>>;
13
- export default AccountActionListPopover;
@@ -1,26 +0,0 @@
1
- import { jsx, jsxs } from "react/jsx-runtime";
2
- import { forwardRef } from "react";
3
- import clsx from "clsx";
4
- import { useTranslation } from "react-i18next";
5
- import SvgIconLogout from "../../../icons/components/IconLogout.js";
6
- import SvgIconSetBackground from "../../../icons/components/IconSetBackground.js";
7
- import SvgIconUser from "../../../icons/components/IconUser.js";
8
- import { ActionItem } from "./ActionItem.js";
9
- import { Popover, PopoverBody } from "../../../../components/Popover/Popover.js";
10
- const AccountActionListPopover = /* @__PURE__ */ forwardRef(({
11
- className,
12
- logoutCallback,
13
- ...restProps
14
- }, ref) => {
15
- const {
16
- t
17
- } = useTranslation();
18
- return /* @__PURE__ */ jsx(Popover, { ref, className: clsx("account-action-list-popover", className), ...restProps, children: /* @__PURE__ */ jsx(PopoverBody, { children: /* @__PURE__ */ jsxs("ul", { className: "account-action-list-popover__list", children: [
19
- /* @__PURE__ */ jsx("li", { children: /* @__PURE__ */ jsx(ActionItem, { href: "/userbook/mon-compte", icon: /* @__PURE__ */ jsx(SvgIconUser, {}), "data-testid": "header-my-account-button", children: t("navbar.myaccount") }) }),
20
- /* @__PURE__ */ jsx("li", { children: /* @__PURE__ */ jsx(ActionItem, { href: "/timeline/customize?callback=" + encodeURIComponent(`${window.location.pathname}${window.location.search}`), icon: /* @__PURE__ */ jsx(SvgIconSetBackground, {}), "data-testid": "header-customize-button", children: t("navbar.customize") }) }),
21
- /* @__PURE__ */ jsx("li", { children: /* @__PURE__ */ jsx(ActionItem, { href: "/auth/logout?callback=" + (logoutCallback ?? ""), icon: /* @__PURE__ */ jsx(SvgIconLogout, {}), variant: "destructive", "data-testid": "header-logout-button", children: t("navbar.disconnect") }) })
22
- ] }) }) });
23
- });
24
- export {
25
- AccountActionListPopover
26
- };
@@ -1,38 +0,0 @@
1
- import { ComponentPropsWithoutRef, ReactNode } from 'react';
2
- /**
3
- * Action row (icon + label), used in the Header v2 account popover.
4
- * Rendered as a link when `href` is set (navigation), otherwise as a button
5
- * (e.g. opening a modal or triggering an in-page action).
6
- *
7
- * Context-free on purpose (no Dropdown context, no `.dropdown-item` styles):
8
- * it is meant to be reused as the item primitive when the Dropdown component
9
- * is redesigned (see ENABLING-882). The ref is forwarded to the underlying
10
- * element so a parent menu can manage focus.
11
- */
12
- interface ActionItemBaseProps {
13
- /**
14
- * Icon displayed before the label (hidden from assistive technologies)
15
- */
16
- icon?: ReactNode;
17
- /**
18
- * Label
19
- */
20
- children: ReactNode;
21
- /**
22
- * `destructive` for destructive actions (e.g. logout)
23
- */
24
- variant?: 'default' | 'destructive';
25
- className?: string;
26
- }
27
- type ActionItemLinkProps = ActionItemBaseProps & Omit<ComponentPropsWithoutRef<'a'>, keyof ActionItemBaseProps> & {
28
- /**
29
- * Link target: renders the item as a link
30
- */
31
- href: string;
32
- };
33
- type ActionItemButtonProps = ActionItemBaseProps & Omit<ComponentPropsWithoutRef<'button'>, keyof ActionItemBaseProps> & {
34
- href?: never;
35
- };
36
- export type ActionItemProps = ActionItemLinkProps | ActionItemButtonProps;
37
- export declare const ActionItem: import('react').ForwardRefExoticComponent<ActionItemProps & import('react').RefAttributes<HTMLButtonElement | HTMLAnchorElement>>;
38
- export default ActionItem;
@@ -1,34 +0,0 @@
1
- import { jsx, jsxs, Fragment } from "react/jsx-runtime";
2
- import { forwardRef } from "react";
3
- import clsx from "clsx";
4
- const isLinkProps = (props) => props.href !== void 0, getClasses = (variant, className) => clsx("action-item", {
5
- "action-item--destructive": variant === "destructive"
6
- }, className), ActionItemContent = ({
7
- icon,
8
- children
9
- }) => /* @__PURE__ */ jsxs(Fragment, { children: [
10
- icon && /* @__PURE__ */ jsx("span", { className: "action-item__icon", "aria-hidden": "true", children: icon }),
11
- /* @__PURE__ */ jsx("span", { className: "action-item__label", children })
12
- ] }), ActionItem = /* @__PURE__ */ forwardRef((props, ref) => {
13
- if (isLinkProps(props)) {
14
- const {
15
- icon: icon2,
16
- children: children2,
17
- variant: variant2 = "default",
18
- className: className2,
19
- ...rest2
20
- } = props;
21
- return /* @__PURE__ */ jsx("a", { ref, className: getClasses(variant2, className2), ...rest2, children: /* @__PURE__ */ jsx(ActionItemContent, { icon: icon2, children: children2 }) });
22
- }
23
- const {
24
- icon,
25
- children,
26
- variant = "default",
27
- className,
28
- ...rest
29
- } = props;
30
- return /* @__PURE__ */ jsx("button", { ref, type: "button", className: getClasses(variant, className), ...rest, children: /* @__PURE__ */ jsx(ActionItemContent, { icon, children }) });
31
- });
32
- export {
33
- ActionItem
34
- };
@@ -1,5 +0,0 @@
1
- import { IWebApp } from '@edifice.io/client';
2
- export declare const MyAppsPopoverFooter: () => import("react/jsx-runtime").JSX.Element;
3
- export declare const MyAppsPopoverBody: ({ bookmarkedApps, }: {
4
- bookmarkedApps: IWebApp[] | undefined;
5
- }) => import("react/jsx-runtime").JSX.Element;
@@ -1,28 +0,0 @@
1
- import { jsxs, jsx } from "react/jsx-runtime";
2
- import { useTranslation } from "react-i18next";
3
- import illuEmptyFavorite from "@edifice.io/bootstrap/dist/images/homepage/illu-empty-favorite.svg";
4
- import Flex from "../../../../components/Flex/Flex.js";
5
- import AppIcon from "../../../../components/AppIcon/AppIcon.js";
6
- const MAX_VISIBLE_APPS = 10, appToOpenOnBlank = ["Administration"], MyAppsPopoverFooter = () => {
7
- const {
8
- t
9
- } = useTranslation();
10
- return /* @__PURE__ */ jsx("a", { href: "/welcome", className: "btn-beta btn-beta-tertiary btn-beta--ghost btn-beta--small", "data-testid": "header-my-apps-popover-more", children: /* @__PURE__ */ jsx("span", { children: t("homepage.header.myapps.seeMore") }) });
11
- }, MyAppsPopoverBody = ({
12
- bookmarkedApps
13
- }) => {
14
- const {
15
- t
16
- } = useTranslation(), getAppName = (app) => app.prefix && app.prefix.length > 1 ? t(app.prefix.substring(1)) : t(app.displayName) || "";
17
- return bookmarkedApps != null && bookmarkedApps.length ? /* @__PURE__ */ jsx("div", { className: "my-apps-popover-grid", "data-testid": "header-my-apps-popover", children: bookmarkedApps.slice(0, MAX_VISIBLE_APPS).map((app, index) => {
18
- const opensInNewTab = appToOpenOnBlank.includes(app.name) || app.isExternal || app.target === "_blank", appName = getAppName(app);
19
- return /* @__PURE__ */ jsx("a", { href: app.address, title: appName, "aria-label": appName, className: "my-apps-popover-item", "data-testid": "header-my-apps-popover-item", target: opensInNewTab ? "_blank" : void 0, rel: opensInNewTab ? "noopener noreferrer" : void 0, children: /* @__PURE__ */ jsx(AppIcon, { app, size: "32" }) }, index);
20
- }) }) : /* @__PURE__ */ jsxs(Flex, { direction: "column", align: "center", gap: "8", children: [
21
- /* @__PURE__ */ jsx("img", { src: illuEmptyFavorite, alt: "", width: 50, height: 50 }),
22
- /* @__PURE__ */ jsx("span", { className: "my-apps-popover-empty-text text-center", children: t("homepage.header.myapps.empty") })
23
- ] });
24
- };
25
- export {
26
- MyAppsPopoverBody,
27
- MyAppsPopoverFooter
28
- };
@@ -1,32 +0,0 @@
1
- import { useState } from "react";
2
- import { useFloating, useHover, safePolygon, useClick, useDismiss, useFocus, useInteractions } from "@floating-ui/react";
3
- function useSafeHoverPopover({
4
- hoverEnabled = !0,
5
- clickEnabled = !1
6
- } = {}) {
7
- const [open, setOpen] = useState(!1), {
8
- refs,
9
- context
10
- } = useFloating({
11
- open,
12
- onOpenChange: setOpen
13
- }), hover = useHover(context, {
14
- enabled: hoverEnabled,
15
- handleClose: safePolygon()
16
- }), click = useClick(context, {
17
- enabled: clickEnabled
18
- }), dismiss = useDismiss(context), focus = useFocus(context), {
19
- getReferenceProps,
20
- getFloatingProps
21
- } = useInteractions([hover, click, dismiss, focus]);
22
- return {
23
- open,
24
- setReference: refs.setReference,
25
- setFloating: refs.setFloating,
26
- getReferenceProps,
27
- getFloatingProps
28
- };
29
- }
30
- export {
31
- useSafeHoverPopover
32
- };
@@ -1,4 +0,0 @@
1
- export interface QwantProps {
2
- handleActionClick: () => void;
3
- }
4
- export default function Qwant({ handleActionClick }: QwantProps): import("react/jsx-runtime").JSX.Element;
@@ -1,41 +0,0 @@
1
- import { jsxs, jsx } from "react/jsx-runtime";
2
- import illuQwant from "@edifice.io/bootstrap/dist/images/homepage/illu-qwant.png";
3
- import { useForm } from "react-hook-form";
4
- import { useTranslation } from "react-i18next";
5
- import SvgIconExternalLink from "../../../icons/components/IconExternalLink.js";
6
- import SvgIconSearch from "../../../icons/components/IconSearch.js";
7
- import HomeCard from "../HomeCard/HomeCard.js";
8
- import ButtonBeta from "../../../../components/ButtonBeta/ButtonBeta.js";
9
- import Image from "../../../../components/Image/Image.js";
10
- import FormControl from "../../../../components/Form/FormControl.js";
11
- import Input from "../../../../components/Input/Input.js";
12
- function Qwant({
13
- handleActionClick
14
- }) {
15
- const {
16
- t
17
- } = useTranslation(), {
18
- register
19
- } = useForm();
20
- return /* @__PURE__ */ jsxs(HomeCard, { variant: "primary", children: [
21
- /* @__PURE__ */ jsxs("div", { className: "qwant__header", children: [
22
- /* @__PURE__ */ jsx("h3", { className: "qwant__title", children: t("homepage.widget.qwant.title") }),
23
- /* @__PURE__ */ jsx(ButtonBeta, { className: "qwant__header-button", "data-testid": "qwant-button-open", "aria-label": t("homepage.widget.qwant.open"), onClick: handleActionClick, leftIcon: /* @__PURE__ */ jsx(SvgIconExternalLink, {}), variant: "ghost", color: "tertiary" })
24
- ] }),
25
- /* @__PURE__ */ jsx(HomeCard.Content, { children: /* @__PURE__ */ jsxs("div", { className: "qwant", children: [
26
- /* @__PURE__ */ jsxs("div", { className: "qwant__intro", children: [
27
- /* @__PURE__ */ jsx(Image, { src: illuQwant, alt: "Qwant", className: "qwant__logo" }),
28
- /* @__PURE__ */ jsx("p", { className: "qwant__description", children: t("homepage.widget.qwant.description") })
29
- ] }),
30
- /* @__PURE__ */ jsx("form", { method: "GET", action: "https://www.qwant.com", target: "_blank", className: "qwant__search", children: /* @__PURE__ */ jsxs(FormControl, { id: "inputQwantQuery", className: "qwant__search-field", children: [
31
- /* @__PURE__ */ jsx(FormControl.Label, { className: "visually-hidden", children: t("search") }),
32
- /* @__PURE__ */ jsx(Input, { "data-testid": "qwant-search-input", placeholder: t("search"), size: "md", type: "text", maxLength: 255, ...register("q") }),
33
- /* @__PURE__ */ jsx("input", { type: "hidden", name: "l", value: "fr" }),
34
- /* @__PURE__ */ jsx(ButtonBeta, { leftIcon: /* @__PURE__ */ jsx(SvgIconSearch, {}), type: "submit", "aria-label": t("search"), variant: "filled", color: "default" })
35
- ] }) })
36
- ] }) })
37
- ] });
38
- }
39
- export {
40
- Qwant as default
41
- };
@@ -1 +0,0 @@
1
- export declare function QwantContainer(): import("react/jsx-runtime").JSX.Element;
@@ -1,10 +0,0 @@
1
- import { jsx } from "react/jsx-runtime";
2
- import Qwant from "./Qwant.js";
3
- function QwantContainer() {
4
- return /* @__PURE__ */ jsx(Qwant, { handleActionClick: () => {
5
- window.open("https://www.qwant.com", "_blank", "noopener,noreferrer");
6
- } });
7
- }
8
- export {
9
- QwantContainer
10
- };
@@ -1,3 +0,0 @@
1
- export * from './Qwant';
2
- export { default as Qwant } from './Qwant';
3
- export * from './QwantContainer';
@@ -1,11 +0,0 @@
1
- import { RssArticle, RssArticlesStatus, RssFeed } from './types';
2
- export interface RssProps {
3
- feeds: RssFeed[];
4
- isLoading?: boolean;
5
- selectedIndex: number;
6
- onSelectFeed: (index: number) => void;
7
- articles: RssArticle[];
8
- articlesStatus: RssArticlesStatus;
9
- onEditClick: () => void;
10
- }
11
- export declare function Rss({ feeds, isLoading, selectedIndex, onSelectFeed, articles, articlesStatus, onEditClick, }: RssProps): import("react/jsx-runtime").JSX.Element;
@@ -1,64 +0,0 @@
1
- import { jsxs, jsx } from "react/jsx-runtime";
2
- import clsx from "clsx";
3
- import { useTranslation } from "react-i18next";
4
- import illuEmptyArticles from "@edifice.io/bootstrap/dist/images/homepage/illu-rss-empty-articles.svg";
5
- import illuError from "@edifice.io/bootstrap/dist/images/homepage/illu-rss-error.svg";
6
- import illuEmptyFeeds from "@edifice.io/bootstrap/dist/images/homepage/illu-empty-useful-links.png";
7
- import SvgIconEdit from "../../../icons/components/IconEdit.js";
8
- import SvgIconPlus from "../../../icons/components/IconPlus.js";
9
- import { htmlToText } from "./utils.js";
10
- import useDate from "../../../../hooks/useDate/useDate.js";
11
- import HomeCard from "../HomeCard/HomeCard.js";
12
- import ButtonBeta from "../../../../components/ButtonBeta/ButtonBeta.js";
13
- import Image from "../../../../components/Image/Image.js";
14
- import TextSkeleton from "../../../../components/Skeleton/TextSkeleton.js";
15
- const SKELETON_ARTICLES = [0, 1, 2];
16
- function Rss({
17
- feeds,
18
- isLoading = !1,
19
- selectedIndex,
20
- onSelectFeed,
21
- articles,
22
- articlesStatus,
23
- onEditClick
24
- }) {
25
- const {
26
- t
27
- } = useTranslation(), {
28
- formatDate
29
- } = useDate(), hasFeeds = feeds.length > 0, renderArticles = (status) => status === "loading" ? /* @__PURE__ */ jsx("div", { className: "rss-widget__articles", "data-testid": "rss-skeleton", children: SKELETON_ARTICLES.map((key) => /* @__PURE__ */ jsxs("div", { className: "rss-widget__article", "aria-hidden": "true", children: [
30
- /* @__PURE__ */ jsx(TextSkeleton, { className: "rss-widget__skeleton-title" }),
31
- /* @__PURE__ */ jsx(TextSkeleton, { size: "xs", className: "rss-widget__skeleton-date" }),
32
- /* @__PURE__ */ jsx(TextSkeleton, { size: "sm" }),
33
- /* @__PURE__ */ jsx(TextSkeleton, { size: "sm" })
34
- ] }, key)) }) : status === "error" ? /* @__PURE__ */ jsxs("div", { className: "rss-widget__state", children: [
35
- /* @__PURE__ */ jsx("div", { className: "rss-widget__state-illustration", children: /* @__PURE__ */ jsx(Image, { src: illuError, alt: "", "aria-hidden": "true", className: "rss-widget__error-image" }) }),
36
- /* @__PURE__ */ jsx("p", { className: "rss-widget__state-text", children: t("homepage.widget.rss.error") })
37
- ] }) : articles.length === 0 ? /* @__PURE__ */ jsxs("div", { className: "rss-widget__state", children: [
38
- /* @__PURE__ */ jsx(Image, { src: illuEmptyArticles, alt: "", "aria-hidden": "true", className: "rss-widget__empty-articles-image" }),
39
- /* @__PURE__ */ jsx("p", { className: "rss-widget__state-text", children: t("homepage.widget.rss.noArticles") })
40
- ] }) : /* @__PURE__ */ jsx("div", { className: "rss-widget__articles", children: articles.map((article, index) => /* @__PURE__ */ jsxs("a", { href: article.link, target: "_blank", rel: "noopener noreferrer", className: "rss-widget__article", "data-testid": `rss-link-article-${index}`, children: [
41
- /* @__PURE__ */ jsx("span", { className: "rss-widget__article-title", children: article.title }),
42
- article.pubDate && /* @__PURE__ */ jsx("span", { className: "rss-widget__article-date", children: formatDate(new Date(article.pubDate), "dddd D MMMM YYYY") }),
43
- article.description && /* @__PURE__ */ jsx("span", { className: "rss-widget__article-description", children: htmlToText(article.description) })
44
- ] }, `${article.link}-${index}`)) });
45
- return /* @__PURE__ */ jsxs(HomeCard, { variant: "primary", children: [
46
- /* @__PURE__ */ jsxs("div", { className: "rss-widget__header", children: [
47
- /* @__PURE__ */ jsx("h3", { className: "rss-widget__title", children: t("homepage.widget.rss.title") }),
48
- !isLoading && (hasFeeds ? /* @__PURE__ */ jsx(ButtonBeta, { type: "button", variant: "ghost", color: "tertiary", leftIcon: /* @__PURE__ */ jsx(SvgIconEdit, {}), "aria-label": t("homepage.widget.rss.edit"), "data-testid": "rss-button-edit", onClick: onEditClick }) : /* @__PURE__ */ jsx(ButtonBeta, { type: "button", variant: "ghost", color: "tertiary", size: "sm", rightIcon: /* @__PURE__ */ jsx(SvgIconPlus, {}), "data-testid": "rss-button-add", onClick: onEditClick, children: t("homepage.widget.rss.add") }))
49
- ] }),
50
- /* @__PURE__ */ jsx(HomeCard.Content, { children: /* @__PURE__ */ jsxs("div", { className: "rss-widget", children: [
51
- !isLoading && !hasFeeds && /* @__PURE__ */ jsxs("div", { className: "rss-widget__empty", children: [
52
- /* @__PURE__ */ jsx(Image, { src: illuEmptyFeeds, alt: "", "aria-hidden": "true", className: "rss-widget__empty-image" }),
53
- /* @__PURE__ */ jsx("p", { className: "rss-widget__state-text", children: t("homepage.widget.rss.empty") })
54
- ] }),
55
- !isLoading && hasFeeds && /* @__PURE__ */ jsx("div", { className: "rss-widget__feeds", role: "group", "aria-label": t("homepage.widget.rss.feeds"), children: feeds.map((feed, index) => /* @__PURE__ */ jsx("button", { type: "button", className: clsx("rss-widget__chip", {
56
- "rss-widget__chip-active": index === selectedIndex
57
- }), "aria-pressed": index === selectedIndex, "data-testid": `rss-button-feed-${index}`, onClick: () => onSelectFeed(index), children: feed.title }, `${feed.link}-${index}`)) }),
58
- (isLoading || hasFeeds) && renderArticles(isLoading ? "loading" : articlesStatus)
59
- ] }) })
60
- ] });
61
- }
62
- export {
63
- Rss
64
- };
@@ -1 +0,0 @@
1
- export declare function RssContainer(): import("react/jsx-runtime").JSX.Element;
@@ -1,45 +0,0 @@
1
- import { jsxs, Fragment, jsx } from "react/jsx-runtime";
2
- import { useState } from "react";
3
- import { useRssContainer } from "./hooks/useRssContainer.js";
4
- import { Rss } from "./Rss.js";
5
- import { RssFeedForm } from "./RssFeedForm.js";
6
- import { RssFeedsModal } from "./RssFeedsModal.js";
7
- function RssContainer() {
8
- const [view, setView] = useState({
9
- name: "closed"
10
- }), {
11
- feeds,
12
- isLoading,
13
- canAddFeed,
14
- selectedIndex,
15
- selectFeed,
16
- articles,
17
- articlesStatus,
18
- addFeed,
19
- updateFeed,
20
- deleteFeed,
21
- isSaving
22
- } = useRssContainer(), closeAll = () => setView({
23
- name: "closed"
24
- }), backToManage = () => setView({
25
- name: "manage"
26
- }), handleSubmit = (payload) => {
27
- view.name === "edit" ? updateFeed(view.index, payload, backToManage) : addFeed(payload, backToManage);
28
- };
29
- return /* @__PURE__ */ jsxs(Fragment, { children: [
30
- /* @__PURE__ */ jsx(Rss, { feeds, isLoading, selectedIndex, onSelectFeed: selectFeed, articles, articlesStatus, onEditClick: () => setView({
31
- name: "manage"
32
- }) }),
33
- /* @__PURE__ */ jsx(RssFeedsModal, { isOpen: view.name === "manage", feeds, canAddFeed, onClose: closeAll, onAddClick: () => setView({
34
- name: "add"
35
- }), onEditFeed: (index) => setView({
36
- name: "edit",
37
- index,
38
- feed: feeds[index]
39
- }), onDeleteFeed: deleteFeed }),
40
- (view.name === "add" || view.name === "edit") && /* @__PURE__ */ jsx(RssFeedForm, { mode: view.name, feed: view.name === "edit" ? view.feed : void 0, isSubmitting: isSaving, onCancel: backToManage, onClose: closeAll, onSubmit: handleSubmit })
41
- ] });
42
- }
43
- export {
44
- RssContainer
45
- };
@@ -1,13 +0,0 @@
1
- import { RssFeed, RssFeedPayload } from './types';
2
- export interface RssFeedFormProps {
3
- mode: 'add' | 'edit';
4
- /** Feed being edited. Ignored in "add" mode. */
5
- feed?: RssFeed;
6
- isSubmitting: boolean;
7
- /** Closes the form and goes back to the management modal, without saving. */
8
- onCancel: () => void;
9
- /** Closes the whole modal stack. */
10
- onClose: () => void;
11
- onSubmit: (payload: RssFeedPayload) => void;
12
- }
13
- export declare function RssFeedForm({ mode, feed, isSubmitting, onCancel, onClose, onSubmit, }: RssFeedFormProps): import("react/jsx-runtime").JSX.Element;
@@ -1,69 +0,0 @@
1
- import { jsxs, jsx } from "react/jsx-runtime";
2
- import { useForm } from "react-hook-form";
3
- import { useTranslation } from "react-i18next";
4
- import { isValidRssFeedUrl } from "./utils.js";
5
- import ModalBeta from "../../../../components/ModalBeta/ModalBeta.js";
6
- import FormControl from "../../../../components/Form/FormControl.js";
7
- import Label from "../../../../components/Label/Label.js";
8
- import Input from "../../../../components/Input/Input.js";
9
- import ButtonBeta from "../../../../components/ButtonBeta/ButtonBeta.js";
10
- const TITLE_MAX_LENGTH = 80;
11
- function RssFeedForm({
12
- mode,
13
- feed,
14
- isSubmitting,
15
- onCancel,
16
- onClose,
17
- onSubmit
18
- }) {
19
- const {
20
- t
21
- } = useTranslation(), formId = "rss-feed-form", {
22
- register,
23
- handleSubmit,
24
- formState: {
25
- errors,
26
- isDirty,
27
- isValid
28
- }
29
- } = useForm({
30
- mode: "onChange",
31
- defaultValues: {
32
- title: (feed == null ? void 0 : feed.title) ?? "",
33
- link: (feed == null ? void 0 : feed.link) ?? ""
34
- }
35
- }), modalTitle = t(mode === "add" ? "homepage.widget.rss.form.addTitle" : "homepage.widget.rss.form.editTitle"), handleFormSubmit = (data) => {
36
- onSubmit({
37
- title: data.title.trim(),
38
- link: data.link.trim()
39
- });
40
- };
41
- return /* @__PURE__ */ jsxs(ModalBeta, { id: "rss-feed-modal", isOpen: !0, size: "l", onModalClose: onClose, children: [
42
- /* @__PURE__ */ jsx(ModalBeta.Header, { onModalClose: onClose, children: modalTitle }),
43
- /* @__PURE__ */ jsx(ModalBeta.Body, { children: /* @__PURE__ */ jsxs("form", { id: formId, className: "rss-widget-form", onSubmit: handleSubmit(handleFormSubmit), children: [
44
- /* @__PURE__ */ jsxs(FormControl, { id: "rss-feed-title", isRequired: !0, children: [
45
- /* @__PURE__ */ jsx(Label, { children: t("homepage.widget.rss.form.title") }),
46
- /* @__PURE__ */ jsx(Input, { type: "text", size: "md", maxLength: TITLE_MAX_LENGTH, showCounter: !0, clearable: !0, "data-testid": "rss-input-title", placeholder: t("homepage.widget.rss.form.title.placeholder"), ...register("title", {
47
- required: !0,
48
- maxLength: TITLE_MAX_LENGTH,
49
- validate: (value) => value.trim().length > 0
50
- }) })
51
- ] }),
52
- /* @__PURE__ */ jsxs(FormControl, { id: "rss-feed-link", isRequired: !0, status: errors.link ? "invalid" : void 0, children: [
53
- /* @__PURE__ */ jsx(Label, { children: t("homepage.widget.rss.form.link") }),
54
- /* @__PURE__ */ jsx(Input, { type: "text", size: "md", "data-testid": "rss-input-link", placeholder: t("homepage.widget.rss.form.link.placeholder"), ...register("link", {
55
- required: !0,
56
- validate: isValidRssFeedUrl
57
- }) }),
58
- errors.link && /* @__PURE__ */ jsx(FormControl.Text, { children: t("homepage.widget.rss.error") })
59
- ] })
60
- ] }) }),
61
- /* @__PURE__ */ jsxs(ModalBeta.Footer, { children: [
62
- /* @__PURE__ */ jsx(ButtonBeta, { type: "button", variant: "ghost", color: "tertiary", "data-testid": "rss-button-cancel", onClick: onCancel, children: t("homepage.widget.rss.form.cancel") }),
63
- /* @__PURE__ */ jsx(ButtonBeta, { form: formId, type: "submit", isLoading: isSubmitting, disabled: !isValid || !isDirty || isSubmitting, "data-testid": "rss-button-save", children: t("homepage.widget.rss.form.save") })
64
- ] })
65
- ] });
66
- }
67
- export {
68
- RssFeedForm
69
- };