@unizap/uniui 1.0.39 → 1.0.40
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 +12 -8
- package/dist/uniui.umd.cjs +1 -1
- package/package.json +1 -1
package/dist/uniui.js
CHANGED
|
@@ -5842,24 +5842,26 @@ const li = {
|
|
|
5842
5842
|
je,
|
|
5843
5843
|
{
|
|
5844
5844
|
color: "dark",
|
|
5845
|
-
icon: /* @__PURE__ */ a.jsx("svg", { className:
|
|
5845
|
+
icon: /* @__PURE__ */ a.jsx("svg", { className: "size-5", xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", fill: "currentColor", children: /* @__PURE__ */ 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" }) }),
|
|
5846
5846
|
onClick: () => o(1),
|
|
5847
5847
|
disabled: u,
|
|
5848
5848
|
roundedFull: !0,
|
|
5849
5849
|
size: "small",
|
|
5850
|
-
variant: "transparent"
|
|
5850
|
+
variant: "transparent",
|
|
5851
|
+
className: l
|
|
5851
5852
|
}
|
|
5852
5853
|
),
|
|
5853
5854
|
/* @__PURE__ */ a.jsx(
|
|
5854
5855
|
je,
|
|
5855
5856
|
{
|
|
5856
5857
|
color: "dark",
|
|
5857
|
-
icon: /* @__PURE__ */ a.jsx("svg", { className:
|
|
5858
|
+
icon: /* @__PURE__ */ a.jsx("svg", { className: "size-5", xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", fill: "currentColor", children: /* @__PURE__ */ 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" }) }),
|
|
5858
5859
|
onClick: () => o(n - 1),
|
|
5859
5860
|
disabled: u,
|
|
5860
5861
|
roundedFull: !0,
|
|
5861
5862
|
size: "small",
|
|
5862
|
-
variant: "transparent"
|
|
5863
|
+
variant: "transparent",
|
|
5864
|
+
className: l
|
|
5863
5865
|
}
|
|
5864
5866
|
),
|
|
5865
5867
|
/* @__PURE__ */ a.jsxs("span", { className: `text-sm text-color-gray-800 ${s}`, children: [
|
|
@@ -5872,24 +5874,26 @@ const li = {
|
|
|
5872
5874
|
je,
|
|
5873
5875
|
{
|
|
5874
5876
|
color: "dark",
|
|
5875
|
-
icon: /* @__PURE__ */ a.jsx("svg", { className:
|
|
5877
|
+
icon: /* @__PURE__ */ a.jsx("svg", { className: "size-5", xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", fill: "currentColor", children: /* @__PURE__ */ 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" }) }),
|
|
5876
5878
|
onClick: () => o(n + 1),
|
|
5877
5879
|
disabled: p,
|
|
5878
5880
|
roundedFull: !0,
|
|
5879
5881
|
size: "small",
|
|
5880
|
-
variant: "transparent"
|
|
5882
|
+
variant: "transparent",
|
|
5883
|
+
className: l
|
|
5881
5884
|
}
|
|
5882
5885
|
),
|
|
5883
5886
|
!r && /* @__PURE__ */ a.jsx(
|
|
5884
5887
|
je,
|
|
5885
5888
|
{
|
|
5886
5889
|
color: "dark",
|
|
5887
|
-
icon: /* @__PURE__ */ a.jsx("svg", { className:
|
|
5890
|
+
icon: /* @__PURE__ */ a.jsx("svg", { className: "size-5", xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", fill: "currentColor", children: /* @__PURE__ */ 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" }) }),
|
|
5888
5891
|
onClick: () => o(c),
|
|
5889
5892
|
disabled: p,
|
|
5890
5893
|
roundedFull: !0,
|
|
5891
5894
|
size: "small",
|
|
5892
|
-
variant: "transparent"
|
|
5895
|
+
variant: "transparent",
|
|
5896
|
+
className: l
|
|
5893
5897
|
}
|
|
5894
5898
|
)
|
|
5895
5899
|
] });
|
package/dist/uniui.umd.cjs
CHANGED
|
@@ -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 Jr(e){const n={state:{},onStateChange:()=>{},renderFallbackValue:null,...e},[t]=Tt.useState(()=>({current:Kr(n)})),[o,r]=Tt.useState(()=>t.current.initialState);return t.current.setOptions(i=>({...i,...e,state:{...o,...e.state},onStateChange:l=>{r(l),e.onStateChange==null||e.onStateChange(l)}})),t.current}const Qr={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"},Vn=({variant:e="body1",component:n,className:t="",children:o,color:r="dark"})=>{var s;const l=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(l,{className:`${Qr[e]} ${(s=pe[r])==null?void 0:s.text} ${t}`,children:o})},Hn=({total:e,currentPage:n,pageSize:t=10,onPageChange:o,hideEdgeButtons:r=!1,className:i="",iconClass:l="",pageClass:s=""})=>{const c=Math.ceil(e/t),u=n===1,d=n===c;return c<=1?null:a.jsxs("div",{className:`flex items-center space-x-1 ${i}`,children:[!r&&a.jsx(he,{color:"dark",icon:a.jsx("svg",{className
|
|
126
|
+
*/function Jr(e){const n={state:{},onStateChange:()=>{},renderFallbackValue:null,...e},[t]=Tt.useState(()=>({current:Kr(n)})),[o,r]=Tt.useState(()=>t.current.initialState);return t.current.setOptions(i=>({...i,...e,state:{...o,...e.state},onStateChange:l=>{r(l),e.onStateChange==null||e.onStateChange(l)}})),t.current}const Qr={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"},Vn=({variant:e="body1",component:n,className:t="",children:o,color:r="dark"})=>{var s;const l=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(l,{className:`${Qr[e]} ${(s=pe[r])==null?void 0:s.text} ${t}`,children:o})},Hn=({total:e,currentPage:n,pageSize:t=10,onPageChange:o,hideEdgeButtons:r=!1,className:i="",iconClass:l="",pageClass:s=""})=>{const c=Math.ceil(e/t),u=n===1,d=n===c;return c<=1?null:a.jsxs("div",{className:`flex items-center space-x-1 ${i}`,children:[!r&&a.jsx(he,{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:()=>o(1),disabled:u,roundedFull:!0,size:"small",variant:"transparent",className:l}),a.jsx(he,{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:()=>o(n-1),disabled:u,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(he,{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:()=>o(n+1),disabled:d,roundedFull:!0,size:"small",variant:"transparent",className:l}),!r&&a.jsx(he,{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:()=>o(c),disabled:d,roundedFull:!0,size:"small",variant:"transparent",className:l})]})},ei=({data:e,columns:n=[],pageSize:t,pageIndex:o,onPageSizeChange:r,onPageChange:i,rowOptionArray:l=[5,10,15],totalRecords:s=e.length,className:c="",paginationClassName:u="",tdClassName:d="",thClassName:m="",responsive:p=!1})=>{const f=Jr({data:e,columns:n,getCoreRowModel:Xr(),manualPagination:!0,pageCount:Math.ceil(s/t),state:{pagination:{pageIndex:o,pageSize:t}}});return a.jsx(a.Fragment,{children:a.jsxs("div",{className:`relative overflow-y-auto flex flex-col ${c} `,children:[a.jsx("div",{className:`${p?"overflow-x-auto":""}`,children:a.jsxs("table",{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:f.getHeaderGroups().map(x=>a.jsx("tr",{children:x.headers.map(g=>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 ${m}`,children:g.isPlaceholder?null:g.column.columnDef.header instanceof Function?g.column.columnDef.header(g.getContext()):g.column.columnDef.header},g.id))},x.id))}),a.jsx("tbody",{className:"",children:f.getRowModel().rows.map(x=>a.jsx("tr",{className:"border-b border-color-gray-200",children:x.getVisibleCells().map(g=>a.jsx("td",{className:`px-2 py-4 font-normal text-sm text-color-gray-800 ${d}`,children:g.column.columnDef.cell instanceof Function?g.column.columnDef.cell(g.getContext()):g.getValue()},g.id))},x.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 ${u} sticky bottom-0 z-10`,children:[a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx(Vn,{variant:"body2",className:"hidden md:!flex",children:"Rows per page"}),a.jsx(kn,{options:l,selectedValue:t,placementTop:!0,onChange:x=>{r(x),i(0)}})]}),a.jsx(Hn,{total:s,pageSize:t,currentPage:o+1,onPageChange:x=>i(x-1)})]})]})})},ti=({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}),ni=({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})]}),oi=({open:e,onClick:n,className:t="",children:o,...r})=>{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,...r,children:o})},Bn=({animation:e="pulse",variant:n="rectangular",width:t,height:o,className:r=""})=>{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:u,defaultHeight:d}=s(),m=t??u,p=o??d,f={};m!==void 0&&(f.width=`${m}px`),p!==void 0&&(f.height=`${p}px`),n==="text"&&t===void 0&&(f.width="100%");const x=[i,c,l[e],r].filter(Boolean).join(" ");return a.jsx("div",{className:x,style:f,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%); }
|