@edifice.io/react 2.2.11-develop-pedago.20250707151414 → 2.2.11-develop-enabling.20250710092201
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 +4 -10
- package/dist/components/Dropdown/Dropdown.js +8 -24
- package/dist/components/Layout/Layout.d.ts +1 -3
- package/dist/components/Layout/Layout.js +1 -3
- package/dist/components/SearchBar/SearchBar.d.ts +33 -9
- package/dist/components/SearchBar/SearchBar.js +30 -4
- package/dist/components/Tabs/components/Tabs.d.ts +3 -11
- package/dist/components/Tabs/components/Tabs.js +2 -4
- package/dist/components/Tabs/components/TabsList.d.ts +1 -7
- package/dist/components/Tabs/components/TabsList.js +2 -5
- package/dist/components/Tabs/components/TabsPanel.d.ts +1 -5
- package/dist/components/Tabs/components/TabsPanel.js +3 -7
- package/dist/hooks/useDropdown/useDropdown.d.ts +0 -2
- package/dist/hooks/useDropdown/useDropdown.js +0 -2
- package/dist/hooks/useLibraryUrl/useLibraryUrl.d.ts +1 -1
- package/dist/hooks/useLibraryUrl/useLibraryUrl.js +2 -2
- package/dist/icons-apps.js +174 -164
- package/dist/icons.js +198 -190
- package/dist/index.js +10 -12
- 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/IconLibrary.d.ts +7 -0
- package/dist/modules/icons/components/IconLibrary.js +12 -0
- package/dist/modules/icons/components/IconNotification.d.ts +7 -0
- package/dist/modules/icons/components/IconNotification.js +12 -0
- package/dist/modules/icons/components/IconStar.d.ts +7 -0
- package/dist/modules/icons/components/IconStar.js +13 -0
- package/dist/modules/icons/components/IconStarFavorite.d.ts +7 -0
- package/dist/modules/icons/components/IconStarFull.d.ts +7 -0
- package/dist/modules/icons/components/IconStarFull.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 +3 -2
- 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 +3 -2
- 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/IconEdt.d.ts +7 -0
- package/dist/modules/icons/components/apps/IconEdt.js +12 -0
- package/dist/modules/icons/components/apps/IconExercizer.js +2 -2
- package/dist/modules/icons/components/apps/IconForms.js +2 -6
- package/dist/modules/icons/components/apps/IconForum.js +2 -2
- package/dist/modules/icons/components/apps/IconGeogebra.d.ts +7 -0
- package/dist/modules/icons/components/apps/IconGeogebra.js +12 -0
- package/dist/modules/icons/components/apps/IconLibrary.js +2 -2
- package/dist/modules/icons/components/apps/IconMagneto.d.ts +7 -0
- package/dist/modules/icons/components/apps/IconMagneto.js +13 -0
- 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/IconMinetest.d.ts +7 -0
- package/dist/modules/icons/components/apps/IconMinetest.js +12 -0
- package/dist/modules/icons/components/apps/IconMinibadge.d.ts +7 -0
- package/dist/modules/icons/components/apps/IconMinibadge.js +12 -0
- package/dist/modules/icons/components/apps/IconMoodle.js +2 -2
- package/dist/modules/icons/components/apps/IconNabook.js +2 -4
- 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 +2 -6
- 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 +5 -0
- package/dist/modules/icons/components/index.d.ts +4 -0
- package/dist/modules/modals/OnboardingModal/OnboardingModal.d.ts +6 -4
- package/dist/modules/modals/OnboardingModal/OnboardingModal.js +27 -13
- package/dist/modules/modals/OnboardingModal/index.d.ts +1 -0
- package/dist/modules/modals/OnboardingModal/useOnboardingModal.js +4 -4
- package/dist/modules/multimedia/FileCard/FileCard.d.ts +2 -13
- package/dist/modules/multimedia/FileCard/FileCard.js +5 -15
- package/dist/modules/multimedia/FileCard/FileIcon.d.ts +1 -5
- package/dist/modules/multimedia/FileCard/FileIcon.js +2 -2
- package/dist/modules/multimedia/MediaLibrary/MediaLibrary.d.ts +1 -3
- package/dist/modules/multimedia/MediaLibrary/MediaLibrary.js +2 -7
- package/dist/modules/multimedia/index.d.ts +0 -1
- package/dist/multimedia.js +10 -12
- package/package.json +6 -6
|
@@ -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' | 'black';
|
|
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,15 +1,6 @@
|
|
|
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
|
-
}
|
|
13
4
|
export interface DropdownProps {
|
|
14
5
|
/** Children Props */
|
|
15
6
|
children: ReactNode | ((...props: any) => ReactNode);
|
|
@@ -77,7 +68,10 @@ export type DropdownMenuOptions = {
|
|
|
77
68
|
*/
|
|
78
69
|
type: 'divider';
|
|
79
70
|
};
|
|
80
|
-
declare const Dropdown:
|
|
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
|
+
} & {
|
|
81
75
|
Trigger: import('react').ForwardRefExoticComponent<Omit<import('./DropdownTrigger').DropdownTriggerProps, "ref"> & import('react').RefAttributes<HTMLButtonElement>>;
|
|
82
76
|
Menu: import('react').ForwardRefExoticComponent<Omit<import('./DropdownMenu').DropdownMenuProps, "ref"> & import('react').RefAttributes<HTMLDivElement>>;
|
|
83
77
|
Item: {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsx } from "react/jsx-runtime";
|
|
2
|
-
import {
|
|
2
|
+
import { 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 = ({
|
|
15
15
|
children,
|
|
16
16
|
block,
|
|
17
17
|
overflow = !0,
|
|
@@ -23,7 +23,7 @@ const Root = /* @__PURE__ */ forwardRef(({
|
|
|
23
23
|
focusOnVisible = !0,
|
|
24
24
|
openOnSpace = !0,
|
|
25
25
|
focusOnMouseEnter = !0
|
|
26
|
-
}
|
|
26
|
+
}) => {
|
|
27
27
|
const {
|
|
28
28
|
visible,
|
|
29
29
|
isFocused,
|
|
@@ -31,22 +31,8 @@ const Root = /* @__PURE__ */ forwardRef(({
|
|
|
31
31
|
menuProps,
|
|
32
32
|
itemProps,
|
|
33
33
|
itemRefs,
|
|
34
|
-
setVisible
|
|
35
|
-
|
|
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(() => {
|
|
34
|
+
setVisible
|
|
35
|
+
} = useDropdown(placement, extraTriggerKeyDownHandler, isTriggerHovered, focusOnVisible, openOnSpace, focusOnMouseEnter), ref = useClickOutside(() => {
|
|
50
36
|
setVisible(!1);
|
|
51
37
|
}), value = useMemo(() => ({
|
|
52
38
|
visible,
|
|
@@ -56,10 +42,8 @@ const Root = /* @__PURE__ */ forwardRef(({
|
|
|
56
42
|
itemProps,
|
|
57
43
|
itemRefs,
|
|
58
44
|
block,
|
|
59
|
-
setVisible
|
|
60
|
-
|
|
61
|
-
closeDropdown
|
|
62
|
-
}), [visible, isFocused, triggerProps, menuProps, itemProps, itemRefs, block, setVisible, openDropdown, closeDropdown]), dropdown = clsx("dropdown", {
|
|
45
|
+
setVisible
|
|
46
|
+
}), [visible, isFocused, triggerProps, menuProps, itemProps, itemRefs, block, setVisible]), dropdown = clsx("dropdown", {
|
|
63
47
|
"w-100": block,
|
|
64
48
|
"dropdown-nowrap": noWrap,
|
|
65
49
|
overflow
|
|
@@ -67,7 +51,7 @@ const Root = /* @__PURE__ */ forwardRef(({
|
|
|
67
51
|
return useEffect(() => {
|
|
68
52
|
onToggle == null || onToggle(visible);
|
|
69
53
|
}, [visible]), /* @__PURE__ */ jsx(DropdownContext.Provider, { value, children: /* @__PURE__ */ jsx("div", { ref, className: dropdown, children: typeof children == "function" ? children(triggerProps, itemRefs, setVisible) : children }) });
|
|
70
|
-
}
|
|
54
|
+
}, Dropdown = /* @__PURE__ */ Object.assign(Root, {
|
|
71
55
|
Trigger: DropdownTrigger,
|
|
72
56
|
Menu: DropdownMenu,
|
|
73
57
|
Item: DropdownItem,
|
|
@@ -4,11 +4,9 @@ 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
7
|
}
|
|
10
8
|
export declare const Layout: {
|
|
11
|
-
({ children, headless,
|
|
9
|
+
({ children, headless, ...restProps }: LayoutProps): import("react/jsx-runtime").JSX.Element;
|
|
12
10
|
displayName: string;
|
|
13
11
|
};
|
|
14
12
|
export default Layout;
|
|
@@ -12,7 +12,6 @@ import Button from "../Button/Button.js";
|
|
|
12
12
|
const Layout = ({
|
|
13
13
|
children,
|
|
14
14
|
headless = !1,
|
|
15
|
-
whiteBg = !0,
|
|
16
15
|
...restProps
|
|
17
16
|
}) => {
|
|
18
17
|
const {
|
|
@@ -25,8 +24,7 @@ const Layout = ({
|
|
|
25
24
|
handleCloseCookiesConsent
|
|
26
25
|
} = useCookiesConsent();
|
|
27
26
|
useZendeskGuide(), useCantoo();
|
|
28
|
-
const classes = clsx("d-flex flex-column", {
|
|
29
|
-
"bg-white": whiteBg,
|
|
27
|
+
const classes = clsx("d-flex flex-column bg-white", {
|
|
30
28
|
"container-fluid": !headless,
|
|
31
29
|
"rounded-4 border": (theme == null ? void 0 : theme.is1d) && !headless,
|
|
32
30
|
"mt-24": (theme == null ? void 0 : theme.is1d) && !headless
|
|
@@ -1,16 +1,19 @@
|
|
|
1
1
|
import { ChangeEvent } from 'react';
|
|
2
2
|
import { Size } from '../../types';
|
|
3
|
+
/**
|
|
4
|
+
* Base props shared by both SearchBar variants
|
|
5
|
+
*/
|
|
3
6
|
export interface BaseProps extends Omit<React.ComponentPropsWithoutRef<'input'>, 'size'> {
|
|
4
7
|
/**
|
|
5
|
-
* String or
|
|
8
|
+
* String or template literal key for i18next translation
|
|
6
9
|
*/
|
|
7
10
|
placeholder?: string;
|
|
8
11
|
/**
|
|
9
|
-
* Control SearchBar size
|
|
12
|
+
* Control SearchBar size (excluding 'sm')
|
|
10
13
|
*/
|
|
11
14
|
size?: Exclude<Size, 'sm'>;
|
|
12
15
|
/**
|
|
13
|
-
*
|
|
16
|
+
* Disable the input
|
|
14
17
|
*/
|
|
15
18
|
disabled?: boolean;
|
|
16
19
|
/**
|
|
@@ -19,37 +22,58 @@ export interface BaseProps extends Omit<React.ComponentPropsWithoutRef<'input'>,
|
|
|
19
22
|
buttonDisabled?: boolean;
|
|
20
23
|
/**
|
|
21
24
|
* Optional class for styling purpose
|
|
25
|
+
* Optional class for custom styling
|
|
22
26
|
*/
|
|
23
27
|
className?: string;
|
|
24
28
|
/**
|
|
25
|
-
*
|
|
29
|
+
* onChange handler for input changes
|
|
26
30
|
*/
|
|
27
31
|
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;
|
|
28
40
|
}
|
|
41
|
+
/**
|
|
42
|
+
* Default SearchBar with a submit button
|
|
43
|
+
*/
|
|
29
44
|
type DefaultSearchBar = {
|
|
30
45
|
/**
|
|
31
|
-
*
|
|
46
|
+
* Use false to render the default SearchBar (with a button)
|
|
32
47
|
*/
|
|
33
48
|
isVariant: false;
|
|
34
49
|
/**
|
|
35
|
-
*
|
|
50
|
+
* Callback when clicking the search button
|
|
36
51
|
*/
|
|
37
52
|
onClick: () => void;
|
|
38
53
|
};
|
|
54
|
+
/**
|
|
55
|
+
* Dynamic SearchBar with icon and no submit button
|
|
56
|
+
*/
|
|
39
57
|
type DynamicSearchBar = {
|
|
40
58
|
/**
|
|
41
|
-
*
|
|
59
|
+
* Use true to render the dynamic SearchBar (with an icon inside input)
|
|
42
60
|
*/
|
|
43
61
|
isVariant: true;
|
|
44
62
|
/**
|
|
45
|
-
*
|
|
63
|
+
* onClick must be undefined for dynamic variant
|
|
46
64
|
*/
|
|
47
65
|
onClick?: undefined;
|
|
48
66
|
};
|
|
67
|
+
/**
|
|
68
|
+
* Props for the SearchBar component
|
|
69
|
+
*/
|
|
49
70
|
export type Props = DefaultSearchBar | DynamicSearchBar;
|
|
50
71
|
export type SearchBarProps = BaseProps & Props;
|
|
72
|
+
/**
|
|
73
|
+
* SearchBar component to handle dynamic or static search input
|
|
74
|
+
*/
|
|
51
75
|
declare const SearchBar: {
|
|
52
|
-
({ isVariant, size, placeholder, className, disabled, buttonDisabled, onChange, onClick, ...restProps }: SearchBarProps): import("react/jsx-runtime").JSX.Element;
|
|
76
|
+
({ isVariant, size, placeholder, className, disabled, buttonDisabled, onChange, onClick, value, clearable, ...restProps }: SearchBarProps): import("react/jsx-runtime").JSX.Element;
|
|
53
77
|
displayName: string;
|
|
54
78
|
};
|
|
55
79
|
export default SearchBar;
|
|
@@ -1,6 +1,7 @@
|
|
|
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";
|
|
4
5
|
import SvgIconSearch from "../../modules/icons/components/IconSearch.js";
|
|
5
6
|
import FormControl from "../Form/FormControl.js";
|
|
6
7
|
import SearchButton from "../Button/SearchButton.js";
|
|
@@ -13,6 +14,8 @@ const SearchBar = ({
|
|
|
13
14
|
buttonDisabled,
|
|
14
15
|
onChange,
|
|
15
16
|
onClick,
|
|
17
|
+
value,
|
|
18
|
+
clearable = !1,
|
|
16
19
|
...restProps
|
|
17
20
|
}) => {
|
|
18
21
|
const {
|
|
@@ -22,15 +25,38 @@ const SearchBar = ({
|
|
|
22
25
|
"position-relative": isVariant
|
|
23
26
|
}), input = clsx({
|
|
24
27
|
"border-end-0": !isVariant,
|
|
25
|
-
"ps-48": isVariant
|
|
28
|
+
"ps-48": isVariant,
|
|
29
|
+
"searchbar-hide-native-clear": isVariant && clearable
|
|
26
30
|
}), handleClick = () => {
|
|
27
31
|
onClick == null || onClick();
|
|
28
|
-
},
|
|
29
|
-
|
|
32
|
+
}, handleClear = () => {
|
|
33
|
+
const event = {
|
|
34
|
+
target: {
|
|
35
|
+
value: ""
|
|
36
|
+
}
|
|
37
|
+
};
|
|
38
|
+
onChange == null || onChange(event);
|
|
30
39
|
};
|
|
31
40
|
return /* @__PURE__ */ jsxs(FormControl, { id: "search-bar", className: searchbar, children: [
|
|
32
41
|
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, {}) }),
|
|
33
|
-
/* @__PURE__ */ jsx(
|
|
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
|
+
} }) }),
|
|
34
60
|
!isVariant && /* @__PURE__ */ jsx(SearchButton, { type: "submit", "aria-label": t("search"), icon: /* @__PURE__ */ jsx(SvgIconSearch, {}), className: "border-start-0", onClick: handleClick, disabled: buttonDisabled })
|
|
35
61
|
] });
|
|
36
62
|
};
|
|
@@ -17,20 +17,12 @@ 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
20
|
}
|
|
29
21
|
/**
|
|
30
22
|
* Tab Content displayed one at a time when a Tab Item is selected
|
|
31
23
|
*/
|
|
32
24
|
export declare const Tabs: {
|
|
33
|
-
({ defaultId, items,
|
|
25
|
+
({ defaultId, items, onChange, children }: TabsProps): import("react/jsx-runtime").JSX.Element;
|
|
34
26
|
Item: {
|
|
35
27
|
({ icon, badge, label, id, order, }: TabsItemProps & {
|
|
36
28
|
order: number;
|
|
@@ -38,11 +30,11 @@ export declare const Tabs: {
|
|
|
38
30
|
displayName: string;
|
|
39
31
|
};
|
|
40
32
|
Panel: {
|
|
41
|
-
({ children, currentItem
|
|
33
|
+
({ children, currentItem }: import('./TabsPanel').TabsPanelProps): import("react/jsx-runtime").JSX.Element;
|
|
42
34
|
displayName: string;
|
|
43
35
|
};
|
|
44
36
|
List: {
|
|
45
|
-
(props: import('
|
|
37
|
+
(props: import('react').ComponentPropsWithoutRef<"div">): import("react/jsx-runtime").JSX.Element;
|
|
46
38
|
displayName: string;
|
|
47
39
|
};
|
|
48
40
|
displayName: string;
|
|
@@ -8,8 +8,6 @@ import TabsPanel from "./TabsPanel.js";
|
|
|
8
8
|
const Tabs = ({
|
|
9
9
|
defaultId,
|
|
10
10
|
items,
|
|
11
|
-
fullWidth = !1,
|
|
12
|
-
fullHeight = !1,
|
|
13
11
|
onChange,
|
|
14
12
|
children
|
|
15
13
|
}) => {
|
|
@@ -34,8 +32,8 @@ const Tabs = ({
|
|
|
34
32
|
onKeyDown
|
|
35
33
|
}), [activeTab, items, onKeyDown, setSelectedTab, tabUnderlineLeft, tabUnderlineWidth, tabsRef]), currentItem = items.find((item) => item.id === activeTab);
|
|
36
34
|
return /* @__PURE__ */ jsx(TabsContext.Provider, { value, children: typeof children == "function" ? children(currentItem) : /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
37
|
-
/* @__PURE__ */ jsx(Tabs.List, {
|
|
38
|
-
/* @__PURE__ */ jsx(Tabs.Panel, { currentItem,
|
|
35
|
+
/* @__PURE__ */ jsx(Tabs.List, {}),
|
|
36
|
+
/* @__PURE__ */ jsx(Tabs.Panel, { currentItem, children: currentItem == null ? void 0 : currentItem.content })
|
|
39
37
|
] }) });
|
|
40
38
|
};
|
|
41
39
|
Tabs.Item = TabsItem;
|
|
@@ -1,12 +1,6 @@
|
|
|
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
2
|
declare const TabsList: {
|
|
9
|
-
(props:
|
|
3
|
+
(props: ComponentPropsWithoutRef<"div">): import("react/jsx-runtime").JSX.Element;
|
|
10
4
|
displayName: string;
|
|
11
5
|
};
|
|
12
6
|
export default TabsList;
|
|
@@ -9,13 +9,10 @@ const TabsList = (props) => {
|
|
|
9
9
|
tabUnderlineWidth
|
|
10
10
|
} = useTabsContext(), {
|
|
11
11
|
className,
|
|
12
|
-
fullWidth,
|
|
13
12
|
...restProps
|
|
14
|
-
} = props,
|
|
15
|
-
"w-100": fullWidth
|
|
16
|
-
}), tabslist = clsx("position-relative flex-shrink-0 overflow-x-auto", className);
|
|
13
|
+
} = props, tabslist = clsx("position-relative flex-shrink-0 overflow-x-auto", className);
|
|
17
14
|
return /* @__PURE__ */ jsxs("div", { className: tabslist, ...restProps, children: [
|
|
18
|
-
/* @__PURE__ */ jsx("ul", { className:
|
|
15
|
+
/* @__PURE__ */ jsx("ul", { className: "nav nav-tabs flex-nowrap", role: "tablist", children: items.map((item, order) => /* @__PURE__ */ jsx(Tabs.Item, { order, ...item }, item.id)) }),
|
|
19
16
|
/* @__PURE__ */ jsx("span", { className: "nav-slide", style: {
|
|
20
17
|
left: tabUnderlineLeft,
|
|
21
18
|
width: tabUnderlineWidth
|
|
@@ -9,13 +9,9 @@ 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;
|
|
16
12
|
}
|
|
17
13
|
declare const TabsPanel: {
|
|
18
|
-
({ children, currentItem
|
|
14
|
+
({ children, currentItem }: TabsPanelProps): import("react/jsx-runtime").JSX.Element;
|
|
19
15
|
displayName: string;
|
|
20
16
|
};
|
|
21
17
|
export default TabsPanel;
|
|
@@ -1,17 +1,13 @@
|
|
|
1
1
|
import { jsx } from "react/jsx-runtime";
|
|
2
2
|
import { useTabsContext } from "../context/TabsContext.js";
|
|
3
|
-
import clsx from "clsx";
|
|
4
3
|
const TabsPanel = ({
|
|
5
4
|
children,
|
|
6
|
-
currentItem
|
|
7
|
-
fullHeight
|
|
5
|
+
currentItem
|
|
8
6
|
}) => {
|
|
9
7
|
const {
|
|
10
8
|
activeTab
|
|
11
|
-
} = useTabsContext()
|
|
12
|
-
|
|
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 }) });
|
|
9
|
+
} = useTabsContext();
|
|
10
|
+
return /* @__PURE__ */ jsx("div", { className: "tab-content d-flex flex-fill w-100", 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 }) });
|
|
15
11
|
};
|
|
16
12
|
export {
|
|
17
13
|
TabsPanel as default
|
|
@@ -28,8 +28,6 @@ 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;
|
|
33
31
|
}
|
|
34
32
|
declare const useDropdown: (placement: Placement | undefined, extraTriggerKeyDownHandler?: (event: React.KeyboardEvent<HTMLButtonElement>) => void, isTriggerHovered?: boolean, focusOnVisible?: boolean, openOnSpace?: boolean, focusOnMouseEnter?: boolean) => UseDropdownProps;
|
|
35
33
|
export default useDropdown;
|
|
@@ -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 = (appCodeName) => {
|
|
4
4
|
var _a;
|
|
5
5
|
const {
|
|
6
6
|
user,
|
|
7
7
|
appCode
|
|
8
|
-
} = useEdificeClient(), appName = libraryMaps[appCode], libraryApp = user == null ? void 0 : user.apps.find((app) => app.isExternal && app.address.includes("library"));
|
|
8
|
+
} = useEdificeClient(), appName = libraryMaps[appCodeName ?? 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("?");
|