@cgi-learning-hub/ui 1.3.5-dev.1738159504 → 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.
- package/package.json +1 -1
- package/dist/components/ResourceCard/ResourceCard.cjs.js +0 -1
- package/dist/components/ResourceCard/ResourceCard.d.ts +0 -23
- package/dist/components/ResourceCard/ResourceCard.es.js +0 -139
- package/dist/components/ResourceCard/style.cjs.js +0 -1
- package/dist/components/ResourceCard/style.es.js +0 -116
- package/dist/components/stories/ResourceCard.stories.cjs.js +0 -1
- package/dist/components/stories/ResourceCard.stories.d.ts +0 -9
- package/dist/components/stories/ResourceCard.stories.es.js +0 -135
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cgi-learning-hub/ui",
|
|
3
|
-
"version": "1.3.5-dev.
|
|
3
|
+
"version": "1.3.5-dev.1738162735",
|
|
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",
|
|
@@ -1 +0,0 @@
|
|
|
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:c=!1,onSelect:p=()=>{},image:x,title:s,logo:h,propertyItems:i=[],infoIcons:l=[],size:t="md",width:d,onClick:n=()=>{}},m)=>(l=l.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:c,size:t,onClick:n,onKeyDown:e=>{(e.key==="Enter"||e.key===" ")&&(e.preventDefault(),n==null||n())},role:"button",tabIndex:0,"aria-label":`Resource card for ${s}`,children:[r.jsx(o.SelectedIcon,{onClick:e=>{e.preventDefault(),e.stopPropagation(),p()},onKeyDown:e=>{(e.key==="Enter"||e.key===" ")&&(e.preventDefault(),e.stopPropagation(),p())},className:"selected-icon",selected:c,role:"button",tabIndex:0,"aria-label":c?"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:l.length>0&&l.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;
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import { ReactNode } from 'react';
|
|
2
|
-
export type PropertyItem = {
|
|
3
|
-
text: ReactNode;
|
|
4
|
-
icon?: ReactNode;
|
|
5
|
-
};
|
|
6
|
-
export type InfoItem = {
|
|
7
|
-
text: string;
|
|
8
|
-
icon: ReactNode;
|
|
9
|
-
};
|
|
10
|
-
export type ResourceCardSize = "md" | "sm";
|
|
11
|
-
export interface ResourceCardProps {
|
|
12
|
-
isSelected?: boolean;
|
|
13
|
-
onSelect?: () => void;
|
|
14
|
-
image?: string;
|
|
15
|
-
logo: string;
|
|
16
|
-
title: string;
|
|
17
|
-
propertyItems?: PropertyItem[];
|
|
18
|
-
infoIcons?: InfoItem[];
|
|
19
|
-
size?: ResourceCardSize;
|
|
20
|
-
width?: string;
|
|
21
|
-
onClick?: () => void;
|
|
22
|
-
}
|
|
23
|
-
export declare const ResourceCard: import('react').ForwardRefExoticComponent<ResourceCardProps & import('react').RefAttributes<HTMLDivElement>>;
|
|
@@ -1,139 +0,0 @@
|
|
|
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 g } from "react";
|
|
4
|
-
import { c as x } from "../../createSvgIcon-C9kh-71a.js";
|
|
5
|
-
import { StyledCard as y, SelectedIcon as P, ResourceCardImage as R, ResourceCardBody as I, ResourcePropertyItem as v, ResourcePropertyText as w, PublicIconWrapper as D, ResourceIconItem as $ } from "./style.es.js";
|
|
6
|
-
import j from "../EllipsisWithTooltip/EllipsisWithTooltip.es.js";
|
|
7
|
-
const E = x(/* @__PURE__ */ r("path", {
|
|
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(({
|
|
10
|
-
isSelected: n = !1,
|
|
11
|
-
onSelect: m = () => {
|
|
12
|
-
},
|
|
13
|
-
image: h,
|
|
14
|
-
title: c,
|
|
15
|
-
logo: u,
|
|
16
|
-
propertyItems: p = [],
|
|
17
|
-
infoIcons: a = [],
|
|
18
|
-
size: t = "md",
|
|
19
|
-
width: d,
|
|
20
|
-
onClick: l = () => {
|
|
21
|
-
}
|
|
22
|
-
}, b) => (a = a.slice(0, 3), /* @__PURE__ */ r(s, { ref: b, sx: {
|
|
23
|
-
position: "relative",
|
|
24
|
-
width: d && t === "md" ? d : "320px",
|
|
25
|
-
height: "auto"
|
|
26
|
-
}, children: /* @__PURE__ */ i(
|
|
27
|
-
y,
|
|
28
|
-
{
|
|
29
|
-
selected: n,
|
|
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 ${c}`,
|
|
38
|
-
children: [
|
|
39
|
-
/* @__PURE__ */ r(
|
|
40
|
-
P,
|
|
41
|
-
{
|
|
42
|
-
onClick: (e) => {
|
|
43
|
-
e.preventDefault(), e.stopPropagation(), m();
|
|
44
|
-
},
|
|
45
|
-
onKeyDown: (e) => {
|
|
46
|
-
(e.key === "Enter" || e.key === " ") && (e.preventDefault(), e.stopPropagation(), m());
|
|
47
|
-
},
|
|
48
|
-
className: "selected-icon",
|
|
49
|
-
selected: n,
|
|
50
|
-
role: "button",
|
|
51
|
-
tabIndex: 0,
|
|
52
|
-
"aria-label": n ? "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
|
-
R,
|
|
64
|
-
{
|
|
65
|
-
image: h,
|
|
66
|
-
logo: u,
|
|
67
|
-
size: t,
|
|
68
|
-
role: "img",
|
|
69
|
-
"aria-label": `Image for ${c}`
|
|
70
|
-
}
|
|
71
|
-
) }),
|
|
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: c
|
|
83
|
-
}
|
|
84
|
-
),
|
|
85
|
-
p.length > 0 && p.map((e, o) => /* @__PURE__ */ i(
|
|
86
|
-
v,
|
|
87
|
-
{
|
|
88
|
-
size: t,
|
|
89
|
-
role: "group",
|
|
90
|
-
"aria-label": `Property ${o}`,
|
|
91
|
-
children: [
|
|
92
|
-
e.icon,
|
|
93
|
-
/* @__PURE__ */ r(
|
|
94
|
-
w,
|
|
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
|
-
D,
|
|
108
|
-
{
|
|
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
|
-
$,
|
|
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
|
-
))
|
|
129
|
-
}
|
|
130
|
-
)
|
|
131
|
-
]
|
|
132
|
-
}
|
|
133
|
-
)
|
|
134
|
-
]
|
|
135
|
-
}
|
|
136
|
-
) })));
|
|
137
|
-
export {
|
|
138
|
-
V as ResourceCard
|
|
139
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
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,116 +0,0 @@
|
|
|
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 }) => ({
|
|
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
|
-
border: "2px solid transparent",
|
|
6
|
-
transition: "border-color 0.2s ease-in-out",
|
|
7
|
-
position: "relative",
|
|
8
|
-
...i === "sm" && {
|
|
9
|
-
display: "flex",
|
|
10
|
-
width: "100%"
|
|
11
|
-
},
|
|
12
|
-
...o && {
|
|
13
|
-
borderColor: e.palette.primary.light
|
|
14
|
-
},
|
|
15
|
-
"&:hover": {
|
|
16
|
-
"& .MuiBox-root.selected-icon": {
|
|
17
|
-
opacity: 1,
|
|
18
|
-
visibility: "visible"
|
|
19
|
-
}
|
|
20
|
-
}
|
|
21
|
-
})), m = t(r)(({ theme: e, selected: o }) => ({
|
|
22
|
-
position: "absolute",
|
|
23
|
-
top: 0,
|
|
24
|
-
right: 0,
|
|
25
|
-
width: "2rem",
|
|
26
|
-
height: "2rem",
|
|
27
|
-
background: e.palette.common.white,
|
|
28
|
-
display: "flex",
|
|
29
|
-
justifyContent: "center",
|
|
30
|
-
alignItems: "center",
|
|
31
|
-
padding: ".8rem",
|
|
32
|
-
borderRadius: ".5rem",
|
|
33
|
-
visibility: "visible",
|
|
34
|
-
opacity: 0,
|
|
35
|
-
cursor: "pointer",
|
|
36
|
-
transition: "opacity 0.2s ease-in-out, visibility 0.2s ease-in-out",
|
|
37
|
-
...o && {
|
|
38
|
-
background: e.palette.primary.lighter,
|
|
39
|
-
opacity: 1,
|
|
40
|
-
visibility: "visible"
|
|
41
|
-
},
|
|
42
|
-
"&:hover, &:focus": {
|
|
43
|
-
background: e.palette.primary.lighter,
|
|
44
|
-
opacity: 1
|
|
45
|
-
},
|
|
46
|
-
"& .MuiSvgIcon-root": {
|
|
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
|
-
}
|
|
74
|
-
}
|
|
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 }) => ({
|
|
101
|
-
position: "absolute",
|
|
102
|
-
bottom: e === "sm" ? ".65rem" : "16px",
|
|
103
|
-
right: e === "sm" ? "8px" : "16px",
|
|
104
|
-
display: "flex",
|
|
105
|
-
gap: ".2rem"
|
|
106
|
-
}));
|
|
107
|
-
export {
|
|
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
|
|
116
|
-
};
|
|
@@ -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.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;
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { Meta, StoryObj } from '@storybook/react';
|
|
2
|
-
import { 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 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
|
-
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 = e(/* @__PURE__ */ o("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 = e(/* @__PURE__ */ o("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 = e(/* @__PURE__ */ o("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
|
-
logo: {
|
|
26
|
-
description: "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
|
-
logo: "https://flashquizz-dev.support-ent.fr/images/logo.svg",
|
|
92
|
-
title: "Titre de la Ressource tres loooooooooooooooooooooooooooooooooooooooooooooooooooooong",
|
|
93
|
-
propertyItems: [
|
|
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" }) }
|
|
96
|
-
],
|
|
97
|
-
infoIcons: [
|
|
98
|
-
{ text: "Information 1", icon: /* @__PURE__ */ o(l, { color: "primary" }) },
|
|
99
|
-
{ text: "Information 2", icon: /* @__PURE__ */ o(a, { color: "primary" }) },
|
|
100
|
-
{ text: "Information 3", icon: /* @__PURE__ */ o(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
|
-
};
|