@clicktap/ui 0.18.7 → 0.18.8

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
- import{jsx as r}from"react/jsx-runtime";import{useState as l,Component as c}from"react";import{N as u}from"../../assets/image-BrrnSrBZ.js";import{cn as y}from"../../utils/cn.js";import{isDevelopment as d}from"../../utils/env.js";import S from"../../hooks/useIsClient.js";import"../../assets/_interop_require_wildcard--0BIJI4E.js";import"react-dom";class w extends c{constructor(){super(...arguments),this.state={hasError:!1}}static getDerivedStateFromError(){return{hasError:!0}}componentDidCatch(o){d&&console.warn("[Image] next/image render error, falling back to <img>:",o.message)}render(){if(this.state.hasError){const{src:o,alt:e,className:i,style:n,width:a,height:g}=this.props,m=typeof o=="string"?o:typeof o=="object"&&"src"in o?o.src:"";return r("img",{src:m,alt:e??"",className:i,style:n,width:a,height:g,loading:"lazy"})}return this.props.children}}function D({src:t,className:o,style:e,...i}){const[n,a]=l(!0),[g,m]=l(null),f=S(),s="width"in i&&"height"in i&&!("fill"in i)?{height:"auto",...e}:e;if(g===t){const h=typeof t=="string"?t:typeof t=="object"&&"src"in t?t.src:"";return r("img",{src:h,alt:i.alt??"",className:o,style:s,width:"width"in i?i.width:void 0,height:"height"in i?i.height:void 0,loading:"lazy"})}const p=typeof t=="string"?t:JSON.stringify(t);return r(w,{src:t,alt:i.alt,className:o,style:s,width:"width"in i?i.width:void 0,height:"height"in i?i.height:void 0,children:r(u,{src:t,className:y("transition-[filter] ease-linear duration-200",f&&n&&"blur-md",o),style:s,onError:()=>{if(d){const h=typeof t=="string"?t:JSON.stringify(t);console.warn(`[Image] next/image optimization failed for ${h}, falling back to <img>`)}m(t)},onLoad:()=>a(!1),...i})},p)}export{D as Image,D as default};
1
+ import{jsx as n}from"react/jsx-runtime";import{useState as m,Component as y}from"react";import{N as S}from"../../assets/image-BrrnSrBZ.js";import{cn as w}from"../../utils/cn.js";import{isDevelopment as d}from"../../utils/env.js";import I from"../../hooks/useIsClient.js";import"../../assets/_interop_require_wildcard--0BIJI4E.js";import"react-dom";const f=new Set;function p(t){return typeof t=="string"?t:JSON.stringify(t)}class E extends y{constructor(){super(...arguments),this.state={hasError:!1}}static getDerivedStateFromError(){return{hasError:!0}}componentDidCatch(o){f.add(p(this.props.src)),d&&console.warn("[Image] next/image render error, falling back to <img>:",o.message)}render(){if(this.state.hasError){const{src:o,alt:e,className:i,style:r,width:a,height:g}=this.props,s=typeof o=="string"?o:typeof o=="object"&&"src"in o?o.src:"";return n("img",{src:s,alt:e??"",className:i,style:r,width:a,height:g,loading:"lazy"})}return this.props.children}}function O({src:t,className:o,style:e,...i}){const[r,a]=m(!0),[g,s]=m(null),c=I(),h="width"in i&&"height"in i&&!("fill"in i)?{height:"auto",...e}:e;if(g===t||f.has(p(t))){const l=typeof t=="string"?t:typeof t=="object"&&"src"in t?t.src:"";return n("img",{src:l,alt:i.alt??"",className:o,style:h,width:"width"in i?i.width:void 0,height:"height"in i?i.height:void 0,loading:"lazy"})}const u=typeof t=="string"?t:JSON.stringify(t);return n(E,{src:t,alt:i.alt,className:o,style:h,width:"width"in i?i.width:void 0,height:"height"in i?i.height:void 0,children:n(S,{src:t,className:w("transition-[filter] ease-linear duration-200",c&&r&&"blur-md",o),style:h,onError:()=>{if(d){const l=typeof t=="string"?t:JSON.stringify(t);console.warn(`[Image] next/image optimization failed for ${l}, falling back to <img>`)}s(t)},onLoad:()=>a(!1),...i})},u)}export{O as Image,O as default};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@clicktap/ui",
3
- "version": "0.18.7",
3
+ "version": "0.18.8",
4
4
  "private": false,
5
5
  "author": "Clicktap",
6
6
  "description": "A library of React UI components and low-level hooks.",