@cgi-learning-hub/ui 1.4.0-dev.1742577174 → 1.4.0-dev.1742579430

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"),s=require("../../createSvgIcon-2wwaxLPT.cjs"),h=require("../../index-BomeQRLD.cjs"),u=require("../../Stack-gtxG2YLo.cjs"),r=require("../../Typography-3CpuuLtj.cjs"),g=s.createSvgIcon(e.jsx("path",{d:"M9 16h6v-6h4l-7-7-7 7h4zm-4 2h14v2H5z"}),"FileUpload"),x=s.createSvgIcon(e.jsx("path",{d:"M14 2H6c-1.1 0-1.99.9-1.99 2L4 20c0 1.1.89 2 1.99 2H18c1.1 0 2-.9 2-2V8zm4 18H6V4h7v5h5zM8 15.01l1.41 1.41L11 14.84V19h2v-4.16l1.59 1.59L16 15.01 12.01 11z"}),"UploadFile"),j=({defaultLabel:c="Glisser et déposer des fichiers ici, ou cliquer pour sélectionner des fichiers",dragLabel:i="Déposer les fichiers ici",information:o,width:n,height:t,...p})=>{const{getRootProps:l,getInputProps:a,isDragActive:d}=h.useDropzone(p);return e.jsxs(u.Stack,{direction:"column",justifyContent:"center",alignItems:"center",spacing:1,width:n??"18rem",height:t??"auto",padding:1,border:"1px dashed",borderColor:"grey.main",borderRadius:1,sx:{cursor:"pointer"},...l(),children:[e.jsx("input",{...a()}),d?e.jsxs(e.Fragment,{children:[e.jsx(g,{color:"primary"}),e.jsx(r.Typography,{children:i})]}):e.jsxs(e.Fragment,{children:[e.jsx(x,{color:"primary"}),e.jsx(r.Typography,{children:c}),o?e.jsx(r.Typography,{fontSize:"0.875rem",color:"grey",children:o}):null]})]})};module.exports=j;
1
+ "use strict";const e=require("react/jsx-runtime"),n=require("../../createSvgIcon-2wwaxLPT.cjs"),u=require("../../index-BomeQRLD.cjs"),g=require("../../Stack-gtxG2YLo.cjs"),i=require("../../Typography-3CpuuLtj.cjs"),x=n.createSvgIcon(e.jsx("path",{d:"M9 16h6v-6h4l-7-7-7 7h4zm-4 2h14v2H5z"}),"FileUpload"),y=n.createSvgIcon(e.jsx("path",{d:"M14 2H6c-1.1 0-1.99.9-1.99 2L4 20c0 1.1.89 2 1.99 2H18c1.1 0 2-.9 2-2V8zm4 18H6V4h7v5h5zM8 15.01l1.41 1.41L11 14.84V19h2v-4.16l1.59 1.59L16 15.01 12.01 11z"}),"UploadFile"),j=({defaultLabel:o="Glisser et déposer des fichiers ici, ou cliquer pour sélectionner des fichiers",dragLabel:t="Déposer les fichiers ici",information:c,width:s,height:a,slotProps:r={},...d})=>{const{getRootProps:l,getInputProps:h,isDragActive:p}=u.useDropzone(d);return e.jsxs(g.Stack,{direction:"column",justifyContent:"center",alignItems:"center",spacing:1,width:s??"18rem",height:a??"auto",padding:1,border:"1px dashed",borderColor:"grey.main",borderRadius:1,sx:{cursor:"pointer"},...l(),...r.root,children:[e.jsx("input",{...h(),...r.input}),p?e.jsxs(e.Fragment,{children:[e.jsx(x,{color:"primary",...r.icon}),e.jsx(i.Typography,{...r.label,children:t})]}):e.jsxs(e.Fragment,{children:[e.jsx(y,{color:"primary",...r.icon}),e.jsx(i.Typography,{...r.label,children:o}),c?e.jsx(i.Typography,{variant:"body2",color:"grey",...r.information,children:c}):null]})]})};module.exports=j;
@@ -1,10 +1,12 @@
1
1
  import { DropzoneProps as ReactDropzoneProps } from 'react-dropzone';
2
+ import { DropZoneSlotProps } from './types';
2
3
  export type DropzoneProps = {
3
4
  defaultLabel?: string;
4
5
  dragLabel?: string;
5
6
  information?: string;
6
7
  width?: string;
7
8
  height?: string;
9
+ slotProps?: DropZoneSlotProps;
8
10
  } & ReactDropzoneProps;
9
11
  declare const Dropzone: React.FunctionComponent<DropzoneProps>;
10
12
  export default Dropzone;
@@ -1,29 +1,30 @@
1
- import { jsx as r, jsxs as e, Fragment as c } from "react/jsx-runtime";
1
+ import { jsx as r, jsxs as i, Fragment as n } from "react/jsx-runtime";
2
2
  import { c as t } from "../../createSvgIcon-BFqOnlgU.js";
3
- import { u } from "../../index-C7WfZsMe.js";
4
- import { S as g } from "../../Stack-PQFKjbdN.js";
3
+ import { u as g } from "../../index-C7WfZsMe.js";
4
+ import { S as f } from "../../Stack-PQFKjbdN.js";
5
5
  import { T as o } from "../../Typography-DZ11k9cZ.js";
6
- const f = t(/* @__PURE__ */ r("path", {
6
+ const y = t(/* @__PURE__ */ r("path", {
7
7
  d: "M9 16h6v-6h4l-7-7-7 7h4zm-4 2h14v2H5z"
8
- }), "FileUpload"), z = t(/* @__PURE__ */ r("path", {
8
+ }), "FileUpload"), v = t(/* @__PURE__ */ r("path", {
9
9
  d: "M14 2H6c-1.1 0-1.99.9-1.99 2L4 20c0 1.1.89 2 1.99 2H18c1.1 0 2-.9 2-2V8zm4 18H6V4h7v5h5zM8 15.01l1.41 1.41L11 14.84V19h2v-4.16l1.59 1.59L16 15.01 12.01 11z"
10
10
  }), "UploadFile"), D = ({
11
- defaultLabel: s = "Glisser et déposer des fichiers ici, ou cliquer pour sélectionner des fichiers",
12
- dragLabel: n = "Déposer les fichiers ici",
13
- information: i,
14
- width: l,
11
+ defaultLabel: a = "Glisser et déposer des fichiers ici, ou cliquer pour sélectionner des fichiers",
12
+ dragLabel: l = "Déposer les fichiers ici",
13
+ information: c,
14
+ width: d,
15
15
  height: p,
16
- ...d
16
+ slotProps: e = {},
17
+ ...h
17
18
  }) => {
18
- const { getRootProps: a, getInputProps: h, isDragActive: m } = u(d);
19
- return /* @__PURE__ */ e(
20
- g,
19
+ const { getRootProps: s, getInputProps: m, isDragActive: u } = g(h);
20
+ return /* @__PURE__ */ i(
21
+ f,
21
22
  {
22
23
  direction: "column",
23
24
  justifyContent: "center",
24
25
  alignItems: "center",
25
26
  spacing: 1,
26
- width: l ?? "18rem",
27
+ width: d ?? "18rem",
27
28
  height: p ?? "auto",
28
29
  padding: 1,
29
30
  border: "1px dashed",
@@ -32,16 +33,17 @@ const f = t(/* @__PURE__ */ r("path", {
32
33
  sx: {
33
34
  cursor: "pointer"
34
35
  },
35
- ...a(),
36
+ ...s(),
37
+ ...e.root,
36
38
  children: [
37
- /* @__PURE__ */ r("input", { ...h() }),
38
- m ? /* @__PURE__ */ e(c, { children: [
39
- /* @__PURE__ */ r(f, { color: "primary" }),
40
- /* @__PURE__ */ r(o, { children: n })
41
- ] }) : /* @__PURE__ */ e(c, { children: [
42
- /* @__PURE__ */ r(z, { color: "primary" }),
43
- /* @__PURE__ */ r(o, { children: s }),
44
- i ? /* @__PURE__ */ r(o, { fontSize: "0.875rem", color: "grey", children: i }) : null
39
+ /* @__PURE__ */ r("input", { ...m(), ...e.input }),
40
+ u ? /* @__PURE__ */ i(n, { children: [
41
+ /* @__PURE__ */ r(y, { color: "primary", ...e.icon }),
42
+ /* @__PURE__ */ r(o, { ...e.label, children: l })
43
+ ] }) : /* @__PURE__ */ i(n, { children: [
44
+ /* @__PURE__ */ r(v, { color: "primary", ...e.icon }),
45
+ /* @__PURE__ */ r(o, { ...e.label, children: a }),
46
+ c ? /* @__PURE__ */ r(o, { variant: "body2", color: "grey", ...e.information, children: c }) : null
45
47
  ] })
46
48
  ]
47
49
  }
@@ -0,0 +1 @@
1
+ "use strict";
@@ -0,0 +1,8 @@
1
+ import { StackProps, SvgIconProps, TypographyProps } from '@mui/material';
2
+ export type DropZoneSlotProps = {
3
+ root?: StackProps;
4
+ input?: React.InputHTMLAttributes<HTMLInputElement>;
5
+ icon?: SvgIconProps;
6
+ label?: TypographyProps;
7
+ information?: TypographyProps;
8
+ };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cgi-learning-hub/ui",
3
- "version": "1.4.0-dev.1742577174",
3
+ "version": "1.4.0-dev.1742579430",
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",