@cgi-learning-hub/ui 1.3.3-dev.1732627187 → 1.3.3-dev.1732633701

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 e=require("react/jsx-runtime"),h=require("../../createSvgIcon-DQqazotA.cjs"),v=require("../../Delete-Bb_PhA6v.cjs"),o=require("@mui/material"),z=require("react"),C=require("../../index-CEgiY5tJ.cjs"),S=require("../../Stack-elRjtOGk.cjs"),i=require("../../Typography-DyMSnhvs.cjs"),d=h.createSvgIcon(e.jsx("path",{d:"M19 7v2.99s-1.99.01-2 0V7h-3s.01-1.99 0-2h3V2h2v3h3v2zm-3 4V8h-3V5H5c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2v-8zM5 19l3-4 2 3 3-4 4 5z"}),"AddPhotoAlternate"),F=h.createSvgIcon(e.jsx("path",{d:"M3 17.25V21h3.75L17.81 9.94l-3.75-3.75zM20.71 7.04c.39-.39.39-1.02 0-1.41l-2.34-2.34a.996.996 0 0 0-1.41 0l-1.83 1.83 3.75 3.75z"}),"Create"),w=()=>e.jsxs(i.Typography,{textAlign:"center",children:[e.jsx(o.Box,{component:"span",fontWeight:"bold",children:"Glissez-déposez"})," ou ",e.jsx(o.Box,{component:"span",fontWeight:"bold",children:"cliquez"})," pour choisir une image"]}),D=()=>e.jsxs(i.Typography,{textAlign:"center",children:[e.jsx(o.Box,{component:"span",fontWeight:"bold",children:"Glissez"})," une image"]}),A=({defaultLabel:p=e.jsx(w,{}),dragLabel:g=e.jsx(D,{}),information:n,onFileChange:c=r=>{},width:x="100%",height:m="400px",...u})=>{const[r,s]=z.useState(null),j=t=>{const a=t[0]||null;s(a),c(a)},y=t=>{t.stopPropagation(),s(null),c(null)},b=t=>{t.stopPropagation(),l()},{open:l,getRootProps:f,getInputProps:k,isDragActive:I}=C.useDropzone({...u,maxFiles:1,onDropAccepted:j,accept:{"image/*":[".png",".jpeg",".jpg",".gif"]},noClick:!0});return e.jsxs(S.Stack,{direction:"column",justifyContent:"center",alignItems:"center",spacing:1,width:x,minWidth:"200px",minHeight:"200px",height:m,padding:1,border:"1px dashed",borderColor:"grey.main",borderRadius:1,sx:{cursor:"pointer",position:"relative",background:`${!r&&"linear-gradient(180deg, #F5F7F9 0%, #FFF 100%)"}`},...f({onClick:l}),children:[e.jsx("input",{...k()}),r?e.jsxs(e.Fragment,{children:[e.jsxs(o.Box,{sx:{position:"absolute",top:"0.5rem",right:"0.5rem",display:"flex",gap:"0.5rem"},children:[e.jsx(o.Box,{onClick:b,sx:{backgroundColor:"common.white",display:"flex",borderRadius:"3px",alignItems:"center",justifyContent:"center",boxShadow:1,width:"2rem",height:"2rem",cursor:"pointer","&:hover":{backgroundColor:"common.black","& .MuiSvgIcon-root":{fill:t=>t.palette.common.white}}},children:e.jsx(F,{fontSize:"small"})}),e.jsx(o.Box,{onClick:y,sx:{backgroundColor:"common.white",display:"flex",borderRadius:"3px",alignItems:"center",boxShadow:1,justifyContent:"center",width:"2rem",height:"2rem",cursor:"pointer","&:hover":{backgroundColor:"common.black","& .MuiSvgIcon-root":{fill:t=>t.palette.common.white}}},children:e.jsx(v.DeleteIcon,{fontSize:"small"})})]}),e.jsx("img",{src:URL.createObjectURL(r),alt:r.name,style:{width:"auto",height:"100%",maxWidth:"100%",objectFit:"cover",borderRadius:"8px"}})]}):e.jsx(e.Fragment,{children:I?e.jsxs(e.Fragment,{children:[e.jsx(d,{color:"primary",style:{width:"4rem",height:"4rem"}}),g,n&&e.jsx(i.Typography,{textAlign:"center",fontSize:"0.875rem",color:"grey",children:n})]}):e.jsxs(o.Box,{sx:{display:"flex",flexDirection:"column",alignItems:"center",padding:"0.5rem",gap:"0.5rem"},children:[e.jsx(d,{color:"primary",style:{width:"4rem",height:"4rem"}}),p,n&&e.jsx(i.Typography,{textAlign:"center",fontSize:"0.875rem",color:"grey",children:n})]})})]})};module.exports=A;
1
+ "use strict";const e=require("react/jsx-runtime"),p=require("../../createSvgIcon-DQqazotA.cjs"),I=require("../../Delete-Bb_PhA6v.cjs"),o=require("@mui/material"),S=require("react"),v=require("../../index-CEgiY5tJ.cjs"),C=require("../../Stack-elRjtOGk.cjs"),i=require("../../Typography-DyMSnhvs.cjs"),d=p.createSvgIcon(e.jsx("path",{d:"M19 7v2.99s-1.99.01-2 0V7h-3s.01-1.99 0-2h3V2h2v3h3v2zm-3 4V8h-3V5H5c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2v-8zM5 19l3-4 2 3 3-4 4 5z"}),"AddPhotoAlternate"),F=p.createSvgIcon(e.jsx("path",{d:"M3 17.25V21h3.75L17.81 9.94l-3.75-3.75zM20.71 7.04c.39-.39.39-1.02 0-1.41l-2.34-2.34a.996.996 0 0 0-1.41 0l-1.83 1.83 3.75 3.75z"}),"Create"),w=()=>e.jsxs(i.Typography,{textAlign:"center",fontSize:"14px",color:"grey.darker",children:[e.jsx(o.Box,{component:"span",fontWeight:"bold",children:"Glissez-déposez"})," ou ",e.jsx(o.Box,{component:"span",fontWeight:"bold",children:"cliquez"})," pour choisir une image"]}),D=()=>e.jsxs(i.Typography,{textAlign:"center",fontSize:"14px",color:"grey.darker",children:[e.jsx(o.Box,{component:"span",fontWeight:"bold",children:"Glissez"})," une image"]}),A=({defaultLabel:h=e.jsx(w,{}),dragLabel:x=e.jsx(D,{}),information:n,onFileChange:c=t=>{},width:g="160px",height:m="160px",...u})=>{const[t,s]=S.useState(null),j=r=>{const a=r[0]||null;s(a),c(a)},y=r=>{r.stopPropagation(),s(null),c(null)},b=r=>{r.stopPropagation(),l()},{open:l,getRootProps:f,getInputProps:k,isDragActive:z}=v.useDropzone({...u,maxFiles:1,onDropAccepted:j,accept:{"image/*":[".png",".jpeg",".jpg",".gif"]},noClick:!0});return e.jsxs(C.Stack,{direction:"column",justifyContent:"center",alignItems:"center",width:g,minWidth:"150px",minHeight:"150px",height:m,borderRadius:1,sx:{cursor:"pointer",position:"relative",background:`${!t&&"linear-gradient(180deg, #F5F7F9 0%, #FFF 100%)"}`,border:`${!t&&"1px dashed"}`,borderColor:r=>!t&&r.palette.grey.main},...f({onClick:l}),children:[e.jsx("input",{...k()}),t?e.jsxs(e.Fragment,{children:[e.jsxs(o.Box,{sx:{position:"absolute",top:"0.5rem",right:"0.5rem",display:"flex",gap:"0.3rem"},children:[e.jsx(o.Box,{onClick:b,sx:{backgroundColor:"common.white",display:"flex",borderRadius:"3px",alignItems:"center",justifyContent:"center",boxShadow:1,width:"2rem",height:"2rem",cursor:"pointer","&:hover":{backgroundColor:"grey.darker","& .MuiSvgIcon-root":{fill:r=>r.palette.common.white}}},children:e.jsx(F,{fontSize:"small"})}),e.jsx(o.Box,{onClick:y,sx:{backgroundColor:"common.white",display:"flex",borderRadius:"3px",alignItems:"center",boxShadow:1,justifyContent:"center",width:"2rem",height:"2rem",cursor:"pointer","&:hover":{backgroundColor:"grey.darker","& .MuiSvgIcon-root":{fill:r=>r.palette.common.white}}},children:e.jsx(I.DeleteIcon,{fontSize:"small"})})]}),e.jsx("img",{src:URL.createObjectURL(t),alt:t.name,style:{width:"auto",height:"100%",maxWidth:"100%",objectFit:"cover",borderRadius:"5px"}})]}):e.jsx(e.Fragment,{children:z?e.jsxs(e.Fragment,{children:[e.jsx(d,{color:"primary",style:{width:"2.5rem",height:"2.5rem"}}),x,n&&e.jsx(i.Typography,{textAlign:"center",fontSize:"12px",color:"grey",children:n})]}):e.jsxs(o.Box,{sx:{display:"flex",flexDirection:"column",alignItems:"center",padding:"0.5rem",gap:"0.3rem"},children:[e.jsx(d,{color:"primary",style:{width:"2.5rem",height:"2.5rem"}}),h,n&&e.jsx(i.Typography,{textAlign:"center",fontSize:"12px",color:"grey",children:n})]})})]})};module.exports=A;
@@ -1,41 +1,41 @@
1
- import { jsx as e, jsxs as t, Fragment as c } from "react/jsx-runtime";
1
+ import { jsx as e, jsxs as o, Fragment as c } from "react/jsx-runtime";
2
2
  import { c as h } from "../../createSvgIcon-BS0Qe85N.js";
3
- import { D as S } from "../../Delete-Dip-1l7n.js";
4
- import { Box as r } from "@mui/material";
3
+ import { D as v } from "../../Delete-Dip-1l7n.js";
4
+ import { Box as n } from "@mui/material";
5
5
  import { useState as w } from "react";
6
6
  import { u as D } from "../../index-BtGBke8y.js";
7
7
  import { S as F } from "../../Stack-DbWQHN5i.js";
8
8
  import { T as l } from "../../Typography-CizHc1nM.js";
9
- const p = h(/* @__PURE__ */ e("path", {
9
+ const m = h(/* @__PURE__ */ e("path", {
10
10
  d: "M19 7v2.99s-1.99.01-2 0V7h-3s.01-1.99 0-2h3V2h2v3h3v2zm-3 4V8h-3V5H5c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2v-8zM5 19l3-4 2 3 3-4 4 5z"
11
11
  }), "AddPhotoAlternate"), A = h(/* @__PURE__ */ e("path", {
12
12
  d: "M3 17.25V21h3.75L17.81 9.94l-3.75-3.75zM20.71 7.04c.39-.39.39-1.02 0-1.41l-2.34-2.34a.996.996 0 0 0-1.41 0l-1.83 1.83 3.75 3.75z"
13
- }), "Create"), j = () => /* @__PURE__ */ t(l, { textAlign: "center", children: [
14
- /* @__PURE__ */ e(r, { component: "span", fontWeight: "bold", children: "Glissez-déposez" }),
13
+ }), "Create"), j = () => /* @__PURE__ */ o(l, { textAlign: "center", fontSize: "14px", color: "grey.darker", children: [
14
+ /* @__PURE__ */ e(n, { component: "span", fontWeight: "bold", children: "Glissez-déposez" }),
15
15
  " ou ",
16
- /* @__PURE__ */ e(r, { component: "span", fontWeight: "bold", children: "cliquez" }),
16
+ /* @__PURE__ */ e(n, { component: "span", fontWeight: "bold", children: "cliquez" }),
17
17
  " pour choisir une image"
18
- ] }), P = () => /* @__PURE__ */ t(l, { textAlign: "center", children: [
19
- /* @__PURE__ */ e(r, { component: "span", fontWeight: "bold", children: "Glissez" }),
18
+ ] }), P = () => /* @__PURE__ */ o(l, { textAlign: "center", fontSize: "14px", color: "grey.darker", children: [
19
+ /* @__PURE__ */ e(n, { component: "span", fontWeight: "bold", children: "Glissez" }),
20
20
  " une image"
21
21
  ] }), U = ({
22
22
  defaultLabel: g = /* @__PURE__ */ e(j, {}),
23
23
  dragLabel: u = /* @__PURE__ */ e(P, {}),
24
24
  information: i,
25
- onFileChange: a = (n) => {
25
+ onFileChange: a = (t) => {
26
26
  },
27
- width: x = "100%",
28
- height: f = "400px",
27
+ width: x = "160px",
28
+ height: f = "160px",
29
29
  ...b
30
30
  }) => {
31
- const [n, s] = w(null), y = (o) => {
32
- const m = o[0] || null;
33
- s(m), a(m);
34
- }, k = (o) => {
35
- o.stopPropagation(), s(null), a(null);
36
- }, z = (o) => {
37
- o.stopPropagation(), d();
38
- }, { open: d, getRootProps: C, getInputProps: I, isDragActive: v } = D({
31
+ const [t, s] = w(null), y = (r) => {
32
+ const p = r[0] || null;
33
+ s(p), a(p);
34
+ }, k = (r) => {
35
+ r.stopPropagation(), s(null), a(null);
36
+ }, z = (r) => {
37
+ r.stopPropagation(), d();
38
+ }, { open: d, getRootProps: C, getInputProps: I, isDragActive: S } = D({
39
39
  ...b,
40
40
  maxFiles: 1,
41
41
  onDropAccepted: y,
@@ -44,45 +44,43 @@ const p = h(/* @__PURE__ */ e("path", {
44
44
  },
45
45
  noClick: !0
46
46
  });
47
- return /* @__PURE__ */ t(
47
+ return /* @__PURE__ */ o(
48
48
  F,
49
49
  {
50
50
  direction: "column",
51
51
  justifyContent: "center",
52
52
  alignItems: "center",
53
- spacing: 1,
54
53
  width: x,
55
- minWidth: "200px",
56
- minHeight: "200px",
54
+ minWidth: "150px",
55
+ minHeight: "150px",
57
56
  height: f,
58
- padding: 1,
59
- border: "1px dashed",
60
- borderColor: "grey.main",
61
57
  borderRadius: 1,
62
58
  sx: {
63
59
  cursor: "pointer",
64
60
  position: "relative",
65
- background: `${!n && "linear-gradient(180deg, #F5F7F9 0%, #FFF 100%)"}`
61
+ background: `${!t && "linear-gradient(180deg, #F5F7F9 0%, #FFF 100%)"}`,
62
+ border: `${!t && "1px dashed"}`,
63
+ borderColor: (r) => !t && r.palette.grey.main
66
64
  },
67
65
  ...C({
68
66
  onClick: d
69
67
  }),
70
68
  children: [
71
69
  /* @__PURE__ */ e("input", { ...I() }),
72
- n ? /* @__PURE__ */ t(c, { children: [
73
- /* @__PURE__ */ t(
74
- r,
70
+ t ? /* @__PURE__ */ o(c, { children: [
71
+ /* @__PURE__ */ o(
72
+ n,
75
73
  {
76
74
  sx: {
77
75
  position: "absolute",
78
76
  top: "0.5rem",
79
77
  right: "0.5rem",
80
78
  display: "flex",
81
- gap: "0.5rem"
79
+ gap: "0.3rem"
82
80
  },
83
81
  children: [
84
82
  /* @__PURE__ */ e(
85
- r,
83
+ n,
86
84
  {
87
85
  onClick: z,
88
86
  sx: {
@@ -96,9 +94,9 @@ const p = h(/* @__PURE__ */ e("path", {
96
94
  height: "2rem",
97
95
  cursor: "pointer",
98
96
  "&:hover": {
99
- backgroundColor: "common.black",
97
+ backgroundColor: "grey.darker",
100
98
  "& .MuiSvgIcon-root": {
101
- fill: (o) => o.palette.common.white
99
+ fill: (r) => r.palette.common.white
102
100
  }
103
101
  }
104
102
  },
@@ -106,7 +104,7 @@ const p = h(/* @__PURE__ */ e("path", {
106
104
  }
107
105
  ),
108
106
  /* @__PURE__ */ e(
109
- r,
107
+ n,
110
108
  {
111
109
  onClick: k,
112
110
  sx: {
@@ -120,13 +118,13 @@ const p = h(/* @__PURE__ */ e("path", {
120
118
  height: "2rem",
121
119
  cursor: "pointer",
122
120
  "&:hover": {
123
- backgroundColor: "common.black",
121
+ backgroundColor: "grey.darker",
124
122
  "& .MuiSvgIcon-root": {
125
- fill: (o) => o.palette.common.white
123
+ fill: (r) => r.palette.common.white
126
124
  }
127
125
  }
128
126
  },
129
- children: /* @__PURE__ */ e(S, { fontSize: "small" })
127
+ children: /* @__PURE__ */ e(v, { fontSize: "small" })
130
128
  }
131
129
  )
132
130
  ]
@@ -135,37 +133,37 @@ const p = h(/* @__PURE__ */ e("path", {
135
133
  /* @__PURE__ */ e(
136
134
  "img",
137
135
  {
138
- src: URL.createObjectURL(n),
139
- alt: n.name,
136
+ src: URL.createObjectURL(t),
137
+ alt: t.name,
140
138
  style: {
141
139
  width: "auto",
142
140
  height: "100%",
143
141
  maxWidth: "100%",
144
142
  objectFit: "cover",
145
- borderRadius: "8px"
143
+ borderRadius: "5px"
146
144
  }
147
145
  }
148
146
  )
149
- ] }) : /* @__PURE__ */ e(c, { children: v ? /* @__PURE__ */ t(c, { children: [
150
- /* @__PURE__ */ e(p, { color: "primary", style: {
151
- width: "4rem",
152
- height: "4rem"
147
+ ] }) : /* @__PURE__ */ e(c, { children: S ? /* @__PURE__ */ o(c, { children: [
148
+ /* @__PURE__ */ e(m, { color: "primary", style: {
149
+ width: "2.5rem",
150
+ height: "2.5rem"
153
151
  } }),
154
152
  u,
155
- i && /* @__PURE__ */ e(l, { textAlign: "center", fontSize: "0.875rem", color: "grey", children: i })
156
- ] }) : /* @__PURE__ */ t(r, { sx: {
153
+ i && /* @__PURE__ */ e(l, { textAlign: "center", fontSize: "12px", color: "grey", children: i })
154
+ ] }) : /* @__PURE__ */ o(n, { sx: {
157
155
  display: "flex",
158
156
  flexDirection: "column",
159
157
  alignItems: "center",
160
158
  padding: "0.5rem",
161
- gap: "0.5rem"
159
+ gap: "0.3rem"
162
160
  }, children: [
163
- /* @__PURE__ */ e(p, { color: "primary", style: {
164
- width: "4rem",
165
- height: "4rem"
161
+ /* @__PURE__ */ e(m, { color: "primary", style: {
162
+ width: "2.5rem",
163
+ height: "2.5rem"
166
164
  } }),
167
165
  g,
168
- i && /* @__PURE__ */ e(l, { textAlign: "center", fontSize: "0.875rem", color: "grey", children: i })
166
+ i && /* @__PURE__ */ e(l, { textAlign: "center", fontSize: "12px", color: "grey", children: i })
169
167
  ] }) })
170
168
  ]
171
169
  }
@@ -1 +1 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const t=require("../ImagePicker/ImagePicker.cjs.js"),a={title:"Components/ImagePicker",component:t,argTypes:{defaultLabel:{description:"Le contenu affiché comme label par défaut (ReactNode).",control:"text",table:{type:{summary:"ReactNode"},defaultValue:{summary:"<ImagePickerDefaultLabel />"}}},dragLabel:{description:"Texte affiché lorsque l'utilisateur fait glisser un fichier.",control:"text",table:{type:{summary:"ReactNode"},defaultValue:{summary:"<ImagePickerDefaultDragLabel />"}}},information:{description:"Informations supplémentaires affichées sous le label par défaut.",control:"text",table:{type:{summary:"string"}}},onFileChange:{description:"Callback déclenché lorsque l'utilisateur sélectionne ou supprime un fichier.",action:"file-changed",table:{type:{summary:"(file: File | null) => void"}}}}},l={args:{information:"SVG, PNG, JPG, GIF",onFileChange:e=>{console.log(e?"Image uplaodé":"Image supprimé")},width:"400px",height:"400px"}};exports.Default=l;exports.default=a;
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const t=require("../ImagePicker/ImagePicker.cjs.js"),a={title:"Components/ImagePicker",component:t,argTypes:{defaultLabel:{description:"Le contenu affiché comme label par défaut (ReactNode).",control:"text",table:{type:{summary:"ReactNode"},defaultValue:{summary:"<ImagePickerDefaultLabel />"}}},dragLabel:{description:"Texte affiché lorsque l'utilisateur fait glisser un fichier.",control:"text",table:{type:{summary:"ReactNode"},defaultValue:{summary:"<ImagePickerDefaultDragLabel />"}}},information:{description:"Informations supplémentaires affichées sous le label par défaut.",control:"text",table:{type:{summary:"string"}}},onFileChange:{description:"Callback déclenché lorsque l'utilisateur sélectionne ou supprime un fichier.",action:"file-changed",table:{type:{summary:"(file: File | null) => void"}}}}},l={args:{information:"SVG, PNG, JPG, GIF",onFileChange:e=>{console.log(e?"Image uplaodé":"Image supprimé")},width:"160px",height:"160px"}};exports.Default=l;exports.default=a;
@@ -40,8 +40,8 @@ const l = {
40
40
  onFileChange: (e) => {
41
41
  console.log(e ? "Image uplaodé" : "Image supprimé");
42
42
  },
43
- width: "400px",
44
- height: "400px"
43
+ width: "160px",
44
+ height: "160px"
45
45
  }
46
46
  };
47
47
  export {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cgi-learning-hub/ui",
3
- "version": "1.3.3-dev.1732627187",
3
+ "version": "1.3.3-dev.1732633701",
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",