@edifice.io/react 2.0.0-develop-rc.22 → 2.0.0-develop-rc.24
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/Alert/Alert.d.ts +3 -3
- package/dist/components/AppHeader/AppHeader.d.ts +1 -1
- package/dist/components/AppIcon/AppIcon.d.ts +6 -6
- package/dist/components/AppIcon/AppIcon.js +14 -14
- package/dist/components/Attachment/Attachment.d.ts +1 -1
- package/dist/components/Avatar/Avatar.d.ts +3 -3
- package/dist/components/Avatar/Avatar.js +2 -2
- package/dist/components/Badge/Badge.d.ts +8 -8
- package/dist/components/Breadcrumb/BreadcrumbItem.d.ts +1 -1
- package/dist/components/Breadcrumb/BreadcrumbNav.d.ts +1 -1
- package/dist/components/Button/Button.d.ts +5 -5
- package/dist/components/Button/IconButton.d.ts +1 -1
- package/dist/components/Button/SearchButton.d.ts +1 -1
- package/dist/components/Card/CardContext.d.ts +1 -1
- package/dist/components/ColorPicker/ColorPalette.d.ts +1 -1
- package/dist/components/ColorPicker/ColorPicker.d.ts +1 -1
- package/dist/components/Combobox/ComboboxTrigger.d.ts +1 -1
- package/dist/components/Dropdown/Dropdown.d.ts +1 -1
- package/dist/components/Dropdown/DropdownContext.d.ts +1 -1
- package/dist/components/Dropdown/DropdownItem.d.ts +1 -1
- package/dist/components/Dropdown/DropdownMenu.d.ts +2 -2
- package/dist/components/Dropdown/DropdownTrigger.d.ts +3 -3
- package/dist/components/Form/FormContext.d.ts +1 -1
- package/dist/components/Form/FormControl.d.ts +2 -2
- package/dist/components/Grid/Grid.d.ts +1 -1
- package/dist/components/Heading/Heading.d.ts +1 -1
- package/dist/components/Image/Image.d.ts +3 -3
- package/dist/components/Image/Image.js +2 -2
- package/dist/components/Input/Input.d.ts +2 -2
- package/dist/components/Label/Label.d.ts +2 -2
- package/dist/components/Layout/components/Main.d.ts +1 -1
- package/dist/components/Layout/components/NavItem.d.ts +1 -1
- package/dist/components/Layout/components/NavbarNav.d.ts +1 -1
- package/dist/components/Loading/Loading.d.ts +1 -1
- package/dist/components/LoadingScreen/LoadingScreen.js +3 -3
- package/dist/components/Menu/components/MenuButton.d.ts +1 -1
- package/dist/components/Menu/hooks/useMenu.d.ts +1 -1
- package/dist/components/Modal/Modal.d.ts +1 -1
- package/dist/components/SearchBar/SearchBar.d.ts +1 -1
- package/dist/components/Select/Select.d.ts +1 -1
- package/dist/components/TextArea/TextArea.d.ts +2 -2
- package/dist/components/Toolbar/Toolbar.d.ts +9 -9
- package/dist/components/Tooltip/Tooltip.d.ts +2 -2
- package/dist/components/Tree/index.d.ts +1 -0
- package/dist/components/Tree/types/index.d.ts +1 -1
- package/dist/components/Tree/utilities/tree-sortable.js +14 -0
- package/dist/hooks/index.d.ts +0 -1
- package/dist/hooks/useDate/useDate.js +4 -4
- package/dist/hooks/useUpload/useUpload.js +4 -4
- package/dist/index.js +77 -66
- package/dist/modules/audience/ReactionModal.Card.d.ts +1 -1
- package/dist/modules/comments/hooks/useComments.js +4 -4
- package/dist/modules/comments/types.d.ts +3 -3
- package/dist/modules/editor/components/Editor/Editor.d.ts +4 -4
- package/dist/modules/editor/components/EditorToolbar/EditorToolbar.DropdownMenu.d.ts +1 -1
- package/dist/modules/editor/components/EditorToolbar/EditorToolbar.Emoji.d.ts +1 -1
- package/dist/modules/editor/components/EditorToolbar/EditorToolbar.HighlightColor.d.ts +1 -1
- package/dist/modules/editor/components/EditorToolbar/EditorToolbar.TextColor.d.ts +1 -1
- package/dist/modules/editor/components/EditorToolbar/EditorToolbar.TextSize.d.ts +1 -1
- package/dist/modules/editor/components/EditorToolbar/EditorToolbar.Typography.d.ts +1 -1
- package/dist/modules/editor/components/EditorToolbar/EditorToolbar.d.ts +1 -1
- package/dist/modules/editor/components/Renderer/MediaRenderer.js +1 -4
- package/dist/modules/editor/components/Toolbar/LinkToolbar.TippyOptions.d.ts +1 -1
- package/dist/modules/editor/hooks/useActionOptions.d.ts +1 -1
- package/dist/modules/icons/components/apps/IconAccount.js +1 -1
- package/dist/modules/icons/components/apps/IconActualites.js +1 -1
- package/dist/modules/icons/components/apps/IconAdmin.js +1 -1
- package/dist/modules/icons/components/apps/IconAdminPortal.js +1 -1
- package/dist/modules/icons/components/apps/IconAdmissionPostBac.js +1 -1
- package/dist/modules/icons/components/apps/IconAgenda.js +1 -1
- package/dist/modules/icons/components/apps/IconArchive.js +1 -1
- package/dist/modules/icons/components/apps/IconAssistance.js +1 -1
- package/dist/modules/icons/components/apps/IconAssr.js +1 -1
- package/dist/modules/icons/components/apps/IconAward.js +1 -1
- package/dist/modules/icons/components/apps/IconBanquesavoir.js +1 -1
- package/dist/modules/icons/components/apps/IconBcdi.js +1 -1
- package/dist/modules/icons/components/apps/IconBiblionisep.js +1 -1
- package/dist/modules/icons/components/apps/IconBlog.js +1 -1
- package/dist/modules/icons/components/apps/IconBookmarkEmpty.js +1 -1
- package/dist/modules/icons/components/apps/IconCahierDeTexte.js +1 -1
- package/dist/modules/icons/components/apps/IconCahierTextes.js +1 -1
- package/dist/modules/icons/components/apps/IconCalendar.js +1 -1
- package/dist/modules/icons/components/apps/IconCanalNumerique.js +1 -1
- package/dist/modules/icons/components/apps/IconCcn.js +1 -1
- package/dist/modules/icons/components/apps/IconCerise.js +1 -1
- package/dist/modules/icons/components/apps/IconCervoprint.js +1 -1
- package/dist/modules/icons/components/apps/IconCharlemagne.js +1 -1
- package/dist/modules/icons/components/apps/IconCharte.js +1 -1
- package/dist/modules/icons/components/apps/IconChat.js +1 -1
- package/dist/modules/icons/components/apps/IconCidj.js +1 -1
- package/dist/modules/icons/components/apps/IconCns.js +1 -1
- package/dist/modules/icons/components/apps/IconCollaborativeWall.js +1 -1
- package/dist/modules/icons/components/apps/IconCompetences.js +1 -1
- package/dist/modules/icons/components/apps/IconConnecteurGenerique1.js +1 -1
- package/dist/modules/icons/components/apps/IconConnecteurGenerique2.js +1 -1
- package/dist/modules/icons/components/apps/IconConversation.js +1 -1
- package/dist/modules/icons/components/apps/IconDirectory.js +1 -1
- package/dist/modules/icons/components/apps/IconEducagri.js +1 -1
- package/dist/modules/icons/components/apps/IconEdumedia.js +1 -1
- package/dist/modules/icons/components/apps/IconEdumoov.js +1 -1
- package/dist/modules/icons/components/apps/IconEdutheque.js +1 -1
- package/dist/modules/icons/components/apps/IconElectron.js +1 -1
- package/dist/modules/icons/components/apps/IconElyceepicardie.js +1 -1
- package/dist/modules/icons/components/apps/IconEsidoc.js +1 -1
- package/dist/modules/icons/components/apps/IconEuropress.js +1 -1
- package/dist/modules/icons/components/apps/IconExercizer.js +1 -1
- package/dist/modules/icons/components/apps/IconForum.js +1 -1
- package/dist/modules/icons/components/apps/IconGepi.js +1 -1
- package/dist/modules/icons/components/apps/IconGlpi.js +1 -1
- package/dist/modules/icons/components/apps/IconHiboutheque.js +1 -1
- package/dist/modules/icons/components/apps/IconItopstore.js +1 -1
- package/dist/modules/icons/components/apps/IconKne.js +1 -1
- package/dist/modules/icons/components/apps/IconLeSiteTv.js +1 -1
- package/dist/modules/icons/components/apps/IconLemonde.js +1 -1
- package/dist/modules/icons/components/apps/IconLesechos.js +1 -1
- package/dist/modules/icons/components/apps/IconLibrary.js +1 -1
- package/dist/modules/icons/components/apps/IconLsu.js +1 -1
- package/dist/modules/icons/components/apps/IconMadmagz.js +1 -1
- package/dist/modules/icons/components/apps/IconMatholycee.js +1 -1
- package/dist/modules/icons/components/apps/IconMaxicours.js +1 -1
- package/dist/modules/icons/components/apps/IconMediacentre.js +1 -1
- package/dist/modules/icons/components/apps/IconMindmap.js +1 -1
- package/dist/modules/icons/components/apps/IconMonorientationenligne.js +1 -1
- package/dist/modules/icons/components/apps/IconMonstageenligne.js +1 -1
- package/dist/modules/icons/components/apps/IconMoodle.js +1 -1
- package/dist/modules/icons/components/apps/IconMuseefrancaisphoto.js +1 -1
- package/dist/modules/icons/components/apps/IconMyNetwork.js +1 -1
- package/dist/modules/icons/components/apps/IconNetvibes.js +1 -1
- package/dist/modules/icons/components/apps/IconNote.js +1 -1
- package/dist/modules/icons/components/apps/IconNotebook.js +1 -1
- package/dist/modules/icons/components/apps/IconNotes.js +1 -1
- package/dist/modules/icons/components/apps/IconOnisep.js +1 -1
- package/dist/modules/icons/components/apps/IconOnisep2.js +1 -1
- package/dist/modules/icons/components/apps/IconPad.js +1 -1
- package/dist/modules/icons/components/apps/IconPages.js +1 -1
- package/dist/modules/icons/components/apps/IconParametrage.js +1 -1
- package/dist/modules/icons/components/apps/IconParametrages.js +1 -1
- package/dist/modules/icons/components/apps/IconParaschool.js +1 -1
- package/dist/modules/icons/components/apps/IconParcours.js +1 -1
- package/dist/modules/icons/components/apps/IconPearltrees.js +1 -1
- package/dist/modules/icons/components/apps/IconPicardieCursus.js +1 -1
- package/dist/modules/icons/components/apps/IconPoll.js +1 -1
- package/dist/modules/icons/components/apps/IconProeps.js +1 -1
- package/dist/modules/icons/components/apps/IconPronote.js +1 -1
- package/dist/modules/icons/components/apps/IconPublic.js +1 -1
- package/dist/modules/icons/components/apps/IconQwant.js +1 -1
- package/dist/modules/icons/components/apps/IconQwantJunior.js +1 -1
- package/dist/modules/icons/components/apps/IconRack.js +1 -1
- package/dist/modules/icons/components/apps/IconRbs.js +1 -1
- package/dist/modules/icons/components/apps/IconResidenceArtiste.js +1 -1
- package/dist/modules/icons/components/apps/IconRessourcesdepartementale91.js +1 -1
- package/dist/modules/icons/components/apps/IconSacoche.js +1 -1
- package/dist/modules/icons/components/apps/IconSchoolbook.js +1 -1
- package/dist/modules/icons/components/apps/IconScolinfo.js +1 -1
- package/dist/modules/icons/components/apps/IconScrapbook.js +1 -1
- package/dist/modules/icons/components/apps/IconSearchengine.js +1 -1
- package/dist/modules/icons/components/apps/IconSettingsClass.js +1 -1
- package/dist/modules/icons/components/apps/IconSharebigfiles.js +1 -1
- package/dist/modules/icons/components/apps/IconStatistics.js +1 -1
- package/dist/modules/icons/components/apps/IconStats.js +1 -1
- package/dist/modules/icons/components/apps/IconSuitcase.js +1 -1
- package/dist/modules/icons/components/apps/IconSupport.js +1 -1
- package/dist/modules/icons/components/apps/IconTimeline.js +1 -1
- package/dist/modules/icons/components/apps/IconTimelinegenerator.js +1 -1
- package/dist/modules/icons/components/apps/IconTurboself.js +1 -1
- package/dist/modules/icons/components/apps/IconUniversalis.js +1 -1
- package/dist/modules/icons/components/apps/IconUnstagepourtous.js +1 -1
- package/dist/modules/icons/components/apps/IconUserbook.js +1 -1
- package/dist/modules/icons/components/apps/IconVideo.js +1 -1
- package/dist/modules/icons/components/apps/IconVieScolaire.js +1 -1
- package/dist/modules/icons/components/apps/IconVisioconf.js +1 -1
- package/dist/modules/icons/components/apps/IconWebclasseur.js +1 -1
- package/dist/modules/icons/components/apps/IconWebsite.js +1 -1
- package/dist/modules/icons/components/apps/IconWiki.js +2 -2
- package/dist/modules/icons/components/apps/IconWorkspace.js +1 -1
- package/dist/modules/modals/OnboardingModal/OnboardingModal.js +2 -3
- package/dist/modules/modals/PublishModal/components/PublishModalFooter.js +3 -3
- package/dist/modules/modals/ResourceModal/ResourceModal.d.ts +2 -2
- package/dist/modules/modals/ShareModal/apps/ShareBlog.d.ts +1 -1
- package/dist/modules/modals/ShareModal/hooks/useShare.d.ts +8 -8
- package/dist/modules/multimedia/AudioRecorder/useAudioRecorder.d.ts +2 -2
- package/dist/modules/multimedia/ImageEditor/components/ImageEditorToolbar.d.ts +1 -1
- package/dist/modules/multimedia/ImageEditor/effects/blur.d.ts +1 -1
- package/dist/modules/multimedia/ImageEditor/effects/crop.d.ts +2 -2
- package/dist/modules/multimedia/ImageEditor/effects/misc.d.ts +1 -1
- package/dist/modules/multimedia/ImageEditor/effects/resize.d.ts +1 -1
- package/dist/modules/multimedia/ImageEditor/effects/rotate.d.ts +1 -1
- package/dist/modules/multimedia/ImageEditor/hooks/useHistoryTool.d.ts +1 -1
- package/dist/modules/multimedia/ImageEditor/hooks/useImageEditor.d.ts +1 -1
- package/dist/modules/multimedia/ImageEditor/hooks/useImageEffects.d.ts +1 -1
- package/dist/modules/multimedia/ImagePicker/ImagePicker.d.ts +1 -1
- package/dist/modules/multimedia/Linker/ExternalLinker/ExternalLinker.d.ts +2 -2
- package/dist/modules/multimedia/Linker/InternalLinker/InternalLinker.js +4 -4
- package/dist/modules/multimedia/MediaLibrary/MediaLibrary.d.ts +7 -7
- package/dist/modules/multimedia/MediaLibrary/MediaLibrary.js +1 -1
- package/dist/modules/multimedia/MediaLibrary/innertabs/InternalLink.d.ts +2 -2
- package/dist/modules/multimedia/UploadCard/UploadCard.js +5 -5
- package/dist/modules/multimedia/VideoEmbed/VideoEmbed.d.ts +1 -1
- package/dist/modules/multimedia/VideoEmbed/VideoEmbed.js +3 -3
- package/dist/modules/multimedia/Workspace/Workspace.js +3 -3
- package/dist/providers/EdificeThemeProvider/EdificeThemeProvider.context.d.ts +1 -1
- package/dist/types/size.d.ts +1 -1
- package/dist/types/status.d.ts +1 -1
- package/dist/utilities/emptyscreen-mapping/emptyscreen-mapping.d.ts +6 -0
- package/dist/utilities/emptyscreen-mapping/emptyscreen-mapping.js +49 -0
- package/dist/utilities/emptyscreen-mapping/index.d.ts +1 -0
- package/dist/utilities/index.d.ts +1 -0
- package/package.json +15 -8
- package/dist/hooks/usePaths/index.d.ts +0 -1
- package/dist/hooks/usePaths/usePaths.d.ts +0 -1
- package/dist/hooks/usePaths/usePaths.js +0 -7
|
@@ -3,9 +3,9 @@ export interface AlertRef {
|
|
|
3
3
|
show: () => void;
|
|
4
4
|
hide: () => void;
|
|
5
5
|
}
|
|
6
|
-
export type AlertTypes =
|
|
7
|
-
export type AlertPosition =
|
|
8
|
-
export interface AlertProps extends ComponentPropsWithRef<
|
|
6
|
+
export type AlertTypes = 'success' | 'warning' | 'info' | 'danger';
|
|
7
|
+
export type AlertPosition = 'none' | 'top-left' | 'top-right' | 'bottom-left' | 'bottom-right';
|
|
8
|
+
export interface AlertProps extends ComponentPropsWithRef<'div'> {
|
|
9
9
|
/**
|
|
10
10
|
* Type of alert
|
|
11
11
|
*/
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { IWebApp } from '@edifice.io/ts-client';
|
|
2
|
-
export type AppIconSize =
|
|
2
|
+
export type AppIconSize = '24' | '32' | '40' | '48' | '80' | '160';
|
|
3
3
|
export interface BaseProps {
|
|
4
4
|
/**
|
|
5
5
|
* Define icon size
|
|
@@ -14,13 +14,13 @@ export interface BaseProps {
|
|
|
14
14
|
*/
|
|
15
15
|
className?: string;
|
|
16
16
|
}
|
|
17
|
-
type AppVariants =
|
|
18
|
-
type SquareVariant = Extract<AppVariants,
|
|
17
|
+
type AppVariants = 'square' | 'circle' | 'rounded';
|
|
18
|
+
type SquareVariant = Extract<AppVariants, 'square'>;
|
|
19
19
|
type SquareIcon = {
|
|
20
20
|
/**
|
|
21
21
|
* Show icon full width
|
|
22
22
|
*/
|
|
23
|
-
iconFit?:
|
|
23
|
+
iconFit?: 'contain';
|
|
24
24
|
/**
|
|
25
25
|
* Square variant
|
|
26
26
|
*/
|
|
@@ -30,7 +30,7 @@ type VariantsIcon = {
|
|
|
30
30
|
/**
|
|
31
31
|
* Add padding around icon
|
|
32
32
|
*/
|
|
33
|
-
iconFit:
|
|
33
|
+
iconFit: 'ratio';
|
|
34
34
|
/**
|
|
35
35
|
* Rounded or Circle variant
|
|
36
36
|
*/
|
|
@@ -41,5 +41,5 @@ export type AppIconProps = BaseProps & Props;
|
|
|
41
41
|
/**
|
|
42
42
|
* Icon Component used to display the icon of an application
|
|
43
43
|
*/
|
|
44
|
-
declare const AppIcon: import('react').ForwardRefExoticComponent<AppIconProps & import('react').RefAttributes<
|
|
44
|
+
declare const AppIcon: import('react').ForwardRefExoticComponent<AppIconProps & import('react').RefAttributes<HTMLDivElement>>;
|
|
45
45
|
export default AppIcon;
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import { jsx } from "react/jsx-runtime";
|
|
2
|
-
import { forwardRef } from "react";
|
|
2
|
+
import { forwardRef, Suspense } from "react";
|
|
3
3
|
import clsx from "clsx";
|
|
4
|
+
import * as iconsApps from "../../icons-apps.js";
|
|
4
5
|
import Image from "../Image/Image.js";
|
|
6
|
+
import LoadingScreen from "../LoadingScreen/LoadingScreen.js";
|
|
5
7
|
import useEdificeIcons from "../../hooks/useEdificeIcons/useEdificeIcons.js";
|
|
6
|
-
import usePaths from "../../hooks/usePaths/usePaths.js";
|
|
7
8
|
const AppIcon = /* @__PURE__ */ forwardRef(({
|
|
8
9
|
app,
|
|
9
10
|
size = "24",
|
|
@@ -14,7 +15,7 @@ const AppIcon = /* @__PURE__ */ forwardRef(({
|
|
|
14
15
|
const {
|
|
15
16
|
isIconUrl,
|
|
16
17
|
getIconCode
|
|
17
|
-
} = useEdificeIcons(),
|
|
18
|
+
} = useEdificeIcons(), isSquare = variant === "square", isRounded = variant === "rounded", isCircle = variant === "circle", isContain = iconFit === "contain", isRatio = iconFit === "ratio", iconSizes = {
|
|
18
19
|
"icon-xs": size === "24",
|
|
19
20
|
"icon-sm": size === "40",
|
|
20
21
|
"icon-md": size === "48",
|
|
@@ -27,24 +28,23 @@ const AppIcon = /* @__PURE__ */ forwardRef(({
|
|
|
27
28
|
}, iconFits = {
|
|
28
29
|
"icon-contain": isContain,
|
|
29
30
|
"icon-ratio": isRatio
|
|
30
|
-
}, icon = typeof app == "string" ? app : (app == null ? void 0 : app.icon) !== void 0 ? app.icon : "placeholder", displayName = typeof app != "string" && (app == null ? void 0 : app.displayName) !== void 0 ? app.displayName : "", code = app ? getIconCode(app) : "", isIconURL = isIconUrl(icon), appCode = code || "placeholder"
|
|
31
|
-
if (isIconURL) {
|
|
32
|
-
const classes2 = clsx("h-full", className);
|
|
33
|
-
return /* @__PURE__ */ jsx(Image, { src: icon, alt: displayName, objectFit: "contain", width: size, height: size, className: classes2, style: {
|
|
34
|
-
minWidth: size + "px"
|
|
35
|
-
} });
|
|
36
|
-
}
|
|
37
|
-
const classes = clsx("app-icon", {
|
|
31
|
+
}, icon = typeof app == "string" ? app : (app == null ? void 0 : app.icon) !== void 0 ? app.icon : "placeholder", displayName = typeof app != "string" && (app == null ? void 0 : app.displayName) !== void 0 ? app.displayName : "", code = app ? getIconCode(app) : "", isIconURL = isIconUrl(icon), appCode = code || "placeholder", classes = clsx("app-icon", {
|
|
38
32
|
...iconSizes,
|
|
39
33
|
...iconVariant,
|
|
40
34
|
...iconFits,
|
|
41
35
|
[`bg-light-${appCode}`]: appCode && !isContain,
|
|
42
36
|
[`color-app-${appCode}`]: appCode
|
|
43
|
-
}, className);
|
|
44
|
-
|
|
37
|
+
}, className), IconComponent = iconsApps[`Icon${appCode.split("-").map((part) => part.charAt(0).toUpperCase() + part.slice(1)).join("")}`];
|
|
38
|
+
if (console.log(`Icon${appCode.split("-").map((part) => part.charAt(0).toUpperCase() + part.slice(1)).join("")}`), isIconURL) {
|
|
39
|
+
const classes2 = clsx("h-full", className);
|
|
40
|
+
return /* @__PURE__ */ jsx(Image, { src: icon, alt: displayName, objectFit: "contain", width: size, height: size, className: classes2, style: {
|
|
41
|
+
minWidth: size + "px"
|
|
42
|
+
} });
|
|
43
|
+
}
|
|
44
|
+
return /* @__PURE__ */ jsx(Suspense, { fallback: /* @__PURE__ */ jsx(LoadingScreen, {}), children: /* @__PURE__ */ jsx("div", { ref, className: classes, style: {
|
|
45
45
|
width: size + "px",
|
|
46
46
|
height: size + "px"
|
|
47
|
-
}, children: /* @__PURE__ */ jsx(
|
|
47
|
+
}, children: /* @__PURE__ */ jsx(IconComponent, { width: size, height: size }) }) });
|
|
48
48
|
});
|
|
49
49
|
export {
|
|
50
50
|
AppIcon as default
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
export type AvatarVariants =
|
|
2
|
-
export type AvatarSizes =
|
|
3
|
-
export interface AvatarProps extends React.ComponentPropsWithRef<
|
|
1
|
+
export type AvatarVariants = 'square' | 'rounded' | 'circle';
|
|
2
|
+
export type AvatarSizes = 'xs' | 'sm' | 'md' | 'lg' | 'xl';
|
|
3
|
+
export interface AvatarProps extends React.ComponentPropsWithRef<'img'> {
|
|
4
4
|
/**
|
|
5
5
|
* Shape of Avatar
|
|
6
6
|
* `title`, `square`, `circle`
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { jsx } from "react/jsx-runtime";
|
|
2
2
|
import { forwardRef } from "react";
|
|
3
3
|
import clsx from "clsx";
|
|
4
|
+
import noAvatar from "@edifice.io/bootstrap/dist/images/avatar/no-avatar.svg";
|
|
4
5
|
import Image from "../Image/Image.js";
|
|
5
|
-
import usePaths from "../../hooks/usePaths/usePaths.js";
|
|
6
6
|
const Avatar = /* @__PURE__ */ forwardRef(({
|
|
7
7
|
variant = "square",
|
|
8
8
|
size = "md",
|
|
@@ -12,7 +12,7 @@ const Avatar = /* @__PURE__ */ forwardRef(({
|
|
|
12
12
|
className,
|
|
13
13
|
...restProps
|
|
14
14
|
}, ref) => {
|
|
15
|
-
const
|
|
15
|
+
const placeholder = imgPlaceholder || noAvatar, classes = clsx("avatar", {
|
|
16
16
|
...{
|
|
17
17
|
"avatar-xs": size === "xs",
|
|
18
18
|
"avatar-sm": size === "sm",
|
|
@@ -3,31 +3,31 @@ import { UserProfile } from '@edifice.io/ts-client';
|
|
|
3
3
|
export type BadgeRef = HTMLSpanElement;
|
|
4
4
|
/** Badge variant : notification */
|
|
5
5
|
export type NotificationBadgeVariant = {
|
|
6
|
-
type:
|
|
7
|
-
level:
|
|
6
|
+
type: 'notification';
|
|
7
|
+
level: 'success' | 'warning' | 'danger' | 'info';
|
|
8
8
|
};
|
|
9
9
|
/** Badge variant : content */
|
|
10
10
|
export type ContentBadgeVariant = {
|
|
11
|
-
type:
|
|
12
|
-
level:
|
|
11
|
+
type: 'content';
|
|
12
|
+
level: 'success' | 'warning' | 'danger' | 'info';
|
|
13
13
|
background?: boolean;
|
|
14
14
|
};
|
|
15
15
|
/** Badge variant : profile = teacher, student, relative or personnel, guest */
|
|
16
16
|
export type ProfileBadgeVariant = {
|
|
17
|
-
type:
|
|
17
|
+
type: 'user';
|
|
18
18
|
profile: UserProfile[number];
|
|
19
19
|
background?: boolean;
|
|
20
20
|
};
|
|
21
21
|
/** Badge variant : chip */
|
|
22
22
|
export type ChipBadgeVariant = {
|
|
23
|
-
type:
|
|
23
|
+
type: 'chip';
|
|
24
24
|
};
|
|
25
25
|
/** Badge variant : link */
|
|
26
26
|
export type LinkBadgeVariant = {
|
|
27
|
-
type:
|
|
27
|
+
type: 'link';
|
|
28
28
|
};
|
|
29
29
|
export type BadgeVariants = NotificationBadgeVariant | ContentBadgeVariant | ProfileBadgeVariant | ChipBadgeVariant | LinkBadgeVariant;
|
|
30
|
-
export interface BadgeProps extends React.ComponentPropsWithRef<
|
|
30
|
+
export interface BadgeProps extends React.ComponentPropsWithRef<'span'> {
|
|
31
31
|
/**
|
|
32
32
|
* Badge variant : notification, link or profile (Teacher|Student|Relative|Personnel)
|
|
33
33
|
* Defaults to notification.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ReactNode } from 'react';
|
|
2
2
|
import { IWebApp } from '@edifice.io/ts-client';
|
|
3
|
-
export interface BreadcrumbNavProps extends React.ComponentPropsWithRef<
|
|
3
|
+
export interface BreadcrumbNavProps extends React.ComponentPropsWithRef<'nav'> {
|
|
4
4
|
/**
|
|
5
5
|
* Pass all data about current application
|
|
6
6
|
*/
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { ReactNode } from 'react';
|
|
2
2
|
import { LoadingIcon, LoadingPosition } from '../Loading';
|
|
3
3
|
export type ButtonRef = HTMLButtonElement;
|
|
4
|
-
export type ButtonTypes =
|
|
5
|
-
export type ButtonColors =
|
|
6
|
-
export type ButtonVariants =
|
|
7
|
-
export type ButtonSizes =
|
|
8
|
-
export interface ButtonProps extends React.ComponentPropsWithRef<
|
|
4
|
+
export type ButtonTypes = 'button' | 'submit' | 'reset';
|
|
5
|
+
export type ButtonColors = 'primary' | 'secondary' | 'tertiary' | 'danger';
|
|
6
|
+
export type ButtonVariants = 'filled' | 'outline' | 'ghost';
|
|
7
|
+
export type ButtonSizes = 'sm' | 'md' | 'lg';
|
|
8
|
+
export interface ButtonProps extends React.ComponentPropsWithRef<'button'> {
|
|
9
9
|
/**
|
|
10
10
|
* `button`, `submit` or `reset`
|
|
11
11
|
*/
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ReactNode } from 'react';
|
|
2
2
|
import { ButtonProps } from './Button';
|
|
3
|
-
type OmittedProps =
|
|
3
|
+
type OmittedProps = 'children' | 'leftIcon' | 'rightIcon';
|
|
4
4
|
export interface IconButtonProps extends Omit<ButtonProps, OmittedProps> {
|
|
5
5
|
icon?: ReactNode;
|
|
6
6
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { IWebApp } from '@edifice.io/ts-client';
|
|
2
2
|
import { CardProps } from './Card';
|
|
3
|
-
export interface CardContextProps extends Omit<CardProps,
|
|
3
|
+
export interface CardContextProps extends Omit<CardProps, 'children' | 'className'> {
|
|
4
4
|
app?: IWebApp | undefined;
|
|
5
5
|
appCode: string | undefined;
|
|
6
6
|
isSelectable?: boolean;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ComponentPropsWithRef } from 'react';
|
|
2
2
|
import { ColorPalette, ColorPaletteItem } from './ColorPalette';
|
|
3
|
-
export interface ColorPickerProps extends ComponentPropsWithRef<
|
|
3
|
+
export interface ColorPickerProps extends ComponentPropsWithRef<'div'> {
|
|
4
4
|
/**
|
|
5
5
|
* Palettes of pickable colors
|
|
6
6
|
*/
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ChangeEvent } from 'react';
|
|
2
|
-
export interface ComboboxTriggerProps extends React.ComponentPropsWithRef<
|
|
2
|
+
export interface ComboboxTriggerProps extends React.ComponentPropsWithRef<'button'> {
|
|
3
3
|
handleSearchInputChange: (event: ChangeEvent<HTMLInputElement>) => void;
|
|
4
4
|
value: string;
|
|
5
5
|
searchMinLength?: number;
|
|
@@ -50,7 +50,7 @@ export type DropdownMenuOptions = {
|
|
|
50
50
|
/**
|
|
51
51
|
* Object type
|
|
52
52
|
*/
|
|
53
|
-
type:
|
|
53
|
+
type: 'divider';
|
|
54
54
|
};
|
|
55
55
|
declare const Dropdown: {
|
|
56
56
|
({ children, block, overflow, placement, extraTriggerKeyDownHandler, onToggle, isTriggerHovered, }: DropdownProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { UseDropdownProps } from '../../hooks/useDropdown/useDropdown';
|
|
2
|
-
type OmittedProps = Omit<UseDropdownProps,
|
|
2
|
+
type OmittedProps = Omit<UseDropdownProps, 'triggerRef' | 'menuRef'>;
|
|
3
3
|
export interface DropdownContextProps extends OmittedProps {
|
|
4
4
|
block?: boolean;
|
|
5
5
|
}
|
|
@@ -21,10 +21,10 @@ interface Divider {
|
|
|
21
21
|
/**
|
|
22
22
|
* Object type
|
|
23
23
|
*/
|
|
24
|
-
type:
|
|
24
|
+
type: 'divider';
|
|
25
25
|
}
|
|
26
26
|
export type DropdownMenuOptions = Item | Divider;
|
|
27
|
-
export interface DropdownMenuProps extends ComponentPropsWithRef<
|
|
27
|
+
export interface DropdownMenuProps extends ComponentPropsWithRef<'div'> {
|
|
28
28
|
children: ReactNode;
|
|
29
29
|
/** Use whole width ? */
|
|
30
30
|
block?: boolean;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export interface DropdownTriggerProps extends React.ComponentPropsWithRef<
|
|
1
|
+
export interface DropdownTriggerProps extends React.ComponentPropsWithRef<'button'> {
|
|
2
2
|
/**
|
|
3
3
|
* Dropdown trigger title
|
|
4
4
|
*/
|
|
@@ -14,11 +14,11 @@ export interface DropdownTriggerProps extends React.ComponentPropsWithRef<"butto
|
|
|
14
14
|
/**
|
|
15
15
|
* Set appearance
|
|
16
16
|
*/
|
|
17
|
-
variant?:
|
|
17
|
+
variant?: 'ghost';
|
|
18
18
|
/**
|
|
19
19
|
* Button size
|
|
20
20
|
*/
|
|
21
|
-
size?:
|
|
21
|
+
size?: 'sm' | 'md' | 'lg';
|
|
22
22
|
/**
|
|
23
23
|
* Disabled Trigger
|
|
24
24
|
* */
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { FormControlProps } from './FormControl';
|
|
2
|
-
type Props = Omit<FormControlProps,
|
|
2
|
+
type Props = Omit<FormControlProps, 'className' | 'children'>;
|
|
3
3
|
export type FormContextProps = Props;
|
|
4
4
|
export declare const Context: import('react').Context<Props | null>;
|
|
5
5
|
export declare const useFormControl: () => Props;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ReactNode } from 'react';
|
|
2
|
-
export interface FormControlProps extends React.ComponentPropsWithRef<
|
|
2
|
+
export interface FormControlProps extends React.ComponentPropsWithRef<'div'> {
|
|
3
3
|
/**
|
|
4
4
|
* For accessibility
|
|
5
5
|
*/
|
|
@@ -27,7 +27,7 @@ export interface FormControlProps extends React.ComponentPropsWithRef<"div"> {
|
|
|
27
27
|
/**
|
|
28
28
|
* Status to handle Form Validation
|
|
29
29
|
*/
|
|
30
|
-
status?:
|
|
30
|
+
status?: 'valid' | 'invalid';
|
|
31
31
|
}
|
|
32
32
|
declare const FormControl: import('react').ForwardRefExoticComponent<Omit<FormControlProps, "ref"> & import('react').RefAttributes<HTMLDivElement>> & {
|
|
33
33
|
Label: import('react').ForwardRefExoticComponent<Omit<import('..').LabelProps, "ref"> & import('react').RefAttributes<HTMLLabelElement>>;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ReactNode } from 'react';
|
|
2
|
-
export type HeadingElement =
|
|
2
|
+
export type HeadingElement = 'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6';
|
|
3
3
|
export interface HeadingProps extends React.HTMLAttributes<HTMLHeadingElement> {
|
|
4
4
|
/**
|
|
5
5
|
* Level of Heading
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export interface ImageProps extends React.ComponentPropsWithRef<
|
|
1
|
+
export interface ImageProps extends React.ComponentPropsWithRef<'img'> {
|
|
2
2
|
/**
|
|
3
3
|
* Image URL
|
|
4
4
|
*/
|
|
@@ -10,11 +10,11 @@ export interface ImageProps extends React.ComponentPropsWithRef<"img"> {
|
|
|
10
10
|
/**
|
|
11
11
|
* Image ratio
|
|
12
12
|
*/
|
|
13
|
-
ratio?:
|
|
13
|
+
ratio?: '1' | '4' | '16' | '21';
|
|
14
14
|
/**
|
|
15
15
|
* Object fit property
|
|
16
16
|
*/
|
|
17
|
-
objectFit?:
|
|
17
|
+
objectFit?: 'contain' | 'cover' | 'fill' | 'scale' | 'none';
|
|
18
18
|
/**
|
|
19
19
|
* Placeholder image as fallback
|
|
20
20
|
*/
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { jsx } from "react/jsx-runtime";
|
|
2
2
|
import { forwardRef } from "react";
|
|
3
3
|
import clsx from "clsx";
|
|
4
|
+
import commonPlaceholder from "@edifice.io/bootstrap/dist/images/common/image-placeholder.png";
|
|
4
5
|
import useImage from "../../hooks/useImage/useImage.js";
|
|
5
|
-
import usePaths from "../../hooks/usePaths/usePaths.js";
|
|
6
6
|
const Image = /* @__PURE__ */ forwardRef(({
|
|
7
7
|
src,
|
|
8
8
|
alt,
|
|
@@ -12,7 +12,7 @@ const Image = /* @__PURE__ */ forwardRef(({
|
|
|
12
12
|
className,
|
|
13
13
|
...restProps
|
|
14
14
|
}, ref) => {
|
|
15
|
-
const
|
|
15
|
+
const placeholder = imgPlaceholder ?? commonPlaceholder, {
|
|
16
16
|
imgSrc,
|
|
17
17
|
onError
|
|
18
18
|
} = useImage({
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Size } from '../../types';
|
|
2
|
-
export type OmitInputProps =
|
|
3
|
-
export interface InputProps extends Omit<React.ComponentPropsWithRef<
|
|
2
|
+
export type OmitInputProps = 'disabled' | 'required' | 'size' | 'id' | 'readOnly';
|
|
3
|
+
export interface InputProps extends Omit<React.ComponentPropsWithRef<'input'>, OmitInputProps> {
|
|
4
4
|
/**
|
|
5
5
|
* Control size of input
|
|
6
6
|
*/
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ReactNode } from 'react';
|
|
2
|
-
export type OmitLabelProps =
|
|
3
|
-
export interface LabelProps extends Omit<React.ComponentPropsWithRef<
|
|
2
|
+
export type OmitLabelProps = 'htmlFor';
|
|
3
|
+
export interface LabelProps extends Omit<React.ComponentPropsWithRef<'label'>, OmitLabelProps> {
|
|
4
4
|
/**
|
|
5
5
|
* Display Icon to the left
|
|
6
6
|
*/
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { jsxs, Fragment, jsx } from "react/jsx-runtime";
|
|
2
2
|
import { forwardRef } from "react";
|
|
3
|
+
import loadingScreen from "@edifice.io/bootstrap/dist/images/loading/screen-loading.gif";
|
|
3
4
|
import clsx from "clsx";
|
|
4
|
-
import usePaths from "../../hooks/usePaths/usePaths.js";
|
|
5
5
|
const LoadingScreen = /* @__PURE__ */ forwardRef(({
|
|
6
6
|
position = !0,
|
|
7
7
|
caption
|
|
8
8
|
}, ref) => {
|
|
9
|
-
const
|
|
9
|
+
const containerClasses = clsx("top-0 end-0 start-0 bottom-0 d-grid justify-content-center align-content-center align-items-center z-2000", {
|
|
10
10
|
"position-fixed": !position,
|
|
11
11
|
"position-static": position
|
|
12
12
|
}), captionClasses = clsx("text-center pt-12", {
|
|
@@ -14,7 +14,7 @@ const LoadingScreen = /* @__PURE__ */ forwardRef(({
|
|
|
14
14
|
});
|
|
15
15
|
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
16
16
|
/* @__PURE__ */ jsxs("div", { ref, className: containerClasses, children: [
|
|
17
|
-
/* @__PURE__ */ jsx("div", { className: "bg-white rounded-circle mx-auto w-25", children: /* @__PURE__ */ jsx("img", { src:
|
|
17
|
+
/* @__PURE__ */ jsx("div", { className: "bg-white rounded-circle mx-auto w-25", children: /* @__PURE__ */ jsx("img", { src: loadingScreen, alt: "loading" }) }),
|
|
18
18
|
caption && /* @__PURE__ */ jsx("div", { className: captionClasses, children: caption })
|
|
19
19
|
] }),
|
|
20
20
|
!position && /* @__PURE__ */ jsx("div", { className: "modal-backdrop fade show" })
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ButtonProps } from '../../Button';
|
|
2
|
-
export type MenuButtonProps = Pick<ButtonProps,
|
|
2
|
+
export type MenuButtonProps = Pick<ButtonProps, 'children' | 'leftIcon' | 'rightIcon' | 'onClick'> & {
|
|
3
3
|
selected: boolean;
|
|
4
4
|
};
|
|
5
5
|
export declare const MenuButton: (props: Partial<MenuButtonProps>) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -2,7 +2,7 @@ export declare const useMenu: () => {
|
|
|
2
2
|
menuRef: import('react').MutableRefObject<HTMLUListElement | null>;
|
|
3
3
|
menuItems: Set<HTMLLIElement>;
|
|
4
4
|
childProps: {
|
|
5
|
-
|
|
5
|
+
'data-menubar-menuitem': string;
|
|
6
6
|
role: string;
|
|
7
7
|
};
|
|
8
8
|
onKeyDown: (event: React.KeyboardEvent<HTMLUListElement>) => void;
|
|
@@ -14,7 +14,7 @@ export interface OptionsType {
|
|
|
14
14
|
*/
|
|
15
15
|
icon?: JSX.Element;
|
|
16
16
|
}
|
|
17
|
-
export interface SelectProps extends Omit<DropdownProps,
|
|
17
|
+
export interface SelectProps extends Omit<DropdownProps, 'children'>, Omit<DropdownTriggerProps, 'badgeContent'> {
|
|
18
18
|
/**
|
|
19
19
|
* Default select label
|
|
20
20
|
*/
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Size } from '../../types';
|
|
2
|
-
export type OmitTextAreaProps =
|
|
3
|
-
export interface TextAreaProps extends Omit<React.ComponentPropsWithRef<
|
|
2
|
+
export type OmitTextAreaProps = 'disabled' | 'required' | 'size' | 'id' | 'readOnly';
|
|
3
|
+
export interface TextAreaProps extends Omit<React.ComponentPropsWithRef<'textarea'>, OmitTextAreaProps> {
|
|
4
4
|
/**
|
|
5
5
|
* Control size of TextArea
|
|
6
6
|
*/
|