the-omelet-ui 1.5.0 → 1.5.2

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.
@@ -25,4 +25,4 @@ interface AvatarProps extends Omit<HTMLAttributes<HTMLDivElement>, "children">,
25
25
  }
26
26
  declare const _default: React__default.NamedExoticComponent<AvatarProps & React__default.RefAttributes<HTMLDivElement>>;
27
27
 
28
- export { _default as Avatar, type AvatarProps };
28
+ export { type AvatarProps, _default as default };
@@ -1 +1 @@
1
- import {a}from'../chunk-6GLPXMGB.js';import R,{forwardRef,useState,useEffect}from'react';import {cva}from'class-variance-authority';import {jsxs,jsx}from'react/jsx-runtime';var C=cva("relative inline-flex items-center justify-center overflow-hidden rounded-full bg-black/5 text-black/50 select-none",{variants:{size:{sm:"h-8 w-8 text-xs",md:"h-10 w-10 text-sm",lg:"h-12 w-12 text-base",xl:"h-16 w-16 text-lg"},ringed:{true:"ring-2 ring-black/10",false:""}},defaultVariants:{size:"md",ringed:false}}),c=forwardRef(({className:u,imageClassName:f,size:m,ringed:g,src:t,defaultSrc:l,alt:v="",fallback:p,loadingIndicator:h,onImageLoad:x,onImageError:k,...y},b)=>{let[a$1,r]=useState("idle"),[o,s]=useState(t);useEffect(()=>{s(t),r(t?"loading":"error");},[t]);let w=()=>{r("loaded"),x?.();},L=()=>{if(l&&o!==l){s(l),r("loading");return}r("error"),k?.();},N=p??jsxs("svg",{className:"h-1/2 w-1/2",viewBox:"0 0 24 24",fill:"none","aria-hidden":"true",children:[jsx("circle",{cx:"12",cy:"8",r:"4",stroke:"currentColor",strokeWidth:"2"}),jsx("path",{d:"M4 20c1.5-3.5 4.6-5 8-5s6.5 1.5 8 5",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round"})]}),E=h??jsxs("svg",{className:"h-5 w-5 animate-spin",viewBox:"0 0 24 24","aria-hidden":"true",children:[jsx("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4",fill:"none"}),jsx("path",{className:"opacity-90",d:"M4 12a8 8 0 0 1 8-8",stroke:"currentColor",strokeWidth:"4",strokeLinecap:"round",fill:"none"})]});return jsxs("div",{ref:b,className:a(C({size:m,ringed:g}),u),"aria-busy":a$1==="loading"||void 0,...y,children:[o?jsx("img",{src:o,alt:v,onLoad:w,onError:L,className:a("absolute inset-0 h-full w-full object-cover transition-opacity",a$1==="loaded"?"opacity-100":"opacity-0",f),draggable:false}):null,jsxs("div",{className:"relative flex h-full w-full items-center justify-center",children:[a$1==="loading"?E:null,a$1==="error"||!o?N:null]})]})});c.displayName="Avatar";var T=R.memo(c);export{T as Avatar};
1
+ import {a}from'../chunk-6GLPXMGB.js';import R,{forwardRef,useState,useEffect}from'react';import {cva}from'class-variance-authority';import {jsxs,jsx}from'react/jsx-runtime';var C=cva("relative inline-flex items-center justify-center overflow-hidden rounded-full bg-black/5 text-black/50 select-none",{variants:{size:{sm:"h-8 w-8 text-xs",md:"h-10 w-10 text-sm",lg:"h-12 w-12 text-base",xl:"h-16 w-16 text-lg"},ringed:{true:"ring-2 ring-black/10",false:""}},defaultVariants:{size:"md",ringed:false}}),c=forwardRef(({className:u,imageClassName:f,size:m,ringed:g,src:t,defaultSrc:l,alt:v="",fallback:p,loadingIndicator:h,onImageLoad:x,onImageError:k,...y},b)=>{let[a$1,r]=useState("idle"),[o,s]=useState(t);useEffect(()=>{s(t),r(t?"loading":"error");},[t]);let w=()=>{r("loaded"),x?.();},L=()=>{if(l&&o!==l){s(l),r("loading");return}r("error"),k?.();},N=p??jsxs("svg",{className:"h-1/2 w-1/2",viewBox:"0 0 24 24",fill:"none","aria-hidden":"true",children:[jsx("circle",{cx:"12",cy:"8",r:"4",stroke:"currentColor",strokeWidth:"2"}),jsx("path",{d:"M4 20c1.5-3.5 4.6-5 8-5s6.5 1.5 8 5",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round"})]}),E=h??jsxs("svg",{className:"h-5 w-5 animate-spin",viewBox:"0 0 24 24","aria-hidden":"true",children:[jsx("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4",fill:"none"}),jsx("path",{className:"opacity-90",d:"M4 12a8 8 0 0 1 8-8",stroke:"currentColor",strokeWidth:"4",strokeLinecap:"round",fill:"none"})]});return jsxs("div",{ref:b,className:a(C({size:m,ringed:g}),u),"aria-busy":a$1==="loading"||void 0,...y,children:[o?jsx("img",{src:o,alt:v,onLoad:w,onError:L,className:a("absolute inset-0 h-full w-full object-cover transition-opacity",a$1==="loaded"?"opacity-100":"opacity-0",f),draggable:false}):null,jsxs("div",{className:"relative flex h-full w-full items-center justify-center",children:[a$1==="loading"?E:null,a$1==="error"||!o?N:null]})]})});c.displayName="Avatar";var T=R.memo(c);export{T as default};
@@ -34,4 +34,4 @@ interface RichContentProps {
34
34
  */
35
35
  declare function RichContent({ html, size, className }: RichContentProps): react_jsx_runtime.JSX.Element;
36
36
 
37
- export { RichContent };
37
+ export { RichContent as default };
@@ -1,4 +1,4 @@
1
- import a from'dompurify';import {useMemo}from'react';import {jsx}from'react/jsx-runtime';function r({html:e,size:o="lg",className:t=""}){let s=useMemo(()=>a.sanitize(e,{ALLOWED_TAGS:["h1","h2","h3","h4","h5","h6","p","strong","em","u","del","mark","small","a","ul","ol","li","blockquote","code","pre","table","thead","tbody","tr","th","td","br","hr","div","span"],ALLOWED_ATTR:["href","target","rel","class","id"]}),[e]),p={sm:"prose-sm",base:"prose-base",lg:"prose-lg",xl:"prose-xl","2xl":"prose-2xl"}[o];return jsx("article",{className:`
1
+ import a from'dompurify';import {useMemo}from'react';import {jsx}from'react/jsx-runtime';function r({html:e,size:o="lg",className:s=""}){let t=useMemo(()=>a.sanitize(e,{ALLOWED_TAGS:["h1","h2","h3","h4","h5","h6","p","strong","em","u","del","mark","small","a","ul","ol","li","blockquote","code","pre","table","thead","tbody","tr","th","td","br","hr","div","span"],ALLOWED_ATTR:["href","target","rel","class","id"]}),[e]),p={sm:"prose-sm",base:"prose-base",lg:"prose-lg",xl:"prose-xl","2xl":"prose-2xl"}[o];return jsx("article",{className:`
2
2
  prose ${p}
3
3
  max-w-none
4
4
  dark:prose-invert
@@ -60,5 +60,5 @@ import a from'dompurify';import {useMemo}from'react';import {jsx}from'react/jsx-
60
60
  prose-li:text-gray-700
61
61
  dark:prose-li:text-gray-300
62
62
 
63
- ${t}
64
- `,dangerouslySetInnerHTML:{__html:s}})}export{r as RichContent};
63
+ ${s}
64
+ `,dangerouslySetInnerHTML:{__html:t}})}export{r as default};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "the-omelet-ui",
3
- "version": "1.5.0",
3
+ "version": "1.5.2",
4
4
  "private": false,
5
5
  "license": "MIT",
6
6
  "type": "module",