@cgi-learning-hub/ui 1.3.5-dev.1739269838 → 1.3.5-dev.1739271848
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"),r=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-B68ooSQ-.cjs"),d=require("../../Typography-Y-OGmT9M.cjs"),j=require("../../createSvgIcon-CWNQW6u6.cjs"),S=require("../../CloseRounded-Cu-sn6XC.cjs"),I=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=({file:n,onDelete:
|
|
1
|
+
"use strict";const e=require("react/jsx-runtime"),r=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-B68ooSQ-.cjs"),d=require("../../Typography-Y-OGmT9M.cjs"),j=require("../../createSvgIcon-CWNQW6u6.cjs"),S=require("../../CloseRounded-Cu-sn6XC.cjs"),I=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=({file:n,onDelete:o,onClick:c,onDownload:a})=>{if(!n.name)return null;const i=p.displaySize(n.size),t=p.displayExtension(n.name),h=()=>c==null?void 0:c(n),m=l=>{l.stopPropagation(),o==null||o(n)},u=l=>{l.stopPropagation(),a==null||a(n)};return e.jsxs(s.Stack,{direction:"row",alignItems:"center",spacing:2,padding:"0.5rem 1rem",width:"100%",justifyContent:"space-between",onClick:h,boxSizing:"border-box",sx:{"&:hover":{boxShadow:"0 4px 8px rgba(192, 192, 192, 0.3)",borderRadius:"4px",cursor:"pointer"}},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(r.Box,{color:"text.secondary",alignItems:"center",justifyContent:"center",display:"flex",children:e.jsx(y.FileIcon,{extension:t??""})})}),e.jsxs(s.Stack,{direction:"column",spacing:0,alignItems:"flex-start",minWidth:"0",children:[e.jsx(g,{children:n.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&&t&&e.jsx(x.FileInfosSeparator,{}),t&&e.jsx(d.Typography,{fontSize:"0.8rem",color:"text.secondary",children:t}),n.ownerName&&(i||t)&&e.jsx(x.FileInfosSeparator,{}),n.ownerName&&e.jsx(d.Typography,{fontSize:"0.8rem",color:"text.secondary",children:n.ownerName})]})]})]}),e.jsxs(r.Box,{alignItems:"center",display:"flex",gap:"1rem",children:[n.isLoading?e.jsx(r.Box,{marginRight:1,children:e.jsx(r.CircularProgress,{size:24,color:"primary"})}):n.isDownloadable?e.jsx(r.IconButton,{onClick:u,children:e.jsx(I,{color:"primary"})}):null,n.isDeletable&&e.jsx(r.IconButton,{onClick:m,children:e.jsx(S.CloseRounded,{})})]})]})};module.exports=b;
|
|
@@ -78,7 +78,7 @@ const C = w(/* @__PURE__ */ r("path", {
|
|
|
78
78
|
children: [
|
|
79
79
|
/* @__PURE__ */ r(f, { children: e.name }),
|
|
80
80
|
/* @__PURE__ */ i(n, { display: "flex", flexDirection: "row", alignItems: "center", gap: 1, children: [
|
|
81
|
-
t && /* @__PURE__ */ r(m, { fontSize: "0.8rem", color: "text.secondary", children: t
|
|
81
|
+
t && /* @__PURE__ */ r(m, { fontSize: "0.8rem", color: "text.secondary", children: t }),
|
|
82
82
|
t && o && /* @__PURE__ */ r(h, {}),
|
|
83
83
|
o && /* @__PURE__ */ r(m, { fontSize: "0.8rem", color: "text.secondary", children: o }),
|
|
84
84
|
e.ownerName && (t || o) && /* @__PURE__ */ r(h, {}),
|
|
@@ -5,4 +5,4 @@
|
|
|
5
5
|
isDeletable?: boolean;
|
|
6
6
|
isDownloadable?: boolean;
|
|
7
7
|
ownerName?: string;
|
|
8
|
-
}`}}},onDelete:{description:"Facultative callback used for deleting a file. Withtout this callback, the delete button will not be displayed.",action:"deleted",table:{type:{summary:"(file: T) => void | undefined"}}},onClick:{description:"Facultative callback when a file is clicked. Without this callback, the file will not be clickable.",action:"clicked",table:{type:{summary:"(file: T) => void | undefined"}}},onDownload:{description:"Facultative callback when a file is downloaded. Without this callback, the download button will not be displayed.",action:"downloaded",table:{type:{summary:"(file: T) => void | undefined"}}}}},
|
|
8
|
+
}`}}},onDelete:{description:"Facultative callback used for deleting a file. Withtout this callback, the delete button will not be displayed.",action:"deleted",table:{type:{summary:"(file: T) => void | undefined"}}},onClick:{description:"Facultative callback when a file is clicked. Without this callback, the file will not be clickable.",action:"clicked",table:{type:{summary:"(file: T) => void | undefined"}}},onDownload:{description:"Facultative callback when a file is downloaded. Without this callback, the download button will not be displayed.",action:"downloaded",table:{type:{summary:"(file: T) => void | undefined"}}}}},a=[{name:"file1 looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong.pdf",size:237482,isLoading:!1,isDeletable:!0,isDownloadable:!0,ownerName:"Alice Smith"},{name:"file2.svg",size:5423,isLoading:!0,isDeletable:!1,isDownloadable:!0},{name:"file3.mp4",size:6548764,isLoading:!1,isDeletable:!0,isDownloadable:!1,ownerName:"John Doe"},{name:"file4.docx",size:18456,isLoading:!0,isDeletable:!0,isDownloadable:!1},{name:"file5.gif",size:43954,isLoading:!1,isDeletable:!1,isDownloadable:!0},{name:"file6.zip",size:234723,isLoading:!0,isDeletable:!1,isDownloadable:!1},{name:"file7.png",size:32e4,isLoading:!1,isDeletable:!0,isDownloadable:!0,ownerName:"Chris Wilson"},{name:"file8.jpg",size:98923,isLoading:!0,isDeletable:!0,isDownloadable:!0,ownerName:"Laura Martinez"},{name:"file9.txt",size:14982,isLoading:!1,isDeletable:!0,isDownloadable:!1,ownerName:"David Moore"},{name:"file10.mp3",size:2930294,isLoading:!0,isDeletable:!1,isDownloadable:!1,ownerName:"Rachel Taylor"},{name:"file11.xlsx",size:11234,isLoading:!1,isDeletable:!0,isDownloadable:!0,ownerName:"James White"},{name:"file12.rar",size:134723,isLoading:!0,isDeletable:!1,isDownloadable:!0,ownerName:"Sophia Harris"}],i={args:{files:a,onDelete:e=>alert("delete : "+e.name),onClick:e=>alert("click : "+e.name),onDownload:e=>alert("download : "+e.name)}};exports.Default=i;exports.default=l;
|
|
@@ -2,7 +2,7 @@ import o from "../FileList/FileList.es.js";
|
|
|
2
2
|
import "react/jsx-runtime";
|
|
3
3
|
import "@mui/material";
|
|
4
4
|
import "react";
|
|
5
|
-
const
|
|
5
|
+
const s = {
|
|
6
6
|
title: "Components/FileList",
|
|
7
7
|
component: o,
|
|
8
8
|
argTypes: {
|
|
@@ -45,13 +45,13 @@ const n = {
|
|
|
45
45
|
}
|
|
46
46
|
}
|
|
47
47
|
}
|
|
48
|
-
},
|
|
48
|
+
}, a = [
|
|
49
49
|
{
|
|
50
50
|
name: "file1 looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong.pdf",
|
|
51
51
|
size: 237482,
|
|
52
52
|
isLoading: !1,
|
|
53
53
|
isDeletable: !0,
|
|
54
|
-
|
|
54
|
+
isDownloadable: !0,
|
|
55
55
|
ownerName: "Alice Smith"
|
|
56
56
|
},
|
|
57
57
|
{
|
|
@@ -59,14 +59,14 @@ const n = {
|
|
|
59
59
|
size: 5423,
|
|
60
60
|
isLoading: !0,
|
|
61
61
|
isDeletable: !1,
|
|
62
|
-
|
|
62
|
+
isDownloadable: !0
|
|
63
63
|
},
|
|
64
64
|
{
|
|
65
65
|
name: "file3.mp4",
|
|
66
66
|
size: 6548764,
|
|
67
67
|
isLoading: !1,
|
|
68
68
|
isDeletable: !0,
|
|
69
|
-
|
|
69
|
+
isDownloadable: !1,
|
|
70
70
|
ownerName: "John Doe"
|
|
71
71
|
},
|
|
72
72
|
{
|
|
@@ -74,28 +74,28 @@ const n = {
|
|
|
74
74
|
size: 18456,
|
|
75
75
|
isLoading: !0,
|
|
76
76
|
isDeletable: !0,
|
|
77
|
-
|
|
77
|
+
isDownloadable: !1
|
|
78
78
|
},
|
|
79
79
|
{
|
|
80
80
|
name: "file5.gif",
|
|
81
81
|
size: 43954,
|
|
82
82
|
isLoading: !1,
|
|
83
83
|
isDeletable: !1,
|
|
84
|
-
|
|
84
|
+
isDownloadable: !0
|
|
85
85
|
},
|
|
86
86
|
{
|
|
87
87
|
name: "file6.zip",
|
|
88
88
|
size: 234723,
|
|
89
89
|
isLoading: !0,
|
|
90
90
|
isDeletable: !1,
|
|
91
|
-
|
|
91
|
+
isDownloadable: !1
|
|
92
92
|
},
|
|
93
93
|
{
|
|
94
94
|
name: "file7.png",
|
|
95
95
|
size: 32e4,
|
|
96
96
|
isLoading: !1,
|
|
97
97
|
isDeletable: !0,
|
|
98
|
-
|
|
98
|
+
isDownloadable: !0,
|
|
99
99
|
ownerName: "Chris Wilson"
|
|
100
100
|
},
|
|
101
101
|
{
|
|
@@ -103,7 +103,7 @@ const n = {
|
|
|
103
103
|
size: 98923,
|
|
104
104
|
isLoading: !0,
|
|
105
105
|
isDeletable: !0,
|
|
106
|
-
|
|
106
|
+
isDownloadable: !0,
|
|
107
107
|
ownerName: "Laura Martinez"
|
|
108
108
|
},
|
|
109
109
|
{
|
|
@@ -111,7 +111,7 @@ const n = {
|
|
|
111
111
|
size: 14982,
|
|
112
112
|
isLoading: !1,
|
|
113
113
|
isDeletable: !0,
|
|
114
|
-
|
|
114
|
+
isDownloadable: !1,
|
|
115
115
|
ownerName: "David Moore"
|
|
116
116
|
},
|
|
117
117
|
{
|
|
@@ -119,7 +119,7 @@ const n = {
|
|
|
119
119
|
size: 2930294,
|
|
120
120
|
isLoading: !0,
|
|
121
121
|
isDeletable: !1,
|
|
122
|
-
|
|
122
|
+
isDownloadable: !1,
|
|
123
123
|
ownerName: "Rachel Taylor"
|
|
124
124
|
},
|
|
125
125
|
{
|
|
@@ -127,7 +127,7 @@ const n = {
|
|
|
127
127
|
size: 11234,
|
|
128
128
|
isLoading: !1,
|
|
129
129
|
isDeletable: !0,
|
|
130
|
-
|
|
130
|
+
isDownloadable: !0,
|
|
131
131
|
ownerName: "James White"
|
|
132
132
|
},
|
|
133
133
|
{
|
|
@@ -135,12 +135,12 @@ const n = {
|
|
|
135
135
|
size: 134723,
|
|
136
136
|
isLoading: !0,
|
|
137
137
|
isDeletable: !1,
|
|
138
|
-
|
|
138
|
+
isDownloadable: !0,
|
|
139
139
|
ownerName: "Sophia Harris"
|
|
140
140
|
}
|
|
141
141
|
], d = {
|
|
142
142
|
args: {
|
|
143
|
-
files:
|
|
143
|
+
files: a,
|
|
144
144
|
onDelete: (e) => alert("delete : " + e.name),
|
|
145
145
|
onClick: (e) => alert("click : " + e.name),
|
|
146
146
|
onDownload: (e) => alert("download : " + e.name)
|
|
@@ -148,5 +148,5 @@ const n = {
|
|
|
148
148
|
};
|
|
149
149
|
export {
|
|
150
150
|
d as Default,
|
|
151
|
-
|
|
151
|
+
s as default
|
|
152
152
|
};
|
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.1739271848",
|
|
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",
|