@unizap/uniui 1.0.56 → 1.0.57

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/uniui.js CHANGED
@@ -5833,7 +5833,14 @@ const si = {
5833
5833
  caption: "span",
5834
5834
  overline: "span"
5835
5835
  }[e] || "p";
5836
- return /* @__PURE__ */ a.jsx(s, { className: `${si[e]} ${(c = we[i]) == null ? void 0 : c.text} ${t}`, id: o || "", children: r });
5836
+ return /* @__PURE__ */ a.jsx(
5837
+ s,
5838
+ {
5839
+ className: `${si[e]} ${(c = we[i]) == null ? void 0 : c.text} ${t}`,
5840
+ ...o ? { id: o } : {},
5841
+ children: r
5842
+ }
5843
+ );
5837
5844
  }, ui = ({
5838
5845
  total: e,
5839
5846
  currentPage: n,
@@ -5936,18 +5943,21 @@ const si = {
5936
5943
  {
5937
5944
  className: `relative overflow-y-auto flex flex-col ${d} `,
5938
5945
  children: [
5939
- /* @__PURE__ */ a.jsx("div", { className: `${f ? "overflow-x-auto" : ""}`, children: /* @__PURE__ */ a.jsxs("table", { className: "w-full relative border-collapse", id: n, children: [
5940
- /* @__PURE__ */ a.jsx("thead", { className: "sticky top-0 left-0 rounded-xl bg-color-[#FAFBFB] z-10 h-10", children: v.getHeaderGroups().map((g) => /* @__PURE__ */ a.jsx("tr", { children: g.headers.map((h) => /* @__PURE__ */ a.jsx(
5941
- "th",
5942
- {
5943
- className: `bg-color-[#FAFBFB] p-2 text-left text-xs font-semibold text-color-gray-500 border-b border-color-gray-200 ${u}`,
5944
- id: n,
5945
- children: h.isPlaceholder ? null : h.column.columnDef.header instanceof Function ? h.column.columnDef.header(
5946
- h.getContext()
5947
- ) : h.column.columnDef.header
5948
- },
5949
- h.id
5950
- )) }, g.id)) }),
5946
+ /* @__PURE__ */ a.jsx("div", { className: `${f ? "overflow-x-auto" : ""}`, children: /* @__PURE__ */ a.jsxs("table", { id: n, className: "w-full relative border-collapse", children: [
5947
+ /* @__PURE__ */ a.jsx("thead", { className: "sticky top-0 left-0 rounded-xl bg-color-[#FAFBFB] z-10 h-10", children: v.getHeaderGroups().map((g) => /* @__PURE__ */ a.jsx("tr", { children: g.headers.map((h) => {
5948
+ var w;
5949
+ return /* @__PURE__ */ a.jsx(
5950
+ "th",
5951
+ {
5952
+ className: `bg-color-[#FAFBFB] p-2 text-left text-xs font-semibold text-color-gray-500 border-b border-color-gray-200 ${u}`,
5953
+ id: ((w = h.column.columnDef.meta) == null ? void 0 : w.headerId) || h.id,
5954
+ children: h.isPlaceholder ? null : h.column.columnDef.header instanceof Function ? h.column.columnDef.header(
5955
+ h.getContext()
5956
+ ) : h.column.columnDef.header
5957
+ },
5958
+ h.id
5959
+ );
5960
+ }) }, g.id)) }),
5951
5961
  /* @__PURE__ */ a.jsx("tbody", { className: "", children: v.getRowModel().rows.map((g) => /* @__PURE__ */ a.jsx(
5952
5962
  "tr",
5953
5963
  {
@@ -5955,7 +5965,6 @@ const si = {
5955
5965
  children: g.getVisibleCells().map((h) => /* @__PURE__ */ a.jsx(
5956
5966
  "td",
5957
5967
  {
5958
- id: n,
5959
5968
  className: `px-2 py-4 font-normal text-sm text-color-gray-800 ${m}`,
5960
5969
  children: h.column.columnDef.cell instanceof Function ? h.column.columnDef.cell(
5961
5970
  h.getContext()
@@ -123,7 +123,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
123
123
  * LICENSE.md file in the root directory of this source tree.
124
124
  *
125
125
  * @license MIT
126
- */function ri(e){const n={state:{},onStateChange:()=>{},renderFallbackValue:null,...e},[t]=Ht.useState(()=>({current:ti(n)})),[r,o]=Ht.useState(()=>t.current.initialState);return t.current.setOptions(i=>({...i,...e,state:{...r,...e.state},onStateChange:l=>{o(l),e.onStateChange==null||e.onStateChange(l)}})),t.current}const oi={h1:"text-5xl font-bold",h2:"text-4xl font-bold",h3:"text-3xl font-bold",h4:"text-2xl font-semibold",h5:"text-xl font-semibold",h6:"text-lg font-semibold",subtitle1:"text-base font-medium",subtitle2:"text-sm font-normal",body1:"text-base",body2:"text-sm",caption:"text-xs",overline:"text-xs uppercase tracking-wide"},Gn=({variant:e="body1",component:n,className:t="",children:r,id:o,color:i="dark"})=>{var c;const s=n||{h1:"h1",h2:"h2",h3:"h3",h4:"h4",h5:"h5",h6:"h6",subtitle1:"p",subtitle2:"p",body1:"p",body2:"p",caption:"span",overline:"span"}[e]||"p";return a.jsx(s,{className:`${oi[e]} ${(c=ve[i])==null?void 0:c.text} ${t}`,id:o||"",children:r})},Yn=({total:e,currentPage:n,pageSize:t=10,onPageChange:r,hideEdgeButtons:o=!1,className:i="",iconClass:l="",pageClass:s=""})=>{const c=Math.ceil(e/t),d=n===1,p=n===c;return c<=1?null:a.jsxs("div",{className:`flex items-center space-x-1 ${i}`,children:[!o&&a.jsx(Se,{color:"dark",icon:a.jsx("svg",{className:"size-5",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",children:a.jsx("path",{d:"M4.83582 12L11.0429 18.2071L12.4571 16.7929L7.66424 12L12.4571 7.20712L11.0429 5.79291L4.83582 12ZM10.4857 12L16.6928 18.2071L18.107 16.7929L13.3141 12L18.107 7.20712L16.6928 5.79291L10.4857 12Z"})}),onClick:()=>r(1),disabled:d,roundedFull:!0,size:"small",variant:"transparent",className:l}),a.jsx(Se,{color:"dark",icon:a.jsx("svg",{className:"size-5",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",children:a.jsx("path",{d:"M10.8284 12.0007L15.7782 16.9504L14.364 18.3646L8 12.0007L14.364 5.63672L15.7782 7.05093L10.8284 12.0007Z"})}),onClick:()=>r(n-1),disabled:d,roundedFull:!0,size:"small",variant:"transparent",className:l}),a.jsxs("span",{className:`text-sm text-color-gray-800 ${s}`,children:["Page ",n," of ",c]}),a.jsx(Se,{color:"dark",icon:a.jsx("svg",{className:"size-5",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",children:a.jsx("path",{d:"M13.1717 12.0007L8.22192 7.05093L9.63614 5.63672L16.0001 12.0007L9.63614 18.3646L8.22192 16.9504L13.1717 12.0007Z"})}),onClick:()=>r(n+1),disabled:p,roundedFull:!0,size:"small",variant:"transparent",className:l}),!o&&a.jsx(Se,{color:"dark",icon:a.jsx("svg",{className:"size-5",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",children:a.jsx("path",{d:"M19.1642 12L12.9571 5.79291L11.5429 7.20712L16.3358 12L11.5429 16.7929L12.9571 18.2071L19.1642 12ZM13.5143 12L7.30722 5.79291L5.89301 7.20712L10.6859 12L5.89301 16.7929L7.30722 18.2071L13.5143 12Z"})}),onClick:()=>r(c),disabled:p,roundedFull:!0,size:"small",variant:"transparent",className:l})]})},ii=({data:e,id:n,columns:t=[],pageSize:r,pageIndex:o,onPageSizeChange:i,onPageChange:l,rowOptionArray:s=[5,10,15],totalRecords:c=e.length,className:d="",paginationClassName:p="",tdClassName:m="",thClassName:u="",responsive:g=!1})=>{const x=ri({data:e,columns:t,getCoreRowModel:ni(),manualPagination:!0,pageCount:Math.ceil(c/r),state:{pagination:{pageIndex:o,pageSize:r}}});return a.jsx(a.Fragment,{children:a.jsxs("div",{className:`relative overflow-y-auto flex flex-col ${d} `,children:[a.jsx("div",{className:`${g?"overflow-x-auto":""}`,children:a.jsxs("table",{className:"w-full relative border-collapse",id:n,children:[a.jsx("thead",{className:"sticky top-0 left-0 rounded-xl bg-color-[#FAFBFB] z-10 h-10",children:x.getHeaderGroups().map(f=>a.jsx("tr",{children:f.headers.map(w=>a.jsx("th",{className:`bg-color-[#FAFBFB] p-2 text-left text-xs font-semibold text-color-gray-500 border-b border-color-gray-200 ${u}`,id:n,children:w.isPlaceholder?null:w.column.columnDef.header instanceof Function?w.column.columnDef.header(w.getContext()):w.column.columnDef.header},w.id))},f.id))}),a.jsx("tbody",{className:"",children:x.getRowModel().rows.map(f=>a.jsx("tr",{className:"border-b border-color-gray-200",children:f.getVisibleCells().map(w=>a.jsx("td",{id:n,className:`px-2 py-4 font-normal text-sm text-color-gray-800 ${m}`,children:w.column.columnDef.cell instanceof Function?w.column.columnDef.cell(w.getContext()):w.getValue()},w.id))},f.id))})]})}),a.jsxs("div",{className:`w-full py-4 px-2 border-t border-color-gray-200 bg-color-[#FAFBFB] flex justify-between items-center ${p} sticky bottom-0 z-10`,children:[a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx(Gn,{variant:"body2",className:"hidden md:!flex",children:"Rows per page"}),a.jsx(En,{options:s,selectedValue:r,placementTop:!0,onChange:f=>{i(f),l(0)}})]}),a.jsx(Yn,{total:c,pageSize:r,currentPage:o+1,onPageChange:f=>l(f-1)})]})]})})},ai=({children:e,className:n=""})=>a.jsx("ul",{className:`divide-y divide-color-gray-200 rounded-md bg-color-white shadow-sm border border-color-gray-200 ${n}`,children:e}),li=({children:e,secondaryAction:n,className:t=""})=>a.jsxs("li",{className:`flex items-center justify-between overflow-hidden px-4 py-3 hover:bg-color-gray-50 transition ${t}`,children:[a.jsx("div",{className:"flex-1",children:e}),n&&a.jsx("div",{className:"ml-4",children:n})]}),si=({open:e,onClick:n,className:t="",children:r,...o})=>{const[i,l]=h.useState(!1);return h.useEffect(()=>{let s;return e?s=setTimeout(()=>l(!0),100):l(!1),()=>clearTimeout(s)},[e]),!e&&!i?null:a.jsx("div",{className:`fixed inset-0 z-999 bg-color-black/50 flex items-center justify-center transition-all duration-300 ${i?"opacity-100 pointer-events-auto":"opacity-0 pointer-events-none"} ${t}`,onClick:n,"aria-hidden":!i,...o,children:r})},ci={small:"p-2 text-sm",medium:"p-3 text-base",large:"p-4 text-lg"},ui={filled:"bg-color-gray-100 border-color-gray-200",outlined:"border-color-gray-200 bg-color-transparent"},Zn=h.forwardRef(({placeholder:e,value:n,onChange:t,type:r="text",inputMode:o="numeric",className:i="",inputClass:l="",iconStyle:s="",startIcon:c,endIcon:d,error:p,maxLength:m,label:u,labelClass:g="",variant:x="outlined",size:f="medium",...w},b)=>{const[$,C]=h.useState(""),k=n!==void 0,y=k?n:$,T=p?"border-color-red-500 focus-within:ring-color-red-500":"border-color-gray-200",_=p?"text-color-red-500":s,I=ee=>{let K=ee.target.value.replace(/(?!^\+)[^\d]/g,"");K.startsWith("+")&&(K="+"+K.slice(1).replace(/\+/g,"")),K=K.replace(/\s/g,""),(!m||K.replace(/^\+/,"").length<=m)&&(t&&t({...ee,target:{...ee.target,value:K}}),k||C(K))};return a.jsxs("div",{className:"w-full",children:[u&&a.jsx("label",{className:`text-sm font-medium text-color-gray-700 mb-1 block ${g}`,children:u}),a.jsxs("div",{className:`flex items-center w-full rounded-md border focus-within:ring-1 ${T} ${ui[x]} ${i}`,children:[c&&a.jsx("span",{className:`pl-3 ${_}`,children:c}),a.jsx("input",{...w,ref:b,type:"text",inputMode:"numeric",placeholder:e,value:y,onChange:I,className:`grow outline-0 w-full font-medium placeholder:font-normal bg-color-transparent ${ci[f]} ${l}`}),d&&a.jsx("span",{className:`pr-3 ${_}`,children:d})]}),p&&a.jsx("p",{className:"text-color-red-500 text-xs mt-1",children:p})]})});Zn.displayName="NumberInput";const Wn=({animation:e="pulse",variant:n="rectangular",width:t,height:r,className:o=""})=>{const i="bg-color-gray-200 dark:bg-color-gray-700",l={pulse:"animate-pulse",wave:"relative overflow-hidden"},s=()=>{switch(n){case"circular":return{classes:"rounded-full",defaultWidth:40,defaultHeight:40};case"rectangular":return{classes:"",defaultWidth:200,defaultHeight:100};case"rounded":return{classes:"rounded-lg",defaultWidth:200,defaultHeight:100};case"text":return{classes:"rounded-sm",defaultWidth:void 0,defaultHeight:16};default:return{classes:"",defaultWidth:200,defaultHeight:100}}},{classes:c,defaultWidth:d,defaultHeight:p}=s(),m=t??d,u=r??p,g={};m!==void 0&&(g.width=`${m}px`),u!==void 0&&(g.height=`${u}px`),n==="text"&&t===void 0&&(g.width="100%");const x=[i,c,l[e],o].filter(Boolean).join(" ");return a.jsx("div",{className:x,style:g,children:e==="wave"&&a.jsxs(a.Fragment,{children:[a.jsx("div",{className:"absolute inset-0 bg-gradient-[linear-gradient(90deg,_rgba(255,_255,_255,_0)_0%,_rgba(255,_255,_255,_0.35)_50%,_rgba(255,_255,_255,_0)_100%)] dark:bg-gradient-[linear-gradient(90deg,_rgba(255,_255,_255,_0)_0%,_rgba(255,_255,_255,_0.1)_50%,_rgba(255,_255,_255,_0)_100%)]",style:{animation:"skeleton-wave 2s ease-in-out infinite"}}),a.jsx("style",{children:`
126
+ */function ri(e){const n={state:{},onStateChange:()=>{},renderFallbackValue:null,...e},[t]=Ht.useState(()=>({current:ti(n)})),[r,o]=Ht.useState(()=>t.current.initialState);return t.current.setOptions(i=>({...i,...e,state:{...r,...e.state},onStateChange:l=>{o(l),e.onStateChange==null||e.onStateChange(l)}})),t.current}const oi={h1:"text-5xl font-bold",h2:"text-4xl font-bold",h3:"text-3xl font-bold",h4:"text-2xl font-semibold",h5:"text-xl font-semibold",h6:"text-lg font-semibold",subtitle1:"text-base font-medium",subtitle2:"text-sm font-normal",body1:"text-base",body2:"text-sm",caption:"text-xs",overline:"text-xs uppercase tracking-wide"},Gn=({variant:e="body1",component:n,className:t="",children:r,id:o,color:i="dark"})=>{var c;const s=n||{h1:"h1",h2:"h2",h3:"h3",h4:"h4",h5:"h5",h6:"h6",subtitle1:"p",subtitle2:"p",body1:"p",body2:"p",caption:"span",overline:"span"}[e]||"p";return a.jsx(s,{className:`${oi[e]} ${(c=ve[i])==null?void 0:c.text} ${t}`,...o?{id:o}:{},children:r})},Yn=({total:e,currentPage:n,pageSize:t=10,onPageChange:r,hideEdgeButtons:o=!1,className:i="",iconClass:l="",pageClass:s=""})=>{const c=Math.ceil(e/t),d=n===1,p=n===c;return c<=1?null:a.jsxs("div",{className:`flex items-center space-x-1 ${i}`,children:[!o&&a.jsx(Se,{color:"dark",icon:a.jsx("svg",{className:"size-5",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",children:a.jsx("path",{d:"M4.83582 12L11.0429 18.2071L12.4571 16.7929L7.66424 12L12.4571 7.20712L11.0429 5.79291L4.83582 12ZM10.4857 12L16.6928 18.2071L18.107 16.7929L13.3141 12L18.107 7.20712L16.6928 5.79291L10.4857 12Z"})}),onClick:()=>r(1),disabled:d,roundedFull:!0,size:"small",variant:"transparent",className:l}),a.jsx(Se,{color:"dark",icon:a.jsx("svg",{className:"size-5",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",children:a.jsx("path",{d:"M10.8284 12.0007L15.7782 16.9504L14.364 18.3646L8 12.0007L14.364 5.63672L15.7782 7.05093L10.8284 12.0007Z"})}),onClick:()=>r(n-1),disabled:d,roundedFull:!0,size:"small",variant:"transparent",className:l}),a.jsxs("span",{className:`text-sm text-color-gray-800 ${s}`,children:["Page ",n," of ",c]}),a.jsx(Se,{color:"dark",icon:a.jsx("svg",{className:"size-5",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",children:a.jsx("path",{d:"M13.1717 12.0007L8.22192 7.05093L9.63614 5.63672L16.0001 12.0007L9.63614 18.3646L8.22192 16.9504L13.1717 12.0007Z"})}),onClick:()=>r(n+1),disabled:p,roundedFull:!0,size:"small",variant:"transparent",className:l}),!o&&a.jsx(Se,{color:"dark",icon:a.jsx("svg",{className:"size-5",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",children:a.jsx("path",{d:"M19.1642 12L12.9571 5.79291L11.5429 7.20712L16.3358 12L11.5429 16.7929L12.9571 18.2071L19.1642 12ZM13.5143 12L7.30722 5.79291L5.89301 7.20712L10.6859 12L5.89301 16.7929L7.30722 18.2071L13.5143 12Z"})}),onClick:()=>r(c),disabled:p,roundedFull:!0,size:"small",variant:"transparent",className:l})]})},ii=({data:e,id:n,columns:t=[],pageSize:r,pageIndex:o,onPageSizeChange:i,onPageChange:l,rowOptionArray:s=[5,10,15],totalRecords:c=e.length,className:d="",paginationClassName:p="",tdClassName:m="",thClassName:u="",responsive:g=!1})=>{const x=ri({data:e,columns:t,getCoreRowModel:ni(),manualPagination:!0,pageCount:Math.ceil(c/r),state:{pagination:{pageIndex:o,pageSize:r}}});return a.jsx(a.Fragment,{children:a.jsxs("div",{className:`relative overflow-y-auto flex flex-col ${d} `,children:[a.jsx("div",{className:`${g?"overflow-x-auto":""}`,children:a.jsxs("table",{id:n,className:"w-full relative border-collapse",children:[a.jsx("thead",{className:"sticky top-0 left-0 rounded-xl bg-color-[#FAFBFB] z-10 h-10",children:x.getHeaderGroups().map(f=>a.jsx("tr",{children:f.headers.map(w=>{var b;return a.jsx("th",{className:`bg-color-[#FAFBFB] p-2 text-left text-xs font-semibold text-color-gray-500 border-b border-color-gray-200 ${u}`,id:((b=w.column.columnDef.meta)==null?void 0:b.headerId)||w.id,children:w.isPlaceholder?null:w.column.columnDef.header instanceof Function?w.column.columnDef.header(w.getContext()):w.column.columnDef.header},w.id)})},f.id))}),a.jsx("tbody",{className:"",children:x.getRowModel().rows.map(f=>a.jsx("tr",{className:"border-b border-color-gray-200",children:f.getVisibleCells().map(w=>a.jsx("td",{className:`px-2 py-4 font-normal text-sm text-color-gray-800 ${m}`,children:w.column.columnDef.cell instanceof Function?w.column.columnDef.cell(w.getContext()):w.getValue()},w.id))},f.id))})]})}),a.jsxs("div",{className:`w-full py-4 px-2 border-t border-color-gray-200 bg-color-[#FAFBFB] flex justify-between items-center ${p} sticky bottom-0 z-10`,children:[a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx(Gn,{variant:"body2",className:"hidden md:!flex",children:"Rows per page"}),a.jsx(En,{options:s,selectedValue:r,placementTop:!0,onChange:f=>{i(f),l(0)}})]}),a.jsx(Yn,{total:c,pageSize:r,currentPage:o+1,onPageChange:f=>l(f-1)})]})]})})},ai=({children:e,className:n=""})=>a.jsx("ul",{className:`divide-y divide-color-gray-200 rounded-md bg-color-white shadow-sm border border-color-gray-200 ${n}`,children:e}),li=({children:e,secondaryAction:n,className:t=""})=>a.jsxs("li",{className:`flex items-center justify-between overflow-hidden px-4 py-3 hover:bg-color-gray-50 transition ${t}`,children:[a.jsx("div",{className:"flex-1",children:e}),n&&a.jsx("div",{className:"ml-4",children:n})]}),si=({open:e,onClick:n,className:t="",children:r,...o})=>{const[i,l]=h.useState(!1);return h.useEffect(()=>{let s;return e?s=setTimeout(()=>l(!0),100):l(!1),()=>clearTimeout(s)},[e]),!e&&!i?null:a.jsx("div",{className:`fixed inset-0 z-999 bg-color-black/50 flex items-center justify-center transition-all duration-300 ${i?"opacity-100 pointer-events-auto":"opacity-0 pointer-events-none"} ${t}`,onClick:n,"aria-hidden":!i,...o,children:r})},ci={small:"p-2 text-sm",medium:"p-3 text-base",large:"p-4 text-lg"},ui={filled:"bg-color-gray-100 border-color-gray-200",outlined:"border-color-gray-200 bg-color-transparent"},Zn=h.forwardRef(({placeholder:e,value:n,onChange:t,type:r="text",inputMode:o="numeric",className:i="",inputClass:l="",iconStyle:s="",startIcon:c,endIcon:d,error:p,maxLength:m,label:u,labelClass:g="",variant:x="outlined",size:f="medium",...w},b)=>{const[$,C]=h.useState(""),k=n!==void 0,y=k?n:$,T=p?"border-color-red-500 focus-within:ring-color-red-500":"border-color-gray-200",_=p?"text-color-red-500":s,I=ee=>{let K=ee.target.value.replace(/(?!^\+)[^\d]/g,"");K.startsWith("+")&&(K="+"+K.slice(1).replace(/\+/g,"")),K=K.replace(/\s/g,""),(!m||K.replace(/^\+/,"").length<=m)&&(t&&t({...ee,target:{...ee.target,value:K}}),k||C(K))};return a.jsxs("div",{className:"w-full",children:[u&&a.jsx("label",{className:`text-sm font-medium text-color-gray-700 mb-1 block ${g}`,children:u}),a.jsxs("div",{className:`flex items-center w-full rounded-md border focus-within:ring-1 ${T} ${ui[x]} ${i}`,children:[c&&a.jsx("span",{className:`pl-3 ${_}`,children:c}),a.jsx("input",{...w,ref:b,type:"text",inputMode:"numeric",placeholder:e,value:y,onChange:I,className:`grow outline-0 w-full font-medium placeholder:font-normal bg-color-transparent ${ci[f]} ${l}`}),d&&a.jsx("span",{className:`pr-3 ${_}`,children:d})]}),p&&a.jsx("p",{className:"text-color-red-500 text-xs mt-1",children:p})]})});Zn.displayName="NumberInput";const Wn=({animation:e="pulse",variant:n="rectangular",width:t,height:r,className:o=""})=>{const i="bg-color-gray-200 dark:bg-color-gray-700",l={pulse:"animate-pulse",wave:"relative overflow-hidden"},s=()=>{switch(n){case"circular":return{classes:"rounded-full",defaultWidth:40,defaultHeight:40};case"rectangular":return{classes:"",defaultWidth:200,defaultHeight:100};case"rounded":return{classes:"rounded-lg",defaultWidth:200,defaultHeight:100};case"text":return{classes:"rounded-sm",defaultWidth:void 0,defaultHeight:16};default:return{classes:"",defaultWidth:200,defaultHeight:100}}},{classes:c,defaultWidth:d,defaultHeight:p}=s(),m=t??d,u=r??p,g={};m!==void 0&&(g.width=`${m}px`),u!==void 0&&(g.height=`${u}px`),n==="text"&&t===void 0&&(g.width="100%");const x=[i,c,l[e],o].filter(Boolean).join(" ");return a.jsx("div",{className:x,style:g,children:e==="wave"&&a.jsxs(a.Fragment,{children:[a.jsx("div",{className:"absolute inset-0 bg-gradient-[linear-gradient(90deg,_rgba(255,_255,_255,_0)_0%,_rgba(255,_255,_255,_0.35)_50%,_rgba(255,_255,_255,_0)_100%)] dark:bg-gradient-[linear-gradient(90deg,_rgba(255,_255,_255,_0)_0%,_rgba(255,_255,_255,_0.1)_50%,_rgba(255,_255,_255,_0)_100%)]",style:{animation:"skeleton-wave 2s ease-in-out infinite"}}),a.jsx("style",{children:`
127
127
  @keyframes skeleton-wave {
128
128
  0% { transform: translateX(-100%); }
129
129
  50% { transform: translateX(100%); }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@unizap/uniui",
3
- "version": "1.0.56",
3
+ "version": "1.0.57",
4
4
  "description": "UniUi helps developers and designers build beautiful, responsive UIs faster with ready-made, customizable components. Simplify your workflow and create stunning user interfaces effortlessly.",
5
5
  "type": "module",
6
6
  "files": [