singularity-components 0.1.132 → 0.1.133

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,6 +1,10 @@
1
- import React__default from 'react';
1
+ import * as react_jsx_runtime from 'react/jsx-runtime';
2
2
  import { BaseImageProps } from '../providers/ImageContext.js';
3
+ import 'react';
3
4
 
4
- declare const UiImage: React__default.FC<BaseImageProps>;
5
+ type Props = {
6
+ showDefaultImage?: boolean;
7
+ } & BaseImageProps;
8
+ declare function UiImage({ showDefaultImage, ...props }: Props): react_jsx_runtime.JSX.Element;
5
9
 
6
10
  export { UiImage };
@@ -1,28 +1,33 @@
1
1
  "use client";
2
2
  import { jsx } from "react/jsx-runtime";
3
- import React, { useEffect, useState } from "react";
3
+ import { useEffect, useState } from "react";
4
4
  import {
5
5
  DefaultImage,
6
6
  useImage
7
7
  } from "../providers/ImageContext";
8
- const UiImage = (props) => {
8
+ import { Skeleton } from "./skeleton/skeleton";
9
+ function UiImage({ showDefaultImage = true, ...props }) {
9
10
  const [isClient, setIsClient] = useState(false);
10
11
  const ImageComponent = useImage();
11
12
  useEffect(() => {
12
13
  setIsClient(true);
13
14
  }, []);
14
15
  if (!isClient) {
15
- return /* @__PURE__ */ jsx(
16
- DefaultImage,
17
- {
18
- src: props.src,
19
- alt: props.alt,
20
- className: props.className
21
- }
22
- );
16
+ if (showDefaultImage) {
17
+ return /* @__PURE__ */ jsx(
18
+ DefaultImage,
19
+ {
20
+ src: props.src,
21
+ alt: props.alt,
22
+ className: props.className
23
+ }
24
+ );
25
+ } else {
26
+ return /* @__PURE__ */ jsx(Skeleton, {});
27
+ }
23
28
  }
24
29
  return /* @__PURE__ */ jsx(ImageComponent, { ...props });
25
- };
30
+ }
26
31
  export {
27
32
  UiImage
28
33
  };
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/components/primitives/ui-image.tsx"],"sourcesContent":["\"use client\";\r\nimport React, { useEffect, useState } from \"react\";\r\nimport {\r\n DefaultImage,\r\n useImage,\r\n type BaseImageProps,\r\n} from \"../providers/ImageContext\";\r\n\r\nexport const UiImage: React.FC<BaseImageProps> = (props) => {\r\n const [isClient, setIsClient] = useState(false);\r\n const ImageComponent = useImage();\r\n\r\n useEffect(() => {\r\n setIsClient(true);\r\n }, []);\r\n\r\n if (!isClient) {\r\n return (\r\n <DefaultImage\r\n src={props.src}\r\n alt={props.alt}\r\n className={props.className}\r\n />\r\n );\r\n }\r\n\r\n return <ImageComponent {...props} />;\r\n};\r\n"],"mappings":";AAkBM;AAjBN,OAAO,SAAS,WAAW,gBAAgB;AAC3C;AAAA,EACE;AAAA,EACA;AAAA,OAEK;AAEA,MAAM,UAAoC,CAAC,UAAU;AAC1D,QAAM,CAAC,UAAU,WAAW,IAAI,SAAS,KAAK;AAC9C,QAAM,iBAAiB,SAAS;AAEhC,YAAU,MAAM;AACd,gBAAY,IAAI;AAAA,EAClB,GAAG,CAAC,CAAC;AAEL,MAAI,CAAC,UAAU;AACb,WACE;AAAA,MAAC;AAAA;AAAA,QACC,KAAK,MAAM;AAAA,QACX,KAAK,MAAM;AAAA,QACX,WAAW,MAAM;AAAA;AAAA,IACnB;AAAA,EAEJ;AAEA,SAAO,oBAAC,kBAAgB,GAAG,OAAO;AACpC;","names":[]}
1
+ {"version":3,"sources":["../../../src/components/primitives/ui-image.tsx"],"sourcesContent":["\"use client\";\r\nimport { useEffect, useState } from \"react\";\r\nimport {\r\n DefaultImage,\r\n useImage,\r\n type BaseImageProps,\r\n} from \"../providers/ImageContext\";\r\nimport { Skeleton } from \"./skeleton/skeleton\";\r\n\r\ntype Props = {\r\n showDefaultImage?: boolean;\r\n} & BaseImageProps;\r\n\r\nexport function UiImage({ showDefaultImage = true, ...props }: Props) {\r\n const [isClient, setIsClient] = useState(false);\r\n const ImageComponent = useImage();\r\n\r\n useEffect(() => {\r\n setIsClient(true);\r\n }, []);\r\n\r\n if (!isClient) {\r\n if (showDefaultImage) {\r\n return (\r\n <DefaultImage\r\n src={props.src}\r\n alt={props.alt}\r\n className={props.className}\r\n />\r\n );\r\n } else {\r\n return <Skeleton />;\r\n }\r\n }\r\n\r\n return <ImageComponent {...props} />;\r\n}\r\n"],"mappings":";AAwBQ;AAvBR,SAAS,WAAW,gBAAgB;AACpC;AAAA,EACE;AAAA,EACA;AAAA,OAEK;AACP,SAAS,gBAAgB;AAMlB,SAAS,QAAQ,EAAE,mBAAmB,MAAM,GAAG,MAAM,GAAU;AACpE,QAAM,CAAC,UAAU,WAAW,IAAI,SAAS,KAAK;AAC9C,QAAM,iBAAiB,SAAS;AAEhC,YAAU,MAAM;AACd,gBAAY,IAAI;AAAA,EAClB,GAAG,CAAC,CAAC;AAEL,MAAI,CAAC,UAAU;AACb,QAAI,kBAAkB;AACpB,aACE;AAAA,QAAC;AAAA;AAAA,UACC,KAAK,MAAM;AAAA,UACX,KAAK,MAAM;AAAA,UACX,WAAW,MAAM;AAAA;AAAA,MACnB;AAAA,IAEJ,OAAO;AACL,aAAO,oBAAC,YAAS;AAAA,IACnB;AAAA,EACF;AAEA,SAAO,oBAAC,kBAAgB,GAAG,OAAO;AACpC;","names":[]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "singularity-components",
3
- "version": "0.1.132",
3
+ "version": "0.1.133",
4
4
  "type": "module",
5
5
  "files": [
6
6
  "dist"
@@ -183,4 +183,4 @@
183
183
  "react": "^19.2.0",
184
184
  "react-dom": "^19.2.0"
185
185
  }
186
- }
186
+ }