@cgi-learning-hub/ui 1.3.5-dev.1740480499 → 1.3.5-dev.1740488536
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.
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";const e=require("react/jsx-runtime"),n=require("@mui/material"),g=require("../EllipsisWithTooltip/EllipsisWithTooltip.cjs.js"),y=require("./FileIcon.cjs.js"),p=require("./FileInfosSeparator.cjs.js"),x=require("./utils.cjs.js"),s=require("../../Stack-C6v70ALA.cjs"),d=require("../../Typography-DEAE8-8u.cjs"),j=require("../../createSvgIcon-Dn4BBPej.cjs"),I=require("../../CloseRounded-DQWTEbNz.cjs"),
|
|
1
|
+
"use strict";const e=require("react/jsx-runtime"),n=require("@mui/material"),g=require("../EllipsisWithTooltip/EllipsisWithTooltip.cjs.js"),y=require("./FileIcon.cjs.js"),p=require("./FileInfosSeparator.cjs.js"),x=require("./utils.cjs.js"),s=require("../../Stack-C6v70ALA.cjs"),d=require("../../Typography-DEAE8-8u.cjs"),j=require("../../createSvgIcon-Dn4BBPej.cjs"),I=require("../../CloseRounded-DQWTEbNz.cjs"),b=j.createSvgIcon(e.jsx("path",{d:"M16.59 9H15V4c0-.55-.45-1-1-1h-4c-.55 0-1 .45-1 1v5H7.41c-.89 0-1.34 1.08-.71 1.71l4.59 4.59c.39.39 1.02.39 1.41 0l4.59-4.59c.63-.63.19-1.71-.7-1.71M5 19c0 .55.45 1 1 1h12c.55 0 1-.45 1-1s-.45-1-1-1H6c-.55 0-1 .45-1 1"}),"DownloadRounded"),S=n.styled(n.ListItemButton)(({isClickable:t})=>({"&:hover":{boxShadow:t?"0 4px 8px rgba(192, 192, 192, 0.3)":"none",backgroundColor:"transparent"},opacity:"1 !important",borderRadius:"4px",cursor:t?"pointer":"default",display:"flex",flexDirection:"row",alignItems:"center",padding:"0.5rem 1rem",width:"100%",justifyContent:"space-between",boxSizing:"border-box",paddingRight:"115px !important"})),q=({file:t,onDelete:a,onClick:r,onDownload:c})=>{if(!t.name)return null;const o=x.displaySize(t.size),i=x.displayExtension(t.name),h=()=>r==null?void 0:r(t),u=l=>{l.stopPropagation(),a==null||a(t)},m=l=>{l.stopPropagation(),c==null||c(t)};return e.jsx(n.ListItem,{secondaryAction:e.jsxs(n.Box,{alignItems:"center",display:"flex",gap:"1rem",children:[t.isLoading?e.jsx(n.Box,{marginRight:1,children:e.jsx(n.CircularProgress,{size:24,color:"primary"})}):t.isDownloadable?e.jsx(n.IconButton,{onClick:m,children:e.jsx(b,{color:"primary"})}):null,t.isDeletable&&e.jsx(n.IconButton,{onClick:u,id:"coucou",children:e.jsx(I.CloseRounded,{})})]}),disablePadding:!0,children:e.jsx(S,{onClick:h,isClickable:!!r,disabled:!r,children:e.jsxs(s.Stack,{direction:"row",alignItems:"center",spacing:2,minWidth:"0",children:[e.jsx(s.Stack,{borderRadius:"4px",minWidth:"40px",maxWidth:"40px",minHeight:"40px",maxHeight:"40px",display:"flex",alignItems:"center",justifyContent:"center",sx:{backgroundColor:"grey.light"},children:e.jsx(n.Box,{color:"text.secondary",alignItems:"center",justifyContent:"center",display:"flex",children:e.jsx(y.FileIcon,{extension:i??""})})}),e.jsxs(s.Stack,{direction:"column",spacing:0,alignItems:"flex-start",minWidth:"0",children:[e.jsx(g,{typographyProps:{variant:"body1"},children:t.name}),e.jsxs(s.Stack,{display:"flex",flexDirection:"row",alignItems:"center",gap:1,children:[o&&e.jsx(d.Typography,{variant:"caption",color:"text.secondary",children:o}),o&&i&&e.jsx(p.FileInfosSeparator,{}),i&&e.jsx(d.Typography,{variant:"caption",color:"text.secondary",children:i}),t.ownerName&&(o||i)&&e.jsx(p.FileInfosSeparator,{}),t.ownerName&&e.jsx(d.Typography,{variant:"caption",color:"text.secondary",children:t.ownerName})]})]})]})})},crypto.randomUUID())};module.exports=q;
|
|
@@ -1,24 +1,24 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { styled as
|
|
3
|
-
import
|
|
4
|
-
import { FileIcon as
|
|
1
|
+
import { jsx as r, jsxs as n } from "react/jsx-runtime";
|
|
2
|
+
import { styled as u, ListItemButton as b, ListItem as I, Box as l, CircularProgress as f, IconButton as m } from "@mui/material";
|
|
3
|
+
import w from "../EllipsisWithTooltip/EllipsisWithTooltip.es.js";
|
|
4
|
+
import { FileIcon as S } from "./FileIcon.es.js";
|
|
5
5
|
import { FileInfosSeparator as h } from "./FileInfosSeparator.es.js";
|
|
6
|
-
import { displaySize as
|
|
6
|
+
import { displaySize as v, displayExtension as C } from "./utils.es.js";
|
|
7
7
|
import { S as a } from "../../Stack-aCUdCw1A.js";
|
|
8
|
-
import { T as
|
|
8
|
+
import { T as p } from "../../Typography-CE8fQQ8B.js";
|
|
9
9
|
import { c as R } from "../../createSvgIcon-CCejzj0C.js";
|
|
10
10
|
import { C as j } from "../../CloseRounded-DTpqUeWr.js";
|
|
11
|
-
const
|
|
11
|
+
const z = R(/* @__PURE__ */ r("path", {
|
|
12
12
|
d: "M16.59 9H15V4c0-.55-.45-1-1-1h-4c-.55 0-1 .45-1 1v5H7.41c-.89 0-1.34 1.08-.71 1.71l4.59 4.59c.39.39 1.02.39 1.41 0l4.59-4.59c.63-.63.19-1.71-.7-1.71M5 19c0 .55.45 1 1 1h12c.55 0 1-.45 1-1s-.45-1-1-1H6c-.55 0-1 .45-1 1"
|
|
13
|
-
}), "DownloadRounded"),
|
|
14
|
-
({ isClickable:
|
|
13
|
+
}), "DownloadRounded"), H = u(b)(
|
|
14
|
+
({ isClickable: t }) => ({
|
|
15
15
|
"&:hover": {
|
|
16
|
-
boxShadow:
|
|
16
|
+
boxShadow: t ? "0 4px 8px rgba(192, 192, 192, 0.3)" : "none",
|
|
17
17
|
backgroundColor: "transparent"
|
|
18
18
|
},
|
|
19
19
|
opacity: "1 !important",
|
|
20
20
|
borderRadius: "4px",
|
|
21
|
-
cursor:
|
|
21
|
+
cursor: t ? "pointer" : "default",
|
|
22
22
|
display: "flex",
|
|
23
23
|
flexDirection: "row",
|
|
24
24
|
alignItems: "center",
|
|
@@ -29,33 +29,33 @@ const H = R(/* @__PURE__ */ e("path", {
|
|
|
29
29
|
paddingRight: "115px !important"
|
|
30
30
|
})
|
|
31
31
|
), M = ({
|
|
32
|
-
file:
|
|
32
|
+
file: t,
|
|
33
33
|
onDelete: c,
|
|
34
|
-
onClick:
|
|
34
|
+
onClick: e,
|
|
35
35
|
onDownload: s
|
|
36
36
|
}) => {
|
|
37
|
-
if (!
|
|
38
|
-
const i =
|
|
39
|
-
d.stopPropagation(), c == null || c(
|
|
40
|
-
},
|
|
41
|
-
d.stopPropagation(), s == null || s(
|
|
37
|
+
if (!t.name) return null;
|
|
38
|
+
const i = v(t.size), o = C(t.name), x = () => e == null ? void 0 : e(t), g = (d) => {
|
|
39
|
+
d.stopPropagation(), c == null || c(t);
|
|
40
|
+
}, y = (d) => {
|
|
41
|
+
d.stopPropagation(), s == null || s(t);
|
|
42
42
|
};
|
|
43
|
-
return /* @__PURE__ */
|
|
43
|
+
return /* @__PURE__ */ r(
|
|
44
44
|
I,
|
|
45
45
|
{
|
|
46
46
|
secondaryAction: /* @__PURE__ */ n(l, { alignItems: "center", display: "flex", gap: "1rem", children: [
|
|
47
|
-
|
|
48
|
-
|
|
47
|
+
t.isLoading ? /* @__PURE__ */ r(l, { marginRight: 1, children: /* @__PURE__ */ r(f, { size: 24, color: "primary" }) }) : t.isDownloadable ? /* @__PURE__ */ r(m, { onClick: y, children: /* @__PURE__ */ r(z, { color: "primary" }) }) : null,
|
|
48
|
+
t.isDeletable && /* @__PURE__ */ r(m, { onClick: g, id: "coucou", children: /* @__PURE__ */ r(j, {}) })
|
|
49
49
|
] }),
|
|
50
50
|
disablePadding: !0,
|
|
51
|
-
children: /* @__PURE__ */
|
|
52
|
-
|
|
51
|
+
children: /* @__PURE__ */ r(
|
|
52
|
+
H,
|
|
53
53
|
{
|
|
54
54
|
onClick: x,
|
|
55
|
-
isClickable: !!
|
|
56
|
-
disabled: !
|
|
55
|
+
isClickable: !!e,
|
|
56
|
+
disabled: !e,
|
|
57
57
|
children: /* @__PURE__ */ n(a, { direction: "row", alignItems: "center", spacing: 2, minWidth: "0", children: [
|
|
58
|
-
/* @__PURE__ */
|
|
58
|
+
/* @__PURE__ */ r(
|
|
59
59
|
a,
|
|
60
60
|
{
|
|
61
61
|
borderRadius: "4px",
|
|
@@ -69,14 +69,14 @@ const H = R(/* @__PURE__ */ e("path", {
|
|
|
69
69
|
sx: {
|
|
70
70
|
backgroundColor: "grey.light"
|
|
71
71
|
},
|
|
72
|
-
children: /* @__PURE__ */
|
|
72
|
+
children: /* @__PURE__ */ r(
|
|
73
73
|
l,
|
|
74
74
|
{
|
|
75
75
|
color: "text.secondary",
|
|
76
76
|
alignItems: "center",
|
|
77
77
|
justifyContent: "center",
|
|
78
78
|
display: "flex",
|
|
79
|
-
children: /* @__PURE__ */
|
|
79
|
+
children: /* @__PURE__ */ r(S, { extension: o ?? "" })
|
|
80
80
|
}
|
|
81
81
|
)
|
|
82
82
|
}
|
|
@@ -89,7 +89,7 @@ const H = R(/* @__PURE__ */ e("path", {
|
|
|
89
89
|
alignItems: "flex-start",
|
|
90
90
|
minWidth: "0",
|
|
91
91
|
children: [
|
|
92
|
-
/* @__PURE__ */
|
|
92
|
+
/* @__PURE__ */ r(w, { typographyProps: { variant: "body1" }, children: t.name }),
|
|
93
93
|
/* @__PURE__ */ n(
|
|
94
94
|
a,
|
|
95
95
|
{
|
|
@@ -98,11 +98,11 @@ const H = R(/* @__PURE__ */ e("path", {
|
|
|
98
98
|
alignItems: "center",
|
|
99
99
|
gap: 1,
|
|
100
100
|
children: [
|
|
101
|
-
i && /* @__PURE__ */
|
|
102
|
-
i && o && /* @__PURE__ */
|
|
103
|
-
o && /* @__PURE__ */
|
|
104
|
-
|
|
105
|
-
|
|
101
|
+
i && /* @__PURE__ */ r(p, { variant: "caption", color: "text.secondary", children: i }),
|
|
102
|
+
i && o && /* @__PURE__ */ r(h, {}),
|
|
103
|
+
o && /* @__PURE__ */ r(p, { variant: "caption", color: "text.secondary", children: o }),
|
|
104
|
+
t.ownerName && (i || o) && /* @__PURE__ */ r(h, {}),
|
|
105
|
+
t.ownerName && /* @__PURE__ */ r(p, { variant: "caption", color: "text.secondary", children: t.ownerName })
|
|
106
106
|
]
|
|
107
107
|
}
|
|
108
108
|
)
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cgi-learning-hub/ui",
|
|
3
|
-
"version": "1.3.5-dev.
|
|
3
|
+
"version": "1.3.5-dev.1740488536",
|
|
4
4
|
"private": false,
|
|
5
5
|
"author": "CGI Learning-hub Team",
|
|
6
6
|
"description": "@cgi-learning-hub/ui is an open-source React component library that implements UI for HUB's features",
|