@cgi-learning-hub/ui 1.3.5-dev.1740488710 → 1.3.5-dev.1740489245

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"),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
+ "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,57 +1,61 @@
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";
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 z, displayExtension as C } from "./utils.es.js";
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 m } from "../../Typography-CE8fQQ8B.js";
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 H = R(/* @__PURE__ */ e("path", {
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"), 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,
13
+ }), "DownloadRounded"), H = u(b)(
14
+ ({ isClickable: t }) => ({
15
+ "&:hover": {
16
+ boxShadow: t ? "0 4px 8px rgba(192, 192, 192, 0.3)" : "none",
17
+ backgroundColor: "transparent"
18
+ },
19
+ opacity: "1 !important",
20
+ borderRadius: "4px",
21
+ cursor: t ? "pointer" : "default",
22
+ display: "flex",
23
+ flexDirection: "row",
24
+ alignItems: "center",
25
+ padding: "0.5rem 1rem",
26
+ width: "100%",
27
+ justifyContent: "space-between",
28
+ boxSizing: "border-box",
29
+ paddingRight: "115px !important"
30
+ })
31
+ ), M = ({
32
+ file: t,
30
33
  onDelete: c,
31
- onClick: o,
34
+ onClick: e,
32
35
  onDownload: s
33
36
  }) => {
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);
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);
39
42
  };
40
- return /* @__PURE__ */ e(
43
+ return /* @__PURE__ */ r(
41
44
  I,
42
45
  {
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, {}) })
46
+ secondaryAction: /* @__PURE__ */ n(l, { alignItems: "center", display: "flex", gap: "1rem", children: [
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, {}) })
46
49
  ] }),
47
50
  disablePadding: !0,
48
- children: /* @__PURE__ */ e(
49
- W,
51
+ children: /* @__PURE__ */ r(
52
+ H,
50
53
  {
51
54
  onClick: x,
52
- isClickable: !!o,
53
- children: /* @__PURE__ */ i(a, { direction: "row", alignItems: "center", spacing: 2, minWidth: "0", children: [
54
- /* @__PURE__ */ e(
55
+ isClickable: !!e,
56
+ disabled: !e,
57
+ children: /* @__PURE__ */ n(a, { direction: "row", alignItems: "center", spacing: 2, minWidth: "0", children: [
58
+ /* @__PURE__ */ r(
55
59
  a,
56
60
  {
57
61
  borderRadius: "4px",
@@ -65,19 +69,19 @@ const H = R(/* @__PURE__ */ e("path", {
65
69
  sx: {
66
70
  backgroundColor: "grey.light"
67
71
  },
68
- children: /* @__PURE__ */ e(
72
+ children: /* @__PURE__ */ r(
69
73
  l,
70
74
  {
71
75
  color: "text.secondary",
72
76
  alignItems: "center",
73
77
  justifyContent: "center",
74
78
  display: "flex",
75
- children: /* @__PURE__ */ e(w, { extension: t ?? "" })
79
+ children: /* @__PURE__ */ r(S, { extension: o ?? "" })
76
80
  }
77
81
  )
78
82
  }
79
83
  ),
80
- /* @__PURE__ */ i(
84
+ /* @__PURE__ */ n(
81
85
  a,
82
86
  {
83
87
  direction: "column",
@@ -85,14 +89,23 @@ const H = R(/* @__PURE__ */ e("path", {
85
89
  alignItems: "flex-start",
86
90
  minWidth: "0",
87
91
  children: [
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
- ] })
92
+ /* @__PURE__ */ r(w, { typographyProps: { variant: "body1" }, children: t.name }),
93
+ /* @__PURE__ */ n(
94
+ a,
95
+ {
96
+ display: "flex",
97
+ flexDirection: "row",
98
+ alignItems: "center",
99
+ gap: 1,
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
+ )
96
109
  ]
97
110
  }
98
111
  )
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cgi-learning-hub/ui",
3
- "version": "1.3.5-dev.1740488710",
3
+ "version": "1.3.5-dev.1740489245",
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",