@cgi-learning-hub/ui 1.3.5-dev.1738162166 → 1.3.5-dev.1738162735

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,135 +0,0 @@
1
- import { jsx as r, jsxs as d } from "react/jsx-runtime";
2
- import { Stack as h, Tooltip as b } from "@mui/material";
3
- import { c as f } from "../../createSvgIcon-C9kh-71a.js";
4
- import { StyledCard as g, SelectedIcon as y, ResourceCardImage as x, ResourceCardBody as P, ResourcePropertyItem as R, ResourcePropertyText as I, PublicIconWrapper as D, ResourceIconItem as $ } from "./style.es.js";
5
- import v from "../EllipsisWithTooltip/EllipsisWithTooltip.es.js";
6
- const w = f(/* @__PURE__ */ r("path", {
7
- 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"
8
- }), "MoreVert"), W = ({
9
- isSelected: c = !1,
10
- onSelect: i = () => {
11
- },
12
- image: m,
13
- title: n,
14
- defaultImage: u,
15
- propertyItems: p = [],
16
- infoIcons: a = [],
17
- size: t = "md",
18
- width: s,
19
- onClick: l = () => {
20
- }
21
- }) => (a = a.slice(0, 3), /* @__PURE__ */ d(
22
- g,
23
- {
24
- selected: c,
25
- size: t,
26
- onClick: l,
27
- width: s,
28
- onKeyDown: (e) => {
29
- (e.key === "Enter" || e.key === " ") && (e.preventDefault(), l == null || l());
30
- },
31
- role: "button",
32
- tabIndex: 0,
33
- "aria-label": `Resource card for ${n}`,
34
- children: [
35
- /* @__PURE__ */ r(
36
- y,
37
- {
38
- onClick: (e) => {
39
- e.preventDefault(), e.stopPropagation(), i();
40
- },
41
- onKeyDown: (e) => {
42
- (e.key === "Enter" || e.key === " ") && (e.preventDefault(), e.stopPropagation(), i());
43
- },
44
- className: "selected-icon",
45
- selected: c,
46
- role: "button",
47
- tabIndex: 0,
48
- "aria-label": c ? "Unselect card" : "Select card",
49
- children: /* @__PURE__ */ r(w, {})
50
- }
51
- ),
52
- /* @__PURE__ */ r(h, { sx: {
53
- width: t == "sm" ? 110 : "100%",
54
- display: "flex",
55
- alignItems: "center",
56
- justifyContent: "center",
57
- boxSizing: "border-box"
58
- }, children: /* @__PURE__ */ r(
59
- x,
60
- {
61
- image: m,
62
- defaultImage: u,
63
- size: t,
64
- role: "img",
65
- "aria-label": `Image for ${n}`
66
- }
67
- ) }),
68
- /* @__PURE__ */ d(
69
- P,
70
- {
71
- size: t,
72
- children: [
73
- /* @__PURE__ */ r(
74
- v,
75
- {
76
- typographyProps: { fontWeight: "700", fontSize: "1.1rem" },
77
- tooltipProps: { placement: "bottom", arrow: !0 },
78
- children: n
79
- }
80
- ),
81
- p.length > 0 && p.map((e, o) => /* @__PURE__ */ d(
82
- R,
83
- {
84
- size: t,
85
- role: "group",
86
- "aria-label": `Property ${o}`,
87
- children: [
88
- e.icon,
89
- /* @__PURE__ */ r(
90
- I,
91
- {
92
- isLast: o === p.length - 1,
93
- size: t,
94
- width: s,
95
- children: e.text
96
- }
97
- )
98
- ]
99
- },
100
- `property-${o}`
101
- )),
102
- /* @__PURE__ */ r(
103
- D,
104
- {
105
- size: t,
106
- children: a.length > 0 && a.map((e, o) => /* @__PURE__ */ r(
107
- b,
108
- {
109
- title: e.text,
110
- placement: "top",
111
- arrow: !0,
112
- children: /* @__PURE__ */ r(
113
- $,
114
- {
115
- size: t,
116
- role: "button",
117
- tabIndex: 0,
118
- "aria-label": e.text,
119
- children: e.icon
120
- }
121
- )
122
- },
123
- `info-${o}`
124
- ))
125
- }
126
- )
127
- ]
128
- }
129
- )
130
- ]
131
- }
132
- ));
133
- export {
134
- W as default
135
- };
@@ -1 +0,0 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./ResourceCard.cjs.js");exports.ResourceCard=e;
@@ -1,2 +0,0 @@
1
- export * from './ResourceCard';
2
- export { default as ResourceCard } from './ResourceCard';
@@ -1,4 +0,0 @@
1
- import { default as a } from "./ResourceCard.es.js";
2
- export {
3
- a as ResourceCard
4
- };
@@ -1 +0,0 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("@mui/material"),a=t.styled(t.Card)(({theme:e,selected:o,size:r,width:i})=>({boxShadow:"0px 4px 12px rgba(0, 0, 0, 0.1), 0px 2px 4px rgba(0, 0, 0, 0.06)",borderRadius:"0.5rem",width:i&&r==="md"?i:"320px",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"}}})),s=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}})),n=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"}})),p=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%"})),d=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"}})),l=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"}}})),m=t.styled(t.Box)(({size:e})=>({position:"absolute",bottom:e==="sm"?".65rem":"16px",right:e==="sm"?"8px":"16px",display:"flex",gap:".2rem"}));exports.PublicIconWrapper=m;exports.ResourceCardBody=p;exports.ResourceCardImage=n;exports.ResourceIconItem=l;exports.ResourcePropertyItem=d;exports.ResourcePropertyText=c;exports.SelectedIcon=s;exports.StyledCard=a;
@@ -1,118 +0,0 @@
1
- import { styled as t, Card as p, Box as r, CardMedia as n, CardContent as s } from "@mui/material";
2
- const c = t(p)(({ theme: e, selected: o, size: i, width: a }) => ({
3
- boxShadow: "0px 4px 12px rgba(0, 0, 0, 0.1), 0px 2px 4px rgba(0, 0, 0, 0.06)",
4
- borderRadius: "0.5rem",
5
- width: a && i === "md" ? a : "320px",
6
- height: "auto",
7
- border: "2px solid transparent",
8
- transition: "border-color 0.2s ease-in-out",
9
- position: "relative",
10
- ...i === "sm" && {
11
- display: "flex",
12
- width: "100%"
13
- },
14
- ...o && {
15
- borderColor: e.palette.primary.light
16
- },
17
- "&:hover": {
18
- "& .MuiBox-root.selected-icon": {
19
- opacity: 1,
20
- visibility: "visible"
21
- }
22
- }
23
- })), d = t(r)(({ 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 && {
40
- background: e.palette.primary.lighter,
41
- opacity: 1,
42
- visibility: "visible"
43
- },
44
- "&:hover, &:focus": {
45
- background: e.palette.primary.lighter,
46
- opacity: 1
47
- },
48
- "& .MuiSvgIcon-root": {
49
- color: e.palette.primary.main
50
- }
51
- })), l = t(n)(({ size: e, image: o, defaultImage: i }) => ({
52
- height: e == "sm" ? 85 : 180,
53
- width: e == "sm" ? 85 : "calc(100% - 2rem)",
54
- objectFit: "cover",
55
- margin: e == "sm" ? "0 10px" : "1rem",
56
- borderRadius: "0.5rem",
57
- ...!o && e === "md" && {
58
- backgroundImage: `url(${i})`,
59
- backgroundRepeat: "repeat",
60
- backgroundSize: "20% 20%",
61
- backgroundPosition: "center",
62
- opacity: "0.7"
63
- }
64
- })), g = t(s)(({ size: e }) => ({
65
- padding: e == "sm" ? ".7rem 5px .7rem 0 !important" : "0 16px 16px 16px !important",
66
- width: e === "sm" ? "calc(100% - 110px)" : "100%"
67
- })), x = t(r)(({ size: e }) => ({
68
- display: "flex",
69
- alignItems: "center",
70
- marginTop: "0.5rem",
71
- ...e === "sm" && {
72
- svg: {
73
- width: ".8em",
74
- height: ".8em"
75
- }
76
- }
77
- })), u = t(r)(({ size: e, width: o, isLast: i }) => ({
78
- marginLeft: e === "sm" ? ".3rem" : ".5rem",
79
- fontSize: e === "sm" ? "12px" : "15px",
80
- "& .MuiTypography-root": {
81
- paddingTop: "2px",
82
- fontSize: e === "sm" ? "12px" : "15px"
83
- },
84
- ...i && !o && {
85
- textOverflow: "ellipsis",
86
- whiteSpace: "nowrap",
87
- overflow: "hidden",
88
- maxWidth: e === "sm" ? "110px" : "172px"
89
- }
90
- })), h = t(r)(({ size: e }) => ({
91
- display: "inline-flex",
92
- alignItems: "center",
93
- justifyContent: "center",
94
- width: "fit-content",
95
- height: "fit-content",
96
- ...e === "sm" && {
97
- svg: {
98
- width: ".8em",
99
- height: ".8em"
100
- }
101
- }
102
- })), b = t(r)(({ size: e }) => ({
103
- position: "absolute",
104
- bottom: e === "sm" ? ".65rem" : "16px",
105
- right: e === "sm" ? "8px" : "16px",
106
- display: "flex",
107
- gap: ".2rem"
108
- }));
109
- export {
110
- b as PublicIconWrapper,
111
- g as ResourceCardBody,
112
- l as ResourceCardImage,
113
- h as ResourceIconItem,
114
- x as ResourcePropertyItem,
115
- u as ResourcePropertyText,
116
- d as SelectedIcon,
117
- c as StyledCard
118
- };
@@ -1 +0,0 @@
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,argTypes:{title:{description:"Titre de la carte.",control:"text",table:{type:{summary:"string"}},required:!0},defaultImage:{description:"Image par défaut => 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",defaultImage:"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;
@@ -1,9 +0,0 @@
1
- import { Meta, StoryObj } from '@storybook/react';
2
- import { default as ResourceCard } from '../ResourceCard/ResourceCard';
3
- declare const meta: Meta<typeof ResourceCard>;
4
- export default meta;
5
- type Story = StoryObj<typeof ResourceCard>;
6
- export declare const Default: Story;
7
- export declare const Selected: Story;
8
- export declare const Small: Story;
9
- export declare const NoImage: Story;
@@ -1,135 +0,0 @@
1
- import { jsx as e } from "react/jsx-runtime";
2
- import c from "../ResourceCard/ResourceCard.es.js";
3
- import { c as o } from "../../createSvgIcon-C9kh-71a.js";
4
- import { Typography as r } from "@mui/material";
5
- const i = o(/* @__PURE__ */ e("path", {
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"), s = o(/* @__PURE__ */ e("path", {
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 = o(/* @__PURE__ */ e("path", {
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"), a = o(/* @__PURE__ */ e("path", {
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
- }), "Star"), u = {
14
- title: "Components/ResourceCard",
15
- component: c,
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
- defaultImage: {
26
- description: "Image par défaut => Logo de l'application",
27
- control: "text",
28
- table: {
29
- type: { summary: "string" }
30
- },
31
- required: !0
32
- },
33
- isSelected: {
34
- description: "Indique si la carte est sélectionnée.",
35
- control: "boolean",
36
- table: {
37
- type: { summary: "boolean" },
38
- defaultValue: { summary: "false" }
39
- }
40
- },
41
- onSelect: {
42
- description: "Callback déclenché lorsque l'utilisateur sélectionne la carte.",
43
- action: "card-selected",
44
- table: {
45
- type: { summary: "() => void" }
46
- }
47
- },
48
- image: {
49
- description: "URL de l'image affichée sur la carte.",
50
- control: "text",
51
- table: {
52
- type: { summary: "string" }
53
- }
54
- },
55
- propertyItems: {
56
- description: "Liste des propriétés affichées sous le titre.",
57
- control: "object",
58
- table: {
59
- type: { summary: "PropertyItem[{text: Typography, icon: MuiIcon}]" }
60
- }
61
- },
62
- infoIcons: {
63
- description: "Liste des icônes d'information affichées dans la carte. (3 maximums)",
64
- control: "object",
65
- table: {
66
- type: { summary: "InfoItem[{text: string, icon: MuiIcon}]" }
67
- }
68
- },
69
- size: {
70
- description: "Taille de la carte (petite ou moyenne).",
71
- control: "radio",
72
- options: ["sm", "md"],
73
- table: {
74
- type: { summary: '"sm" | "md"' },
75
- defaultValue: { summary: "md" }
76
- }
77
- },
78
- width: {
79
- description: "Largeur de la carte.",
80
- control: "text",
81
- table: {
82
- type: { summary: "string" },
83
- defaultValue: { summary: "320px" }
84
- }
85
- }
86
- }
87
- }, t = {
88
- args: {
89
- isSelected: !1,
90
- image: "https://dummyimage.com/600x400/000/fff.png&text=flashquizz",
91
- defaultImage: "https://flashquizz-dev.support-ent.fr/images/logo.svg",
92
- title: "Titre de la Ressource tres loooooooooooooooooooooooooooooooooooooooooooooooooooooong",
93
- propertyItems: [
94
- { text: /* @__PURE__ */ e(r, { color: "text.primary", children: "0 questions" }), icon: /* @__PURE__ */ e(s, { color: "primary" }) },
95
- { text: /* @__PURE__ */ e(r, { color: "text.primary", children: "27 septembre 2025" }), icon: /* @__PURE__ */ e(i, { color: "primary" }) }
96
- ],
97
- infoIcons: [
98
- { text: "Information 1", icon: /* @__PURE__ */ e(l, { color: "primary" }) },
99
- { text: "Information 2", icon: /* @__PURE__ */ e(a, { color: "primary" }) },
100
- { text: "Information 3", icon: /* @__PURE__ */ e(a, { color: "primary" }) }
101
- ],
102
- size: "md",
103
- onSelect: () => {
104
- console.log("Carte sélectionnée !");
105
- },
106
- onClick: () => {
107
- console.log("Select all");
108
- }
109
- }
110
- }, y = {
111
- args: {
112
- ...t.args,
113
- isSelected: !0,
114
- title: "Carte Sélectionnée"
115
- }
116
- }, g = {
117
- args: {
118
- ...t.args,
119
- size: "sm",
120
- title: "Petite Carte"
121
- }
122
- }, f = {
123
- args: {
124
- ...t.args,
125
- title: "Pas d'image",
126
- image: void 0
127
- }
128
- };
129
- export {
130
- t as Default,
131
- f as NoImage,
132
- y as Selected,
133
- g as Small,
134
- u as default
135
- };