@cgi-learning-hub/ui 1.5.0-dev.1743686462 → 1.5.0-dev.1743700044

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 n=require("react/jsx-runtime"),t=require("../../CloseRounded-D4Rf4Yq-.cjs"),c=require("@mui/material"),u=require("../../Dialog-LbgQSeqb.cjs"),a=({children:s,showCloseButton:i=!0,...e})=>{const o=()=>{var l;return(l=e.onClose)==null?void 0:l.call(e,{},"escapeKeyDown")};return n.jsxs(u.Dialog,{...e,children:[i?n.jsx(c.IconButton,{"aria-label":"close",onClick:o,sx:{position:"absolute",right:24,top:24},children:n.jsx(t.CloseRounded,{})}):null,s]})};module.exports=a;
1
+ "use strict";const n=require("react/jsx-runtime"),s=require("../../CloseRounded-D4Rf4Yq-.cjs"),c=require("@mui/material"),a=require("../../Dialog-LbgQSeqb.cjs"),r=({children:i,showCloseButton:o=!0,...e})=>{const t=()=>{var l;return(l=e.onClose)==null?void 0:l.call(e,{},"escapeKeyDown")};return n.jsxs(a.Dialog,{...e,children:[o?n.jsx(c.IconButton,{"aria-label":"close",onClick:t,sx:{position:"absolute",right:15,top:15,color:l=>l.palette.text.primary},children:n.jsx(s.CloseRounded,{color:"inherit"})}):null,i]})};module.exports=r;
@@ -1,25 +1,25 @@
1
- import { jsxs as i, jsx as n } from "react/jsx-runtime";
2
- import { C as s } from "../../CloseRounded-DXBTbQ8P.js";
3
- import { IconButton as t } from "@mui/material";
4
- import { D as c } from "../../Dialog-BdWhnP_F.js";
1
+ import { jsxs as t, jsx as e } from "react/jsx-runtime";
2
+ import { C as a } from "../../CloseRounded-DXBTbQ8P.js";
3
+ import { IconButton as s } from "@mui/material";
4
+ import { D as r } from "../../Dialog-BdWhnP_F.js";
5
5
  const f = ({
6
- children: e,
7
- showCloseButton: a = !0,
8
- ...l
9
- }) => /* @__PURE__ */ i(c, { ...l, children: [
10
- a ? /* @__PURE__ */ n(
11
- t,
6
+ children: i,
7
+ showCloseButton: n = !0,
8
+ ...o
9
+ }) => /* @__PURE__ */ t(r, { ...o, children: [
10
+ n ? /* @__PURE__ */ e(
11
+ s,
12
12
  {
13
13
  "aria-label": "close",
14
14
  onClick: () => {
15
- var o;
16
- return (o = l.onClose) == null ? void 0 : o.call(l, {}, "escapeKeyDown");
15
+ var l;
16
+ return (l = o.onClose) == null ? void 0 : l.call(o, {}, "escapeKeyDown");
17
17
  },
18
- sx: { position: "absolute", right: 24, top: 24 },
19
- children: /* @__PURE__ */ n(s, {})
18
+ sx: { position: "absolute", right: 15, top: 15, color: (l) => l.palette.text.primary },
19
+ children: /* @__PURE__ */ e(a, { color: "inherit" })
20
20
  }
21
21
  ) : null,
22
- e
22
+ i
23
23
  ] });
24
24
  export {
25
25
  f as default
@@ -1 +1 @@
1
- "use strict";const r=require("react/jsx-runtime"),h=require("../../Folder-NcfJgwuN.cjs"),m=require("../../MoreVert-RHtym60m.cjs"),s=require("@mui/material"),p=require("../EllipsisWithTooltip/EllipsisWithTooltip.cjs.js"),n=require("./styles.cjs.js"),d=require("../ResourceCard/style.cjs.js"),c=require("./types.cjs.js"),f=({isSelected:o=!1,onSelect:l=()=>{},title:x,subtitle:a,width:y="320px",onClick:t=()=>{},iconSize:u="2rem"})=>{const i=e=>e.key==="Enter"||e.key===" ";return r.jsx(s.Box,{sx:{width:y},children:r.jsxs(d.StyledCard,{selected:o,onClick:t,onKeyDown:e=>{i(e)&&(e.preventDefault(),t==null||t())},role:"button",tabIndex:0,"aria-labelledby":"folder-title folder-subtitle","aria-pressed":o,children:[r.jsx(d.SelectedIcon,{onClick:e=>{e.preventDefault(),e.stopPropagation(),l()},onKeyDown:e=>{i(e)&&(e.preventDefault(),e.stopPropagation(),l())},className:"selected-icon",selected:o,role:"button",tabIndex:0,"aria-label":o?"Unselect folder":"Select folder","aria-pressed":o,children:r.jsx(m.MoreVertIcon,{})}),r.jsxs(s.CardContent,{sx:n.FolderBodyStyle,children:[r.jsx(s.Box,{fontSize:u,sx:n.IconContainerStyle,children:r.jsx(h.FolderIcon,{color:"primary",sx:n.FolderIconStyle,"aria-hidden":"true"})}),r.jsxs(s.Box,{sx:n.TextContainerStyle,children:[r.jsx(p,{typographyProps:c.titleTypographyProps,tooltipProps:{placement:"bottom",arrow:!0},children:x}),a&&r.jsx(p,{typographyProps:c.subtitleTypographyProps,tooltipProps:{placement:"bottom",arrow:!0},children:a})]})]})]})})};module.exports=f;
1
+ "use strict";const r=require("react/jsx-runtime"),m=require("../../Folder-NcfJgwuN.cjs"),f=require("../../MoreVert-RHtym60m.cjs"),s=require("@mui/material"),p=require("../EllipsisWithTooltip/EllipsisWithTooltip.cjs.js"),d=require("../ResourceCard/style.cjs.js"),n=require("./styles.cjs.js"),c=require("./types.cjs.js"),j=({isSelected:o=!1,onSelect:l=()=>{},title:x,subtitle:a,width:y="320px",onClick:t=()=>{},iconSize:u="2rem",hasNoButtonOnFocus:h=!1})=>{const i=e=>e.key==="Enter"||e.key===" ";return r.jsx(s.Box,{sx:{width:y},children:r.jsxs(d.StyledCard,{selected:o,onClick:t,onKeyDown:e=>{i(e)&&(e.preventDefault(),t==null||t())},role:"button",tabIndex:0,"aria-labelledby":"folder-title folder-subtitle","aria-pressed":o,children:[r.jsx(d.SelectedIcon,{onClick:e=>{e.preventDefault(),e.stopPropagation(),l()},onKeyDown:e=>{i(e)&&(e.preventDefault(),e.stopPropagation(),l())},className:"selected-icon",selected:o,role:"button",tabIndex:0,"aria-label":o?"Unselect folder":"Select folder","aria-pressed":o,hasNoButtonOnFocus:h,children:r.jsx(f.MoreVertIcon,{})}),r.jsxs(s.CardContent,{sx:n.FolderBodyStyle,children:[r.jsx(s.Box,{fontSize:u,sx:n.IconContainerStyle,children:r.jsx(m.FolderIcon,{color:"primary",sx:n.FolderIconStyle,"aria-hidden":"true"})}),r.jsxs(s.Box,{sx:n.TextContainerStyle,children:[r.jsx(p,{typographyProps:c.titleTypographyProps,tooltipProps:{placement:"bottom",arrow:!0},children:x}),a&&r.jsx(p,{typographyProps:c.subtitleTypographyProps,tooltipProps:{placement:"bottom",arrow:!0},children:a})]})]})]})})};module.exports=j;
@@ -6,6 +6,7 @@ export type FolderCardProps = {
6
6
  width?: string;
7
7
  onClick?: () => void;
8
8
  iconSize?: string;
9
+ hasNoButtonOnFocus?: boolean;
9
10
  };
10
11
  declare const FolderCard: React.FunctionComponent<FolderCardProps>;
11
12
  export default FolderCard;
@@ -1,12 +1,12 @@
1
1
  import { jsx as o, jsxs as a } from "react/jsx-runtime";
2
- import { F as f } from "../../Folder-DbtkTNEB.js";
3
- import { M as c } from "../../MoreVert-WFvQcAf-.js";
4
- import { Box as l, CardContent as h } from "@mui/material";
2
+ import { F as c } from "../../Folder-DbtkTNEB.js";
3
+ import { M as h } from "../../MoreVert-WFvQcAf-.js";
4
+ import { Box as l, CardContent as x } from "@mui/material";
5
5
  import i from "../EllipsisWithTooltip/EllipsisWithTooltip.es.js";
6
- import { FolderBodyStyle as x, IconContainerStyle as u, FolderIconStyle as b, TextContainerStyle as P } from "./styles.es.js";
7
- import { StyledCard as I, SelectedIcon as g } from "../ResourceCard/style.es.js";
8
- import { titleTypographyProps as D, subtitleTypographyProps as F } from "./types.es.js";
9
- const E = ({
6
+ import { StyledCard as u, SelectedIcon as b } from "../ResourceCard/style.es.js";
7
+ import { FolderBodyStyle as P, IconContainerStyle as I, FolderIconStyle as g, TextContainerStyle as D } from "./styles.es.js";
8
+ import { titleTypographyProps as F, subtitleTypographyProps as w } from "./types.es.js";
9
+ const M = ({
10
10
  isSelected: e = !1,
11
11
  onSelect: p = () => {
12
12
  },
@@ -15,11 +15,12 @@ const E = ({
15
15
  width: m = "320px",
16
16
  onClick: t = () => {
17
17
  },
18
- iconSize: y = "2rem"
18
+ iconSize: f = "2rem",
19
+ hasNoButtonOnFocus: y = !1
19
20
  }) => {
20
21
  const s = (r) => r.key === "Enter" || r.key === " ";
21
22
  return /* @__PURE__ */ o(l, { sx: { width: m }, children: /* @__PURE__ */ a(
22
- I,
23
+ u,
23
24
  {
24
25
  selected: e,
25
26
  onClick: t,
@@ -32,7 +33,7 @@ const E = ({
32
33
  "aria-pressed": e,
33
34
  children: [
34
35
  /* @__PURE__ */ o(
35
- g,
36
+ b,
36
37
  {
37
38
  onClick: (r) => {
38
39
  r.preventDefault(), r.stopPropagation(), p();
@@ -46,16 +47,24 @@ const E = ({
46
47
  tabIndex: 0,
47
48
  "aria-label": e ? "Unselect folder" : "Select folder",
48
49
  "aria-pressed": e,
49
- children: /* @__PURE__ */ o(c, {})
50
+ hasNoButtonOnFocus: y,
51
+ children: /* @__PURE__ */ o(h, {})
50
52
  }
51
53
  ),
52
- /* @__PURE__ */ a(h, { sx: x, children: [
53
- /* @__PURE__ */ o(l, { fontSize: y, sx: u, children: /* @__PURE__ */ o(f, { color: "primary", sx: b, "aria-hidden": "true" }) }),
54
- /* @__PURE__ */ a(l, { sx: P, children: [
54
+ /* @__PURE__ */ a(x, { sx: P, children: [
55
+ /* @__PURE__ */ o(l, { fontSize: f, sx: I, children: /* @__PURE__ */ o(
56
+ c,
57
+ {
58
+ color: "primary",
59
+ sx: g,
60
+ "aria-hidden": "true"
61
+ }
62
+ ) }),
63
+ /* @__PURE__ */ a(l, { sx: D, children: [
55
64
  /* @__PURE__ */ o(
56
65
  i,
57
66
  {
58
- typographyProps: D,
67
+ typographyProps: F,
59
68
  tooltipProps: { placement: "bottom", arrow: !0 },
60
69
  children: d
61
70
  }
@@ -63,7 +72,7 @@ const E = ({
63
72
  n && /* @__PURE__ */ o(
64
73
  i,
65
74
  {
66
- typographyProps: F,
75
+ typographyProps: w,
67
76
  tooltipProps: { placement: "bottom", arrow: !0 },
68
77
  children: n
69
78
  }
@@ -75,5 +84,5 @@ const E = ({
75
84
  ) });
76
85
  };
77
86
  export {
78
- E as default
87
+ M as default
79
88
  };
@@ -1 +1 @@
1
- "use strict";const r=require("react/jsx-runtime"),b=require("../../MoreVert-RHtym60m.cjs"),d=require("@mui/material"),m=require("../EllipsisWithTooltip/EllipsisWithTooltip.cjs.js"),o=require("./style.cjs.js"),j=({isSelected:s=!1,onSelect:u=()=>{},image:x,title:c,defaultImage:h,propertyItems:p=[],infoIcons:l=[],size:t="md",width:i,onClick:n=()=>{}})=>(l=l.slice(0,3),r.jsx(d.Box,{sx:{width:i&&t==="md"?i:"320px"},children:r.jsxs(o.StyledCard,{selected:s,size:t,onClick:n,onKeyDown:e=>{(e.key==="Enter"||e.key===" ")&&(e.preventDefault(),n==null||n())},role:"button",tabIndex:0,"aria-label":`Resource card for ${c}`,children:[r.jsx(o.SelectedIcon,{onClick:e=>{e.preventDefault(),e.stopPropagation(),u()},onKeyDown:e=>{(e.key==="Enter"||e.key===" ")&&(e.preventDefault(),e.stopPropagation(),u())},className:"selected-icon",selected:s,role:"button",tabIndex:0,"aria-label":s?"Unselect card":"Select card",children:r.jsx(b.MoreVertIcon,{})}),r.jsx(d.Stack,{sx:{width:t=="sm"?110:"100%",display:"flex",alignItems:"center",justifyContent:"center",boxSizing:"border-box"},children:r.jsx(o.ResourceCardImage,{image:x,defaultImage:h,size:t,role:"img","aria-label":`Image for ${c}`})}),r.jsxs(o.ResourceCardBody,{size:t,children:[r.jsx(m,{typographyProps:{variant:"h4",component:"p"},tooltipProps:{placement:"bottom",arrow:!0},children:c}),p.length>0&&p.map((e,a)=>r.jsxs(o.ResourcePropertyItem,{size:t,role:"group","aria-label":`Property ${a}`,children:[e.icon,r.jsx(o.ResourcePropertyText,{isLast:a===p.length-1,size:t,width:i,children:e.text})]},`property-${a}`)),r.jsx(o.PublicIconWrapper,{size:t,children:l.length>0&&l.map((e,a)=>r.jsx(d.Tooltip,{title:e.text,placement:"top",arrow:!0,children:r.jsx(o.ResourceIconItem,{size:t,role:"button",tabIndex:0,"aria-label":e.text,children:e.icon})},`info-${a}`))})]})]})}));module.exports=j;
1
+ "use strict";const r=require("react/jsx-runtime"),m=require("../../MoreVert-RHtym60m.cjs"),d=require("@mui/material"),j=require("../EllipsisWithTooltip/EllipsisWithTooltip.cjs.js"),o=require("./style.cjs.js"),y=({isSelected:s=!1,onSelect:u=()=>{},image:x,title:c,defaultImage:h,propertyItems:p=[],infoIcons:l=[],size:t="md",width:i,onClick:n=()=>{},hasNoButtonOnFocus:b=!1})=>(l=l.slice(0,3),r.jsx(d.Box,{sx:{width:i&&t==="md"?i:"320px"},children:r.jsxs(o.StyledCard,{selected:s,size:t,onClick:n,onKeyDown:e=>{(e.key==="Enter"||e.key===" ")&&(e.preventDefault(),n==null||n())},role:"button",tabIndex:0,"aria-label":`Resource card for ${c}`,children:[r.jsx(o.SelectedIcon,{onClick:e=>{e.preventDefault(),e.stopPropagation(),u()},onKeyDown:e=>{(e.key==="Enter"||e.key===" ")&&(e.preventDefault(),e.stopPropagation(),u())},className:"selected-icon",selected:s,role:"button",tabIndex:0,"aria-label":s?"Unselect card":"Select card",hasNoButtonOnFocus:b,children:r.jsx(m.MoreVertIcon,{})}),r.jsx(d.Stack,{sx:{width:t=="sm"?110:"100%",display:"flex",alignItems:"center",justifyContent:"center",boxSizing:"border-box"},children:r.jsx(o.ResourceCardImage,{image:x,defaultImage:h,size:t,role:"img","aria-label":`Image for ${c}`})}),r.jsxs(o.ResourceCardBody,{size:t,children:[r.jsx(j,{typographyProps:{variant:"h4",component:"p"},tooltipProps:{placement:"bottom",arrow:!0},children:c}),p.length>0&&p.map((e,a)=>r.jsxs(o.ResourcePropertyItem,{size:t,role:"group","aria-label":`Property ${a}`,children:[e.icon,r.jsx(o.ResourcePropertyText,{isLast:a===p.length-1,size:t,width:i,children:e.text})]},`property-${a}`)),r.jsx(o.PublicIconWrapper,{size:t,children:l.length>0&&l.map((e,a)=>r.jsx(d.Tooltip,{title:e.text,placement:"top",arrow:!0,children:r.jsx(o.ResourceIconItem,{size:t,role:"button",tabIndex:0,"aria-label":e.text,children:e.icon})},`info-${a}`))})]})]})}));module.exports=y;
@@ -19,6 +19,7 @@ export type ResourceCardProps = {
19
19
  size?: ResourceCardSize;
20
20
  width?: string;
21
21
  onClick?: () => void;
22
+ hasNoButtonOnFocus?: boolean;
22
23
  };
23
24
  declare const ResourceCard: React.FunctionComponent<ResourceCardProps>;
24
25
  export default ResourceCard;
@@ -1,9 +1,9 @@
1
1
  import { jsx as r, jsxs as i } from "react/jsx-runtime";
2
- import { M as h } from "../../MoreVert-WFvQcAf-.js";
3
- import { Box as b, Stack as x, Tooltip as y } from "@mui/material";
4
- import f from "../EllipsisWithTooltip/EllipsisWithTooltip.es.js";
5
- import { StyledCard as g, SelectedIcon as P, ResourceCardImage as R, ResourceCardBody as D, ResourcePropertyItem as I, ResourcePropertyText as $, PublicIconWrapper as v, ResourceIconItem as w } from "./style.es.js";
6
- const M = ({
2
+ import { M as b } from "../../MoreVert-WFvQcAf-.js";
3
+ import { Box as x, Stack as f, Tooltip as y } from "@mui/material";
4
+ import g from "../EllipsisWithTooltip/EllipsisWithTooltip.es.js";
5
+ import { StyledCard as P, SelectedIcon as R, ResourceCardImage as D, ResourceCardBody as I, ResourcePropertyItem as $, ResourcePropertyText as v, PublicIconWrapper as w, ResourceIconItem as j } from "./style.es.js";
6
+ const S = ({
7
7
  isSelected: n = !1,
8
8
  onSelect: m = () => {
9
9
  },
@@ -15,9 +15,10 @@ const M = ({
15
15
  size: t = "md",
16
16
  width: d,
17
17
  onClick: l = () => {
18
- }
19
- }) => (a = a.slice(0, 3), /* @__PURE__ */ r(b, { sx: { width: d && t === "md" ? d : "320px" }, children: /* @__PURE__ */ i(
20
- g,
18
+ },
19
+ hasNoButtonOnFocus: h = !1
20
+ }) => (a = a.slice(0, 3), /* @__PURE__ */ r(x, { sx: { width: d && t === "md" ? d : "320px" }, children: /* @__PURE__ */ i(
21
+ P,
21
22
  {
22
23
  selected: n,
23
24
  size: t,
@@ -30,7 +31,7 @@ const M = ({
30
31
  "aria-label": `Resource card for ${c}`,
31
32
  children: [
32
33
  /* @__PURE__ */ r(
33
- P,
34
+ R,
34
35
  {
35
36
  onClick: (e) => {
36
37
  e.preventDefault(), e.stopPropagation(), m();
@@ -43,11 +44,12 @@ const M = ({
43
44
  role: "button",
44
45
  tabIndex: 0,
45
46
  "aria-label": n ? "Unselect card" : "Select card",
46
- children: /* @__PURE__ */ r(h, {})
47
+ hasNoButtonOnFocus: h,
48
+ children: /* @__PURE__ */ r(b, {})
47
49
  }
48
50
  ),
49
51
  /* @__PURE__ */ r(
50
- x,
52
+ f,
51
53
  {
52
54
  sx: {
53
55
  width: t == "sm" ? 110 : "100%",
@@ -57,7 +59,7 @@ const M = ({
57
59
  boxSizing: "border-box"
58
60
  },
59
61
  children: /* @__PURE__ */ r(
60
- R,
62
+ D,
61
63
  {
62
64
  image: s,
63
65
  defaultImage: u,
@@ -68,9 +70,9 @@ const M = ({
68
70
  )
69
71
  }
70
72
  ),
71
- /* @__PURE__ */ i(D, { size: t, children: [
73
+ /* @__PURE__ */ i(I, { size: t, children: [
72
74
  /* @__PURE__ */ r(
73
- f,
75
+ g,
74
76
  {
75
77
  typographyProps: { variant: "h4", component: "p" },
76
78
  tooltipProps: { placement: "bottom", arrow: !0 },
@@ -78,7 +80,7 @@ const M = ({
78
80
  }
79
81
  ),
80
82
  p.length > 0 && p.map((e, o) => /* @__PURE__ */ i(
81
- I,
83
+ $,
82
84
  {
83
85
  size: t,
84
86
  role: "group",
@@ -86,7 +88,7 @@ const M = ({
86
88
  children: [
87
89
  e.icon,
88
90
  /* @__PURE__ */ r(
89
- $,
91
+ v,
90
92
  {
91
93
  isLast: o === p.length - 1,
92
94
  size: t,
@@ -98,14 +100,14 @@ const M = ({
98
100
  },
99
101
  `property-${o}`
100
102
  )),
101
- /* @__PURE__ */ r(v, { size: t, children: a.length > 0 && a.map((e, o) => /* @__PURE__ */ r(
103
+ /* @__PURE__ */ r(w, { size: t, children: a.length > 0 && a.map((e, o) => /* @__PURE__ */ r(
102
104
  y,
103
105
  {
104
106
  title: e.text,
105
107
  placement: "top",
106
108
  arrow: !0,
107
109
  children: /* @__PURE__ */ r(
108
- w,
110
+ j,
109
111
  {
110
112
  size: t,
111
113
  role: "button",
@@ -122,5 +124,5 @@ const M = ({
122
124
  }
123
125
  ) }));
124
126
  export {
125
- M as default
127
+ S as default
126
128
  };
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("@mui/material"),i=t.styled(t.Card)(({theme:e,selected:o,size:r})=>({boxShadow:"0px 4px 12px rgba(0, 0, 0, 0.1), 0px 2px 4px rgba(0, 0, 0, 0.06)",borderRadius:"0.5rem",height:"auto",border:"2px solid transparent",transition:"border-color 0.2s ease-in-out",position:"relative",...r==="sm"&&{display:"flex",width:"100%"},...o&&{borderColor:e.palette.primary.light},"&:hover":{"& .MuiBox-root.selected-icon":{opacity:1,visibility:"visible"}}})),a=t.styled(t.Box)(({theme:e,selected:o})=>({position:"absolute",top:0,right:0,width:"2rem",height:"2rem",background:e.palette.common.white,display:"flex",justifyContent:"center",alignItems:"center",padding:".8rem",borderRadius:".5rem",visibility:"visible",opacity:0,cursor:"pointer",transition:"opacity 0.2s ease-in-out, visibility 0.2s ease-in-out",...o&&{background:e.palette.primary.lighter,opacity:1,visibility:"visible"},"&:hover, &:focus":{background:e.palette.primary.lighter,opacity:1},"& .MuiSvgIcon-root":{color:e.palette.primary.main}})),s=t.styled(t.CardMedia)(({size:e,image:o,defaultImage:r})=>({height:e=="sm"?85:180,width:e=="sm"?85:"calc(100% - 2rem)",objectFit:"cover",margin:e=="sm"?"0 10px":"1rem",borderRadius:"0.5rem",...!o&&e==="md"&&{backgroundImage:`url(${r})`,backgroundRepeat:"repeat",backgroundSize:"20% 20%",backgroundPosition:"center",opacity:"0.7"}})),n=t.styled(t.CardContent)(({size:e})=>({padding:e=="sm"?".7rem 5px .7rem 0 !important":"0 16px 16px 16px !important",width:e==="sm"?"calc(100% - 110px)":"100%"})),p=t.styled(t.Box)(({size:e})=>({display:"flex",alignItems:"center",marginTop:"0.5rem",...e==="sm"&&{svg:{width:".8em",height:".8em"}}})),c=t.styled(t.Box)(({size:e,width:o,isLast:r})=>({marginLeft:e==="sm"?".3rem":".5rem",fontSize:e==="sm"?"12px":"15px","& .MuiTypography-root":{paddingTop:"2px",fontSize:e==="sm"?"12px":"15px"},...r&&!o&&{textOverflow:"ellipsis",whiteSpace:"nowrap",overflow:"hidden",maxWidth:e==="sm"?"110px":"172px"}})),d=t.styled(t.Box)(({size:e})=>({display:"inline-flex",alignItems:"center",justifyContent:"center",width:"fit-content",height:"fit-content",...e==="sm"&&{svg:{width:".8em",height:".8em"}}})),l=t.styled(t.Box)(({size:e})=>({position:"absolute",bottom:e==="sm"?".65rem":"16px",right:e==="sm"?"8px":"16px",display:"flex",gap:".2rem"}));exports.PublicIconWrapper=l;exports.ResourceCardBody=n;exports.ResourceCardImage=s;exports.ResourceIconItem=d;exports.ResourcePropertyItem=p;exports.ResourcePropertyText=c;exports.SelectedIcon=a;exports.StyledCard=i;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("@mui/material"),i=t.styled(t.Card)(({theme:e,selected:r,size:o})=>({boxShadow:"0px 4px 12px rgba(0, 0, 0, 0.1), 0px 2px 4px rgba(0, 0, 0, 0.06)",borderRadius:"0.5rem",height:"auto",border:"2px solid transparent",transition:"border-color 0.2s ease-in-out",position:"relative",...o==="sm"&&{display:"flex",width:"100%"},...r&&{borderColor:e.palette.primary.light},"&:hover":{"& .MuiBox-root.selected-icon":{opacity:1,visibility:"visible"}}})),a=t.styled(t.Box)(({theme:e,selected:r,hasNoButtonOnFocus:o})=>({position:"absolute",top:0,right:0,width:"2rem",height:"2rem",background:e.palette.common.white,display:"flex",justifyContent:"center",alignItems:"center",padding:".8rem",borderRadius:".5rem",visibility:"visible",opacity:0,cursor:"pointer",transition:"opacity 0.2s ease-in-out, visibility 0.2s ease-in-out",...r&&{background:e.palette.primary.lighter,opacity:1,visibility:"visible"},...o?{"&:hover":{background:e.palette.primary.lighter,opacity:1}}:{"&:hover, &:focus":{background:e.palette.primary.lighter,opacity:1}},"& .MuiSvgIcon-root":{color:e.palette.primary.main}})),s=t.styled(t.CardMedia)(({size:e,image:r,defaultImage:o})=>({height:e=="sm"?85:180,width:e=="sm"?85:"calc(100% - 2rem)",objectFit:"cover",margin:e=="sm"?"0 10px":"1rem",borderRadius:"0.5rem",...!r&&e==="md"&&{backgroundImage:`url(${o})`,backgroundRepeat:"repeat",backgroundSize:"20% 20%",backgroundPosition:"center",opacity:"0.7"}})),n=t.styled(t.CardContent)(({size:e})=>({padding:e=="sm"?".7rem 5px .7rem 0 !important":"0 16px 16px 16px !important",width:e==="sm"?"calc(100% - 110px)":"100%"})),p=t.styled(t.Box)(({size:e})=>({display:"flex",alignItems:"center",marginTop:"0.5rem",...e==="sm"&&{svg:{width:".8em",height:".8em"}}})),c=t.styled(t.Box)(({size:e,width:r,isLast:o})=>({marginLeft:e==="sm"?".3rem":".5rem",fontSize:e==="sm"?"12px":"15px","& .MuiTypography-root":{paddingTop:"2px",fontSize:e==="sm"?"12px":"15px"},...o&&!r&&{textOverflow:"ellipsis",whiteSpace:"nowrap",overflow:"hidden",maxWidth:e==="sm"?"110px":"172px"}})),d=t.styled(t.Box)(({size:e})=>({display:"inline-flex",alignItems:"center",justifyContent:"center",width:"fit-content",height:"fit-content",...e==="sm"&&{svg:{width:".8em",height:".8em"}}})),l=t.styled(t.Box)(({size:e})=>({position:"absolute",bottom:e==="sm"?".65rem":"16px",right:e==="sm"?"8px":"16px",display:"flex",gap:".2rem"}));exports.PublicIconWrapper=l;exports.ResourceCardBody=n;exports.ResourceCardImage=s;exports.ResourceIconItem=d;exports.ResourcePropertyItem=p;exports.ResourcePropertyText=c;exports.SelectedIcon=a;exports.StyledCard=i;
@@ -1,12 +1,12 @@
1
- import { styled as t, Card as a, Box as r, CardMedia as p, CardContent as n } from "@mui/material";
2
- const c = t(a)(({ theme: e, selected: o, size: i }) => ({
1
+ import { styled as t, Card as a, Box as i, CardMedia as p, CardContent as n } from "@mui/material";
2
+ const c = t(a)(({ theme: e, selected: o, size: r }) => ({
3
3
  boxShadow: "0px 4px 12px rgba(0, 0, 0, 0.1), 0px 2px 4px rgba(0, 0, 0, 0.06)",
4
4
  borderRadius: "0.5rem",
5
5
  height: "auto",
6
6
  border: "2px solid transparent",
7
7
  transition: "border-color 0.2s ease-in-out",
8
8
  position: "relative",
9
- ...i === "sm" && {
9
+ ...r === "sm" && {
10
10
  display: "flex",
11
11
  width: "100%"
12
12
  },
@@ -19,44 +19,49 @@ const c = t(a)(({ theme: e, selected: o, size: i }) => ({
19
19
  visibility: "visible"
20
20
  }
21
21
  }
22
- })), m = t(r)(
23
- ({ theme: e, selected: o }) => ({
24
- position: "absolute",
25
- top: 0,
26
- right: 0,
27
- width: "2rem",
28
- height: "2rem",
29
- background: e.palette.common.white,
30
- display: "flex",
31
- justifyContent: "center",
32
- alignItems: "center",
33
- padding: ".8rem",
34
- borderRadius: ".5rem",
35
- visibility: "visible",
36
- opacity: 0,
37
- cursor: "pointer",
38
- transition: "opacity 0.2s ease-in-out, visibility 0.2s ease-in-out",
39
- ...o && {
22
+ })), m = t(i)(({ theme: e, selected: o, hasNoButtonOnFocus: r }) => ({
23
+ position: "absolute",
24
+ top: 0,
25
+ right: 0,
26
+ width: "2rem",
27
+ height: "2rem",
28
+ background: e.palette.common.white,
29
+ display: "flex",
30
+ justifyContent: "center",
31
+ alignItems: "center",
32
+ padding: ".8rem",
33
+ borderRadius: ".5rem",
34
+ visibility: "visible",
35
+ opacity: 0,
36
+ cursor: "pointer",
37
+ transition: "opacity 0.2s ease-in-out, visibility 0.2s ease-in-out",
38
+ ...o && {
39
+ background: e.palette.primary.lighter,
40
+ opacity: 1,
41
+ visibility: "visible"
42
+ },
43
+ ...r ? {
44
+ "&:hover": {
40
45
  background: e.palette.primary.lighter,
41
- opacity: 1,
42
- visibility: "visible"
43
- },
46
+ opacity: 1
47
+ }
48
+ } : {
44
49
  "&:hover, &:focus": {
45
50
  background: e.palette.primary.lighter,
46
51
  opacity: 1
47
- },
48
- "& .MuiSvgIcon-root": {
49
- color: e.palette.primary.main
50
52
  }
51
- })
52
- ), d = t(p)(({ size: e, image: o, defaultImage: i }) => ({
53
+ },
54
+ "& .MuiSvgIcon-root": {
55
+ color: e.palette.primary.main
56
+ }
57
+ })), d = t(p)(({ size: e, image: o, defaultImage: r }) => ({
53
58
  height: e == "sm" ? 85 : 180,
54
59
  width: e == "sm" ? 85 : "calc(100% - 2rem)",
55
60
  objectFit: "cover",
56
61
  margin: e == "sm" ? "0 10px" : "1rem",
57
62
  borderRadius: "0.5rem",
58
63
  ...!o && e === "md" && {
59
- backgroundImage: `url(${i})`,
64
+ backgroundImage: `url(${r})`,
60
65
  backgroundRepeat: "repeat",
61
66
  backgroundSize: "20% 20%",
62
67
  backgroundPosition: "center",
@@ -65,7 +70,7 @@ const c = t(a)(({ theme: e, selected: o, size: i }) => ({
65
70
  })), l = t(n)(({ size: e }) => ({
66
71
  padding: e == "sm" ? ".7rem 5px .7rem 0 !important" : "0 16px 16px 16px !important",
67
72
  width: e === "sm" ? "calc(100% - 110px)" : "100%"
68
- })), g = t(r)(
73
+ })), g = t(i)(
69
74
  ({ size: e }) => ({
70
75
  display: "flex",
71
76
  alignItems: "center",
@@ -77,20 +82,20 @@ const c = t(a)(({ theme: e, selected: o, size: i }) => ({
77
82
  }
78
83
  }
79
84
  })
80
- ), x = t(r)(({ size: e, width: o, isLast: i }) => ({
85
+ ), x = t(i)(({ size: e, width: o, isLast: r }) => ({
81
86
  marginLeft: e === "sm" ? ".3rem" : ".5rem",
82
87
  fontSize: e === "sm" ? "12px" : "15px",
83
88
  "& .MuiTypography-root": {
84
89
  paddingTop: "2px",
85
90
  fontSize: e === "sm" ? "12px" : "15px"
86
91
  },
87
- ...i && !o && {
92
+ ...r && !o && {
88
93
  textOverflow: "ellipsis",
89
94
  whiteSpace: "nowrap",
90
95
  overflow: "hidden",
91
96
  maxWidth: e === "sm" ? "110px" : "172px"
92
97
  }
93
- })), u = t(r)(
98
+ })), u = t(i)(
94
99
  ({ size: e }) => ({
95
100
  display: "inline-flex",
96
101
  alignItems: "center",
@@ -104,7 +109,7 @@ const c = t(a)(({ theme: e, selected: o, size: i }) => ({
104
109
  }
105
110
  }
106
111
  })
107
- ), h = t(r)(
112
+ ), h = t(i)(
108
113
  ({ size: e }) => ({
109
114
  position: "absolute",
110
115
  bottom: e === "sm" ? ".65rem" : "16px",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cgi-learning-hub/ui",
3
- "version": "1.5.0-dev.1743686462",
3
+ "version": "1.5.0-dev.1743700044",
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",