@cgi-learning-hub/ui 1.4.0-dev.1742203139 → 1.4.0-dev.1742204063
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";const r=require("react/jsx-runtime"),
|
|
1
|
+
"use strict";const r=require("react/jsx-runtime"),x=require("../../createSvgIcon-DJMYlO0S.cjs"),h=require("../../MoreVert-CxgmXooO.cjs"),s=require("@mui/material"),p=require("../EllipsisWithTooltip/EllipsisWithTooltip.cjs.js"),c=require("./styles.cjs.js"),d=require("../ResourceCard/style.cjs.js"),i=require("./types.cjs.js"),m=x.createSvgIcon(r.jsx("path",{d:"M10 4H4c-1.1 0-1.99.9-1.99 2L2 18c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V8c0-1.1-.9-2-2-2h-8z"}),"Folder"),j=({isSelected:o=!1,onSelect:n=()=>{},title:u,subtitle:l,width:y,onClick:t=()=>{}})=>{const a=e=>e.key==="Enter"||e.key===" ";return r.jsx(s.Box,{sx:{width:y||"320px"},children:r.jsxs(d.StyledCard,{selected:o,onClick:t,onKeyDown:e=>{a(e)&&(e.preventDefault(),t==null||t())},role:"button",tabIndex:0,"aria-labelledby":"folder-title folder-subtitle","aria-pressed":o,children:[r.jsx(d.SelectedIcon,{onClick:e=>{e.preventDefault(),e.stopPropagation(),n()},onKeyDown:e=>{a(e)&&(e.preventDefault(),e.stopPropagation(),n())},className:"selected-icon",selected:o,role:"button",tabIndex:0,"aria-label":o?"Unselect folder":"Select folder","aria-pressed":o,children:r.jsx(h.MoreVertIcon,{})}),r.jsxs(s.CardContent,{sx:c.FolderBodyStyle,children:[r.jsx(m,{color:"primary",sx:c.FolderIconStyle,"aria-hidden":"true"}),r.jsxs(s.Box,{children:[r.jsx(p,{typographyProps:i.titleTypographyProps,tooltipProps:{placement:"bottom",arrow:!0},children:u}),l&&r.jsx(p,{typographyProps:i.subtitleTypographyProps,tooltipProps:{placement:"bottom",arrow:!0},children:l})]})]})]})})};module.exports=j;
|
|
@@ -1,77 +1,80 @@
|
|
|
1
1
|
import { jsx as o, jsxs as a } from "react/jsx-runtime";
|
|
2
|
-
import { c } from "../../createSvgIcon-K2ZAdASa.js";
|
|
3
|
-
import { M as
|
|
4
|
-
import { Box as
|
|
5
|
-
import
|
|
6
|
-
import { FolderBodyStyle as
|
|
7
|
-
import { StyledCard as
|
|
8
|
-
import { titleTypographyProps as
|
|
9
|
-
const
|
|
2
|
+
import { c as m } from "../../createSvgIcon-K2ZAdASa.js";
|
|
3
|
+
import { M as f } from "../../MoreVert-CrM_1EkN.js";
|
|
4
|
+
import { Box as d, CardContent as y } from "@mui/material";
|
|
5
|
+
import s from "../EllipsisWithTooltip/EllipsisWithTooltip.es.js";
|
|
6
|
+
import { FolderBodyStyle as h, FolderIconStyle as u } from "./styles.es.js";
|
|
7
|
+
import { StyledCard as b, SelectedIcon as x } from "../ResourceCard/style.es.js";
|
|
8
|
+
import { titleTypographyProps as P, subtitleTypographyProps as g } from "./types.es.js";
|
|
9
|
+
const I = m(/* @__PURE__ */ o("path", {
|
|
10
10
|
d: "M10 4H4c-1.1 0-1.99.9-1.99 2L2 18c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V8c0-1.1-.9-2-2-2h-8z"
|
|
11
|
-
}), "Folder"),
|
|
11
|
+
}), "Folder"), B = ({
|
|
12
12
|
isSelected: e = !1,
|
|
13
|
-
onSelect:
|
|
13
|
+
onSelect: l = () => {
|
|
14
14
|
},
|
|
15
15
|
title: i,
|
|
16
|
-
subtitle:
|
|
17
|
-
width:
|
|
16
|
+
subtitle: p,
|
|
17
|
+
width: c,
|
|
18
18
|
onClick: t = () => {
|
|
19
19
|
}
|
|
20
|
-
}) =>
|
|
21
|
-
|
|
22
|
-
{
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
/* @__PURE__ */ a(
|
|
54
|
-
/* @__PURE__ */ o(
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
20
|
+
}) => {
|
|
21
|
+
const n = (r) => r.key === "Enter" || r.key === " ";
|
|
22
|
+
return /* @__PURE__ */ o(d, { sx: { width: c || "320px" }, children: /* @__PURE__ */ a(
|
|
23
|
+
b,
|
|
24
|
+
{
|
|
25
|
+
selected: e,
|
|
26
|
+
onClick: t,
|
|
27
|
+
onKeyDown: (r) => {
|
|
28
|
+
n(r) && (r.preventDefault(), t == null || t());
|
|
29
|
+
},
|
|
30
|
+
role: "button",
|
|
31
|
+
tabIndex: 0,
|
|
32
|
+
"aria-labelledby": "folder-title folder-subtitle",
|
|
33
|
+
"aria-pressed": e,
|
|
34
|
+
children: [
|
|
35
|
+
/* @__PURE__ */ o(
|
|
36
|
+
x,
|
|
37
|
+
{
|
|
38
|
+
onClick: (r) => {
|
|
39
|
+
r.preventDefault(), r.stopPropagation(), l();
|
|
40
|
+
},
|
|
41
|
+
onKeyDown: (r) => {
|
|
42
|
+
n(r) && (r.preventDefault(), r.stopPropagation(), l());
|
|
43
|
+
},
|
|
44
|
+
className: "selected-icon",
|
|
45
|
+
selected: e,
|
|
46
|
+
role: "button",
|
|
47
|
+
tabIndex: 0,
|
|
48
|
+
"aria-label": e ? "Unselect folder" : "Select folder",
|
|
49
|
+
"aria-pressed": e,
|
|
50
|
+
children: /* @__PURE__ */ o(f, {})
|
|
51
|
+
}
|
|
52
|
+
),
|
|
53
|
+
/* @__PURE__ */ a(y, { sx: h, children: [
|
|
54
|
+
/* @__PURE__ */ o(I, { color: "primary", sx: u, "aria-hidden": "true" }),
|
|
55
|
+
/* @__PURE__ */ a(d, { children: [
|
|
56
|
+
/* @__PURE__ */ o(
|
|
57
|
+
s,
|
|
58
|
+
{
|
|
59
|
+
typographyProps: P,
|
|
60
|
+
tooltipProps: { placement: "bottom", arrow: !0 },
|
|
61
|
+
children: i
|
|
62
|
+
}
|
|
63
|
+
),
|
|
64
|
+
p && /* @__PURE__ */ o(
|
|
65
|
+
s,
|
|
66
|
+
{
|
|
67
|
+
typographyProps: g,
|
|
68
|
+
tooltipProps: { placement: "bottom", arrow: !0 },
|
|
69
|
+
children: p
|
|
70
|
+
}
|
|
71
|
+
)
|
|
72
|
+
] })
|
|
70
73
|
] })
|
|
71
|
-
]
|
|
72
|
-
|
|
73
|
-
}
|
|
74
|
-
|
|
74
|
+
]
|
|
75
|
+
}
|
|
76
|
+
) });
|
|
77
|
+
};
|
|
75
78
|
export {
|
|
76
|
-
|
|
79
|
+
B as default
|
|
77
80
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cgi-learning-hub/ui",
|
|
3
|
-
"version": "1.4.0-dev.
|
|
3
|
+
"version": "1.4.0-dev.1742204063",
|
|
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",
|