@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.
@@ -4,5 +4,6 @@ export type ShimmerImageProps = {
4
4
  width: number;
5
5
  height: number;
6
6
  alt?: string;
7
+ defaultImageUrl?: string;
7
8
  };
8
9
  export declare const ShimmerImage: React.FC<ShimmerImageProps>;
@@ -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=r=>{let{imageUrl:s,width:n,height:h,alt:l}=r;const[m,o]=t.useState(!0);return t.useEffect((()=>{const e=new Image;return e.src=s,e.onload=()=>{o(!1)},()=>{e.onload=null}}),[s]),e.jsxs("div",Object.assign({style:{position:"relative",width:n,height:h}},{children:[m&&e.jsx(i.BikShimmer,{boxes:[{height:`${h}px`,width:`${n}`,marginTop:"0px"}]}),e.jsx("img",{src:s,alt:null!=l?l:"Image",style:{display:m?"none":"block",width:"100%",height:"100%"}})]}))};
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>>;
@@ -4,5 +4,6 @@ export type ShimmerImageProps = {
4
4
  width: number;
5
5
  height: number;
6
6
  alt?: string;
7
+ defaultImageUrl?: string;
7
8
  };
8
9
  export declare const ShimmerImage: React.FC<ShimmerImageProps>;
@@ -1 +1 @@
1
- import{jsxs as t,jsx as e}from"react/jsx-runtime";import{useState as i,useEffect as r}from"react";import{BikShimmer as o}from"../shimmer/ShimmerComponent/BikShimmer.js";const m=m=>{let{imageUrl:n,width:h,height:l,alt:s}=m;const[a,c]=i(!0);return r((()=>{const t=new Image;return t.src=n,t.onload=()=>{c(!1)},()=>{t.onload=null}}),[n]),t("div",Object.assign({style:{position:"relative",width:h,height:l}},{children:[a&&e(o,{boxes:[{height:`${l}px`,width:`${h}`,marginTop:"0px"}]}),e("img",{src:n,alt:null!=s?s:"Image",style:{display:a?"none":"block",width:"100%",height:"100%"}})]}))};export{m as ShimmerImage};
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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bikdotai/bik-component-library",
3
- "version": "0.0.140",
3
+ "version": "0.0.141",
4
4
  "description": "Bik Component Library",
5
5
  "repository": {
6
6
  "type": "git",
package/CHANGELOG.md DELETED
@@ -1,7 +0,0 @@
1
- # @boilertown/react-ui-boilerplate
2
-
3
- ## 0.0.1
4
-
5
- ### Patch Changes
6
-
7
- - 93e5422: First release ever!