@cgi-learning-hub/ui 1.3.5-dev.1740488536 → 1.3.5-dev.1740488710
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"),
|
|
1
|
+
"use strict";const e=require("react/jsx-runtime"),n=require("@mui/material"),g=require("../EllipsisWithTooltip/EllipsisWithTooltip.cjs.js"),y=require("./FileIcon.cjs.js"),x=require("./FileInfosSeparator.cjs.js"),p=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"),S=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"),b=n.styled(n.ListItemButton)(({isClickable:t})=>({"&:hover":{boxShadow:t?"0 4px 8px rgba(192, 192, 192, 0.3)":"none",backgroundColor:"transparent"},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:c,onClick:o,onDownload:a})=>{if(!t.name)return null;const i=p.displaySize(t.size),r=p.displayExtension(t.name),m=()=>o==null?void 0:o(t),u=l=>{l.stopPropagation(),c==null||c(t)},h=l=>{l.stopPropagation(),a==null||a(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:h,children:e.jsx(S,{color:"primary"})}):null,t.isDeletable&&e.jsx(n.IconButton,{onClick:u,id:"coucou",children:e.jsx(I.CloseRounded,{})})]}),disablePadding:!0,children:e.jsx(b,{onClick:m,isClickable:!!o,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:r??""})})}),e.jsxs(s.Stack,{direction:"column",spacing:0,alignItems:"flex-start",minWidth:"0",children:[e.jsx(g,{children:t.name}),e.jsxs(s.Stack,{display:"flex",flexDirection:"row",alignItems:"center",gap:1,children:[i&&e.jsx(d.Typography,{fontSize:"0.8rem",color:"text.secondary",children:i}),i&&r&&e.jsx(x.FileInfosSeparator,{}),r&&e.jsx(d.Typography,{fontSize:"0.8rem",color:"text.secondary",children:r}),t.ownerName&&(i||r)&&e.jsx(x.FileInfosSeparator,{}),t.ownerName&&e.jsx(d.Typography,{fontSize:"0.8rem",color:"text.secondary",children:t.ownerName})]})]})]})})},crypto.randomUUID())};module.exports=q;
|
|
@@ -1,61 +1,57 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { styled as
|
|
3
|
-
import
|
|
4
|
-
import { FileIcon as
|
|
1
|
+
import { jsx as e, jsxs as i } from "react/jsx-runtime";
|
|
2
|
+
import { styled as y, ListItemButton as f, ListItem as I, Box as l, CircularProgress as b, IconButton as p } from "@mui/material";
|
|
3
|
+
import S from "../EllipsisWithTooltip/EllipsisWithTooltip.es.js";
|
|
4
|
+
import { FileIcon as w } from "./FileIcon.es.js";
|
|
5
5
|
import { FileInfosSeparator as h } from "./FileInfosSeparator.es.js";
|
|
6
|
-
import { displaySize as
|
|
6
|
+
import { displaySize as z, 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 m } 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 H = R(/* @__PURE__ */ e("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
|
-
|
|
15
|
-
"
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
})
|
|
31
|
-
), M = ({
|
|
32
|
-
file: t,
|
|
13
|
+
}), "DownloadRounded"), W = y(f)(({ isClickable: r }) => ({
|
|
14
|
+
"&:hover": {
|
|
15
|
+
boxShadow: r ? "0 4px 8px rgba(192, 192, 192, 0.3)" : "none",
|
|
16
|
+
backgroundColor: "transparent"
|
|
17
|
+
},
|
|
18
|
+
borderRadius: "4px",
|
|
19
|
+
cursor: r ? "pointer" : "default",
|
|
20
|
+
display: "flex",
|
|
21
|
+
flexDirection: "row",
|
|
22
|
+
alignItems: "center",
|
|
23
|
+
padding: "0.5rem 1rem",
|
|
24
|
+
width: "100%",
|
|
25
|
+
justifyContent: "space-between",
|
|
26
|
+
boxSizing: "border-box",
|
|
27
|
+
paddingRight: "115px !important"
|
|
28
|
+
})), M = ({
|
|
29
|
+
file: r,
|
|
33
30
|
onDelete: c,
|
|
34
|
-
onClick:
|
|
31
|
+
onClick: o,
|
|
35
32
|
onDownload: s
|
|
36
33
|
}) => {
|
|
37
|
-
if (!
|
|
38
|
-
const
|
|
39
|
-
d.stopPropagation(), c == null || c(
|
|
40
|
-
},
|
|
41
|
-
d.stopPropagation(), s == null || s(
|
|
34
|
+
if (!r.name) return null;
|
|
35
|
+
const n = z(r.size), t = C(r.name), x = () => o == null ? void 0 : o(r), g = (d) => {
|
|
36
|
+
d.stopPropagation(), c == null || c(r);
|
|
37
|
+
}, u = (d) => {
|
|
38
|
+
d.stopPropagation(), s == null || s(r);
|
|
42
39
|
};
|
|
43
|
-
return /* @__PURE__ */
|
|
40
|
+
return /* @__PURE__ */ e(
|
|
44
41
|
I,
|
|
45
42
|
{
|
|
46
|
-
secondaryAction: /* @__PURE__ */
|
|
47
|
-
|
|
48
|
-
|
|
43
|
+
secondaryAction: /* @__PURE__ */ i(l, { alignItems: "center", display: "flex", gap: "1rem", children: [
|
|
44
|
+
r.isLoading ? /* @__PURE__ */ e(l, { marginRight: 1, children: /* @__PURE__ */ e(b, { size: 24, color: "primary" }) }) : r.isDownloadable ? /* @__PURE__ */ e(p, { onClick: u, children: /* @__PURE__ */ e(H, { color: "primary" }) }) : null,
|
|
45
|
+
r.isDeletable && /* @__PURE__ */ e(p, { onClick: g, id: "coucou", children: /* @__PURE__ */ e(j, {}) })
|
|
49
46
|
] }),
|
|
50
47
|
disablePadding: !0,
|
|
51
|
-
children: /* @__PURE__ */
|
|
52
|
-
|
|
48
|
+
children: /* @__PURE__ */ e(
|
|
49
|
+
W,
|
|
53
50
|
{
|
|
54
51
|
onClick: x,
|
|
55
|
-
isClickable: !!
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
/* @__PURE__ */ r(
|
|
52
|
+
isClickable: !!o,
|
|
53
|
+
children: /* @__PURE__ */ i(a, { direction: "row", alignItems: "center", spacing: 2, minWidth: "0", children: [
|
|
54
|
+
/* @__PURE__ */ e(
|
|
59
55
|
a,
|
|
60
56
|
{
|
|
61
57
|
borderRadius: "4px",
|
|
@@ -69,19 +65,19 @@ const z = R(/* @__PURE__ */ r("path", {
|
|
|
69
65
|
sx: {
|
|
70
66
|
backgroundColor: "grey.light"
|
|
71
67
|
},
|
|
72
|
-
children: /* @__PURE__ */
|
|
68
|
+
children: /* @__PURE__ */ e(
|
|
73
69
|
l,
|
|
74
70
|
{
|
|
75
71
|
color: "text.secondary",
|
|
76
72
|
alignItems: "center",
|
|
77
73
|
justifyContent: "center",
|
|
78
74
|
display: "flex",
|
|
79
|
-
children: /* @__PURE__ */
|
|
75
|
+
children: /* @__PURE__ */ e(w, { extension: t ?? "" })
|
|
80
76
|
}
|
|
81
77
|
)
|
|
82
78
|
}
|
|
83
79
|
),
|
|
84
|
-
/* @__PURE__ */
|
|
80
|
+
/* @__PURE__ */ i(
|
|
85
81
|
a,
|
|
86
82
|
{
|
|
87
83
|
direction: "column",
|
|
@@ -89,23 +85,14 @@ const z = R(/* @__PURE__ */ r("path", {
|
|
|
89
85
|
alignItems: "flex-start",
|
|
90
86
|
minWidth: "0",
|
|
91
87
|
children: [
|
|
92
|
-
/* @__PURE__ */
|
|
93
|
-
/* @__PURE__ */
|
|
94
|
-
|
|
95
|
-
{
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
children: [
|
|
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
|
-
]
|
|
107
|
-
}
|
|
108
|
-
)
|
|
88
|
+
/* @__PURE__ */ e(S, { children: r.name }),
|
|
89
|
+
/* @__PURE__ */ i(a, { display: "flex", flexDirection: "row", alignItems: "center", gap: 1, children: [
|
|
90
|
+
n && /* @__PURE__ */ e(m, { fontSize: "0.8rem", color: "text.secondary", children: n }),
|
|
91
|
+
n && t && /* @__PURE__ */ e(h, {}),
|
|
92
|
+
t && /* @__PURE__ */ e(m, { fontSize: "0.8rem", color: "text.secondary", children: t }),
|
|
93
|
+
r.ownerName && (n || t) && /* @__PURE__ */ e(h, {}),
|
|
94
|
+
r.ownerName && /* @__PURE__ */ e(m, { fontSize: "0.8rem", color: "text.secondary", children: r.ownerName })
|
|
95
|
+
] })
|
|
109
96
|
]
|
|
110
97
|
}
|
|
111
98
|
)
|
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.1740488710",
|
|
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",
|