@cgi-learning-hub/ui 1.3.5-dev.1740480499 → 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"),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
+ "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,4 +1,4 @@
1
- import { jsx as e, jsxs as n } from "react/jsx-runtime";
1
+ import { jsx as e, jsxs as i } 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,32 +10,29 @@ 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)(
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 = ({
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 = ({
32
29
  file: r,
33
30
  onDelete: c,
34
- onClick: t,
31
+ onClick: o,
35
32
  onDownload: s
36
33
  }) => {
37
34
  if (!r.name) return null;
38
- const i = z(r.size), o = C(r.name), x = () => t == null ? void 0 : t(r), g = (d) => {
35
+ const n = z(r.size), t = C(r.name), x = () => o == null ? void 0 : o(r), g = (d) => {
39
36
  d.stopPropagation(), c == null || c(r);
40
37
  }, u = (d) => {
41
38
  d.stopPropagation(), s == null || s(r);
@@ -43,7 +40,7 @@ const H = R(/* @__PURE__ */ e("path", {
43
40
  return /* @__PURE__ */ e(
44
41
  I,
45
42
  {
46
- secondaryAction: /* @__PURE__ */ n(l, { alignItems: "center", display: "flex", gap: "1rem", children: [
43
+ secondaryAction: /* @__PURE__ */ i(l, { alignItems: "center", display: "flex", gap: "1rem", children: [
47
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,
48
45
  r.isDeletable && /* @__PURE__ */ e(p, { onClick: g, id: "coucou", children: /* @__PURE__ */ e(j, {}) })
49
46
  ] }),
@@ -52,9 +49,8 @@ const H = R(/* @__PURE__ */ e("path", {
52
49
  W,
53
50
  {
54
51
  onClick: x,
55
- isClickable: !!t,
56
- disabled: !t,
57
- children: /* @__PURE__ */ n(a, { direction: "row", alignItems: "center", spacing: 2, minWidth: "0", children: [
52
+ isClickable: !!o,
53
+ children: /* @__PURE__ */ i(a, { direction: "row", alignItems: "center", spacing: 2, minWidth: "0", children: [
58
54
  /* @__PURE__ */ e(
59
55
  a,
60
56
  {
@@ -76,12 +72,12 @@ const H = R(/* @__PURE__ */ e("path", {
76
72
  alignItems: "center",
77
73
  justifyContent: "center",
78
74
  display: "flex",
79
- children: /* @__PURE__ */ e(w, { extension: o ?? "" })
75
+ children: /* @__PURE__ */ e(w, { extension: t ?? "" })
80
76
  }
81
77
  )
82
78
  }
83
79
  ),
84
- /* @__PURE__ */ n(
80
+ /* @__PURE__ */ i(
85
81
  a,
86
82
  {
87
83
  direction: "column",
@@ -90,22 +86,13 @@ const H = R(/* @__PURE__ */ e("path", {
90
86
  minWidth: "0",
91
87
  children: [
92
88
  /* @__PURE__ */ e(S, { children: r.name }),
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
- )
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.1740480499",
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",