ui-mathilde-web 0.1.36 → 0.1.37

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.
@@ -92,6 +92,7 @@ declare interface CustomPaginationProps {
92
92
  currentPage: number;
93
93
  totalPages: number;
94
94
  onPageChange: (page: number) => void;
95
+ value?: number;
95
96
  }
96
97
 
97
98
  export declare const DatePicker: ({ minDate, maxDate, }: {
@@ -20256,11 +20256,20 @@ function Y2(t) {
20256
20256
  const V2 = ({
20257
20257
  currentPage: t,
20258
20258
  totalPages: e,
20259
- onPageChange: r
20259
+ onPageChange: r,
20260
+ value: n
20260
20261
  }) => /* @__PURE__ */ K("div", { className: "flex items-center justify-center gap-4", children: [
20261
20262
  /* @__PURE__ */ K("span", { className: "text-base text-gray-700", children: [
20262
20263
  "Ver  ",
20263
- /* @__PURE__ */ b("input", { type: "number", className: `w-10 ${ml["mth-input-number"]}`, id: "itemsPerPage" })
20264
+ /* @__PURE__ */ b(
20265
+ "input",
20266
+ {
20267
+ type: "number",
20268
+ className: `w-10 ${ml["mth-input-number"]}`,
20269
+ id: "itemsPerPage",
20270
+ defaultValue: n || 15
20271
+ }
20272
+ )
20264
20273
  ] }),
20265
20274
  /* @__PURE__ */ b(
20266
20275
  "button",
@@ -484,7 +484,7 @@ You may have forgotten to import it.`);var r=e.__emotion_real===e,a=r&&e.__emoti
484
484
 
485
485
  `,`;
486
486
  }
487
- `])),function(t){var e=t.menuItemStyles;return e},function(t){var e=t.rootStyles;return e},ye.button,function(t){var e=t.level,n=t.disabled,r=t.active,a=t.collapsed,s=t.rtl;return ip({level:e,disabled:n,active:r,collapsed:a,rtl:s})},function(t){var e=t.buttonStyles;return e}),u2=function(t,e){var n,r=t.children,a=t.icon,s=t.className,o=t.prefix,i=t.suffix,l=t.active,c=l===void 0?!1:l,d=t.disabled,u=d===void 0?!1:d,f=t.component,h=t.rootStyles,g=br(t,["children","icon","className","prefix","suffix","active","disabled","component","rootStyles"]),p=_.useContext(Yo),b=_.useContext(Ho),w=b.collapsed,y=b.rtl,k=b.transitionDuration,v=wc().menuItemStyles,x=function(N){if(v){var C={level:p,disabled:u,active:c,isSubmenu:!1},T=v.root,E=v.button,P=v.label,I=v.icon,M=v.prefix,S=v.suffix;switch(N){case"root":return typeof T=="function"?T(C):T;case"button":return typeof E=="function"?E(C):E;case"label":return typeof P=="function"?P(C):P;case"icon":return typeof I=="function"?I(C):I;case"prefix":return typeof M=="function"?M(C):M;case"suffix":return typeof S=="function"?S(C):S;default:return}}},O=(n={},n[ye.active]=c,n[ye.disabled]=u,n);return _.createElement(d2,{ref:e,className:$e(ye.menuItemRoot,O,s),menuItemStyles:x("root"),level:p,collapsed:w,rtl:y,disabled:u,active:c,buttonStyles:x("button"),rootStyles:h},_.createElement(lp,St({className:$e(ye.button,O),"data-testid":"".concat(ye.button,"-test-id"),component:f,tabIndex:0},g),a&&_.createElement(N0,{rtl:y,className:$e(ye.icon,O),rootStyles:x("icon")},a),o&&_.createElement(I0,{collapsed:w,transitionDuration:k,firstLevel:p===0,className:$e(ye.prefix,O),rtl:y,rootStyles:x("prefix")},o),_.createElement(P0,{className:$e(ye.label,O),rootStyles:x("label")},r),i&&_.createElement(A0,{collapsed:w,transitionDuration:k,firstLevel:p===0,className:$e(ye.suffix,O),rootStyles:x("suffix")},i)))},f2=_.forwardRef(u2),dp;const Tc=_.forwardRef((t,e)=>{const{imageUrl:n,icon:r,title:a,description:s}=t;return m.jsxs("div",{className:`${Uh.Card} border px-3.5 py-7`,ref:e,children:[n?m.jsx(jn,{classIm:"mx-auto",src:n,alt:a,width:74,height:74}):r?m.jsx("div",{className:"flex justify-center",children:m.jsx(r,{size:74})}):null,m.jsx("h3",{className:"my-3 font-bold",children:a}),m.jsx("p",{children:s})]})});Tc.displayName="Card";const h2=({aHref:t,logo:e,menuItems:n,campaignCards:r=[],onLogout:a,defaultCollapsed:s=!1,background:o="linear-gradient(180deg, rgba(25, 25, 96, 0.95) 0%, rgba(41, 41, 139, 0.95) 100%)",textColor:i="#ffffff",className:l=""})=>{const[c,d]=_.useState(s),[u,f]=_.useState(null),[h,g]=_.useState(new Set),[p,b]=_.useState(null),[w,y]=_.useState(null),k=n.filter(M=>M.position!=="bottom"),v=n.filter(M=>M.position==="bottom"),x=(M,S="text-xl")=>typeof M=="string"?m.jsx("img",{src:M,style:{width:"25px",height:"25px"}}):M?_.createElement(M,{className:S}):null,O=(M=!1,S=!1)=>({background:c?"transparent":S?"#FFFFFF55":M?"#FFFFFF22":"#FFFFFF33",color:i,borderRadius:M?"15px":"20px",button:{width:c?"calc(100% - 0.5rem)":"calc(100% - 1rem)",margin:c?"0 0.25rem":"0 0.5rem",color:i,fontSize:M?"0.9rem":void 0}}),N=(M,S=!1,R)=>{const z=S?w===M.id:p===M.id;return m.jsx(f2,{icon:x(M.icon,S?"":"text-2xl"),onClick:()=>P(M,R),className:"mx-auto mb-1 rounded-md",rootStyles:O(S,z),children:S?M.label:m.jsxs("div",{className:"flex w-full items-center justify-between",children:[m.jsx("span",{children:M.label}),M.subMenuSection&&m.jsx(pS,{className:`text-lg transition-transform duration-200 ${h.has(M.id)?"rotate-180":""}`})]})},M.id)},C=M=>M.map(S=>m.jsxs("div",{children:[N(S),S.subMenuSection&&h.has(S.id)&&m.jsx("div",{className:"ml-4 space-y-1 mb-2",children:S.subMenuSection.items.map(R=>N(R,!0,S.id))})]},S.id)),T=()=>{u||d(!1)},E=()=>{u||(d(!0),g(new Set))},P=(M,S)=>{if(S?(b(S),y(M.id)):(b(M.id),y(null)),M.subMenuSection){const R=new Set(h);R.has(M.id)?R.delete(M.id):R.add(M.id),g(R)}else M.action?M.action():M.href&&(M.target==="_blank"?window.open(M.href,"_blank"):window.location.href=M.href)},I=M=>{M.action?M.action():M.href&&(M.target==="_blank"?window.open(M.href,"_blank"):window.location.href=M.href)};return m.jsx("div",{className:`fixed left-0 top-0 z-40 h-full ${l}`,children:m.jsxs("div",{className:"flex flex-col",onMouseEnter:T,onMouseLeave:E,children:[m.jsxs(BD,{collapsed:c,rootStyles:{[`.${We.container}`]:{background:o,color:i,height:"100vh",display:"flex",flexDirection:"column",width:c?"95px":"275px",transition:"all 400ms ease-in-out"}},children:[m.jsx("div",{className:`${c?"mx-auto":""} mb-2 mt-5 px-2`,children:m.jsx("a",{href:t||"/",children:m.jsx(jn,{classIm:"mx-3",src:e.src,alt:e.alt,width:e.width,height:e.height})})}),m.jsxs("div",{className:"flex flex-col h-full",children:[m.jsxs(VD,{className:"flex-1 mx-5 relative",children:[m.jsx("div",{className:"flex flex-col",children:C(k)}),m.jsx("div",{className:` ${h.size===0?"absolute bottom-0":""} w-full`,children:C(v)})]}),a&&m.jsx("div",{className:"w-full cursor-pointer py-4 px-7 mt-auto",children:m.jsx("div",{className:"flex rounded-2xl p-2",style:{background:c?"transparent":"#FFFFFF1A",float:c?"none":"right",width:c?"":"fit-content"},onClick:a,children:m.jsx("button",{style:{color:i},children:m.jsx("img",{src:"https://ftp.mathilde-ads.com/382-1a63116bc0d0909114f6c93af9d3dd8d.svg",width:"25px",height:"25px",alt:"logout"})})})})]})]}),r.length>0&&m.jsx(jm,{width:"40%",isOpen:u==="campaigns",onClose:()=>f(null),children:m.jsxs("div",{className:"flex flex-col px-10 pb-5",children:[m.jsx("h2",{className:"mb-3 text-center font-bold",children:"Selecciona el tipo de campaña que quieres crear"}),m.jsx("div",{className:"flex",children:r.map(M=>m.jsx("div",{className:"flex w-3/6 p-2",onClick:()=>I(M),children:m.jsx(Tc,{imageUrl:M.imageUrl,title:M.title,description:M.description})},M.id))})]})})]})})},Nc={"mth-color-primary":"pagination-module__mth-color-primary__hNTQd","mth-input-number":"pagination-module__mth-input-number__2TY-u"};function g2(t){return Te({attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{fill:"none",strokeLinecap:"square",strokeMiterlimit:"10",strokeWidth:"48",d:"M328 112 184 256l144 144"},child:[]}]})(t)}function m2(t){return Te({attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{fill:"none",strokeLinecap:"square",strokeMiterlimit:"10",strokeWidth:"48",d:"m184 112 144 144-144 144"},child:[]}]})(t)}const up=({currentPage:t,totalPages:e,onPageChange:n})=>m.jsxs("div",{className:"flex items-center justify-center gap-4",children:[m.jsxs("span",{className:"text-base text-gray-700",children:["Ver  ",m.jsx("input",{type:"number",className:`w-10 ${Nc["mth-input-number"]}`,id:"itemsPerPage"})]}),m.jsx("button",{onClick:()=>n(t-1),disabled:t===1,className:" text-gray-500 hover:text-gray-700 disabled:cursor-not-allowed disabled:opacity-50",children:m.jsx(g2,{className:`h-9 w-9 ${Nc["mth-color-primary"]}`})}),m.jsxs("span",{className:"text-sm text-gray-700",children:[t," DE ",e]}),m.jsx("button",{onClick:()=>n(t+1),disabled:t===e,className:"text-gray-500 hover:text-gray-700 disabled:cursor-not-allowed disabled:opacity-50",children:m.jsx(m2,{className:`h-9 w-9 ${Nc["mth-color-primary"]}`})})]}),p2={mth_toggle:"toggle-module__mth_toggle__8NB4F"};function b2({label:t,checked:e=!1,disabled:n=!1,onChange:r}){const[a,s]=_.useState(e),o=i=>{if(n)return;const l=i.target.checked;s(l),r==null||r(l)};return m.jsxs("div",{className:"flex items-center gap-2",children:[m.jsxs("label",{className:`inline-flex items-center ${n?"cursor-not-allowed opacity-60":"cursor-pointer"}`,children:[m.jsx("input",{type:"checkbox",className:"peer sr-only",checked:a,onChange:o,disabled:n}),m.jsx("div",{className:`${p2.mth_toggle} peer relative h-6 w-11 rounded-full
487
+ `])),function(t){var e=t.menuItemStyles;return e},function(t){var e=t.rootStyles;return e},ye.button,function(t){var e=t.level,n=t.disabled,r=t.active,a=t.collapsed,s=t.rtl;return ip({level:e,disabled:n,active:r,collapsed:a,rtl:s})},function(t){var e=t.buttonStyles;return e}),u2=function(t,e){var n,r=t.children,a=t.icon,s=t.className,o=t.prefix,i=t.suffix,l=t.active,c=l===void 0?!1:l,d=t.disabled,u=d===void 0?!1:d,f=t.component,h=t.rootStyles,g=br(t,["children","icon","className","prefix","suffix","active","disabled","component","rootStyles"]),p=_.useContext(Yo),b=_.useContext(Ho),w=b.collapsed,y=b.rtl,k=b.transitionDuration,v=wc().menuItemStyles,x=function(N){if(v){var C={level:p,disabled:u,active:c,isSubmenu:!1},T=v.root,E=v.button,P=v.label,I=v.icon,M=v.prefix,S=v.suffix;switch(N){case"root":return typeof T=="function"?T(C):T;case"button":return typeof E=="function"?E(C):E;case"label":return typeof P=="function"?P(C):P;case"icon":return typeof I=="function"?I(C):I;case"prefix":return typeof M=="function"?M(C):M;case"suffix":return typeof S=="function"?S(C):S;default:return}}},O=(n={},n[ye.active]=c,n[ye.disabled]=u,n);return _.createElement(d2,{ref:e,className:$e(ye.menuItemRoot,O,s),menuItemStyles:x("root"),level:p,collapsed:w,rtl:y,disabled:u,active:c,buttonStyles:x("button"),rootStyles:h},_.createElement(lp,St({className:$e(ye.button,O),"data-testid":"".concat(ye.button,"-test-id"),component:f,tabIndex:0},g),a&&_.createElement(N0,{rtl:y,className:$e(ye.icon,O),rootStyles:x("icon")},a),o&&_.createElement(I0,{collapsed:w,transitionDuration:k,firstLevel:p===0,className:$e(ye.prefix,O),rtl:y,rootStyles:x("prefix")},o),_.createElement(P0,{className:$e(ye.label,O),rootStyles:x("label")},r),i&&_.createElement(A0,{collapsed:w,transitionDuration:k,firstLevel:p===0,className:$e(ye.suffix,O),rootStyles:x("suffix")},i)))},f2=_.forwardRef(u2),dp;const Tc=_.forwardRef((t,e)=>{const{imageUrl:n,icon:r,title:a,description:s}=t;return m.jsxs("div",{className:`${Uh.Card} border px-3.5 py-7`,ref:e,children:[n?m.jsx(jn,{classIm:"mx-auto",src:n,alt:a,width:74,height:74}):r?m.jsx("div",{className:"flex justify-center",children:m.jsx(r,{size:74})}):null,m.jsx("h3",{className:"my-3 font-bold",children:a}),m.jsx("p",{children:s})]})});Tc.displayName="Card";const h2=({aHref:t,logo:e,menuItems:n,campaignCards:r=[],onLogout:a,defaultCollapsed:s=!1,background:o="linear-gradient(180deg, rgba(25, 25, 96, 0.95) 0%, rgba(41, 41, 139, 0.95) 100%)",textColor:i="#ffffff",className:l=""})=>{const[c,d]=_.useState(s),[u,f]=_.useState(null),[h,g]=_.useState(new Set),[p,b]=_.useState(null),[w,y]=_.useState(null),k=n.filter(M=>M.position!=="bottom"),v=n.filter(M=>M.position==="bottom"),x=(M,S="text-xl")=>typeof M=="string"?m.jsx("img",{src:M,style:{width:"25px",height:"25px"}}):M?_.createElement(M,{className:S}):null,O=(M=!1,S=!1)=>({background:c?"transparent":S?"#FFFFFF55":M?"#FFFFFF22":"#FFFFFF33",color:i,borderRadius:M?"15px":"20px",button:{width:c?"calc(100% - 0.5rem)":"calc(100% - 1rem)",margin:c?"0 0.25rem":"0 0.5rem",color:i,fontSize:M?"0.9rem":void 0}}),N=(M,S=!1,R)=>{const z=S?w===M.id:p===M.id;return m.jsx(f2,{icon:x(M.icon,S?"":"text-2xl"),onClick:()=>P(M,R),className:"mx-auto mb-1 rounded-md",rootStyles:O(S,z),children:S?M.label:m.jsxs("div",{className:"flex w-full items-center justify-between",children:[m.jsx("span",{children:M.label}),M.subMenuSection&&m.jsx(pS,{className:`text-lg transition-transform duration-200 ${h.has(M.id)?"rotate-180":""}`})]})},M.id)},C=M=>M.map(S=>m.jsxs("div",{children:[N(S),S.subMenuSection&&h.has(S.id)&&m.jsx("div",{className:"ml-4 space-y-1 mb-2",children:S.subMenuSection.items.map(R=>N(R,!0,S.id))})]},S.id)),T=()=>{u||d(!1)},E=()=>{u||(d(!0),g(new Set))},P=(M,S)=>{if(S?(b(S),y(M.id)):(b(M.id),y(null)),M.subMenuSection){const R=new Set(h);R.has(M.id)?R.delete(M.id):R.add(M.id),g(R)}else M.action?M.action():M.href&&(M.target==="_blank"?window.open(M.href,"_blank"):window.location.href=M.href)},I=M=>{M.action?M.action():M.href&&(M.target==="_blank"?window.open(M.href,"_blank"):window.location.href=M.href)};return m.jsx("div",{className:`fixed left-0 top-0 z-40 h-full ${l}`,children:m.jsxs("div",{className:"flex flex-col",onMouseEnter:T,onMouseLeave:E,children:[m.jsxs(BD,{collapsed:c,rootStyles:{[`.${We.container}`]:{background:o,color:i,height:"100vh",display:"flex",flexDirection:"column",width:c?"95px":"275px",transition:"all 400ms ease-in-out"}},children:[m.jsx("div",{className:`${c?"mx-auto":""} mb-2 mt-5 px-2`,children:m.jsx("a",{href:t||"/",children:m.jsx(jn,{classIm:"mx-3",src:e.src,alt:e.alt,width:e.width,height:e.height})})}),m.jsxs("div",{className:"flex flex-col h-full",children:[m.jsxs(VD,{className:"flex-1 mx-5 relative",children:[m.jsx("div",{className:"flex flex-col",children:C(k)}),m.jsx("div",{className:` ${h.size===0?"absolute bottom-0":""} w-full`,children:C(v)})]}),a&&m.jsx("div",{className:"w-full cursor-pointer py-4 px-7 mt-auto",children:m.jsx("div",{className:"flex rounded-2xl p-2",style:{background:c?"transparent":"#FFFFFF1A",float:c?"none":"right",width:c?"":"fit-content"},onClick:a,children:m.jsx("button",{style:{color:i},children:m.jsx("img",{src:"https://ftp.mathilde-ads.com/382-1a63116bc0d0909114f6c93af9d3dd8d.svg",width:"25px",height:"25px",alt:"logout"})})})})]})]}),r.length>0&&m.jsx(jm,{width:"40%",isOpen:u==="campaigns",onClose:()=>f(null),children:m.jsxs("div",{className:"flex flex-col px-10 pb-5",children:[m.jsx("h2",{className:"mb-3 text-center font-bold",children:"Selecciona el tipo de campaña que quieres crear"}),m.jsx("div",{className:"flex",children:r.map(M=>m.jsx("div",{className:"flex w-3/6 p-2",onClick:()=>I(M),children:m.jsx(Tc,{imageUrl:M.imageUrl,title:M.title,description:M.description})},M.id))})]})})]})})},Nc={"mth-color-primary":"pagination-module__mth-color-primary__hNTQd","mth-input-number":"pagination-module__mth-input-number__2TY-u"};function g2(t){return Te({attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{fill:"none",strokeLinecap:"square",strokeMiterlimit:"10",strokeWidth:"48",d:"M328 112 184 256l144 144"},child:[]}]})(t)}function m2(t){return Te({attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{fill:"none",strokeLinecap:"square",strokeMiterlimit:"10",strokeWidth:"48",d:"m184 112 144 144-144 144"},child:[]}]})(t)}const up=({currentPage:t,totalPages:e,onPageChange:n,value:r})=>m.jsxs("div",{className:"flex items-center justify-center gap-4",children:[m.jsxs("span",{className:"text-base text-gray-700",children:["Ver  ",m.jsx("input",{type:"number",className:`w-10 ${Nc["mth-input-number"]}`,id:"itemsPerPage",defaultValue:r||15})]}),m.jsx("button",{onClick:()=>n(t-1),disabled:t===1,className:" text-gray-500 hover:text-gray-700 disabled:cursor-not-allowed disabled:opacity-50",children:m.jsx(g2,{className:`h-9 w-9 ${Nc["mth-color-primary"]}`})}),m.jsxs("span",{className:"text-sm text-gray-700",children:[t," DE ",e]}),m.jsx("button",{onClick:()=>n(t+1),disabled:t===e,className:"text-gray-500 hover:text-gray-700 disabled:cursor-not-allowed disabled:opacity-50",children:m.jsx(m2,{className:`h-9 w-9 ${Nc["mth-color-primary"]}`})})]}),p2={mth_toggle:"toggle-module__mth_toggle__8NB4F"};function b2({label:t,checked:e=!1,disabled:n=!1,onChange:r}){const[a,s]=_.useState(e),o=i=>{if(n)return;const l=i.target.checked;s(l),r==null||r(l)};return m.jsxs("div",{className:"flex items-center gap-2",children:[m.jsxs("label",{className:`inline-flex items-center ${n?"cursor-not-allowed opacity-60":"cursor-pointer"}`,children:[m.jsx("input",{type:"checkbox",className:"peer sr-only",checked:a,onChange:o,disabled:n}),m.jsx("div",{className:`${p2.mth_toggle} peer relative h-6 w-11 rounded-full
488
488
  after:absolute after:start-[2px]
489
489
  after:top-0.5 after:h-5
490
490
  after:w-5 after:rounded-full
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ui-mathilde-web",
3
- "version": "0.1.36",
3
+ "version": "0.1.37",
4
4
  "type": "module",
5
5
  "files": [
6
6
  "dist"