@cgi-learning-hub/ui 1.4.0-dev.1742203139 → 1.4.0-dev.1742207843

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"),u=require("../../createSvgIcon-DJMYlO0S.cjs"),x=require("../../MoreVert-CxgmXooO.cjs"),s=require("@mui/material"),a=require("../EllipsisWithTooltip/EllipsisWithTooltip.cjs.js"),p=require("./styles.cjs.js"),c=require("../ResourceCard/style.cjs.js"),i=require("./types.cjs.js"),h=u.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"),m=({isSelected:o=!1,onSelect:n=()=>{},title:d,subtitle:l,width:y,onClick:t=()=>{}})=>r.jsx(s.Box,{sx:{width:y||"320px"},children:r.jsxs(c.StyledCard,{selected:o,onClick:t,onKeyDown:e=>{(e.key==="Enter"||e.key===" ")&&(e.preventDefault(),t==null||t())},role:"button",tabIndex:0,"aria-labelledby":"folder-title folder-subtitle","aria-pressed":o,children:[r.jsx(c.SelectedIcon,{onClick:e=>{e.preventDefault(),e.stopPropagation(),n()},onKeyDown:e=>{(e.key==="Enter"||e.key===" ")&&(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(x.MoreVertIcon,{})}),r.jsxs(s.CardContent,{sx:p.FolderBodyStyle,children:[r.jsx(h,{color:"primary",sx:p.FolderIconStyle,"aria-hidden":"true"}),r.jsxs(s.Box,{children:[r.jsx(a,{typographyProps:i.titleTypographyProps,tooltipProps:{placement:"bottom",arrow:!0},children:d}),l&&r.jsx(a,{typographyProps:i.subtitleTypographyProps,tooltipProps:{placement:"bottom",arrow:!0},children:l})]})]})]})});module.exports=m;
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 m } from "../../MoreVert-CrM_1EkN.js";
4
- import { Box as n, CardContent as y } from "@mui/material";
5
- import d from "../EllipsisWithTooltip/EllipsisWithTooltip.es.js";
6
- import { FolderBodyStyle as f, FolderIconStyle as h } from "./styles.es.js";
7
- import { StyledCard as u, SelectedIcon as b } from "../ResourceCard/style.es.js";
8
- import { titleTypographyProps as x, subtitleTypographyProps as P } from "./types.es.js";
9
- const g = c(/* @__PURE__ */ o("path", {
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"), j = ({
11
+ }), "Folder"), B = ({
12
12
  isSelected: e = !1,
13
- onSelect: p = () => {
13
+ onSelect: l = () => {
14
14
  },
15
15
  title: i,
16
- subtitle: l,
17
- width: s,
16
+ subtitle: p,
17
+ width: c,
18
18
  onClick: t = () => {
19
19
  }
20
- }) => /* @__PURE__ */ o(n, { sx: { width: s || "320px" }, children: /* @__PURE__ */ a(
21
- u,
22
- {
23
- selected: e,
24
- onClick: t,
25
- onKeyDown: (r) => {
26
- (r.key === "Enter" || r.key === " ") && (r.preventDefault(), t == null || t());
27
- },
28
- role: "button",
29
- tabIndex: 0,
30
- "aria-labelledby": "folder-title folder-subtitle",
31
- "aria-pressed": e,
32
- children: [
33
- /* @__PURE__ */ o(
34
- b,
35
- {
36
- onClick: (r) => {
37
- r.preventDefault(), r.stopPropagation(), p();
38
- },
39
- onKeyDown: (r) => {
40
- (r.key === "Enter" || r.key === " ") && (r.preventDefault(), r.stopPropagation(), p());
41
- },
42
- className: "selected-icon",
43
- selected: e,
44
- role: "button",
45
- tabIndex: 0,
46
- "aria-label": e ? "Unselect folder" : "Select folder",
47
- "aria-pressed": e,
48
- children: /* @__PURE__ */ o(m, {})
49
- }
50
- ),
51
- /* @__PURE__ */ a(y, { sx: f, children: [
52
- /* @__PURE__ */ o(g, { color: "primary", sx: h, "aria-hidden": "true" }),
53
- /* @__PURE__ */ a(n, { children: [
54
- /* @__PURE__ */ o(
55
- d,
56
- {
57
- typographyProps: x,
58
- tooltipProps: { placement: "bottom", arrow: !0 },
59
- children: i
60
- }
61
- ),
62
- l && /* @__PURE__ */ o(
63
- d,
64
- {
65
- typographyProps: P,
66
- tooltipProps: { placement: "bottom", arrow: !0 },
67
- children: l
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
- j as default
79
+ B as default
77
80
  };
@@ -1 +1 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const t=require("../FolderCard/FolderCard.cjs.js"),l={title:"Components/ResourceFolder",component:t,argTypes:{title:{description:"Title of the folder.",control:"text",table:{type:{summary:"string"}},required:!0},subtitle:{description:"Subtitle of the folder.",control:"text",table:{type:{summary:"string"}},required:!0},isSelected:{description:"Indicates if the folder is selected.",control:"boolean",table:{type:{summary:"boolean"},defaultValue:{summary:"false"}}},onSelect:{description:"Callback triggered when the folder is selected.",action:"folder-selected",table:{type:{summary:"() => void"}}},width:{description:"Width of the folder.",control:"text",table:{type:{summary:"string"},defaultValue:{summary:"320px"}}},onClick:{description:"Callback triggered on click.",action:"clicked",table:{type:{summary:"() => void"}}}}},e={args:{title:"Mon premier dossier",subtitle:"0 dossier(s), 1 formulaire(s)",isSelected:!1,width:"320px"}},r={args:{...e.args,isSelected:!0,title:"Selected Folder"}};exports.Default=e;exports.Selected=r;exports.default=l;
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const t=require("../FolderCard/FolderCard.cjs.js"),l={title:"Components/FolderCard",component:t,argTypes:{title:{description:"Title of the folder.",control:"text",table:{type:{summary:"string"}},required:!0},subtitle:{description:"Subtitle of the folder.",control:"text",table:{type:{summary:"string"}},required:!0},isSelected:{description:"Indicates if the folder is selected.",control:"boolean",table:{type:{summary:"boolean"},defaultValue:{summary:"false"}}},onSelect:{description:"Callback triggered when the folder is selected.",action:"folder-selected",table:{type:{summary:"() => void"}}},width:{description:"Width of the folder.",control:"text",table:{type:{summary:"string"},defaultValue:{summary:"320px"}}},onClick:{description:"Callback triggered on click.",action:"clicked",table:{type:{summary:"() => void"}}}}},e={args:{title:"Mon premier dossier",subtitle:"0 dossier(s), 1 formulaire(s)",isSelected:!1,width:"320px"}},r={args:{...e.args,isSelected:!0,title:"Selected Folder"}};exports.Default=e;exports.Selected=r;exports.default=l;
@@ -1,6 +1,6 @@
1
1
  import e from "../FolderCard/FolderCard.es.js";
2
2
  const l = {
3
- title: "Components/ResourceFolder",
3
+ title: "Components/FolderCard",
4
4
  component: e,
5
5
  argTypes: {
6
6
  title: {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cgi-learning-hub/ui",
3
- "version": "1.4.0-dev.1742203139",
3
+ "version": "1.4.0-dev.1742207843",
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",