@redi.run/redi-components 0.0.33 → 0.0.34
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/redi-components.js
CHANGED
|
@@ -13356,9 +13356,9 @@ var AdvancedTable_default = ({ data: e, columns: t, defaultSort: o, defaultFilte
|
|
|
13356
13356
|
},
|
|
13357
13357
|
draggable: !e.isAction && E && (e.draggable ?? !1),
|
|
13358
13358
|
onDragStart: (n) => !e.isAction && E && (e.draggable ?? !1) && q(n, t),
|
|
13359
|
-
onDragOver: (n) => !e.isAction && E &&
|
|
13359
|
+
onDragOver: (n) => !e.isAction && E && tp(n, t),
|
|
13360
13360
|
onDragLeave: np,
|
|
13361
|
-
onDrop: (n) => !e.isAction && E &&
|
|
13361
|
+
onDrop: (n) => !e.isAction && E && rp(n, t),
|
|
13362
13362
|
onDragEnd: ip,
|
|
13363
13363
|
"aria-sort": H?.column === e.id ? H.direction === "asc" ? "ascending" : "descending" : "none",
|
|
13364
13364
|
children: /* @__PURE__ */ jsxs("div", {
|
|
@@ -110,7 +110,7 @@ function op(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r
|
|
|
110
110
|
${E===t?`opacity-50 bg-gray-300`:``}
|
|
111
111
|
${O===t?`bg-redi-primary-bg border-l border-solid border-redi-primary`:``}
|
|
112
112
|
${O===t?`bg-redi-primary-bg border-l border-solid border-redi-primary`:``}
|
|
113
|
-
`,style:{width:r,minWidth:r,maxWidth:r},draggable:!e.isAction&&S&&(e.draggable??!1),onDragStart:n=>!e.isAction&&S&&(e.draggable??!1)&&ge(n,t),onDragOver:n=>!e.isAction&&S&&
|
|
113
|
+
`,style:{width:r,minWidth:r,maxWidth:r},draggable:!e.isAction&&S&&(e.draggable??!1),onDragStart:n=>!e.isAction&&S&&(e.draggable??!1)&&ge(n,t),onDragOver:n=>!e.isAction&&S&&_e(n,t),onDragLeave:ve,onDrop:n=>!e.isAction&&S&&ye(n,t),onDragEnd:be,"aria-sort":fe?.column===e.id?fe.direction===`asc`?`ascending`:`descending`:`none`,children:(0,n.jsxs)(`div`,{className:`flex items-center py-3 px-4 gap-2 min-h-12`,children:[!e.isAction&&S&&(e.draggable??!1)&&(0,n.jsx)(`div`,{className:`text-gray-600 cursor-grab opacity-70 hover:opacity-100 text-base`,"aria-hidden":`true`,children:`⋮⋮`}),(0,n.jsxs)(`div`,{className:`flex flex-1 items-center gap-2`,children:[(0,n.jsxs)(`span`,{className:c?`cursor-pointer py-1 px-1.5 rounded-sm flex items-center gap-1.5 text-sm font-semibold text-redi-text uppercase hover:bg-redi-background hover:text-redi-link-text`:``,onClick:t=>{t.stopPropagation(),e.sortable&&ie(e.id)},role:`button`,tabIndex:0,onKeyDown:t=>{(t.key===`Enter`||t.key===` `)&&(t.preventDefault(),e.sortable&&ie(e.id))},children:[e.label,e.sortable&&fe?.column===e.id&&(0,n.jsx)(`span`,{className:`font-bold text-redi-link-text text-base`,children:fe.direction===`asc`?` ↑`:` ↓`})]}),(0,n.jsx)(`div`,{className:`flex items-center gap-1`,children:e.filterable&&(0,n.jsxs)(`div`,{className:`relative`,children:[(0,n.jsx)(np,{level:`icon`,onClick:t=>{t.stopPropagation(),Se(e.id)},"aria-label":`Filter by ${e.label}`,children:(0,n.jsx)(g,{size:16})}),M===e.id&&(0,n.jsx)(ap,{columnId:e.id,label:e.label,options:Ce(e.id),textValue:pe[e.id]?.type===`text`?String(pe[e.id].value||``):``,selectedValues:pe[e.id]?.type===`multiselect`&&Array.isArray(pe[e.id]?.value)?pe[e.id].value:[],onTextChange:t=>ae(e.id,t,`text`),onSelectionChange:t=>ae(e.id,t,`multiselect`),onClose:()=>N(null)})]})})]})]})},e.id)})})}),(0,n.jsx)(`tbody`,{children:T?Array.from({length:5}).map((e,t)=>(0,n.jsx)(`tr`,{className:`border-b border-solid border-gray-100`,children:he.map((e,t)=>{let r=Te(e),i={width:r,minWidth:r,maxWidth:r};return(0,n.jsx)(`td`,{className:`py-4 px-4 ${e.isAction?`bg-white border-l border-gray-200`:``}`,style:i,children:(0,n.jsx)(`div`,{className:`h-4 bg-gray-200 rounded animate-pulse w-3/4`})},`skeleton-cell-${t}`)})},`skeleton-${t}`)):de.length>0?de.map((e,t)=>(0,n.jsx)(`tr`,{className:`even:bg-gray-50 hover:bg-gray-100 border-b border-solid border-b-gray-100 odd:bg-white`,children:he.map((r,i)=>{let a=typeof r.accessor==`function`?r.accessor(e):e[r.accessor],o=r.isAction,s=Te(r),c=`py-3 px-4 text-redi-text font-normal leading-6 align-middle border-r border-solid border-r-gray-300 static table-cell last:border-r-0 first:font-medium
|
|
114
114
|
${o?`border-l border-gray-300 shadow-[-2px_0_5px_-2px_rgba(0,0,0,0.05)]`:``}
|
|
115
115
|
`,l={width:s,minWidth:s,maxWidth:s};return r.render?(0,n.jsx)(`td`,{className:c,style:l,children:r.render({value:a,row:e,column:r,index:t})},r.id):(0,n.jsx)(`td`,{className:c,style:l,children:Zf(a)},r.id)})},t)):(0,n.jsx)(`tr`,{children:(0,n.jsx)(`td`,{colSpan:he.length,className:`py-12 text-center text-gray-500`,children:(0,n.jsxs)(`div`,{className:`flex flex-col items-center justify-center gap-2`,children:[(0,n.jsx)(`svg`,{className:`w-12 h-12 text-gray-300`,fill:`none`,stroke:`currentColor`,viewBox:`0 0 24 24`,children:(0,n.jsx)(`path`,{strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:1.5,d:`M20 13V6a2 2 0 00-2-2H6a2 2 0 00-2 2v7m16 0v5a2 2 0 01-2 2H6a2 2 0 01-2-2v-5m16 0h-2.586a1 1 0 00-.707.293l-2.414 2.414a1 1 0 01-.707.293h-3.172a1 1 0 01-.707-.293l-2.414-2.414A1 1 0 006.586 13H4`})}),(0,n.jsx)(`span`,{className:`text-sm font-medium`,children:`No data available`})]})})})})]})}),u&&(0,n.jsxs)(`div`,{className:`flex items-center justify-between py-4 px-6 bg-white border-t-gray-300 border-solid border-t gap-4`,children:[(0,n.jsx)(`div`,{className:`text-redi-text text-base font-medium shrink-0`,children:(0,n.jsxs)(`span`,{children:[x.pagination?.showingItems,` `,(F.page-1)*F.pageSize+1,` `,x.pagination?.to,` `,Math.min(F.page*F.pageSize,F.total),` `,x.pagination?.of,` `,F.total,` `,x.pagination?.items]})}),(0,n.jsxs)(`div`,{className:`flex items-center gap-5`,children:[(0,n.jsxs)(`label`,{className:`flex items-center gap-3 text-sm font-semibold text-redi-text`,children:[x.pagination?.showPerPage,(0,n.jsx)(`select`,{value:F.pageSize,onChange:e=>ce(Number(e.target.value)),className:`py-1.5 px-2.5 border border-solid border-gray-300 rounded-md bg-white text-redi-text focus:outline-none focus:ring-2 focus:ring-redi-primary`,children:s.map(e=>(0,n.jsx)(`option`,{value:e,children:e},e))}),x.pagination?.perPageItems]}),(0,n.jsxs)(`div`,{className:`flex gap-1 items-center`,children:[(0,n.jsx)(np,{level:`icon`,onClick:()=>se(1),disabled:F.page===1,children:`<<`}),(0,n.jsx)(np,{level:`icon`,onClick:()=>se(F.page-1),disabled:F.page===1,children:`<`}),Array.from({length:Math.min(3,we)},(e,t)=>{let r;return r=we<=3||F.page<=2?t+1:F.page>we-2?we-2+t:F.page-1+t,(0,n.jsx)(np,{level:F.page===r?`primary`:`secondary`,onClick:()=>se(r),children:r},r)}),(0,n.jsx)(np,{level:`icon`,onClick:()=>se(F.page+1),disabled:F.page===we,children:`>`}),(0,n.jsx)(np,{level:`icon`,onClick:()=>se(we),disabled:F.page===we,children:`>>`})]})]})]})]})},pp={info:`border-redi-link text-redi-tertiary-text`,success:`border-redi-success text-redi-tertiary-text`,warning:`border-redi-warning text-redi-tertiary-text`,danger:`border-redi-danger text-redi-tertiary-text`},mp=({title:e,description:t,tone:r=`info`,onClose:i})=>(0,n.jsxs)(`div`,{className:`rounded-lg border px-4 py-2 ${pp[r]}`,children:[(0,n.jsxs)(`div`,{className:`flex items-center justify-between`,children:[e&&(0,n.jsx)(`div`,{className:`font-semibold`,children:e}),i&&(0,n.jsx)(`button`,{type:`button`,onClick:i,className:`text-redi-tertiary-text`,children:`×`})]}),t&&(0,n.jsx)(`div`,{className:`text-sm`,children:t})]}),hp={success:`bg-redi-success text-white`,warning:`bg-redi-warning text-white`,danger:`bg-redi-danger text-white`,info:`bg-redi-link text-white`},gp=({label:e,tone:t=`info`})=>(0,n.jsx)(`span`,{className:`inline-block rounded px-2 py-1 text-xs ${hp[t]}`,children:e});let _p=({className:e,...t})=>(0,n.jsx)(`svg`,{className:e||`w-3.5 h-3.5`,fill:`none`,viewBox:`0 0 24 24`,stroke:`currentColor`,strokeWidth:3,...t,children:(0,n.jsx)(`path`,{strokeLinecap:`round`,strokeLinejoin:`round`,d:`M4.5 12.75l6 6 9-13.5`})});var vp=({checked:e,onChange:t,label:r,disabled:i=!1,color:a,error:o=!1,helperText:s,id:c,name:l})=>{let u=a?tp(a):null,d=u&&e&&!i?{backgroundColor:u.main,borderColor:u.main,"--checkbox-ring":u.active}:{},f=o?`border-red-500`:`border-gray-300`,p=o?`text-red-500`:`text-gray-700`;return(0,n.jsxs)(`div`,{className:`flex flex-col`,children:[(0,n.jsxs)(`label`,{className:`inline-flex items-center gap-2 ${i?`cursor-not-allowed opacity-75`:`cursor-pointer`}`,children:[(0,n.jsxs)(`div`,{className:`relative flex items-center`,children:[(0,n.jsx)(`input`,{id:c||l,name:l,type:`checkbox`,checked:e,onChange:e=>!i&&t(e.target.checked),disabled:i,className:`peer sr-only`}),(0,n.jsx)(`div`,{className:`
|
|
116
116
|
h-5 w-5 rounded border transition-all duration-200 flex items-center justify-center
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@redi.run/redi-components",
|
|
3
3
|
"description": "This project was created to define the style of the UI and improve the UX in all projects from REDI",
|
|
4
|
-
"version": "0.0.
|
|
4
|
+
"version": "0.0.34",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"author": {
|
|
7
7
|
"name": "Jonathan Manchego Sosa",
|