@cgi-learning-hub/ui 1.3.5-dev.1737994728 → 1.3.5-dev.1738155719

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 e=require("react/jsx-runtime"),t=require("@mui/material"),h=require("react"),u=require("../../createSvgIcon-DestgQu_.cjs"),r=require("./style.cjs.js"),m=require("../EllipsisWithTooltip/EllipsisWithTooltip.cjs.js"),j=u.createSvgIcon(e.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"),g=h.forwardRef(({isSelected:n=!1,onSelect:a=()=>{},image:x,title:d,propertyItems:o=[],infoIcons:i=[],size:C="md",width:c,height:l},p)=>(i=i.slice(0,3),e.jsx(t.Box,{ref:p,sx:{position:"relative",width:c||"300px",height:l||"auto"},children:e.jsxs(r.StyledCard,{selected:n,children:[e.jsx(t.Box,{sx:{width:"100%",display:"flex",alignItems:"center",justifyContent:"center"},children:e.jsx(t.CardMedia,{image:x,sx:r.ImageStyle})}),e.jsxs(t.CardContent,{sx:{padding:"0 16px 16px 16px"},children:[e.jsx(m,{typographyProps:{fontWeight:"700",fontSize:"1.1rem"},tooltipProps:{placement:"bottom",arrow:!0},children:d}),o.length>0&&o.map(s=>e.jsxs(t.Box,{sx:r.ItemCard,children:[s.icon&&s.icon,e.jsx(t.Box,{sx:{marginLeft:"0.5rem",display:"flex"},children:s.text})]})),e.jsx(t.Box,{sx:r.PublicIconWrapper,children:i.length>0&&i.map(s=>e.jsx(t.Tooltip,{title:s.text,placement:"top",arrow:!0,children:e.jsx(t.Box,{sx:{display:"inline-flex",alignItems:"center",justifyContent:"center",width:"fit-content",height:"fit-content"},children:s.icon})}))})]}),e.jsx(r.SelectedIcon,{onClick:s=>{s.stopPropagation(),a()},className:"selected-icon",selected:n,children:e.jsx(j,{})})]})})));exports.ResourceCard=g;
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"),t=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:l=!1,onSelect:p=()=>{},image:x,title:n,logo:h,propertyItems:i=[],infoIcons:s=[],size:o="md",width:d,onClick:c=()=>{}},m)=>(s=s.slice(0,3),r.jsx(u.Box,{ref:m,sx:{position:"relative",width:d&&o==="md"?d:"320px",height:"auto"},children:r.jsxs(t.StyledCard,{selected:l,size:o,onClick:c,onKeyDown:e=>{(e.key==="Enter"||e.key===" ")&&(e.preventDefault(),c==null||c())},role:"button",tabIndex:0,"aria-label":`Resource card for ${n}`,children:[r.jsx(t.SelectedIcon,{onClick:e=>{e.stopPropagation(),p()},onKeyDown:e=>{(e.key==="Enter"||e.key===" ")&&(e.preventDefault(),p())},className:"selected-icon",selected:l,role:"button",tabIndex:0,"aria-label":l?"Unselect card":"Select card",children:r.jsx(y,{})}),r.jsx(u.Box,{sx:{width:o=="sm"?110:"100%",display:"flex",alignItems:"center",justifyContent:"center",boxSizing:"border-box"},children:r.jsx(t.ResourceCardImage,{image:x,logo:h,role:"img","aria-label":`Image for ${n}`})}),r.jsxs(t.ResourceCardBody,{size:o,children:[r.jsx(j,{typographyProps:{fontWeight:"700",fontSize:"1.1rem"},tooltipProps:{placement:"bottom",arrow:!0},children:n}),i.length>0&&i.map((e,a)=>r.jsxs(t.ResourcePropertyItem,{role:"group","aria-label":`Property ${a}`,children:[e.icon,r.jsx(t.ResourcePropertyText,{isLast:a===i.length-1,size:o,width:d,children:e.text})]},`property-${a}`)),r.jsx(t.PublicIconWrapper,{size:o,children:s.length>0&&s.map((e,a)=>r.jsx(u.Tooltip,{title:e.text,placement:"top",arrow:!0,children:r.jsx(t.ResourceIconItem,{role:"button",tabIndex:0,"aria-label":e.text,children:e.icon})},`info-${a}`))})]})]})})));exports.ResourceCard=R;
@@ -7,17 +7,17 @@ export type InfoItem = {
7
7
  text: string;
8
8
  icon: ReactNode;
9
9
  };
10
- type Size = "md" | "sm";
10
+ export type ResourceCardSize = "md" | "sm";
11
11
  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[];
18
- size?: Size;
19
+ size?: ResourceCardSize;
19
20
  width?: string;
20
- height?: string;
21
+ onClick?: () => void;
21
22
  }
22
23
  export declare const ResourceCard: import('react').ForwardRefExoticComponent<ResourceCardProps & import('react').RefAttributes<HTMLDivElement>>;
23
- export {};
@@ -1,62 +1,136 @@
1
- import { jsx as e, jsxs as o } from "react/jsx-runtime";
2
- import { Box as r, CardMedia as h, CardContent as x, Tooltip as f } from "@mui/material";
3
- import { forwardRef as g } from "react";
4
- import { c as C } from "../../createSvgIcon-C9kh-71a.js";
5
- import { StyledCard as u, ImageStyle as y, ItemCard as w, PublicIconWrapper as j, SelectedIcon as M } from "./style.es.js";
6
- import P from "../EllipsisWithTooltip/EllipsisWithTooltip.es.js";
7
- const S = C(/* @__PURE__ */ e("path", {
1
+ import { jsx as r, jsxs as d } 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"), V = g(({ isSelected: n = !1, onSelect: a = () => {
10
- }, image: d, title: p, propertyItems: l = [], infoIcons: i = [], size: I = "md", width: c, height: s }, m) => (i = i.slice(0, 3), /* @__PURE__ */ e(r, { ref: m, sx: {
9
+ }), "MoreVert"), V = x(({
10
+ isSelected: c = !1,
11
+ onSelect: m = () => {
12
+ },
13
+ image: h,
14
+ title: n,
15
+ logo: u,
16
+ propertyItems: i = [],
17
+ infoIcons: a = [],
18
+ size: t = "md",
19
+ width: p,
20
+ onClick: l = () => {
21
+ }
22
+ }, b) => (a = a.slice(0, 3), /* @__PURE__ */ r(s, { ref: b, sx: {
11
23
  position: "relative",
12
- width: c || "300px",
13
- height: s || "auto"
14
- }, children: /* @__PURE__ */ o(u, { selected: n, children: [
15
- /* @__PURE__ */ e(r, { sx: {
16
- width: "100%",
17
- display: "flex",
18
- alignItems: "center",
19
- justifyContent: "center"
20
- }, children: /* @__PURE__ */ e(h, { image: d, sx: y }) }),
21
- /* @__PURE__ */ o(x, { sx: { padding: "0 16px 16px 16px" }, children: [
22
- /* @__PURE__ */ e(
23
- P,
24
- {
25
- typographyProps: { fontWeight: "700", fontSize: "1.1rem" },
26
- tooltipProps: { placement: "bottom", arrow: !0 },
27
- children: p
28
- }
29
- ),
30
- l.length > 0 && l.map((t) => /* @__PURE__ */ o(r, { sx: w, children: [
31
- t.icon && t.icon,
32
- /* @__PURE__ */ e(r, { sx: { marginLeft: "0.5rem", display: "flex" }, children: t.text })
33
- ] })),
34
- /* @__PURE__ */ e(r, { sx: j, children: i.length > 0 && i.map((t) => /* @__PURE__ */ e(f, { title: t.text, placement: "top", arrow: !0, children: /* @__PURE__ */ e(
35
- r,
36
- {
37
- sx: {
38
- display: "inline-flex",
39
- alignItems: "center",
40
- justifyContent: "center",
41
- width: "fit-content",
42
- height: "fit-content"
43
- },
44
- children: t.icon
45
- }
46
- ) })) })
47
- ] }),
48
- /* @__PURE__ */ e(
49
- M,
50
- {
51
- onClick: (t) => {
52
- t.stopPropagation(), a();
53
- },
54
- className: "selected-icon",
55
- selected: n,
56
- children: /* @__PURE__ */ e(S, {})
57
- }
58
- )
59
- ] }) })));
24
+ width: p && t === "md" ? p : "320px",
25
+ height: "auto"
26
+ }, children: /* @__PURE__ */ d(
27
+ y,
28
+ {
29
+ selected: c,
30
+ size: t,
31
+ onClick: l,
32
+ onKeyDown: (e) => {
33
+ (e.key === "Enter" || e.key === " ") && (e.preventDefault(), l == null || l());
34
+ },
35
+ role: "button",
36
+ tabIndex: 0,
37
+ "aria-label": `Resource card for ${n}`,
38
+ children: [
39
+ /* @__PURE__ */ r(
40
+ R,
41
+ {
42
+ onClick: (e) => {
43
+ e.stopPropagation(), m();
44
+ },
45
+ onKeyDown: (e) => {
46
+ (e.key === "Enter" || e.key === " ") && (e.preventDefault(), m());
47
+ },
48
+ className: "selected-icon",
49
+ selected: c,
50
+ role: "button",
51
+ tabIndex: 0,
52
+ "aria-label": c ? "Unselect card" : "Select card",
53
+ children: /* @__PURE__ */ r(E, {})
54
+ }
55
+ ),
56
+ /* @__PURE__ */ r(s, { sx: {
57
+ width: t == "sm" ? 110 : "100%",
58
+ display: "flex",
59
+ alignItems: "center",
60
+ justifyContent: "center",
61
+ boxSizing: "border-box"
62
+ }, children: /* @__PURE__ */ r(
63
+ P,
64
+ {
65
+ image: h,
66
+ logo: u,
67
+ role: "img",
68
+ "aria-label": `Image for ${n}`
69
+ }
70
+ ) }),
71
+ /* @__PURE__ */ d(
72
+ I,
73
+ {
74
+ size: t,
75
+ children: [
76
+ /* @__PURE__ */ r(
77
+ j,
78
+ {
79
+ typographyProps: { fontWeight: "700", fontSize: "1.1rem" },
80
+ tooltipProps: { placement: "bottom", arrow: !0 },
81
+ children: n
82
+ }
83
+ ),
84
+ i.length > 0 && i.map((e, o) => /* @__PURE__ */ d(
85
+ w,
86
+ {
87
+ role: "group",
88
+ "aria-label": `Property ${o}`,
89
+ children: [
90
+ e.icon,
91
+ /* @__PURE__ */ r(
92
+ $,
93
+ {
94
+ isLast: o === i.length - 1,
95
+ size: t,
96
+ width: p,
97
+ children: e.text
98
+ }
99
+ )
100
+ ]
101
+ },
102
+ `property-${o}`
103
+ )),
104
+ /* @__PURE__ */ r(
105
+ v,
106
+ {
107
+ size: t,
108
+ children: a.length > 0 && a.map((e, o) => /* @__PURE__ */ r(
109
+ f,
110
+ {
111
+ title: e.text,
112
+ placement: "top",
113
+ arrow: !0,
114
+ children: /* @__PURE__ */ r(
115
+ D,
116
+ {
117
+ role: "button",
118
+ tabIndex: 0,
119
+ "aria-label": e.text,
120
+ children: e.icon
121
+ }
122
+ )
123
+ },
124
+ `info-${o}`
125
+ ))
126
+ }
127
+ )
128
+ ]
129
+ }
130
+ )
131
+ ]
132
+ }
133
+ ) })));
60
134
  export {
61
135
  V as ResourceCard
62
136
  };
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("@mui/material"),r={display:"flex",marginTop:"0.5rem"},o=i.styled(i.Card)(({theme:e,selected:t})=>({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",...t&&{borderColor:e.palette.primary.light},"&:hover":{"& .MuiBox-root.selected-icon":{opacity:1,visibility:"visible"}}})),a={height:180,width:"calc(100% - 2rem)",maxWidth:300,objectFit:"cover",margin:"1rem",borderRadius:"0.5rem"},l=i.styled(i.Box)(({theme:e,selected:t})=>({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:"hidden",opacity:0,cursor:"pointer",transition:"opacity 0.2s ease-in-out, visibility 0.2s ease-in-out",...t&&{background:e.palette.primary.lighter,opacity:1,visibility:"visible"},"&:hover":{background:e.palette.primary.lighter},"& .MuiSvgIcon-root":{color:e.palette.primary.main}})),n={position:"absolute",bottom:".8rem",right:".8rem",display:"flex",gap:".2rem"};exports.ImageStyle=a;exports.ItemCard=r;exports.PublicIconWrapper=n;exports.SelectedIcon=l;exports.StyledCard=o;
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,15 +1,16 @@
1
- import { styled as e, Card as t, Box as o } from "@mui/material";
2
- const s = {
3
- display: "flex",
4
- marginTop: "0.5rem"
5
- }, n = e(t)(({ theme: i, selected: 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 && {
12
- borderColor: i.palette.primary.light
8
+ ...i === "sm" && {
9
+ display: "flex",
10
+ width: "100%"
11
+ },
12
+ ...o && {
13
+ borderColor: e.palette.primary.light
13
14
  },
14
15
  "&:hover": {
15
16
  "& .MuiBox-root.selected-icon": {
@@ -17,51 +18,99 @@ const s = {
17
18
  visibility: "visible"
18
19
  }
19
20
  }
20
- })), p = {
21
- height: 180,
22
- width: "calc(100% - 2rem)",
23
- maxWidth: 300,
24
- objectFit: "cover",
25
- margin: "1rem",
26
- borderRadius: "0.5rem"
27
- }, l = e(o)(({ theme: i, selected: r }) => ({
21
+ })), m = t(r)(({ theme: e, selected: o }) => ({
28
22
  position: "absolute",
29
23
  top: 0,
30
24
  right: 0,
31
25
  width: "2rem",
32
26
  height: "2rem",
33
- background: i.palette.common.white,
27
+ background: e.palette.common.white,
34
28
  display: "flex",
35
29
  justifyContent: "center",
36
30
  alignItems: "center",
37
31
  padding: ".8rem",
38
32
  borderRadius: ".5rem",
39
- visibility: "hidden",
33
+ visibility: "visible",
40
34
  opacity: 0,
41
35
  cursor: "pointer",
42
36
  transition: "opacity 0.2s ease-in-out, visibility 0.2s ease-in-out",
43
- ...r && {
44
- background: i.palette.primary.lighter,
37
+ ...o && {
38
+ background: e.palette.primary.lighter,
45
39
  opacity: 1,
46
40
  visibility: "visible"
47
41
  },
48
- "&:hover": {
49
- background: i.palette.primary.lighter
42
+ "&:hover, &:focus": {
43
+ background: e.palette.primary.lighter,
44
+ opacity: 1
50
45
  },
51
46
  "& .MuiSvgIcon-root": {
52
- 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
+ }
53
74
  }
54
- })), 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 }) => ({
55
101
  position: "absolute",
56
- bottom: ".8rem",
57
- right: ".8rem",
102
+ bottom: e === "sm" ? ".65rem" : "16px",
103
+ right: e === "sm" ? "8px" : "16px",
58
104
  display: "flex",
59
105
  gap: ".2rem"
60
- };
106
+ }));
61
107
  export {
62
- p as ImageStyle,
63
- s as ItemCard,
64
- d as PublicIconWrapper,
65
- l as SelectedIcon,
66
- n 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
67
116
  };
@@ -1 +1 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("react/jsx-runtime"),a=require("../ResourceCard/ResourceCard.cjs.js"),o=require("../../createSvgIcon-DestgQu_.cjs"),s=require("@mui/material"),c=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"),n=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"),r=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"),l={title:"Components/ResourceCard",component:a.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"}}},height:{description:"Hauteur de la carte.",control:"text",table:{type:{summary:"string"},defaultValue:{summary:"auto"}}}}},t={args:{isSelected:!1,image:"https://dummyimage.com/600x400/000/fff&text=flashquizz",title:"Titre de la Ressource",propertyItems:[{text:e.jsx(s.Typography,{color:"text.primary",children:"0 questions"}),icon:e.jsx(i,{color:"primary"})},{text:"27 janvier 2025",icon:e.jsx(c,{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"})}],size:"md",width:"300px",height:"auto",onSelect:()=>{console.log("Carte sélectionnée !")}}},m={args:{...t.args,isSelected:!0,title:"Carte Sélectionnée"}},u={args:{...t.args,size:"sm",title:"Petite Carte"}},d={args:{...t.args,propertyItems:[],infoIcons:[],title:"Carte sans Icônes"}},p={args:{...t.args,width:"400px",height:"200px",title:"Carte avec taille personnalisée"}};exports.CustomSize=p;exports.Default=t;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"),a=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"),c=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:a.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[{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(c,{color:"primary"})},{text:"Information 3",icon:e.jsx(c,{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,18 +1,18 @@
1
- import { jsx as e } from "react/jsx-runtime";
2
- import { ResourceCard as a } from "../ResourceCard/ResourceCard.es.js";
3
- import { c as t } from "../../createSvgIcon-C9kh-71a.js";
4
- import { Typography as c } from "@mui/material";
5
- const s = t(/* @__PURE__ */ e("path", {
1
+ import { jsx as o } from "react/jsx-runtime";
2
+ import { ResourceCard as c } from "../ResourceCard/ResourceCard.es.js";
3
+ import { c as e } from "../../createSvgIcon-C9kh-71a.js";
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 = t(/* @__PURE__ */ e("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
- }), "LiveHelp"), l = t(/* @__PURE__ */ e("path", {
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 = t(/* @__PURE__ */ e("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
17
  isSelected: {
18
18
  description: "Indique si la carte est sélectionnée.",
@@ -47,14 +47,14 @@ const s = t(/* @__PURE__ */ e("path", {
47
47
  description: "Liste des propriétés affichées sous le titre.",
48
48
  control: "object",
49
49
  table: {
50
- type: { summary: "PropertyItem[]" }
50
+ type: { summary: "PropertyItem[{text: Typography, icon: MuiIcon}]" }
51
51
  }
52
52
  },
53
53
  infoIcons: {
54
54
  description: "Liste des icônes d'information affichées dans la carte. (3 maximums)",
55
55
  control: "object",
56
56
  table: {
57
- type: { summary: "InfoItem[]" }
57
+ type: { summary: "InfoItem[{text: string, icon: MuiIcon}]" }
58
58
  }
59
59
  },
60
60
  size: {
@@ -71,71 +71,56 @@ const s = t(/* @__PURE__ */ e("path", {
71
71
  control: "text",
72
72
  table: {
73
73
  type: { summary: "string" },
74
- defaultValue: { summary: "300px" }
75
- }
76
- },
77
- height: {
78
- description: "Hauteur de la carte.",
79
- control: "text",
80
- table: {
81
- type: { summary: "string" },
82
- defaultValue: { summary: "auto" }
74
+ defaultValue: { summary: "320px" }
83
75
  }
84
76
  }
85
77
  }
86
- }, o = {
78
+ }, t = {
87
79
  args: {
88
80
  isSelected: !1,
89
- image: "https://dummyimage.com/600x400/000/fff&text=flashquizz",
90
- title: "Titre de la Ressource",
81
+ image: "https://dummyimage.com/600x400/000/fff.png&text=flashquizz",
82
+ logo: "https://flashquizz-dev.support-ent.fr/images/logo.svg",
83
+ title: "Titre de la Ressource tres loooooooooooooooooooooooooooooooooooooooooooooooooooooong",
91
84
  propertyItems: [
92
- { text: /* @__PURE__ */ e(c, { color: "text.primary", children: "0 questions" }), icon: /* @__PURE__ */ e(i, { color: "primary" }) },
93
- { text: "27 janvier 2025", icon: /* @__PURE__ */ e(s, { color: "primary" }) }
85
+ { text: /* @__PURE__ */ o(r, { color: "text.primary", children: "0 questions" }), icon: /* @__PURE__ */ o(s, { color: "primary" }) },
86
+ { text: /* @__PURE__ */ o(r, { color: "text.primary", children: "27 septembre 2025" }), icon: /* @__PURE__ */ o(i, { color: "primary" }) }
94
87
  ],
95
88
  infoIcons: [
96
- { text: "Information 1", icon: /* @__PURE__ */ e(l, { color: "primary" }) },
97
- { text: "Information 2", icon: /* @__PURE__ */ e(r, { color: "primary" }) },
98
- { text: "Information 3", icon: /* @__PURE__ */ e(r, { color: "primary" }) }
89
+ { text: "Information 1", icon: /* @__PURE__ */ o(l, { color: "primary" }) },
90
+ { text: "Information 2", icon: /* @__PURE__ */ o(a, { color: "primary" }) },
91
+ { text: "Information 3", icon: /* @__PURE__ */ o(a, { color: "primary" }) }
99
92
  ],
100
93
  size: "md",
101
- width: "300px",
102
- height: "auto",
103
94
  onSelect: () => {
104
95
  console.log("Carte sélectionnée !");
96
+ },
97
+ onClick: () => {
98
+ console.log("Select all");
105
99
  }
106
100
  }
107
101
  }, y = {
108
102
  args: {
109
- ...o.args,
103
+ ...t.args,
110
104
  isSelected: !0,
111
105
  title: "Carte Sélectionnée"
112
106
  }
113
- }, h = {
107
+ }, f = {
114
108
  args: {
115
- ...o.args,
109
+ ...t.args,
116
110
  size: "sm",
117
111
  title: "Petite Carte"
118
112
  }
119
- }, f = {
120
- args: {
121
- ...o.args,
122
- propertyItems: [],
123
- infoIcons: [],
124
- title: "Carte sans Icônes"
125
- }
126
113
  }, g = {
127
114
  args: {
128
- ...o.args,
129
- width: "400px",
130
- height: "200px",
131
- title: "Carte avec taille personnalisée"
115
+ ...t.args,
116
+ title: "Pas d'image",
117
+ image: void 0
132
118
  }
133
119
  };
134
120
  export {
135
- g as CustomSize,
136
- o as Default,
137
- f as NoIcons,
121
+ t as Default,
122
+ g as NoImage,
138
123
  y as Selected,
139
- h as Small,
124
+ f as Small,
140
125
  u as default
141
126
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cgi-learning-hub/ui",
3
- "version": "1.3.5-dev.1737994728",
3
+ "version": "1.3.5-dev.1738155719",
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",