@cgi-learning-hub/ui 1.3.5-dev.1740479297 → 1.3.5-dev.1740480499

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"),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"},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:c,onClick:r,onDownload:a})=>{if(!t.name)return null;const o=x.displaySize(t.size),i=x.displayExtension(t.name),m=()=>r==null?void 0:r(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:!!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,{children:t.name}),e.jsxs(s.Stack,{display:"flex",flexDirection:"row",alignItems:"center",gap:1,children:[o&&e.jsx(d.Typography,{fontSize:"0.8rem",color:"text.secondary",children:o}),o&&i&&e.jsx(p.FileInfosSeparator,{}),i&&e.jsx(d.Typography,{fontSize:"0.8rem",color:"text.secondary",children:i}),t.ownerName&&(o||i)&&e.jsx(p.FileInfosSeparator,{}),t.ownerName&&e.jsx(d.Typography,{fontSize:"0.8rem",color:"text.secondary",children:t.ownerName})]})]})]})})},crypto.randomUUID())};module.exports=q;
@@ -1,4 +1,4 @@
1
- import { jsx as e, jsxs as i } from "react/jsx-runtime";
1
+ import { jsx as e, jsxs as n } from "react/jsx-runtime";
2
2
  import { styled as y, ListItemButton as f, ListItem as I, Box as l, CircularProgress as b, IconButton as p } from "@mui/material";
3
3
  import S from "../EllipsisWithTooltip/EllipsisWithTooltip.es.js";
4
4
  import { FileIcon as w } from "./FileIcon.es.js";
@@ -10,29 +10,32 @@ import { c as R } from "../../createSvgIcon-CCejzj0C.js";
10
10
  import { C as j } from "../../CloseRounded-DTpqUeWr.js";
11
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"), 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 = ({
13
+ }), "DownloadRounded"), W = y(f)(
14
+ ({ isClickable: r }) => ({
15
+ "&:hover": {
16
+ boxShadow: r ? "0 4px 8px rgba(192, 192, 192, 0.3)" : "none",
17
+ backgroundColor: "transparent"
18
+ },
19
+ opacity: "1 !important",
20
+ borderRadius: "4px",
21
+ cursor: r ? "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 = ({
29
32
  file: r,
30
33
  onDelete: c,
31
- onClick: o,
34
+ onClick: t,
32
35
  onDownload: s
33
36
  }) => {
34
37
  if (!r.name) return null;
35
- const n = z(r.size), t = C(r.name), x = () => o == null ? void 0 : o(r), g = (d) => {
38
+ const i = z(r.size), o = C(r.name), x = () => t == null ? void 0 : t(r), g = (d) => {
36
39
  d.stopPropagation(), c == null || c(r);
37
40
  }, u = (d) => {
38
41
  d.stopPropagation(), s == null || s(r);
@@ -40,7 +43,7 @@ const H = R(/* @__PURE__ */ e("path", {
40
43
  return /* @__PURE__ */ e(
41
44
  I,
42
45
  {
43
- secondaryAction: /* @__PURE__ */ i(l, { alignItems: "center", display: "flex", gap: "1rem", children: [
46
+ secondaryAction: /* @__PURE__ */ n(l, { alignItems: "center", display: "flex", gap: "1rem", children: [
44
47
  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
48
  r.isDeletable && /* @__PURE__ */ e(p, { onClick: g, id: "coucou", children: /* @__PURE__ */ e(j, {}) })
46
49
  ] }),
@@ -49,8 +52,9 @@ const H = R(/* @__PURE__ */ e("path", {
49
52
  W,
50
53
  {
51
54
  onClick: x,
52
- isClickable: !!o,
53
- children: /* @__PURE__ */ i(a, { direction: "row", alignItems: "center", spacing: 2, minWidth: "0", children: [
55
+ isClickable: !!t,
56
+ disabled: !t,
57
+ children: /* @__PURE__ */ n(a, { direction: "row", alignItems: "center", spacing: 2, minWidth: "0", children: [
54
58
  /* @__PURE__ */ e(
55
59
  a,
56
60
  {
@@ -72,12 +76,12 @@ const H = R(/* @__PURE__ */ e("path", {
72
76
  alignItems: "center",
73
77
  justifyContent: "center",
74
78
  display: "flex",
75
- children: /* @__PURE__ */ e(w, { extension: t ?? "" })
79
+ children: /* @__PURE__ */ e(w, { 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",
@@ -86,13 +90,22 @@ const H = R(/* @__PURE__ */ e("path", {
86
90
  minWidth: "0",
87
91
  children: [
88
92
  /* @__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
- ] })
93
+ /* @__PURE__ */ n(
94
+ a,
95
+ {
96
+ display: "flex",
97
+ flexDirection: "row",
98
+ alignItems: "center",
99
+ gap: 1,
100
+ children: [
101
+ i && /* @__PURE__ */ e(m, { fontSize: "0.8rem", color: "text.secondary", children: i }),
102
+ i && o && /* @__PURE__ */ e(h, {}),
103
+ o && /* @__PURE__ */ e(m, { fontSize: "0.8rem", color: "text.secondary", children: o }),
104
+ r.ownerName && (i || o) && /* @__PURE__ */ e(h, {}),
105
+ r.ownerName && /* @__PURE__ */ e(m, { fontSize: "0.8rem", color: "text.secondary", children: r.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.1740479297",
3
+ "version": "1.3.5-dev.1740480499",
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",