@cgi-learning-hub/ui 1.10.0-dev.1761580279 → 1.10.0-dev.1761752478

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/dist/index.cjs.js CHANGED
@@ -56894,6 +56894,7 @@ const ImagePicker = ({
56894
56894
  width: width2 = "160px",
56895
56895
  height: height2 = "160px",
56896
56896
  initialFile = null,
56897
+ disabled = false,
56897
56898
  ...otherProps
56898
56899
  }) => {
56899
56900
  const [currentFile, setCurrentFile] = React.useState(
@@ -56903,16 +56904,19 @@ const ImagePicker = ({
56903
56904
  setCurrentFile(initialFile);
56904
56905
  }, [initialFile]);
56905
56906
  const handleDrop = (acceptedFiles) => {
56907
+ if (disabled) return;
56906
56908
  const selectedFile = acceptedFiles[0] || null;
56907
56909
  setCurrentFile(selectedFile);
56908
56910
  onFileChange(selectedFile);
56909
56911
  };
56910
56912
  const handleDelete = (e) => {
56913
+ if (disabled) return;
56911
56914
  e.stopPropagation();
56912
56915
  setCurrentFile(null);
56913
56916
  onFileChange(null);
56914
56917
  };
56915
56918
  const handleEdit = (e) => {
56919
+ if (disabled) return;
56916
56920
  e.stopPropagation();
56917
56921
  open();
56918
56922
  };
@@ -56923,7 +56927,8 @@ const ImagePicker = ({
56923
56927
  accept: {
56924
56928
  "image/*": [".png", ".jpeg", ".jpg", ".gif"]
56925
56929
  },
56926
- noClick: true
56930
+ noClick: true,
56931
+ disabled
56927
56932
  });
56928
56933
  return /* @__PURE__ */ jsxRuntime.jsxs(
56929
56934
  Stack,
@@ -56937,18 +56942,19 @@ const ImagePicker = ({
56937
56942
  height: height2,
56938
56943
  borderRadius: 1,
56939
56944
  sx: {
56940
- cursor: "pointer",
56945
+ cursor: disabled ? "default" : "pointer",
56941
56946
  position: "relative",
56942
56947
  background: `${!currentFile && "linear-gradient(180deg, #F5F7F9 0%, #FFF 100%)"}`,
56943
56948
  border: `${!currentFile && "1px dashed"}`,
56944
- borderColor: (theme) => !currentFile && theme.palette.grey.main
56949
+ borderColor: (theme) => !currentFile && theme.palette.grey.main,
56950
+ opacity: disabled ? 0.6 : 1
56945
56951
  },
56946
56952
  ...getRootProps({
56947
- onClick: open
56953
+ onClick: disabled ? void 0 : open
56948
56954
  }),
56949
56955
  children: [
56950
56956
  /* @__PURE__ */ jsxRuntime.jsx("input", { ...getInputProps() }),
56951
- !currentFile ? /* @__PURE__ */ jsxRuntime.jsx(jsxRuntime.Fragment, { children: isDragActive ? /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
56957
+ !currentFile ? /* @__PURE__ */ jsxRuntime.jsx(jsxRuntime.Fragment, { children: isDragActive && !disabled ? /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
56952
56958
  /* @__PURE__ */ jsxRuntime.jsx(
56953
56959
  AddPhotoAlternateIcon,
56954
56960
  {
@@ -56987,7 +56993,7 @@ const ImagePicker = ({
56987
56993
  ]
56988
56994
  }
56989
56995
  ) }) : /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
56990
- /* @__PURE__ */ jsxRuntime.jsxs(
56996
+ !disabled && /* @__PURE__ */ jsxRuntime.jsxs(
56991
56997
  material.Box,
56992
56998
  {
56993
56999
  sx: {
package/dist/index.d.ts CHANGED
@@ -425,6 +425,7 @@ export declare type ImagePickerProps = {
425
425
  width?: string;
426
426
  height?: string;
427
427
  initialFile?: string | File;
428
+ disabled?: boolean;
428
429
  } & DropzoneProps_2;
429
430
 
430
431
  export declare type InfoItem = {
package/dist/index.es.js CHANGED
@@ -56877,6 +56877,7 @@ const ImagePicker = ({
56877
56877
  width: width2 = "160px",
56878
56878
  height: height2 = "160px",
56879
56879
  initialFile = null,
56880
+ disabled = false,
56880
56881
  ...otherProps
56881
56882
  }) => {
56882
56883
  const [currentFile, setCurrentFile] = useState(
@@ -56886,16 +56887,19 @@ const ImagePicker = ({
56886
56887
  setCurrentFile(initialFile);
56887
56888
  }, [initialFile]);
56888
56889
  const handleDrop = (acceptedFiles) => {
56890
+ if (disabled) return;
56889
56891
  const selectedFile = acceptedFiles[0] || null;
56890
56892
  setCurrentFile(selectedFile);
56891
56893
  onFileChange(selectedFile);
56892
56894
  };
56893
56895
  const handleDelete = (e) => {
56896
+ if (disabled) return;
56894
56897
  e.stopPropagation();
56895
56898
  setCurrentFile(null);
56896
56899
  onFileChange(null);
56897
56900
  };
56898
56901
  const handleEdit = (e) => {
56902
+ if (disabled) return;
56899
56903
  e.stopPropagation();
56900
56904
  open();
56901
56905
  };
@@ -56906,7 +56910,8 @@ const ImagePicker = ({
56906
56910
  accept: {
56907
56911
  "image/*": [".png", ".jpeg", ".jpg", ".gif"]
56908
56912
  },
56909
- noClick: true
56913
+ noClick: true,
56914
+ disabled
56910
56915
  });
56911
56916
  return /* @__PURE__ */ jsxs(
56912
56917
  Stack,
@@ -56920,18 +56925,19 @@ const ImagePicker = ({
56920
56925
  height: height2,
56921
56926
  borderRadius: 1,
56922
56927
  sx: {
56923
- cursor: "pointer",
56928
+ cursor: disabled ? "default" : "pointer",
56924
56929
  position: "relative",
56925
56930
  background: `${!currentFile && "linear-gradient(180deg, #F5F7F9 0%, #FFF 100%)"}`,
56926
56931
  border: `${!currentFile && "1px dashed"}`,
56927
- borderColor: (theme) => !currentFile && theme.palette.grey.main
56932
+ borderColor: (theme) => !currentFile && theme.palette.grey.main,
56933
+ opacity: disabled ? 0.6 : 1
56928
56934
  },
56929
56935
  ...getRootProps({
56930
- onClick: open
56936
+ onClick: disabled ? void 0 : open
56931
56937
  }),
56932
56938
  children: [
56933
56939
  /* @__PURE__ */ jsx("input", { ...getInputProps() }),
56934
- !currentFile ? /* @__PURE__ */ jsx(Fragment, { children: isDragActive ? /* @__PURE__ */ jsxs(Fragment, { children: [
56940
+ !currentFile ? /* @__PURE__ */ jsx(Fragment, { children: isDragActive && !disabled ? /* @__PURE__ */ jsxs(Fragment, { children: [
56935
56941
  /* @__PURE__ */ jsx(
56936
56942
  AddPhotoAlternateIcon,
56937
56943
  {
@@ -56970,7 +56976,7 @@ const ImagePicker = ({
56970
56976
  ]
56971
56977
  }
56972
56978
  ) }) : /* @__PURE__ */ jsxs(Fragment, { children: [
56973
- /* @__PURE__ */ jsxs(
56979
+ !disabled && /* @__PURE__ */ jsxs(
56974
56980
  Box$1,
56975
56981
  {
56976
56982
  sx: {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cgi-learning-hub/ui",
3
- "version": "1.10.0-dev.1761580279",
3
+ "version": "1.10.0-dev.1761752478",
4
4
  "description": "React component library for Hub's design system, built on Material UI with custom and extended components.",
5
5
  "keywords": [
6
6
  "cgi-learning-hub",