@edifice.io/react 2.2.11-develop-enabling.20250710092201 → 2.2.11-develop-pedago.20250710120949
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/Button/Button.d.ts +1 -1
- package/dist/components/Dropdown/Dropdown.d.ts +10 -4
- package/dist/components/Dropdown/Dropdown.js +24 -8
- package/dist/components/Flex/Flex.d.ts +1 -0
- package/dist/components/Flex/Flex.js +2 -1
- package/dist/components/Layout/Layout.d.ts +5 -1
- package/dist/components/Layout/Layout.js +5 -2
- package/dist/components/SearchBar/SearchBar.d.ts +9 -33
- package/dist/components/SearchBar/SearchBar.js +4 -30
- package/dist/components/Tabs/components/Tabs.d.ts +23 -3
- package/dist/components/Tabs/components/Tabs.js +8 -3
- package/dist/components/Tabs/components/TabsList.d.ts +15 -1
- package/dist/components/Tabs/components/TabsList.js +13 -3
- package/dist/components/Tabs/components/TabsPanel.d.ts +5 -1
- package/dist/components/Tabs/components/TabsPanel.js +7 -3
- package/dist/hooks/useDropdown/useDropdown.d.ts +2 -0
- package/dist/hooks/useDropdown/useDropdown.js +2 -0
- package/dist/hooks/useEdificeIcons/useEdificeIcons.js +4 -1
- package/dist/hooks/useLibraryUrl/useLibraryUrl.d.ts +1 -1
- package/dist/hooks/useLibraryUrl/useLibraryUrl.js +2 -2
- package/dist/icons-apps.js +164 -174
- package/dist/icons.js +86 -90
- package/dist/index.js +12 -10
- package/dist/modules/editor/components/Toolbar/TableToolbar.AddMenu.js +1 -1
- package/dist/modules/editor/components/Toolbar/TableToolbar.DelMenu.js +1 -1
- package/dist/modules/icons/components/{apps/IconMinibadge.d.ts → IconMegaphone.d.ts} +2 -2
- package/dist/modules/icons/components/IconMegaphone.js +12 -0
- package/dist/modules/icons/components/IconNotes.d.ts +7 -0
- package/dist/modules/icons/components/IconNotes.js +13 -0
- package/dist/modules/icons/components/apps/IconAccount.js +2 -2
- package/dist/modules/icons/components/apps/IconActualites.js +2 -2
- package/dist/modules/icons/components/apps/IconAdmin.js +2 -2
- package/dist/modules/icons/components/apps/IconAgenda.js +2 -3
- package/dist/modules/icons/components/apps/IconAppointments.js +2 -2
- package/dist/modules/icons/components/apps/IconArchive.js +2 -2
- package/dist/modules/icons/components/apps/IconBlog.js +2 -2
- package/dist/modules/icons/components/apps/IconCahierDeTexte.js +2 -2
- package/dist/modules/icons/components/apps/IconCalendar.js +2 -3
- package/dist/modules/icons/components/apps/IconCollaborativeWall.js +2 -2
- package/dist/modules/icons/components/apps/IconCommunity.js +2 -2
- package/dist/modules/icons/components/apps/IconConversation.js +2 -2
- package/dist/modules/icons/components/apps/IconDirectory.js +2 -2
- package/dist/modules/icons/components/apps/IconExercizer.js +2 -2
- package/dist/modules/icons/components/apps/IconForms.js +6 -2
- package/dist/modules/icons/components/apps/IconForum.js +2 -2
- package/dist/modules/icons/components/apps/IconLibrary.js +2 -2
- package/dist/modules/icons/components/apps/IconMediacentre.js +2 -2
- package/dist/modules/icons/components/apps/IconMindmap.js +2 -2
- package/dist/modules/icons/components/apps/IconMoodle.js +2 -2
- package/dist/modules/icons/components/apps/IconNabook.js +4 -2
- package/dist/modules/icons/components/apps/IconNotebook.js +2 -2
- package/dist/modules/icons/components/apps/IconPad.js +2 -2
- package/dist/modules/icons/components/apps/IconPages.js +2 -2
- package/dist/modules/icons/components/apps/IconParametrage.js +2 -2
- package/dist/modules/icons/components/apps/IconParametrages.js +2 -2
- package/dist/modules/icons/components/apps/IconPoll.js +2 -2
- package/dist/modules/icons/components/apps/IconPresences.js +6 -2
- package/dist/modules/icons/components/apps/IconRack.js +2 -2
- package/dist/modules/icons/components/apps/IconRbs.js +2 -2
- package/dist/modules/icons/components/apps/IconSchoolbook.js +2 -2
- package/dist/modules/icons/components/apps/IconScrapbook.js +2 -2
- package/dist/modules/icons/components/apps/IconSettingsClass.js +2 -2
- package/dist/modules/icons/components/apps/IconSharebigfiles.js +2 -2
- package/dist/modules/icons/components/apps/IconStatistics.js +2 -2
- package/dist/modules/icons/components/apps/IconSupport.js +2 -2
- package/dist/modules/icons/components/apps/IconTimeline.js +2 -2
- package/dist/modules/icons/components/apps/IconTimelinegenerator.js +2 -2
- package/dist/modules/icons/components/apps/IconUserbook.js +2 -2
- package/dist/modules/icons/components/apps/IconVisioconf.js +2 -2
- package/dist/modules/icons/components/apps/IconWebsite.js +2 -2
- package/dist/modules/icons/components/apps/IconWiki.js +3 -3
- package/dist/modules/icons/components/apps/IconWorkspace.js +2 -2
- package/dist/modules/icons/components/apps/index.d.ts +0 -5
- package/dist/modules/icons/components/index.d.ts +2 -4
- package/dist/modules/modals/OnboardingModal/OnboardingModal.d.ts +4 -6
- package/dist/modules/modals/OnboardingModal/OnboardingModal.js +13 -27
- package/dist/modules/modals/OnboardingModal/index.d.ts +0 -1
- package/dist/modules/modals/OnboardingModal/useOnboardingModal.js +4 -4
- package/dist/modules/modals/ResourceModal/ResourceModal.d.ts +57 -2
- package/dist/modules/modals/ResourceModal/ResourceModal.js +20 -16
- package/dist/modules/multimedia/FileCard/FileCard.d.ts +13 -2
- package/dist/modules/multimedia/FileCard/FileCard.js +15 -5
- package/dist/modules/multimedia/FileCard/FileIcon.d.ts +5 -1
- package/dist/modules/multimedia/FileCard/FileIcon.js +2 -2
- package/dist/modules/multimedia/MediaLibrary/MediaLibrary.d.ts +3 -1
- package/dist/modules/multimedia/MediaLibrary/MediaLibrary.js +7 -2
- package/dist/modules/multimedia/index.d.ts +1 -0
- package/dist/multimedia.js +12 -10
- package/package.json +6 -6
- package/dist/modules/icons/components/IconLibrary.d.ts +0 -7
- package/dist/modules/icons/components/IconLibrary.js +0 -12
- package/dist/modules/icons/components/IconNotification.d.ts +0 -7
- package/dist/modules/icons/components/IconNotification.js +0 -12
- package/dist/modules/icons/components/IconStar.d.ts +0 -7
- package/dist/modules/icons/components/IconStar.js +0 -13
- package/dist/modules/icons/components/IconStarFavorite.d.ts +0 -7
- package/dist/modules/icons/components/IconStarFull.d.ts +0 -7
- package/dist/modules/icons/components/IconStarFull.js +0 -13
- package/dist/modules/icons/components/apps/IconEdt.d.ts +0 -7
- package/dist/modules/icons/components/apps/IconEdt.js +0 -12
- package/dist/modules/icons/components/apps/IconGeogebra.d.ts +0 -7
- package/dist/modules/icons/components/apps/IconGeogebra.js +0 -12
- package/dist/modules/icons/components/apps/IconMagneto.d.ts +0 -7
- package/dist/modules/icons/components/apps/IconMagneto.js +0 -13
- package/dist/modules/icons/components/apps/IconMinetest.d.ts +0 -7
- package/dist/modules/icons/components/apps/IconMinetest.js +0 -12
- package/dist/modules/icons/components/apps/IconMinibadge.js +0 -12
|
@@ -2,7 +2,7 @@ import { ReactNode } from 'react';
|
|
|
2
2
|
import { LoadingIcon, LoadingPosition } from '../Loading';
|
|
3
3
|
export type ButtonRef = HTMLButtonElement;
|
|
4
4
|
export type ButtonTypes = 'button' | 'submit' | 'reset';
|
|
5
|
-
export type ButtonColors = 'primary' | 'secondary' | 'tertiary' | 'danger'
|
|
5
|
+
export type ButtonColors = 'primary' | 'secondary' | 'tertiary' | 'danger';
|
|
6
6
|
export type ButtonVariants = 'filled' | 'outline' | 'ghost';
|
|
7
7
|
export type ButtonSizes = 'sm' | 'md' | 'lg';
|
|
8
8
|
export interface ButtonProps extends React.ComponentPropsWithRef<'button'> {
|
|
@@ -1,6 +1,15 @@
|
|
|
1
1
|
import { ReactNode } from 'react';
|
|
2
2
|
import { Placement } from '@floating-ui/react';
|
|
3
3
|
import { default as DropdownCheckboxItem } from './DropdownCheckboxItem';
|
|
4
|
+
export interface DropdownApi {
|
|
5
|
+
visible: boolean;
|
|
6
|
+
isFocused: string | null;
|
|
7
|
+
menuRef: React.MutableRefObject<HTMLUListElement | null>;
|
|
8
|
+
triggerRef: React.MutableRefObject<HTMLButtonElement | null>;
|
|
9
|
+
setVisible: (visible: boolean) => void;
|
|
10
|
+
openDropdown: () => void;
|
|
11
|
+
closeDropdown: () => void;
|
|
12
|
+
}
|
|
4
13
|
export interface DropdownProps {
|
|
5
14
|
/** Children Props */
|
|
6
15
|
children: ReactNode | ((...props: any) => ReactNode);
|
|
@@ -68,10 +77,7 @@ export type DropdownMenuOptions = {
|
|
|
68
77
|
*/
|
|
69
78
|
type: 'divider';
|
|
70
79
|
};
|
|
71
|
-
declare const Dropdown: {
|
|
72
|
-
({ children, block, overflow, noWrap, placement, extraTriggerKeyDownHandler, onToggle, isTriggerHovered, focusOnVisible, openOnSpace, focusOnMouseEnter, }: DropdownProps): import("react/jsx-runtime").JSX.Element;
|
|
73
|
-
displayName: string;
|
|
74
|
-
} & {
|
|
80
|
+
declare const Dropdown: import('react').ForwardRefExoticComponent<DropdownProps & import('react').RefAttributes<DropdownApi>> & {
|
|
75
81
|
Trigger: import('react').ForwardRefExoticComponent<Omit<import('./DropdownTrigger').DropdownTriggerProps, "ref"> & import('react').RefAttributes<HTMLButtonElement>>;
|
|
76
82
|
Menu: import('react').ForwardRefExoticComponent<Omit<import('./DropdownMenu').DropdownMenuProps, "ref"> & import('react').RefAttributes<HTMLDivElement>>;
|
|
77
83
|
Item: {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsx } from "react/jsx-runtime";
|
|
2
|
-
import { useMemo, useEffect } from "react";
|
|
2
|
+
import { forwardRef, useImperativeHandle, useMemo, useEffect } from "react";
|
|
3
3
|
import clsx from "clsx";
|
|
4
4
|
import useDropdown from "../../hooks/useDropdown/useDropdown.js";
|
|
5
5
|
import DropdownCheckboxItem from "./DropdownCheckboxItem.js";
|
|
@@ -11,7 +11,7 @@ import DropdownRadioItem from "./DropdownRadioItem.js";
|
|
|
11
11
|
import DropdownSeparator from "./DropdownSeparator.js";
|
|
12
12
|
import DropdownTrigger from "./DropdownTrigger.js";
|
|
13
13
|
import useClickOutside from "../../hooks/useClickOutside/useClickOutside.js";
|
|
14
|
-
const Root = ({
|
|
14
|
+
const Root = /* @__PURE__ */ forwardRef(({
|
|
15
15
|
children,
|
|
16
16
|
block,
|
|
17
17
|
overflow = !0,
|
|
@@ -23,7 +23,7 @@ const Root = ({
|
|
|
23
23
|
focusOnVisible = !0,
|
|
24
24
|
openOnSpace = !0,
|
|
25
25
|
focusOnMouseEnter = !0
|
|
26
|
-
}) => {
|
|
26
|
+
}, refDropdown) => {
|
|
27
27
|
const {
|
|
28
28
|
visible,
|
|
29
29
|
isFocused,
|
|
@@ -31,8 +31,22 @@ const Root = ({
|
|
|
31
31
|
menuProps,
|
|
32
32
|
itemProps,
|
|
33
33
|
itemRefs,
|
|
34
|
-
setVisible
|
|
35
|
-
|
|
34
|
+
setVisible,
|
|
35
|
+
menuRef,
|
|
36
|
+
triggerRef,
|
|
37
|
+
closeDropdown,
|
|
38
|
+
openDropdown
|
|
39
|
+
} = useDropdown(placement, extraTriggerKeyDownHandler, isTriggerHovered, focusOnVisible, openOnSpace, focusOnMouseEnter);
|
|
40
|
+
useImperativeHandle(refDropdown, () => ({
|
|
41
|
+
visible,
|
|
42
|
+
setVisible,
|
|
43
|
+
isFocused,
|
|
44
|
+
menuRef,
|
|
45
|
+
triggerRef,
|
|
46
|
+
closeDropdown,
|
|
47
|
+
openDropdown
|
|
48
|
+
}));
|
|
49
|
+
const ref = useClickOutside(() => {
|
|
36
50
|
setVisible(!1);
|
|
37
51
|
}), value = useMemo(() => ({
|
|
38
52
|
visible,
|
|
@@ -42,8 +56,10 @@ const Root = ({
|
|
|
42
56
|
itemProps,
|
|
43
57
|
itemRefs,
|
|
44
58
|
block,
|
|
45
|
-
setVisible
|
|
46
|
-
|
|
59
|
+
setVisible,
|
|
60
|
+
openDropdown,
|
|
61
|
+
closeDropdown
|
|
62
|
+
}), [visible, isFocused, triggerProps, menuProps, itemProps, itemRefs, block, setVisible, openDropdown, closeDropdown]), dropdown = clsx("dropdown", {
|
|
47
63
|
"w-100": block,
|
|
48
64
|
"dropdown-nowrap": noWrap,
|
|
49
65
|
overflow
|
|
@@ -51,7 +67,7 @@ const Root = ({
|
|
|
51
67
|
return useEffect(() => {
|
|
52
68
|
onToggle == null || onToggle(visible);
|
|
53
69
|
}, [visible]), /* @__PURE__ */ jsx(DropdownContext.Provider, { value, children: /* @__PURE__ */ jsx("div", { ref, className: dropdown, children: typeof children == "function" ? children(triggerProps, itemRefs, setVisible) : children }) });
|
|
54
|
-
}, Dropdown = /* @__PURE__ */ Object.assign(Root, {
|
|
70
|
+
}), Dropdown = /* @__PURE__ */ Object.assign(Root, {
|
|
55
71
|
Trigger: DropdownTrigger,
|
|
56
72
|
Menu: DropdownMenu,
|
|
57
73
|
Item: DropdownItem,
|
|
@@ -5,6 +5,7 @@ interface FlexProps extends React.HTMLAttributes<HTMLElement> {
|
|
|
5
5
|
align?: 'start' | 'end' | 'center' | 'baseline' | 'stretch';
|
|
6
6
|
justify?: 'start' | 'end' | 'center' | 'between' | 'around' | 'evenly';
|
|
7
7
|
gap?: string;
|
|
8
|
+
fill?: boolean;
|
|
8
9
|
wrap?: 'wrap' | 'nowrap' | 'reverse';
|
|
9
10
|
className?: string;
|
|
10
11
|
}
|
|
@@ -6,12 +6,13 @@ const Flex = ({
|
|
|
6
6
|
align,
|
|
7
7
|
justify,
|
|
8
8
|
gap,
|
|
9
|
+
fill,
|
|
9
10
|
wrap = "wrap",
|
|
10
11
|
className,
|
|
11
12
|
children,
|
|
12
13
|
...restProps
|
|
13
14
|
}) => {
|
|
14
|
-
const classes = clsx("d-flex", direction &&
|
|
15
|
+
const classes = clsx("d-flex", direction && `flex-${direction}`, fill && "flex-fill", align && `align-items-${align}`, justify && `justify-content-${justify}`, gap && `gap-${gap}`, wrap && `flex-${wrap}`, className);
|
|
15
16
|
return /* @__PURE__ */ jsx(Component, { className: classes, ...restProps, children });
|
|
16
17
|
};
|
|
17
18
|
export {
|
|
@@ -4,9 +4,13 @@ export interface LayoutProps extends ComponentPropsWithoutRef<any> {
|
|
|
4
4
|
children: ReactNode;
|
|
5
5
|
/** Full screen mode without header component */
|
|
6
6
|
headless?: boolean;
|
|
7
|
+
/** Control white background - defaults to true */
|
|
8
|
+
whiteBg?: boolean;
|
|
9
|
+
/** Additional class name */
|
|
10
|
+
className?: string;
|
|
7
11
|
}
|
|
8
12
|
export declare const Layout: {
|
|
9
|
-
({ children, headless, ...restProps }: LayoutProps): import("react/jsx-runtime").JSX.Element;
|
|
13
|
+
({ children, headless, whiteBg, className, ...restProps }: LayoutProps): import("react/jsx-runtime").JSX.Element;
|
|
10
14
|
displayName: string;
|
|
11
15
|
};
|
|
12
16
|
export default Layout;
|
|
@@ -12,6 +12,8 @@ import Button from "../Button/Button.js";
|
|
|
12
12
|
const Layout = ({
|
|
13
13
|
children,
|
|
14
14
|
headless = !1,
|
|
15
|
+
whiteBg = !0,
|
|
16
|
+
className,
|
|
15
17
|
...restProps
|
|
16
18
|
}) => {
|
|
17
19
|
const {
|
|
@@ -24,11 +26,12 @@ const Layout = ({
|
|
|
24
26
|
handleCloseCookiesConsent
|
|
25
27
|
} = useCookiesConsent();
|
|
26
28
|
useZendeskGuide(), useCantoo();
|
|
27
|
-
const classes = clsx("d-flex flex-column
|
|
29
|
+
const classes = clsx("d-flex flex-column", {
|
|
30
|
+
"bg-white": whiteBg,
|
|
28
31
|
"container-fluid": !headless,
|
|
29
32
|
"rounded-4 border": (theme == null ? void 0 : theme.is1d) && !headless,
|
|
30
33
|
"mt-24": (theme == null ? void 0 : theme.is1d) && !headless
|
|
31
|
-
}), renderHeader = headless ? null : /* @__PURE__ */ jsx(Header, { is1d: theme == null ? void 0 : theme.is1d, src: theme == null ? void 0 : theme.basePath }), renderCookies = showCookiesConsent && /* @__PURE__ */ jsx(Alert, { type: "info", className: "m-12 rgpd", isConfirm: !0, position: "bottom-right", button: /* @__PURE__ */ jsx(Button, { color: "tertiary", variant: "ghost", onClick: handleConsultCookies, children: t("rgpd.cookies.banner.button.consult") }), onClose: handleCloseCookiesConsent, children: t("rgpd.cookies.banner.text1") }), renderToaster = /* @__PURE__ */ jsx(Toaster, { containerClassName: "toaster-container", toastOptions: {
|
|
34
|
+
}, className), renderHeader = headless ? null : /* @__PURE__ */ jsx(Header, { is1d: theme == null ? void 0 : theme.is1d, src: theme == null ? void 0 : theme.basePath }), renderCookies = showCookiesConsent && /* @__PURE__ */ jsx(Alert, { type: "info", className: "m-12 rgpd", isConfirm: !0, position: "bottom-right", button: /* @__PURE__ */ jsx(Button, { color: "tertiary", variant: "ghost", onClick: handleConsultCookies, children: t("rgpd.cookies.banner.button.consult") }), onClose: handleCloseCookiesConsent, children: t("rgpd.cookies.banner.text1") }), renderToaster = /* @__PURE__ */ jsx(Toaster, { containerClassName: "toaster-container", toastOptions: {
|
|
32
35
|
position: "top-right"
|
|
33
36
|
} });
|
|
34
37
|
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
@@ -1,19 +1,16 @@
|
|
|
1
1
|
import { ChangeEvent } from 'react';
|
|
2
2
|
import { Size } from '../../types';
|
|
3
|
-
/**
|
|
4
|
-
* Base props shared by both SearchBar variants
|
|
5
|
-
*/
|
|
6
3
|
export interface BaseProps extends Omit<React.ComponentPropsWithoutRef<'input'>, 'size'> {
|
|
7
4
|
/**
|
|
8
|
-
* String or
|
|
5
|
+
* String or Template literal with React i18next namespace
|
|
9
6
|
*/
|
|
10
7
|
placeholder?: string;
|
|
11
8
|
/**
|
|
12
|
-
* Control SearchBar size
|
|
9
|
+
* Control SearchBar size
|
|
13
10
|
*/
|
|
14
11
|
size?: Exclude<Size, 'sm'>;
|
|
15
12
|
/**
|
|
16
|
-
*
|
|
13
|
+
* Disabled status
|
|
17
14
|
*/
|
|
18
15
|
disabled?: boolean;
|
|
19
16
|
/**
|
|
@@ -22,58 +19,37 @@ export interface BaseProps extends Omit<React.ComponentPropsWithoutRef<'input'>,
|
|
|
22
19
|
buttonDisabled?: boolean;
|
|
23
20
|
/**
|
|
24
21
|
* Optional class for styling purpose
|
|
25
|
-
* Optional class for custom styling
|
|
26
22
|
*/
|
|
27
23
|
className?: string;
|
|
28
24
|
/**
|
|
29
|
-
*
|
|
25
|
+
* ChangeEvent Handler
|
|
30
26
|
*/
|
|
31
27
|
onChange?: (e: ChangeEvent<HTMLInputElement>) => void;
|
|
32
|
-
/**
|
|
33
|
-
* Current value of the input
|
|
34
|
-
*/
|
|
35
|
-
value?: string;
|
|
36
|
-
/**
|
|
37
|
-
* Show a clear (reset) button when value is present
|
|
38
|
-
*/
|
|
39
|
-
clearable?: boolean;
|
|
40
28
|
}
|
|
41
|
-
/**
|
|
42
|
-
* Default SearchBar with a submit button
|
|
43
|
-
*/
|
|
44
29
|
type DefaultSearchBar = {
|
|
45
30
|
/**
|
|
46
|
-
*
|
|
31
|
+
* Switch between button or dynamic search bar
|
|
47
32
|
*/
|
|
48
33
|
isVariant: false;
|
|
49
34
|
/**
|
|
50
|
-
*
|
|
35
|
+
* Handle Search with Default SearchBar
|
|
51
36
|
*/
|
|
52
37
|
onClick: () => void;
|
|
53
38
|
};
|
|
54
|
-
/**
|
|
55
|
-
* Dynamic SearchBar with icon and no submit button
|
|
56
|
-
*/
|
|
57
39
|
type DynamicSearchBar = {
|
|
58
40
|
/**
|
|
59
|
-
*
|
|
41
|
+
* Switch between button or dynamic search bar
|
|
60
42
|
*/
|
|
61
43
|
isVariant: true;
|
|
62
44
|
/**
|
|
63
|
-
*
|
|
45
|
+
* Handle Search with Default SearchBar
|
|
64
46
|
*/
|
|
65
47
|
onClick?: undefined;
|
|
66
48
|
};
|
|
67
|
-
/**
|
|
68
|
-
* Props for the SearchBar component
|
|
69
|
-
*/
|
|
70
49
|
export type Props = DefaultSearchBar | DynamicSearchBar;
|
|
71
50
|
export type SearchBarProps = BaseProps & Props;
|
|
72
|
-
/**
|
|
73
|
-
* SearchBar component to handle dynamic or static search input
|
|
74
|
-
*/
|
|
75
51
|
declare const SearchBar: {
|
|
76
|
-
({ isVariant, size, placeholder, className, disabled, buttonDisabled, onChange, onClick,
|
|
52
|
+
({ isVariant, size, placeholder, className, disabled, buttonDisabled, onChange, onClick, ...restProps }: SearchBarProps): import("react/jsx-runtime").JSX.Element;
|
|
77
53
|
displayName: string;
|
|
78
54
|
};
|
|
79
55
|
export default SearchBar;
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { jsxs, jsx } from "react/jsx-runtime";
|
|
2
2
|
import clsx from "clsx";
|
|
3
3
|
import { useTranslation } from "react-i18next";
|
|
4
|
-
import SvgIconClose from "../../modules/icons/components/IconClose.js";
|
|
5
4
|
import SvgIconSearch from "../../modules/icons/components/IconSearch.js";
|
|
6
5
|
import FormControl from "../Form/FormControl.js";
|
|
7
6
|
import SearchButton from "../Button/SearchButton.js";
|
|
@@ -14,8 +13,6 @@ const SearchBar = ({
|
|
|
14
13
|
buttonDisabled,
|
|
15
14
|
onChange,
|
|
16
15
|
onClick,
|
|
17
|
-
value,
|
|
18
|
-
clearable = !1,
|
|
19
16
|
...restProps
|
|
20
17
|
}) => {
|
|
21
18
|
const {
|
|
@@ -25,38 +22,15 @@ const SearchBar = ({
|
|
|
25
22
|
"position-relative": isVariant
|
|
26
23
|
}), input = clsx({
|
|
27
24
|
"border-end-0": !isVariant,
|
|
28
|
-
"ps-48": isVariant
|
|
29
|
-
"searchbar-hide-native-clear": isVariant && clearable
|
|
25
|
+
"ps-48": isVariant
|
|
30
26
|
}), handleClick = () => {
|
|
31
27
|
onClick == null || onClick();
|
|
32
|
-
},
|
|
33
|
-
|
|
34
|
-
target: {
|
|
35
|
-
value: ""
|
|
36
|
-
}
|
|
37
|
-
};
|
|
38
|
-
onChange == null || onChange(event);
|
|
28
|
+
}, handleKeyDown = (e) => {
|
|
29
|
+
e.key === "Enter" && (e.preventDefault(), handleClick());
|
|
39
30
|
};
|
|
40
31
|
return /* @__PURE__ */ jsxs(FormControl, { id: "search-bar", className: searchbar, children: [
|
|
41
32
|
isVariant && /* @__PURE__ */ jsx("div", { className: "position-absolute z-1 top-50 start-0 translate-middle-y border-0 ps-12 bg-transparent", children: /* @__PURE__ */ jsx(SvgIconSearch, {}) }),
|
|
42
|
-
/* @__PURE__ */ jsx(
|
|
43
|
-
FormControl.Input,
|
|
44
|
-
{
|
|
45
|
-
type: "search",
|
|
46
|
-
placeholder: t(placeholder),
|
|
47
|
-
size,
|
|
48
|
-
noValidationIcon: !0,
|
|
49
|
-
className: input,
|
|
50
|
-
onChange,
|
|
51
|
-
value,
|
|
52
|
-
disabled,
|
|
53
|
-
...restProps
|
|
54
|
-
}
|
|
55
|
-
),
|
|
56
|
-
isVariant && clearable && value && onChange && /* @__PURE__ */ jsx("button", { type: "button", onClick: handleClear, className: "position-absolute end-0 top-50 translate-middle-y pe-12 bg-transparent border-0", "aria-label": t("clear"), children: /* @__PURE__ */ jsx(SvgIconClose, { className: "color-gray", style: {
|
|
57
|
-
width: 12,
|
|
58
|
-
height: 12
|
|
59
|
-
} }) }),
|
|
33
|
+
/* @__PURE__ */ jsx(FormControl.Input, { type: "search", placeholder: t(placeholder), size, noValidationIcon: !0, className: input, onChange, disabled, onKeyDown: handleKeyDown, ...restProps }),
|
|
60
34
|
!isVariant && /* @__PURE__ */ jsx(SearchButton, { type: "submit", "aria-label": t("search"), icon: /* @__PURE__ */ jsx(SvgIconSearch, {}), className: "border-start-0", onClick: handleClick, disabled: buttonDisabled })
|
|
61
35
|
] });
|
|
62
36
|
};
|
|
@@ -17,12 +17,32 @@ export interface TabsProps {
|
|
|
17
17
|
* Children Props
|
|
18
18
|
*/
|
|
19
19
|
children?: (...props: any) => ReactNode;
|
|
20
|
+
/**
|
|
21
|
+
* Whether tabs should take full available width
|
|
22
|
+
*/
|
|
23
|
+
fullWidth?: boolean;
|
|
24
|
+
/**
|
|
25
|
+
* Whether tabs should take full available height
|
|
26
|
+
*/
|
|
27
|
+
fullHeight?: boolean;
|
|
28
|
+
/**
|
|
29
|
+
* Whether the tab list should be sticky
|
|
30
|
+
*/
|
|
31
|
+
isSticky?: boolean;
|
|
32
|
+
/**
|
|
33
|
+
* The top offset for the sticky tab list
|
|
34
|
+
*/
|
|
35
|
+
stickyTop?: number;
|
|
36
|
+
/**
|
|
37
|
+
* Additional class names for the Tabs component
|
|
38
|
+
*/
|
|
39
|
+
className?: string;
|
|
20
40
|
}
|
|
21
41
|
/**
|
|
22
42
|
* Tab Content displayed one at a time when a Tab Item is selected
|
|
23
43
|
*/
|
|
24
44
|
export declare const Tabs: {
|
|
25
|
-
({ defaultId, items, onChange, children }: TabsProps): import("react/jsx-runtime").JSX.Element;
|
|
45
|
+
({ defaultId, items, fullWidth, fullHeight, onChange, children, isSticky, stickyTop, className, }: TabsProps): import("react/jsx-runtime").JSX.Element;
|
|
26
46
|
Item: {
|
|
27
47
|
({ icon, badge, label, id, order, }: TabsItemProps & {
|
|
28
48
|
order: number;
|
|
@@ -30,11 +50,11 @@ export declare const Tabs: {
|
|
|
30
50
|
displayName: string;
|
|
31
51
|
};
|
|
32
52
|
Panel: {
|
|
33
|
-
({ children, currentItem }: import('./TabsPanel').TabsPanelProps): import("react/jsx-runtime").JSX.Element;
|
|
53
|
+
({ children, currentItem, fullHeight }: import('./TabsPanel').TabsPanelProps): import("react/jsx-runtime").JSX.Element;
|
|
34
54
|
displayName: string;
|
|
35
55
|
};
|
|
36
56
|
List: {
|
|
37
|
-
(props: import('
|
|
57
|
+
(props: import('./TabsList').TabsListProps): import("react/jsx-runtime").JSX.Element;
|
|
38
58
|
displayName: string;
|
|
39
59
|
};
|
|
40
60
|
displayName: string;
|
|
@@ -8,8 +8,13 @@ import TabsPanel from "./TabsPanel.js";
|
|
|
8
8
|
const Tabs = ({
|
|
9
9
|
defaultId,
|
|
10
10
|
items,
|
|
11
|
+
fullWidth = !1,
|
|
12
|
+
fullHeight = !1,
|
|
11
13
|
onChange,
|
|
12
|
-
children
|
|
14
|
+
children,
|
|
15
|
+
isSticky = !1,
|
|
16
|
+
stickyTop = 0,
|
|
17
|
+
className
|
|
13
18
|
}) => {
|
|
14
19
|
const {
|
|
15
20
|
activeTab,
|
|
@@ -32,8 +37,8 @@ const Tabs = ({
|
|
|
32
37
|
onKeyDown
|
|
33
38
|
}), [activeTab, items, onKeyDown, setSelectedTab, tabUnderlineLeft, tabUnderlineWidth, tabsRef]), currentItem = items.find((item) => item.id === activeTab);
|
|
34
39
|
return /* @__PURE__ */ jsx(TabsContext.Provider, { value, children: typeof children == "function" ? children(currentItem) : /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
35
|
-
/* @__PURE__ */ jsx(Tabs.List, {}),
|
|
36
|
-
/* @__PURE__ */ jsx(Tabs.Panel, { currentItem, children: currentItem == null ? void 0 : currentItem.content })
|
|
40
|
+
/* @__PURE__ */ jsx(Tabs.List, { fullWidth, isSticky, stickyTop, className }),
|
|
41
|
+
/* @__PURE__ */ jsx(Tabs.Panel, { currentItem, fullHeight, children: currentItem == null ? void 0 : currentItem.content })
|
|
37
42
|
] }) });
|
|
38
43
|
};
|
|
39
44
|
Tabs.Item = TabsItem;
|
|
@@ -1,6 +1,20 @@
|
|
|
1
1
|
import { ComponentPropsWithoutRef } from 'react';
|
|
2
|
+
export interface TabsListProps extends ComponentPropsWithoutRef<'div'> {
|
|
3
|
+
/**
|
|
4
|
+
* Whether tabs should take full available width
|
|
5
|
+
*/
|
|
6
|
+
fullWidth?: boolean;
|
|
7
|
+
/**
|
|
8
|
+
* Whether the tab list should be sticky
|
|
9
|
+
*/
|
|
10
|
+
isSticky?: boolean;
|
|
11
|
+
/**
|
|
12
|
+
* The top offset for the sticky tab list
|
|
13
|
+
*/
|
|
14
|
+
stickyTop?: number;
|
|
15
|
+
}
|
|
2
16
|
declare const TabsList: {
|
|
3
|
-
(props:
|
|
17
|
+
(props: TabsListProps): import("react/jsx-runtime").JSX.Element;
|
|
4
18
|
displayName: string;
|
|
5
19
|
};
|
|
6
20
|
export default TabsList;
|
|
@@ -9,10 +9,20 @@ const TabsList = (props) => {
|
|
|
9
9
|
tabUnderlineWidth
|
|
10
10
|
} = useTabsContext(), {
|
|
11
11
|
className,
|
|
12
|
+
fullWidth,
|
|
13
|
+
isSticky,
|
|
14
|
+
stickyTop,
|
|
12
15
|
...restProps
|
|
13
|
-
} = props,
|
|
14
|
-
|
|
15
|
-
|
|
16
|
+
} = props, ulClasses = clsx("nav nav-tabs flex-nowrap", {
|
|
17
|
+
"w-100": fullWidth
|
|
18
|
+
}), tabslist = clsx(" flex-shrink-0 overflow-x-auto", {
|
|
19
|
+
"position-sticky z-1": isSticky,
|
|
20
|
+
"position-relative": !isSticky
|
|
21
|
+
}, className);
|
|
22
|
+
return /* @__PURE__ */ jsxs("div", { className: tabslist, ...restProps, style: isSticky ? {
|
|
23
|
+
top: stickyTop
|
|
24
|
+
} : void 0, children: [
|
|
25
|
+
/* @__PURE__ */ jsx("ul", { className: ulClasses, role: "tablist", children: items.map((item, order) => /* @__PURE__ */ jsx(Tabs.Item, { order, ...item }, item.id)) }),
|
|
16
26
|
/* @__PURE__ */ jsx("span", { className: "nav-slide", style: {
|
|
17
27
|
left: tabUnderlineLeft,
|
|
18
28
|
width: tabUnderlineWidth
|
|
@@ -9,9 +9,13 @@ export interface TabsPanelProps {
|
|
|
9
9
|
* Current Item
|
|
10
10
|
*/
|
|
11
11
|
currentItem: TabsItemProps | undefined;
|
|
12
|
+
/**
|
|
13
|
+
* Whether tabs should take full available height
|
|
14
|
+
*/
|
|
15
|
+
fullHeight?: boolean;
|
|
12
16
|
}
|
|
13
17
|
declare const TabsPanel: {
|
|
14
|
-
({ children, currentItem }: TabsPanelProps): import("react/jsx-runtime").JSX.Element;
|
|
18
|
+
({ children, currentItem, fullHeight }: TabsPanelProps): import("react/jsx-runtime").JSX.Element;
|
|
15
19
|
displayName: string;
|
|
16
20
|
};
|
|
17
21
|
export default TabsPanel;
|
|
@@ -1,13 +1,17 @@
|
|
|
1
1
|
import { jsx } from "react/jsx-runtime";
|
|
2
2
|
import { useTabsContext } from "../context/TabsContext.js";
|
|
3
|
+
import clsx from "clsx";
|
|
3
4
|
const TabsPanel = ({
|
|
4
5
|
children,
|
|
5
|
-
currentItem
|
|
6
|
+
currentItem,
|
|
7
|
+
fullHeight
|
|
6
8
|
}) => {
|
|
7
9
|
const {
|
|
8
10
|
activeTab
|
|
9
|
-
} = useTabsContext()
|
|
10
|
-
|
|
11
|
+
} = useTabsContext(), contentClasses = clsx("tab-content d-flex flex-fill w-100", {
|
|
12
|
+
"position-relative h-100": fullHeight
|
|
13
|
+
});
|
|
14
|
+
return /* @__PURE__ */ jsx("div", { className: contentClasses, children: /* @__PURE__ */ jsx("div", { className: `tab-pane flex-fill w-100 fade ${activeTab === (currentItem == null ? void 0 : currentItem.id) ? "show active" : ""}`, id: `tabpanel-${currentItem == null ? void 0 : currentItem.id}`, role: "tabpanel", "aria-labelledby": `tab-${currentItem == null ? void 0 : currentItem.id}`, tabIndex: 0, children }) });
|
|
11
15
|
};
|
|
12
16
|
export {
|
|
13
17
|
TabsPanel as default
|
|
@@ -28,6 +28,8 @@ export interface UseDropdownProps {
|
|
|
28
28
|
itemProps: Record<string, any>;
|
|
29
29
|
setVisible: Dispatch<SetStateAction<boolean>>;
|
|
30
30
|
openOnSpace?: boolean;
|
|
31
|
+
openDropdown: () => void;
|
|
32
|
+
closeDropdown: () => void;
|
|
31
33
|
}
|
|
32
34
|
declare const useDropdown: (placement: Placement | undefined, extraTriggerKeyDownHandler?: (event: React.KeyboardEvent<HTMLButtonElement>) => void, isTriggerHovered?: boolean, focusOnVisible?: boolean, openOnSpace?: boolean, focusOnMouseEnter?: boolean) => UseDropdownProps;
|
|
33
35
|
export default useDropdown;
|
|
@@ -21,7 +21,7 @@ function useEdificeIcons() {
|
|
|
21
21
|
};
|
|
22
22
|
function getIconCode(app) {
|
|
23
23
|
let appCode = "";
|
|
24
|
-
switch (typeof app == "string" ? appCode = app : appCode = (app == null ? void 0 : app.icon) !== void 0 ? app == null ? void 0 : app.icon.trim().toLowerCase() : "placeholder", appCode && appCode.length > 0 ? appCode.endsWith("-large") && (appCode = appCode.replace("-large", "")) : typeof app == "object" && (appCode = (app == null ? void 0 : app.displayName) !== void 0 ? app == null ? void 0 : app.displayName.trim().toLowerCase() : ""), appCode) {
|
|
24
|
+
switch (typeof app == "string" ? appCode = app : appCode = (app == null ? void 0 : app.icon) !== void 0 ? app == null ? void 0 : app.icon.trim().toLowerCase() : "placeholder", appCode && appCode.length > 0 ? appCode.endsWith("-large") && (appCode = appCode.replace("-large", "")) : typeof app == "object" && (appCode = (app == null ? void 0 : app.displayName) !== void 0 ? app == null ? void 0 : app.displayName.trim().toLowerCase() : ""), console.log(appCode), appCode) {
|
|
25
25
|
case "admin.title":
|
|
26
26
|
appCode = "admin";
|
|
27
27
|
break;
|
|
@@ -34,6 +34,9 @@ function useEdificeIcons() {
|
|
|
34
34
|
case "communautés":
|
|
35
35
|
appCode = "community";
|
|
36
36
|
break;
|
|
37
|
+
case "communities":
|
|
38
|
+
appCode = "community";
|
|
39
|
+
break;
|
|
37
40
|
case "directory.user":
|
|
38
41
|
appCode = "userbook";
|
|
39
42
|
break;
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { libraryMaps } from "@edifice.io/utilities";
|
|
2
2
|
import { useEdificeClient } from "../../providers/EdificeClientProvider/EdificeClientProvider.hook.js";
|
|
3
|
-
const useLibraryUrl = (
|
|
3
|
+
const useLibraryUrl = () => {
|
|
4
4
|
var _a;
|
|
5
5
|
const {
|
|
6
6
|
user,
|
|
7
7
|
appCode
|
|
8
|
-
} = useEdificeClient(), appName = libraryMaps[
|
|
8
|
+
} = useEdificeClient(), appName = libraryMaps[appCode], libraryApp = user == null ? void 0 : user.apps.find((app) => app.isExternal && app.address.includes("library"));
|
|
9
9
|
if (!libraryApp)
|
|
10
10
|
return null;
|
|
11
11
|
const libraryUrlSplit = (_a = libraryApp.address) == null ? void 0 : _a.split("?");
|