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

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 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;
@@ -7,7 +7,7 @@ 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;
@@ -15,9 +15,8 @@ export interface ResourceCardProps {
15
15
  title: string;
16
16
  propertyItems?: PropertyItem[];
17
17
  infoIcons?: InfoItem[];
18
- size?: Size;
18
+ size?: ResourceCardSize;
19
19
  width?: string;
20
- height?: string;
20
+ onClick?: () => void;
21
21
  }
22
22
  export declare const ResourceCard: import('react').ForwardRefExoticComponent<ResourceCardProps & import('react').RefAttributes<HTMLDivElement>>;
23
- export {};
@@ -1,62 +1,129 @@
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";
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
6
  import P from "../EllipsisWithTooltip/EllipsisWithTooltip.es.js";
7
- const S = C(/* @__PURE__ */ e("path", {
7
+ const $ = y(/* @__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"), W = u(({
10
+ isSelected: i = !1,
11
+ onSelect: p = () => {
12
+ },
13
+ image: x,
14
+ title: c,
15
+ propertyItems: m = [],
16
+ infoIcons: a = [],
17
+ size: t = "md",
18
+ width: s,
19
+ onClick: n = () => {
20
+ }
21
+ }, h) => (a = a.slice(0, 3), /* @__PURE__ */ r(o, { ref: h, sx: {
11
22
  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
- ] }) })));
23
+ width: s && t === "md" ? s : "360px",
24
+ height: "auto"
25
+ }, children: /* @__PURE__ */ d(
26
+ w,
27
+ {
28
+ selected: i,
29
+ size: t,
30
+ onClick: n,
31
+ onKeyDown: (e) => {
32
+ (e.key === "Enter" || e.key === " ") && (e.preventDefault(), n == null || n());
33
+ },
34
+ role: "button",
35
+ tabIndex: 0,
36
+ "aria-label": `Resource card for ${c}`,
37
+ children: [
38
+ /* @__PURE__ */ r(
39
+ j,
40
+ {
41
+ onClick: (e) => {
42
+ e.stopPropagation(), p();
43
+ },
44
+ onKeyDown: (e) => {
45
+ (e.key === "Enter" || e.key === " ") && (e.preventDefault(), p());
46
+ },
47
+ className: "selected-icon",
48
+ selected: i,
49
+ role: "button",
50
+ tabIndex: 0,
51
+ "aria-label": i ? "Unselect card" : "Select card",
52
+ children: /* @__PURE__ */ r($, {})
53
+ }
54
+ ),
55
+ /* @__PURE__ */ r(o, { sx: {
56
+ width: t == "sm" ? 110 : "100%",
57
+ display: "flex",
58
+ alignItems: "center",
59
+ justifyContent: "center",
60
+ boxSizing: "border-box"
61
+ }, children: /* @__PURE__ */ r(
62
+ f,
63
+ {
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
+ },
72
+ role: "img",
73
+ "aria-label": `Image for ${c}`
74
+ }
75
+ ) }),
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,
106
+ {
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
118
+ }
119
+ )
120
+ },
121
+ `info-${l}`
122
+ )) })
123
+ ] })
124
+ ]
125
+ }
126
+ ) })));
60
127
  export {
61
- V as ResourceCard
128
+ W as ResourceCard
62
129
  };
@@ -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 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,14 +1,18 @@
1
- import { styled as e, Card as t, Box as o } from "@mui/material";
1
+ import { styled as t, Card as e, Box as a } from "@mui/material";
2
2
  const s = {
3
3
  display: "flex",
4
4
  marginTop: "0.5rem"
5
- }, n = e(t)(({ theme: i, selected: r }) => ({
5
+ }, l = t(e)(({ theme: i, selected: o, size: r }) => ({
6
6
  boxShadow: "0px 4px 12px rgba(0, 0, 0, 0.1), 0px 2px 4px rgba(0, 0, 0, 0.06)",
7
7
  borderRadius: "0.5rem",
8
8
  border: "2px solid transparent",
9
9
  transition: "border-color 0.2s ease-in-out",
10
10
  position: "relative",
11
- ...r && {
11
+ ...r === "sm" && {
12
+ display: "flex",
13
+ width: "100%"
14
+ },
15
+ ...o && {
12
16
  borderColor: i.palette.primary.light
13
17
  },
14
18
  "&:hover": {
@@ -17,14 +21,7 @@ const s = {
17
21
  visibility: "visible"
18
22
  }
19
23
  }
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 }) => ({
24
+ })), n = t(a)(({ theme: i, selected: o }) => ({
28
25
  position: "absolute",
29
26
  top: 0,
30
27
  right: 0,
@@ -36,32 +33,32 @@ const s = {
36
33
  alignItems: "center",
37
34
  padding: ".8rem",
38
35
  borderRadius: ".5rem",
39
- visibility: "hidden",
36
+ visibility: "visible",
40
37
  opacity: 0,
41
38
  cursor: "pointer",
42
39
  transition: "opacity 0.2s ease-in-out, visibility 0.2s ease-in-out",
43
- ...r && {
40
+ ...o && {
44
41
  background: i.palette.primary.lighter,
45
42
  opacity: 1,
46
43
  visibility: "visible"
47
44
  },
48
- "&:hover": {
49
- background: i.palette.primary.lighter
45
+ "&:hover, &:focus": {
46
+ background: i.palette.primary.lighter,
47
+ opacity: 1
50
48
  },
51
49
  "& .MuiSvgIcon-root": {
52
50
  color: i.palette.primary.main
53
51
  }
54
52
  })), d = {
55
53
  position: "absolute",
56
- bottom: ".8rem",
57
- right: ".8rem",
54
+ bottom: "16px",
55
+ right: "16px",
58
56
  display: "flex",
59
57
  gap: ".2rem"
60
58
  };
61
59
  export {
62
- p as ImageStyle,
63
60
  s as ItemCard,
64
61
  d as PublicIconWrapper,
65
- l as SelectedIcon,
66
- n as StyledCard
62
+ n as SelectedIcon,
63
+ l as StyledCard
67
64
  };
@@ -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"),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,14 +1,14 @@
1
- import { jsx as e } from "react/jsx-runtime";
1
+ import { jsx as o } from "react/jsx-runtime";
2
2
  import { ResourceCard as a } from "../ResourceCard/ResourceCard.es.js";
3
- import { c as t } from "../../createSvgIcon-C9kh-71a.js";
3
+ import { c as e } from "../../createSvgIcon-C9kh-71a.js";
4
4
  import { Typography as c } from "@mui/material";
5
- const s = t(/* @__PURE__ */ e("path", {
5
+ const s = 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"), i = 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"), r = 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",
@@ -73,69 +73,62 @@ const s = t(/* @__PURE__ */ e("path", {
73
73
  type: { summary: "string" },
74
74
  defaultValue: { summary: "300px" }
75
75
  }
76
- },
77
- height: {
78
- description: "Hauteur de la carte.",
79
- control: "text",
80
- table: {
81
- type: { summary: "string" },
82
- defaultValue: { summary: "auto" }
83
- }
84
76
  }
85
77
  }
86
- }, o = {
78
+ }, t = {
87
79
  args: {
88
80
  isSelected: !1,
89
81
  image: "https://dummyimage.com/600x400/000/fff&text=flashquizz",
90
- title: "Titre de la Ressource",
82
+ title: "Titre de la Ressource tres loooooooooooooooooooooooooooooooooooooooooooooooooooooong",
91
83
  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" }) }
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
86
  ],
95
87
  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" }) }
88
+ { 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
92
  ],
100
- size: "md",
101
- width: "300px",
102
- height: "auto",
93
+ size: "sm",
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 = {
113
+ }, h = {
120
114
  args: {
121
- ...o.args,
115
+ ...t.args,
122
116
  propertyItems: [],
123
117
  infoIcons: [],
124
118
  title: "Carte sans Icônes"
125
119
  }
126
120
  }, g = {
127
121
  args: {
128
- ...o.args,
122
+ ...t.args,
129
123
  width: "400px",
130
- height: "200px",
131
124
  title: "Carte avec taille personnalisée"
132
125
  }
133
126
  };
134
127
  export {
135
128
  g as CustomSize,
136
- o as Default,
137
- f as NoIcons,
129
+ t as Default,
130
+ h as NoIcons,
138
131
  y as Selected,
139
- h as Small,
132
+ f as Small,
140
133
  u as default
141
134
  };
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.1738080904",
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",