@bikdotai/bik-component-library 0.0.140 → 0.0.141
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/cjs/components/shimmer-image/ShimmerImage.d.ts +1 -0
- package/dist/cjs/components/shimmer-image/ShimmerImage.js +1 -1
- package/dist/cjs/components/shimmer-image/ShimmerImage.stories.d.ts +1 -0
- package/dist/esm/components/shimmer-image/ShimmerImage.d.ts +1 -0
- package/dist/esm/components/shimmer-image/ShimmerImage.js +1 -1
- package/dist/esm/components/shimmer-image/ShimmerImage.stories.d.ts +1 -0
- package/package.json +1 -1
- package/CHANGELOG.md +0 -7
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),t=require("react"),i=require("../shimmer/ShimmerComponent/BikShimmer.js");exports.ShimmerImage=
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),t=require("react"),i=require("../shimmer/ShimmerComponent/BikShimmer.js");const r="https://firebasestorage.googleapis.com/v0/b/bikayi-chat.appspot.com/o/images-uid%2F9034204a-cbf9-4b93-8b28-ccf880d273f9?alt=media&token=318529b5-8df0-4644-85b0-40fff1dc1d5c";exports.ShimmerImage=s=>{let{imageUrl:a,width:o,height:l,alt:m,defaultImageUrl:n=r}=s;const[c,h]=t.useState(!0),[d,g]=t.useState(!1);return t.useEffect((()=>{const e=new Image;return e.src=a,e.onload=()=>{g(!1),h(!1)},e.onerror=()=>{g(!0),h(!1)},()=>{e.onload=null,e.onerror=null}}),[a]),e.jsxs("div",Object.assign({style:{position:"relative",width:o,height:l}},{children:[c&&e.jsx(i.BikShimmer,{boxes:[{height:`${l}px`,width:`${o}`,marginTop:"0px"}]}),d?e.jsx("img",{src:n,alt:null!=m?m:"Image",style:{display:"block",width:"100%",height:"100%"}}):e.jsx("img",{src:a,alt:null!=m?m:"Image",style:{display:c?"none":"block",width:"100%",height:"100%"}})]}))};
|
|
@@ -3,3 +3,4 @@ import { ComponentMeta, ComponentStory } from '@storybook/react';
|
|
|
3
3
|
declare const _default: ComponentMeta<import("react").FC<import("./ShimmerImage").ShimmerImageProps>>;
|
|
4
4
|
export default _default;
|
|
5
5
|
export declare const Image: ComponentStory<import("react").FC<import("./ShimmerImage").ShimmerImageProps>>;
|
|
6
|
+
export declare const ImageWithError: ComponentStory<import("react").FC<import("./ShimmerImage").ShimmerImageProps>>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsxs as
|
|
1
|
+
import{jsxs as e,jsx as t}from"react/jsx-runtime";import{useState as i,useEffect as o}from"react";import{BikShimmer as r}from"../shimmer/ShimmerComponent/BikShimmer.js";const a="https://firebasestorage.googleapis.com/v0/b/bikayi-chat.appspot.com/o/images-uid%2F9034204a-cbf9-4b93-8b28-ccf880d273f9?alt=media&token=318529b5-8df0-4644-85b0-40fff1dc1d5c",l=l=>{let{imageUrl:m,width:n,height:s,alt:h,defaultImageUrl:c=a}=l;const[d,g]=i(!0),[p,b]=i(!1);return o((()=>{const e=new Image;return e.src=m,e.onload=()=>{b(!1),g(!1)},e.onerror=()=>{b(!0),g(!1)},()=>{e.onload=null,e.onerror=null}}),[m]),e("div",Object.assign({style:{position:"relative",width:n,height:s}},{children:[d&&t(r,{boxes:[{height:`${s}px`,width:`${n}`,marginTop:"0px"}]}),t("img",p?{src:c,alt:null!=h?h:"Image",style:{display:"block",width:"100%",height:"100%"}}:{src:m,alt:null!=h?h:"Image",style:{display:d?"none":"block",width:"100%",height:"100%"}})]}))};export{l as ShimmerImage};
|
|
@@ -3,3 +3,4 @@ import { ComponentMeta, ComponentStory } from '@storybook/react';
|
|
|
3
3
|
declare const _default: ComponentMeta<import("react").FC<import("./ShimmerImage").ShimmerImageProps>>;
|
|
4
4
|
export default _default;
|
|
5
5
|
export declare const Image: ComponentStory<import("react").FC<import("./ShimmerImage").ShimmerImageProps>>;
|
|
6
|
+
export declare const ImageWithError: ComponentStory<import("react").FC<import("./ShimmerImage").ShimmerImageProps>>;
|
package/package.json
CHANGED