@cgi-learning-hub/ui 1.3.5-dev.1738080904 → 1.3.5-dev.1738156506

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";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("react/jsx-runtime"),r=require("@mui/material"),u=require("react"),g=require("../../createSvgIcon-DestgQu_.cjs"),l=require("./style.cjs.js"),b=require("../EllipsisWithTooltip/EllipsisWithTooltip.cjs.js"),j=g.createSvgIcon(t.jsx("path",{d:"M12 8c1.1 0 2-.9 2-2s-.9-2-2-2-2 .9-2 2 .9 2 2 2m0 2c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2m0 6c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2"}),"MoreVert"),y=u.forwardRef(({isSelected:c=!1,onSelect:x=()=>{},image:m,title:i,propertyItems:d=[],infoIcons:a=[],size:o="md",width:p,onClick:n=()=>{}},h)=>(a=a.slice(0,3),t.jsx(r.Box,{ref:h,sx:{position:"relative",width:p&&o==="md"?p:"360px",height:"auto"},children:t.jsxs(l.StyledCard,{selected:c,size:o,onClick:n,onKeyDown:e=>{(e.key==="Enter"||e.key===" ")&&(e.preventDefault(),n==null||n())},role:"button",tabIndex:0,"aria-label":`Resource card for ${i}`,children:[t.jsx(l.SelectedIcon,{onClick:e=>{e.stopPropagation(),x()},onKeyDown:e=>{(e.key==="Enter"||e.key===" ")&&(e.preventDefault(),x())},className:"selected-icon",selected:c,role:"button",tabIndex:0,"aria-label":c?"Unselect card":"Select card",children:t.jsx(j,{})}),t.jsx(r.Box,{sx:{width:o=="sm"?110:"100%",display:"flex",alignItems:"center",justifyContent:"center",boxSizing:"border-box"},children:t.jsx(r.CardMedia,{image:m,sx:{height:o=="sm"?"calc(100% - 32px)":180,width:o=="sm"?"calc(100% - 32px)":"calc(100% - 2rem)",objectFit:"cover",margin:o=="sm"?0:"1rem",borderRadius:"0.5rem"},role:"img","aria-label":`Image for ${i}`})}),t.jsxs(r.CardContent,{sx:{padding:o=="sm"?"1rem 0 !important":"0 16px 16px 16px !important",width:o==="sm"?"calc(100% - 110px)":"100%"},children:[t.jsx(b,{typographyProps:{fontWeight:"700",fontSize:"1.1rem"},tooltipProps:{placement:"bottom",arrow:!0},children:i}),d.length>0&&d.map((e,s)=>t.jsxs(r.Box,{sx:l.ItemCard,role:"group","aria-label":`Property ${s}`,children:[e.icon,t.jsx(r.Box,{sx:{marginLeft:"0.5rem",display:"flex"},children:e.text})]},`property-${s}`)),t.jsx(r.Box,{sx:l.PublicIconWrapper,children:a.length>0&&a.map((e,s)=>t.jsx(r.Tooltip,{title:e.text,placement:"top",arrow:!0,children:t.jsx(r.Box,{role:"button",tabIndex:0,"aria-label":e.text,sx:{display:"inline-flex",alignItems:"center",justifyContent:"center",width:"fit-content",height:"fit-content"},children:e.icon})},`info-${s}`))})]})]})})));exports.ResourceCard=y;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("react/jsx-runtime"),u=require("@mui/material"),b=require("react"),g=require("../../createSvgIcon-DestgQu_.cjs"),o=require("./style.cjs.js"),j=require("../EllipsisWithTooltip/EllipsisWithTooltip.cjs.js"),y=g.createSvgIcon(r.jsx("path",{d:"M12 8c1.1 0 2-.9 2-2s-.9-2-2-2-2 .9-2 2 .9 2 2 2m0 2c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2m0 6c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2"}),"MoreVert"),R=b.forwardRef(({isSelected:n=!1,onSelect:p=()=>{},image:x,title:s,logo:h,propertyItems:i=[],infoIcons:c=[],size:t="md",width:d,onClick:l=()=>{}},m)=>(c=c.slice(0,3),r.jsx(u.Box,{ref:m,sx:{position:"relative",width:d&&t==="md"?d:"320px",height:"auto"},children:r.jsxs(o.StyledCard,{selected:n,size:t,onClick:l,onKeyDown:e=>{(e.key==="Enter"||e.key===" ")&&(e.preventDefault(),l==null||l())},role:"button",tabIndex:0,"aria-label":`Resource card for ${s}`,children:[r.jsx(o.SelectedIcon,{onClick:e=>{e.stopPropagation(),p()},onKeyDown:e=>{(e.key==="Enter"||e.key===" ")&&(e.preventDefault(),p())},className:"selected-icon",selected:n,role:"button",tabIndex:0,"aria-label":n?"Unselect card":"Select card",children:r.jsx(y,{})}),r.jsx(u.Box,{sx:{width:t=="sm"?110:"100%",display:"flex",alignItems:"center",justifyContent:"center",boxSizing:"border-box"},children:r.jsx(o.ResourceCardImage,{image:x,logo:h,size:t,role:"img","aria-label":`Image for ${s}`})}),r.jsxs(o.ResourceCardBody,{size:t,children:[r.jsx(j,{typographyProps:{fontWeight:"700",fontSize:"1.1rem"},tooltipProps:{placement:"bottom",arrow:!0},children:s}),i.length>0&&i.map((e,a)=>r.jsxs(o.ResourcePropertyItem,{size:t,role:"group","aria-label":`Property ${a}`,children:[e.icon,r.jsx(o.ResourcePropertyText,{isLast:a===i.length-1,size:t,width:d,children:e.text})]},`property-${a}`)),r.jsx(o.PublicIconWrapper,{size:t,children:c.length>0&&c.map((e,a)=>r.jsx(u.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}`))})]})]})})));exports.ResourceCard=R;
@@ -12,6 +12,7 @@ export interface ResourceCardProps {
12
12
  isSelected?: boolean;
13
13
  onSelect?: () => void;
14
14
  image?: string;
15
+ logo: string;
15
16
  title: string;
16
17
  propertyItems?: PropertyItem[];
17
18
  infoIcons?: InfoItem[];
@@ -1,129 +1,139 @@
1
- import { jsx as r, jsxs as d } from "react/jsx-runtime";
2
- import { Box as o, CardMedia as f, CardContent as b, Tooltip as g } from "@mui/material";
3
- import { forwardRef as u } from "react";
4
- import { c as y } from "../../createSvgIcon-C9kh-71a.js";
5
- import { StyledCard as w, SelectedIcon as j, ItemCard as v, PublicIconWrapper as I } from "./style.es.js";
6
- import P from "../EllipsisWithTooltip/EllipsisWithTooltip.es.js";
7
- const $ = y(/* @__PURE__ */ r("path", {
1
+ import { jsx as r, jsxs as i } from "react/jsx-runtime";
2
+ import { Box as s, Tooltip as f } from "@mui/material";
3
+ import { forwardRef as x } from "react";
4
+ import { c as g } from "../../createSvgIcon-C9kh-71a.js";
5
+ import { StyledCard as y, SelectedIcon as R, ResourceCardImage as P, ResourceCardBody as I, ResourcePropertyItem as w, ResourcePropertyText as $, PublicIconWrapper as v, ResourceIconItem as D } from "./style.es.js";
6
+ import j from "../EllipsisWithTooltip/EllipsisWithTooltip.es.js";
7
+ const E = g(/* @__PURE__ */ r("path", {
8
8
  d: "M12 8c1.1 0 2-.9 2-2s-.9-2-2-2-2 .9-2 2 .9 2 2 2m0 2c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2m0 6c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2"
9
- }), "MoreVert"), W = u(({
10
- isSelected: i = !1,
11
- onSelect: p = () => {
9
+ }), "MoreVert"), V = x(({
10
+ isSelected: c = !1,
11
+ onSelect: m = () => {
12
12
  },
13
- image: x,
14
- title: c,
15
- propertyItems: m = [],
13
+ image: h,
14
+ title: n,
15
+ logo: u,
16
+ propertyItems: p = [],
16
17
  infoIcons: a = [],
17
18
  size: t = "md",
18
- width: s,
19
- onClick: n = () => {
19
+ width: d,
20
+ onClick: l = () => {
20
21
  }
21
- }, h) => (a = a.slice(0, 3), /* @__PURE__ */ r(o, { ref: h, sx: {
22
+ }, b) => (a = a.slice(0, 3), /* @__PURE__ */ r(s, { ref: b, sx: {
22
23
  position: "relative",
23
- width: s && t === "md" ? s : "360px",
24
+ width: d && t === "md" ? d : "320px",
24
25
  height: "auto"
25
- }, children: /* @__PURE__ */ d(
26
- w,
26
+ }, children: /* @__PURE__ */ i(
27
+ y,
27
28
  {
28
- selected: i,
29
+ selected: c,
29
30
  size: t,
30
- onClick: n,
31
+ onClick: l,
31
32
  onKeyDown: (e) => {
32
- (e.key === "Enter" || e.key === " ") && (e.preventDefault(), n == null || n());
33
+ (e.key === "Enter" || e.key === " ") && (e.preventDefault(), l == null || l());
33
34
  },
34
35
  role: "button",
35
36
  tabIndex: 0,
36
- "aria-label": `Resource card for ${c}`,
37
+ "aria-label": `Resource card for ${n}`,
37
38
  children: [
38
39
  /* @__PURE__ */ r(
39
- j,
40
+ R,
40
41
  {
41
42
  onClick: (e) => {
42
- e.stopPropagation(), p();
43
+ e.stopPropagation(), m();
43
44
  },
44
45
  onKeyDown: (e) => {
45
- (e.key === "Enter" || e.key === " ") && (e.preventDefault(), p());
46
+ (e.key === "Enter" || e.key === " ") && (e.preventDefault(), m());
46
47
  },
47
48
  className: "selected-icon",
48
- selected: i,
49
+ selected: c,
49
50
  role: "button",
50
51
  tabIndex: 0,
51
- "aria-label": i ? "Unselect card" : "Select card",
52
- children: /* @__PURE__ */ r($, {})
52
+ "aria-label": c ? "Unselect card" : "Select card",
53
+ children: /* @__PURE__ */ r(E, {})
53
54
  }
54
55
  ),
55
- /* @__PURE__ */ r(o, { sx: {
56
+ /* @__PURE__ */ r(s, { sx: {
56
57
  width: t == "sm" ? 110 : "100%",
57
58
  display: "flex",
58
59
  alignItems: "center",
59
60
  justifyContent: "center",
60
61
  boxSizing: "border-box"
61
62
  }, children: /* @__PURE__ */ r(
62
- f,
63
+ P,
63
64
  {
64
- image: x,
65
- sx: {
66
- height: t == "sm" ? "calc(100% - 32px)" : 180,
67
- width: t == "sm" ? "calc(100% - 32px)" : "calc(100% - 2rem)",
68
- objectFit: "cover",
69
- margin: t == "sm" ? 0 : "1rem",
70
- borderRadius: "0.5rem"
71
- },
65
+ image: h,
66
+ logo: u,
67
+ size: t,
72
68
  role: "img",
73
- "aria-label": `Image for ${c}`
69
+ "aria-label": `Image for ${n}`
74
70
  }
75
71
  ) }),
76
- /* @__PURE__ */ d(b, { sx: { padding: t == "sm" ? "1rem 0 !important" : "0 16px 16px 16px !important", width: t === "sm" ? "calc(100% - 110px)" : "100%" }, children: [
77
- /* @__PURE__ */ r(
78
- P,
79
- {
80
- typographyProps: { fontWeight: "700", fontSize: "1.1rem" },
81
- tooltipProps: { placement: "bottom", arrow: !0 },
82
- children: c
83
- }
84
- ),
85
- m.length > 0 && m.map((e, l) => /* @__PURE__ */ d(
86
- o,
87
- {
88
- sx: v,
89
- role: "group",
90
- "aria-label": `Property ${l}`,
91
- children: [
92
- e.icon,
93
- /* @__PURE__ */ r(o, { sx: { marginLeft: "0.5rem", display: "flex" }, children: e.text })
94
- ]
95
- },
96
- `property-${l}`
97
- )),
98
- /* @__PURE__ */ r(o, { sx: I, children: a.length > 0 && a.map((e, l) => /* @__PURE__ */ r(
99
- g,
100
- {
101
- title: e.text,
102
- placement: "top",
103
- arrow: !0,
104
- children: /* @__PURE__ */ r(
105
- o,
72
+ /* @__PURE__ */ i(
73
+ I,
74
+ {
75
+ size: t,
76
+ children: [
77
+ /* @__PURE__ */ r(
78
+ j,
79
+ {
80
+ typographyProps: { fontWeight: "700", fontSize: "1.1rem" },
81
+ tooltipProps: { placement: "bottom", arrow: !0 },
82
+ children: n
83
+ }
84
+ ),
85
+ p.length > 0 && p.map((e, o) => /* @__PURE__ */ i(
86
+ w,
87
+ {
88
+ size: t,
89
+ role: "group",
90
+ "aria-label": `Property ${o}`,
91
+ children: [
92
+ e.icon,
93
+ /* @__PURE__ */ r(
94
+ $,
95
+ {
96
+ isLast: o === p.length - 1,
97
+ size: t,
98
+ width: d,
99
+ children: e.text
100
+ }
101
+ )
102
+ ]
103
+ },
104
+ `property-${o}`
105
+ )),
106
+ /* @__PURE__ */ r(
107
+ v,
106
108
  {
107
- role: "button",
108
- tabIndex: 0,
109
- "aria-label": e.text,
110
- sx: {
111
- display: "inline-flex",
112
- alignItems: "center",
113
- justifyContent: "center",
114
- width: "fit-content",
115
- height: "fit-content"
116
- },
117
- children: e.icon
109
+ size: t,
110
+ children: a.length > 0 && a.map((e, o) => /* @__PURE__ */ r(
111
+ f,
112
+ {
113
+ title: e.text,
114
+ placement: "top",
115
+ arrow: !0,
116
+ children: /* @__PURE__ */ r(
117
+ D,
118
+ {
119
+ size: t,
120
+ role: "button",
121
+ tabIndex: 0,
122
+ "aria-label": e.text,
123
+ children: e.icon
124
+ }
125
+ )
126
+ },
127
+ `info-${o}`
128
+ ))
118
129
  }
119
130
  )
120
- },
121
- `info-${l}`
122
- )) })
123
- ] })
131
+ ]
132
+ }
133
+ )
124
134
  ]
125
135
  }
126
136
  ) })));
127
137
  export {
128
- W as ResourceCard
138
+ V as ResourceCard
129
139
  };
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("@mui/material"),r={display:"flex",marginTop:"0.5rem"},a=e.styled(e.Card)(({theme:i,selected:t,size:o})=>({boxShadow:"0px 4px 12px rgba(0, 0, 0, 0.1), 0px 2px 4px rgba(0, 0, 0, 0.06)",borderRadius:"0.5rem",border:"2px solid transparent",transition:"border-color 0.2s ease-in-out",position:"relative",...o==="sm"&&{display:"flex",width:"100%"},...t&&{borderColor:i.palette.primary.light},"&:hover":{"& .MuiBox-root.selected-icon":{opacity:1,visibility:"visible"}}})),l=e.styled(e.Box)(({theme:i,selected:t})=>({position:"absolute",top:0,right:0,width:"2rem",height:"2rem",background:i.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",...t&&{background:i.palette.primary.lighter,opacity:1,visibility:"visible"},"&:hover, &:focus":{background:i.palette.primary.lighter,opacity:1},"& .MuiSvgIcon-root":{color:i.palette.primary.main}})),s={position:"absolute",bottom:"16px",right:"16px",display:"flex",gap:".2rem"};exports.ItemCard=r;exports.PublicIconWrapper=s;exports.SelectedIcon=l;exports.StyledCard=a;
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",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,logo: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,19 +1,16 @@
1
- import { styled as t, Card as e, Box as a } from "@mui/material";
2
- const s = {
3
- display: "flex",
4
- marginTop: "0.5rem"
5
- }, l = t(e)(({ theme: i, selected: o, size: r }) => ({
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 }) => ({
6
3
  boxShadow: "0px 4px 12px rgba(0, 0, 0, 0.1), 0px 2px 4px rgba(0, 0, 0, 0.06)",
7
4
  borderRadius: "0.5rem",
8
5
  border: "2px solid transparent",
9
6
  transition: "border-color 0.2s ease-in-out",
10
7
  position: "relative",
11
- ...r === "sm" && {
8
+ ...i === "sm" && {
12
9
  display: "flex",
13
10
  width: "100%"
14
11
  },
15
12
  ...o && {
16
- borderColor: i.palette.primary.light
13
+ borderColor: e.palette.primary.light
17
14
  },
18
15
  "&:hover": {
19
16
  "& .MuiBox-root.selected-icon": {
@@ -21,13 +18,13 @@ const s = {
21
18
  visibility: "visible"
22
19
  }
23
20
  }
24
- })), n = t(a)(({ theme: i, selected: o }) => ({
21
+ })), m = t(r)(({ theme: e, selected: o }) => ({
25
22
  position: "absolute",
26
23
  top: 0,
27
24
  right: 0,
28
25
  width: "2rem",
29
26
  height: "2rem",
30
- background: i.palette.common.white,
27
+ background: e.palette.common.white,
31
28
  display: "flex",
32
29
  justifyContent: "center",
33
30
  alignItems: "center",
@@ -38,27 +35,82 @@ const s = {
38
35
  cursor: "pointer",
39
36
  transition: "opacity 0.2s ease-in-out, visibility 0.2s ease-in-out",
40
37
  ...o && {
41
- background: i.palette.primary.lighter,
38
+ background: e.palette.primary.lighter,
42
39
  opacity: 1,
43
40
  visibility: "visible"
44
41
  },
45
42
  "&:hover, &:focus": {
46
- background: i.palette.primary.lighter,
43
+ background: e.palette.primary.lighter,
47
44
  opacity: 1
48
45
  },
49
46
  "& .MuiSvgIcon-root": {
50
- color: i.palette.primary.main
47
+ color: e.palette.primary.main
48
+ }
49
+ })), d = t(p)(({ size: e, image: o, logo: i }) => ({
50
+ height: e == "sm" ? 85 : 180,
51
+ width: e == "sm" ? 85 : "calc(100% - 2rem)",
52
+ objectFit: "cover",
53
+ margin: e == "sm" ? "0 10px" : "1rem",
54
+ borderRadius: "0.5rem",
55
+ ...!o && e === "md" && {
56
+ backgroundImage: `url(${i})`,
57
+ backgroundRepeat: "repeat",
58
+ backgroundSize: "20% 20%",
59
+ backgroundPosition: "center",
60
+ opacity: "0.7"
61
+ }
62
+ })), l = t(n)(({ size: e }) => ({
63
+ padding: e == "sm" ? ".7rem 5px .7rem 0 !important" : "0 16px 16px 16px !important",
64
+ width: e === "sm" ? "calc(100% - 110px)" : "100%"
65
+ })), g = t(r)(({ size: e }) => ({
66
+ display: "flex",
67
+ alignItems: "center",
68
+ marginTop: "0.5rem",
69
+ ...e === "sm" && {
70
+ svg: {
71
+ width: ".8em",
72
+ height: ".8em"
73
+ }
51
74
  }
52
- })), d = {
75
+ })), x = t(r)(({ size: e, width: o, isLast: i }) => ({
76
+ marginLeft: e === "sm" ? ".3rem" : ".5rem",
77
+ fontSize: e === "sm" ? "12px" : "15px",
78
+ "& .MuiTypography-root": {
79
+ paddingTop: "2px",
80
+ fontSize: e === "sm" ? "12px" : "15px"
81
+ },
82
+ ...i && !o && {
83
+ textOverflow: "ellipsis",
84
+ whiteSpace: "nowrap",
85
+ overflow: "hidden",
86
+ maxWidth: e === "sm" ? "110px" : "172px"
87
+ }
88
+ })), u = t(r)(({ size: e }) => ({
89
+ display: "inline-flex",
90
+ alignItems: "center",
91
+ justifyContent: "center",
92
+ width: "fit-content",
93
+ height: "fit-content",
94
+ ...e === "sm" && {
95
+ svg: {
96
+ width: ".8em",
97
+ height: ".8em"
98
+ }
99
+ }
100
+ })), b = t(r)(({ size: e }) => ({
53
101
  position: "absolute",
54
- bottom: "16px",
55
- right: "16px",
102
+ bottom: e === "sm" ? ".65rem" : "16px",
103
+ right: e === "sm" ? "8px" : "16px",
56
104
  display: "flex",
57
105
  gap: ".2rem"
58
- };
106
+ }));
59
107
  export {
60
- s as ItemCard,
61
- d as PublicIconWrapper,
62
- n as SelectedIcon,
63
- l as StyledCard
108
+ b as PublicIconWrapper,
109
+ l as ResourceCardBody,
110
+ d as ResourceCardImage,
111
+ u as ResourceIconItem,
112
+ g as ResourcePropertyItem,
113
+ x as ResourcePropertyText,
114
+ m as SelectedIcon,
115
+ c as StyledCard
64
116
  };
@@ -1 +1 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("react/jsx-runtime"),s=require("../ResourceCard/ResourceCard.cjs.js"),t=require("../../createSvgIcon-DestgQu_.cjs"),c=require("@mui/material"),a=t.createSvgIcon(e.jsx("path",{d:"M20 3h-1V1h-2v2H7V1H5v2H4c-1.1 0-2 .9-2 2v16c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2m0 18H4V8h16z"}),"CalendarToday"),i=t.createSvgIcon(e.jsx("path",{d:"M19 2H5c-1.11 0-2 .9-2 2v14c0 1.1.89 2 2 2h4l3 3 3-3h4c1.1 0 2-.9 2-2V4c0-1.1-.9-2-2-2m-6 16h-2v-2h2zm2.07-7.75-.9.92C13.45 11.9 13 12.5 13 14h-2v-.5c0-1.1.45-2.1 1.17-2.83l1.24-1.26c.37-.36.59-.86.59-1.41 0-1.1-.9-2-2-2s-2 .9-2 2H8c0-2.21 1.79-4 4-4s4 1.79 4 4c0 .88-.36 1.68-.93 2.25"}),"LiveHelp"),n=t.createSvgIcon(e.jsx("path",{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2m-1 17.93c-3.95-.49-7-3.85-7-7.93 0-.62.08-1.21.21-1.79L9 15v1c0 1.1.9 2 2 2zm6.9-2.54c-.26-.81-1-1.39-1.9-1.39h-1v-3c0-.55-.45-1-1-1H8v-2h2c.55 0 1-.45 1-1V7h2c1.1 0 2-.9 2-2v-.41c2.93 1.19 5 4.06 5 7.41 0 2.08-.8 3.97-2.1 5.39"}),"Public"),r=t.createSvgIcon(e.jsx("path",{d:"M12 17.27 18.18 21l-1.64-7.03L22 9.24l-7.19-.61L12 2 9.19 8.63 2 9.24l5.46 4.73L5.82 21z"}),"Star"),l={title:"Components/ResourceCard",component:s.ResourceCard,argTypes:{isSelected:{description:"Indique si la carte est sélectionnée.",control:"boolean",table:{type:{summary:"boolean"},defaultValue:{summary:"false"}}},onSelect:{description:"Callback déclenché lorsque l'utilisateur sélectionne la carte.",action:"card-selected",table:{type:{summary:"() => void"}}},image:{description:"URL de l'image affichée sur la carte.",control:"text",table:{type:{summary:"string"}}},title:{description:"Titre de la carte.",control:"text",table:{type:{summary:"string"}}},propertyItems:{description:"Liste des propriétés affichées sous le titre.",control:"object",table:{type:{summary:"PropertyItem[]"}}},infoIcons:{description:"Liste des icônes d'information affichées dans la carte. (3 maximums)",control:"object",table:{type:{summary:"InfoItem[]"}}},size:{description:"Taille de la carte (petite ou moyenne).",control:"radio",options:["sm","md"],table:{type:{summary:'"sm" | "md"'},defaultValue:{summary:"md"}}},width:{description:"Largeur de la carte.",control:"text",table:{type:{summary:"string"},defaultValue:{summary:"300px"}}}}},o={args:{isSelected:!1,image:"https://dummyimage.com/600x400/000/fff&text=flashquizz",title:"Titre de la Ressource tres loooooooooooooooooooooooooooooooooooooooooooooooooooooong",propertyItems:[{text:e.jsx(c.Typography,{color:"text.primary",children:"0 questions"}),icon:e.jsx(i,{color:"primary"})},{text:"27 janvier 2025",icon:e.jsx(a,{color:"primary"})}],infoIcons:[{text:"Information 1",icon:e.jsx(n,{color:"primary"})},{text:"Information 2",icon:e.jsx(r,{color:"primary"})},{text:"Information 3",icon:e.jsx(r,{color:"primary"})},{text:"Information 3",icon:e.jsx(r,{color:"primary"})}],size:"sm",onSelect:()=>{console.log("Carte sélectionnée !")},onClick:()=>{console.log("Select all")}}},m={args:{...o.args,isSelected:!0,title:"Carte Sélectionnée"}},u={args:{...o.args,size:"sm",title:"Petite Carte"}},d={args:{...o.args,propertyItems:[],infoIcons:[],title:"Carte sans Icônes"}},p={args:{...o.args,width:"400px",title:"Carte avec taille personnalisée"}};exports.CustomSize=p;exports.Default=o;exports.NoIcons=d;exports.Selected=m;exports.Small=u;exports.default=l;
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("react/jsx-runtime"),c=require("../ResourceCard/ResourceCard.cjs.js"),o=require("../../createSvgIcon-DestgQu_.cjs"),r=require("@mui/material"),s=o.createSvgIcon(e.jsx("path",{d:"M20 3h-1V1h-2v2H7V1H5v2H4c-1.1 0-2 .9-2 2v16c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2m0 18H4V8h16z"}),"CalendarToday"),i=o.createSvgIcon(e.jsx("path",{d:"M19 2H5c-1.11 0-2 .9-2 2v14c0 1.1.89 2 2 2h4l3 3 3-3h4c1.1 0 2-.9 2-2V4c0-1.1-.9-2-2-2m-6 16h-2v-2h2zm2.07-7.75-.9.92C13.45 11.9 13 12.5 13 14h-2v-.5c0-1.1.45-2.1 1.17-2.83l1.24-1.26c.37-.36.59-.86.59-1.41 0-1.1-.9-2-2-2s-2 .9-2 2H8c0-2.21 1.79-4 4-4s4 1.79 4 4c0 .88-.36 1.68-.93 2.25"}),"LiveHelp"),l=o.createSvgIcon(e.jsx("path",{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2m-1 17.93c-3.95-.49-7-3.85-7-7.93 0-.62.08-1.21.21-1.79L9 15v1c0 1.1.9 2 2 2zm6.9-2.54c-.26-.81-1-1.39-1.9-1.39h-1v-3c0-.55-.45-1-1-1H8v-2h2c.55 0 1-.45 1-1V7h2c1.1 0 2-.9 2-2v-.41c2.93 1.19 5 4.06 5 7.41 0 2.08-.8 3.97-2.1 5.39"}),"Public"),a=o.createSvgIcon(e.jsx("path",{d:"M12 17.27 18.18 21l-1.64-7.03L22 9.24l-7.19-.61L12 2 9.19 8.63 2 9.24l5.46 4.73L5.82 21z"}),"Star"),n={title:"Components/ResourceCard",component:c.ResourceCard,argTypes:{title:{description:"Titre de la carte.",control:"text",table:{type:{summary:"string"}},required:!0},logo:{description:"Logo de l'application",control:"text",table:{type:{summary:"string"}},required:!0},isSelected:{description:"Indique si la carte est sélectionnée.",control:"boolean",table:{type:{summary:"boolean"},defaultValue:{summary:"false"}}},onSelect:{description:"Callback déclenché lorsque l'utilisateur sélectionne la carte.",action:"card-selected",table:{type:{summary:"() => void"}}},image:{description:"URL de l'image affichée sur la carte.",control:"text",table:{type:{summary:"string"}}},propertyItems:{description:"Liste des propriétés affichées sous le titre.",control:"object",table:{type:{summary:"PropertyItem[{text: Typography, icon: MuiIcon}]"}}},infoIcons:{description:"Liste des icônes d'information affichées dans la carte. (3 maximums)",control:"object",table:{type:{summary:"InfoItem[{text: string, icon: MuiIcon}]"}}},size:{description:"Taille de la carte (petite ou moyenne).",control:"radio",options:["sm","md"],table:{type:{summary:'"sm" | "md"'},defaultValue:{summary:"md"}}},width:{description:"Largeur de la carte.",control:"text",table:{type:{summary:"string"},defaultValue:{summary:"320px"}}}}},t={args:{isSelected:!1,image:"https://dummyimage.com/600x400/000/fff.png&text=flashquizz",logo:"https://flashquizz-dev.support-ent.fr/images/logo.svg",title:"Titre de la Ressource tres loooooooooooooooooooooooooooooooooooooooooooooooooooooong",propertyItems:[{text:e.jsx(r.Typography,{color:"text.primary",children:"0 questions"}),icon:e.jsx(i,{color:"primary"})},{text:e.jsx(r.Typography,{color:"text.primary",children:"27 septembre 2025"}),icon:e.jsx(s,{color:"primary"})}],infoIcons:[{text:"Information 1",icon:e.jsx(l,{color:"primary"})},{text:"Information 2",icon:e.jsx(a,{color:"primary"})},{text:"Information 3",icon:e.jsx(a,{color:"primary"})}],size:"md",onSelect:()=>{console.log("Carte sélectionnée !")},onClick:()=>{console.log("Select all")}}},m={args:{...t.args,isSelected:!0,title:"Carte Sélectionnée"}},d={args:{...t.args,size:"sm",title:"Petite Carte"}},u={args:{...t.args,title:"Pas d'image",image:void 0}};exports.Default=t;exports.NoImage=u;exports.Selected=m;exports.Small=d;exports.default=n;
@@ -6,5 +6,4 @@ type Story = StoryObj<typeof ResourceCard>;
6
6
  export declare const Default: Story;
7
7
  export declare const Selected: Story;
8
8
  export declare const Small: Story;
9
- export declare const NoIcons: Story;
10
- export declare const CustomSize: Story;
9
+ export declare const NoImage: Story;
@@ -1,19 +1,35 @@
1
1
  import { jsx as o } from "react/jsx-runtime";
2
- import { ResourceCard as a } from "../ResourceCard/ResourceCard.es.js";
2
+ import { ResourceCard as c } from "../ResourceCard/ResourceCard.es.js";
3
3
  import { c as e } from "../../createSvgIcon-C9kh-71a.js";
4
- import { Typography as c } from "@mui/material";
5
- const s = e(/* @__PURE__ */ o("path", {
4
+ import { Typography as r } from "@mui/material";
5
+ const i = e(/* @__PURE__ */ o("path", {
6
6
  d: "M20 3h-1V1h-2v2H7V1H5v2H4c-1.1 0-2 .9-2 2v16c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2m0 18H4V8h16z"
7
- }), "CalendarToday"), i = e(/* @__PURE__ */ o("path", {
7
+ }), "CalendarToday"), s = e(/* @__PURE__ */ o("path", {
8
8
  d: "M19 2H5c-1.11 0-2 .9-2 2v14c0 1.1.89 2 2 2h4l3 3 3-3h4c1.1 0 2-.9 2-2V4c0-1.1-.9-2-2-2m-6 16h-2v-2h2zm2.07-7.75-.9.92C13.45 11.9 13 12.5 13 14h-2v-.5c0-1.1.45-2.1 1.17-2.83l1.24-1.26c.37-.36.59-.86.59-1.41 0-1.1-.9-2-2-2s-2 .9-2 2H8c0-2.21 1.79-4 4-4s4 1.79 4 4c0 .88-.36 1.68-.93 2.25"
9
9
  }), "LiveHelp"), l = e(/* @__PURE__ */ o("path", {
10
10
  d: "M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2m-1 17.93c-3.95-.49-7-3.85-7-7.93 0-.62.08-1.21.21-1.79L9 15v1c0 1.1.9 2 2 2zm6.9-2.54c-.26-.81-1-1.39-1.9-1.39h-1v-3c0-.55-.45-1-1-1H8v-2h2c.55 0 1-.45 1-1V7h2c1.1 0 2-.9 2-2v-.41c2.93 1.19 5 4.06 5 7.41 0 2.08-.8 3.97-2.1 5.39"
11
- }), "Public"), r = e(/* @__PURE__ */ o("path", {
11
+ }), "Public"), a = e(/* @__PURE__ */ o("path", {
12
12
  d: "M12 17.27 18.18 21l-1.64-7.03L22 9.24l-7.19-.61L12 2 9.19 8.63 2 9.24l5.46 4.73L5.82 21z"
13
13
  }), "Star"), u = {
14
14
  title: "Components/ResourceCard",
15
- component: a,
15
+ component: c,
16
16
  argTypes: {
17
+ title: {
18
+ description: "Titre de la carte.",
19
+ control: "text",
20
+ table: {
21
+ type: { summary: "string" }
22
+ },
23
+ required: !0
24
+ },
25
+ logo: {
26
+ description: "Logo de l'application",
27
+ control: "text",
28
+ table: {
29
+ type: { summary: "string" }
30
+ },
31
+ required: !0
32
+ },
17
33
  isSelected: {
18
34
  description: "Indique si la carte est sélectionnée.",
19
35
  control: "boolean",
@@ -36,25 +52,18 @@ const s = e(/* @__PURE__ */ o("path", {
36
52
  type: { summary: "string" }
37
53
  }
38
54
  },
39
- title: {
40
- description: "Titre de la carte.",
41
- control: "text",
42
- table: {
43
- type: { summary: "string" }
44
- }
45
- },
46
55
  propertyItems: {
47
56
  description: "Liste des propriétés affichées sous le titre.",
48
57
  control: "object",
49
58
  table: {
50
- type: { summary: "PropertyItem[]" }
59
+ type: { summary: "PropertyItem[{text: Typography, icon: MuiIcon}]" }
51
60
  }
52
61
  },
53
62
  infoIcons: {
54
63
  description: "Liste des icônes d'information affichées dans la carte. (3 maximums)",
55
64
  control: "object",
56
65
  table: {
57
- type: { summary: "InfoItem[]" }
66
+ type: { summary: "InfoItem[{text: string, icon: MuiIcon}]" }
58
67
  }
59
68
  },
60
69
  size: {
@@ -71,26 +80,26 @@ const s = e(/* @__PURE__ */ o("path", {
71
80
  control: "text",
72
81
  table: {
73
82
  type: { summary: "string" },
74
- defaultValue: { summary: "300px" }
83
+ defaultValue: { summary: "320px" }
75
84
  }
76
85
  }
77
86
  }
78
87
  }, t = {
79
88
  args: {
80
89
  isSelected: !1,
81
- image: "https://dummyimage.com/600x400/000/fff&text=flashquizz",
90
+ image: "https://dummyimage.com/600x400/000/fff.png&text=flashquizz",
91
+ logo: "https://flashquizz-dev.support-ent.fr/images/logo.svg",
82
92
  title: "Titre de la Ressource tres loooooooooooooooooooooooooooooooooooooooooooooooooooooong",
83
93
  propertyItems: [
84
- { text: /* @__PURE__ */ o(c, { color: "text.primary", children: "0 questions" }), icon: /* @__PURE__ */ o(i, { color: "primary" }) },
85
- { text: "27 janvier 2025", icon: /* @__PURE__ */ o(s, { color: "primary" }) }
94
+ { text: /* @__PURE__ */ o(r, { color: "text.primary", children: "0 questions" }), icon: /* @__PURE__ */ o(s, { color: "primary" }) },
95
+ { text: /* @__PURE__ */ o(r, { color: "text.primary", children: "27 septembre 2025" }), icon: /* @__PURE__ */ o(i, { color: "primary" }) }
86
96
  ],
87
97
  infoIcons: [
88
98
  { text: "Information 1", icon: /* @__PURE__ */ o(l, { color: "primary" }) },
89
- { text: "Information 2", icon: /* @__PURE__ */ o(r, { color: "primary" }) },
90
- { text: "Information 3", icon: /* @__PURE__ */ o(r, { color: "primary" }) },
91
- { text: "Information 3", icon: /* @__PURE__ */ o(r, { color: "primary" }) }
99
+ { text: "Information 2", icon: /* @__PURE__ */ o(a, { color: "primary" }) },
100
+ { text: "Information 3", icon: /* @__PURE__ */ o(a, { color: "primary" }) }
92
101
  ],
93
- size: "sm",
102
+ size: "md",
94
103
  onSelect: () => {
95
104
  console.log("Carte sélectionnée !");
96
105
  },
@@ -104,31 +113,23 @@ const s = e(/* @__PURE__ */ o("path", {
104
113
  isSelected: !0,
105
114
  title: "Carte Sélectionnée"
106
115
  }
107
- }, f = {
116
+ }, g = {
108
117
  args: {
109
118
  ...t.args,
110
119
  size: "sm",
111
120
  title: "Petite Carte"
112
121
  }
113
- }, h = {
114
- args: {
115
- ...t.args,
116
- propertyItems: [],
117
- infoIcons: [],
118
- title: "Carte sans Icônes"
119
- }
120
- }, g = {
122
+ }, f = {
121
123
  args: {
122
124
  ...t.args,
123
- width: "400px",
124
- title: "Carte avec taille personnalisée"
125
+ title: "Pas d'image",
126
+ image: void 0
125
127
  }
126
128
  };
127
129
  export {
128
- g as CustomSize,
129
130
  t as Default,
130
- h as NoIcons,
131
+ f as NoImage,
131
132
  y as Selected,
132
- f as Small,
133
+ g as Small,
133
134
  u as default
134
135
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cgi-learning-hub/ui",
3
- "version": "1.3.5-dev.1738080904",
3
+ "version": "1.3.5-dev.1738156506",
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",