@edifice.io/react 2.2.11-develop-pedago.20250710182455 → 2.2.11-develop-pedago.20250822111402
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/Avatar/Avatar.d.ts +5 -0
- package/dist/components/Avatar/Avatar.js +8 -2
- package/dist/components/AvatarGroup/AvatarGroup.d.ts +10 -0
- package/dist/components/AvatarGroup/AvatarGroup.js +5 -5
- package/dist/components/StackedGroup/StackedGroup.d.ts +5 -0
- package/dist/components/StackedGroup/StackedGroup.js +10 -8
- package/dist/hooks/useEdificeIcons/useEdificeIcons.js +1 -1
- package/package.json +6 -6
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
1
2
|
import { Color } from 'src/types/color';
|
|
2
3
|
export type AvatarVariants = 'square' | 'rounded' | 'circle';
|
|
3
4
|
export type AvatarSizes = 'xs' | 'sm' | 'md' | 'lg' | 'xl';
|
|
@@ -47,6 +48,10 @@ export interface AvatarProps extends React.ComponentPropsWithRef<'img'> {
|
|
|
47
48
|
* Outer border offset in pixels
|
|
48
49
|
*/
|
|
49
50
|
outerBorderOffset?: number;
|
|
51
|
+
/**
|
|
52
|
+
* Cover content for the avatar
|
|
53
|
+
*/
|
|
54
|
+
cover?: ReactNode;
|
|
50
55
|
}
|
|
51
56
|
declare const Avatar: import('react').ForwardRefExoticComponent<Omit<AvatarProps, "ref"> & import('react').RefAttributes<HTMLDivElement>>;
|
|
52
57
|
export default Avatar;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { jsx } from "react/jsx-runtime";
|
|
1
|
+
import { jsxs, jsx } from "react/jsx-runtime";
|
|
2
2
|
import { forwardRef } from "react";
|
|
3
3
|
import clsx from "clsx";
|
|
4
4
|
import noAvatar from "@edifice.io/bootstrap/dist/images/avatar/no-avatar.svg";
|
|
@@ -15,6 +15,7 @@ const Avatar = /* @__PURE__ */ forwardRef(({
|
|
|
15
15
|
outerBorderColor,
|
|
16
16
|
outerBorderWidth,
|
|
17
17
|
outerBorderOffset,
|
|
18
|
+
cover,
|
|
18
19
|
...restProps
|
|
19
20
|
}, ref) => {
|
|
20
21
|
const placeholder = imgPlaceholder || noAvatar, classes = clsx("avatar", {
|
|
@@ -30,6 +31,8 @@ const Avatar = /* @__PURE__ */ forwardRef(({
|
|
|
30
31
|
rounded: variant === "rounded",
|
|
31
32
|
"rounded-circle": variant === "circle"
|
|
32
33
|
}
|
|
34
|
+
}, {
|
|
35
|
+
"avatar-with-cover": cover
|
|
33
36
|
}, className), style = {
|
|
34
37
|
...outerBorderColor && {
|
|
35
38
|
outline: `${outerBorderWidth}px solid var(--edifice-${outerBorderColor})`,
|
|
@@ -39,7 +42,10 @@ const Avatar = /* @__PURE__ */ forwardRef(({
|
|
|
39
42
|
border: `${innerBorderWidth}px solid var(--edifice-${innerBorderColor})`
|
|
40
43
|
}
|
|
41
44
|
};
|
|
42
|
-
return /* @__PURE__ */
|
|
45
|
+
return /* @__PURE__ */ jsxs("div", { ref, className: classes, style, children: [
|
|
46
|
+
/* @__PURE__ */ jsx(Image, { src: src || placeholder, alt, imgPlaceholder: placeholder, ...restProps }),
|
|
47
|
+
cover && /* @__PURE__ */ jsx("div", { className: "avatar-cover", children: cover })
|
|
48
|
+
] });
|
|
43
49
|
});
|
|
44
50
|
export {
|
|
45
51
|
Avatar as default
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
1
2
|
import { AvatarProps } from '../Avatar';
|
|
2
3
|
export interface AvatarGroupProps extends Omit<AvatarProps, 'src'> {
|
|
3
4
|
/**
|
|
@@ -19,6 +20,15 @@ export interface AvatarGroupProps extends Omit<AvatarProps, 'src'> {
|
|
|
19
20
|
* @default 'leftFirst'
|
|
20
21
|
*/
|
|
21
22
|
stackingOrder?: 'leftFirst' | 'rightFirst';
|
|
23
|
+
/**
|
|
24
|
+
* Whether to wrap avatars to the next line
|
|
25
|
+
* @default false
|
|
26
|
+
*/
|
|
27
|
+
wrap?: boolean;
|
|
28
|
+
/**
|
|
29
|
+
* Cover content for the last avatar
|
|
30
|
+
*/
|
|
31
|
+
lastItemCover?: ReactNode;
|
|
22
32
|
}
|
|
23
33
|
declare const AvatarGroup: import('react').ForwardRefExoticComponent<Omit<AvatarGroupProps, "ref"> & import('react').RefAttributes<HTMLDivElement>>;
|
|
24
34
|
export default AvatarGroup;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsx } from "react/jsx-runtime";
|
|
2
|
-
import { forwardRef } from "react";
|
|
3
2
|
import clsx from "clsx";
|
|
3
|
+
import { forwardRef } from "react";
|
|
4
4
|
import StackedGroup from "../StackedGroup/StackedGroup.js";
|
|
5
5
|
import Avatar from "../Avatar/Avatar.js";
|
|
6
6
|
const AvatarGroup = /* @__PURE__ */ forwardRef(({
|
|
@@ -12,12 +12,12 @@ const AvatarGroup = /* @__PURE__ */ forwardRef(({
|
|
|
12
12
|
variant = "circle",
|
|
13
13
|
alt,
|
|
14
14
|
stackingOrder = "leftFirst",
|
|
15
|
+
wrap = !1,
|
|
16
|
+
lastItemCover,
|
|
15
17
|
...restProps
|
|
16
18
|
}, ref) => {
|
|
17
|
-
const visibleAvatars = src.slice(0, maxAvatars), classes = clsx("avatar-group", className);
|
|
18
|
-
return /* @__PURE__ */ jsx("div", { ref, className: classes,
|
|
19
|
-
display: "flex"
|
|
20
|
-
}, children: /* @__PURE__ */ jsx(StackedGroup, { overlap, stackingOrder, children: visibleAvatars.map((avatarSrc, index) => /* @__PURE__ */ jsx(Avatar, { src: avatarSrc, size, variant, alt: `${alt} ${index + 1}`, ...restProps })) }) });
|
|
19
|
+
const visibleAvatars = src.slice(0, maxAvatars), classes = clsx("avatar-group d-flex", className);
|
|
20
|
+
return /* @__PURE__ */ jsx("div", { ref, className: classes, children: /* @__PURE__ */ jsx(StackedGroup, { overlap, stackingOrder, wrap, children: visibleAvatars.map((avatarSrc, index) => /* @__PURE__ */ jsx(Avatar, { src: avatarSrc, size, variant, alt: `${alt} ${index + 1}`, cover: index === maxAvatars - 1 ? lastItemCover : void 0, ...restProps })) }) });
|
|
21
21
|
});
|
|
22
22
|
export {
|
|
23
23
|
AvatarGroup as default
|
|
@@ -18,6 +18,11 @@ export interface StackedGroupProps {
|
|
|
18
18
|
* Additional CSS class
|
|
19
19
|
*/
|
|
20
20
|
className?: string;
|
|
21
|
+
/**
|
|
22
|
+
* Whether to wrap items to the next line
|
|
23
|
+
* @default false
|
|
24
|
+
*/
|
|
25
|
+
wrap?: boolean;
|
|
21
26
|
}
|
|
22
27
|
declare const StackedGroup: import('react').ForwardRefExoticComponent<StackedGroupProps & import('react').RefAttributes<HTMLDivElement>>;
|
|
23
28
|
export default StackedGroup;
|
|
@@ -1,18 +1,20 @@
|
|
|
1
1
|
import { jsx } from "react/jsx-runtime";
|
|
2
|
-
import { forwardRef } from "react";
|
|
3
2
|
import clsx from "clsx";
|
|
3
|
+
import { forwardRef } from "react";
|
|
4
4
|
const StackedGroup = /* @__PURE__ */ forwardRef(({
|
|
5
5
|
children,
|
|
6
6
|
overlap = 20,
|
|
7
7
|
className,
|
|
8
|
-
stackingOrder = "leftFirst"
|
|
8
|
+
stackingOrder = "leftFirst",
|
|
9
|
+
wrap = !1
|
|
9
10
|
}, ref) => {
|
|
10
|
-
const classes = clsx("stacked-group", className
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
11
|
+
const classes = clsx("stacked-group d-flex align-items-center", className, {
|
|
12
|
+
"flex-wrap": wrap
|
|
13
|
+
});
|
|
14
|
+
return /* @__PURE__ */ jsx("div", { ref, className: classes, style: wrap ? {
|
|
15
|
+
paddingLeft: `${overlap}px`
|
|
16
|
+
} : void 0, children: children.map((child, index) => /* @__PURE__ */ jsx("div", { style: {
|
|
17
|
+
marginLeft: index === 0 && !wrap ? 0 : `-${overlap}px`,
|
|
16
18
|
zIndex: stackingOrder === "rightFirst" ? children.length - index : index + 1
|
|
17
19
|
}, children: child }, index)) });
|
|
18
20
|
});
|
|
@@ -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() : ""),
|
|
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) {
|
|
25
25
|
case "admin.title":
|
|
26
26
|
appCode = "admin";
|
|
27
27
|
break;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@edifice.io/react",
|
|
3
|
-
"version": "2.2.11-develop-pedago.
|
|
3
|
+
"version": "2.2.11-develop-pedago.20250822111402",
|
|
4
4
|
"description": "Edifice React Library",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"react",
|
|
@@ -130,9 +130,9 @@
|
|
|
130
130
|
"react-slugify": "^3.0.3",
|
|
131
131
|
"swiper": "^10.1.0",
|
|
132
132
|
"ua-parser-js": "^1.0.36",
|
|
133
|
-
"@edifice.io/bootstrap": "2.2.11-develop-pedago.
|
|
134
|
-
"@edifice.io/tiptap-extensions": "2.2.11-develop-pedago.
|
|
135
|
-
"@edifice.io/utilities": "2.2.11-develop-pedago.
|
|
133
|
+
"@edifice.io/bootstrap": "2.2.11-develop-pedago.20250822111402",
|
|
134
|
+
"@edifice.io/tiptap-extensions": "2.2.11-develop-pedago.20250822111402",
|
|
135
|
+
"@edifice.io/utilities": "2.2.11-develop-pedago.20250822111402"
|
|
136
136
|
},
|
|
137
137
|
"devDependencies": {
|
|
138
138
|
"@babel/plugin-transform-react-pure-annotations": "^7.23.3",
|
|
@@ -163,8 +163,8 @@
|
|
|
163
163
|
"vite": "^5.4.11",
|
|
164
164
|
"vite-plugin-dts": "^4.1.0",
|
|
165
165
|
"vite-tsconfig-paths": "^5.0.1",
|
|
166
|
-
"@edifice.io/client": "2.2.11-develop-pedago.
|
|
167
|
-
"@edifice.io/config": "2.2.11-develop-pedago.
|
|
166
|
+
"@edifice.io/client": "2.2.11-develop-pedago.20250822111402",
|
|
167
|
+
"@edifice.io/config": "2.2.11-develop-pedago.20250822111402"
|
|
168
168
|
},
|
|
169
169
|
"peerDependencies": {
|
|
170
170
|
"@react-spring/web": "^9.7.5",
|