@clicktap/ui 0.18.8 → 0.18.9

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