ui-mathilde-web 0.1.15 → 0.1.16
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/ui-mathilde-web.js +534 -535
- package/dist/ui-mathilde-web.umd.cjs +1 -1
- package/package.json +74 -74
|
@@ -493,7 +493,7 @@ You may have forgotten to import it.`);var r=e.__emotion_real===e,a=r&&e.__emoti
|
|
|
493
493
|
peer-checked:bg-blue-600 peer-checked:after:translate-x-full peer-checked:after:border-white
|
|
494
494
|
peer-focus:ring-4 peer-focus:ring-blue-300 dark:border-gray-600
|
|
495
495
|
dark:bg-gray-700 dark:peer-checked:bg-blue-600
|
|
496
|
-
dark:peer-focus:ring-blue-800 rtl:peer-checked:after:-translate-x-full`})]}),t&&p.jsx("span",{className:`text-sm ${n?"text-gray-500":"text-gray-700"}`,children:t})]})}const h2=({columns:t,data:e,showSearch:n=!1,itemsPerPage:r=5,title:a,onToggleChange:s})=>{const[o,i]=W.useState(""),[l,c]=W.useState(1),[d,u]=W.useState(null),f=W.useMemo(()=>d?[...e].sort((y,k)=>{const v=y[d.key],x=k[d.key];return v==null||x==null?0:typeof v=="string"&&typeof x=="string"?d.direction==="asc"?v.localeCompare(x):x.localeCompare(v):d.direction==="asc"?Number(v)-Number(x):Number(x)-Number(v)}):e,[e,d]),h=W.useMemo(()=>o.trim()?f.filter(y=>t.some(k=>{const v=y[k.relation];return v!=null&&String(v).toLowerCase().includes(o.toLowerCase().trim())})):f,[f,o,t]),g=W.useMemo(()=>{const y=(l-1)*r,k=y+r;return h.slice(y,k)},[h,l,r]),m=Math.ceil(h.length/r),b=y=>{u(k=>!k||k.key!==y?{key:y,direction:"asc"}:{key:y,direction:k.direction==="asc"?"desc":"asc"})},w=(y,k)=>{const v=k[y.relation];if(y.isToggle){const x=!!v;return p.jsxs("div",{className:"flex items-center gap-2",children:[p.jsx(f2,{checked:x,onChange:O=>s==null?void 0:s({rowId:k.id,checked:O,row:k,columnKey:y.relation}),disabled:!1}),y.toggleText&&p.jsx("span",{className:"text-sm text-gray-600",children:x?y.toggleText.active:y.toggleText.inactive})]})}return y.cell?y.cell(k):v!=null?String(v):""};return p.jsxs("div",{className:"w-full",children:[p.jsx("div",{className:"mb-4 flex items-center justify-between",children:a&&p.jsx("h2",{className:"text-xl font-bold",children:a})}),p.jsxs("div",{className:"mb-4 flex",children:[n&&p.jsx("div",{className:"w-1/2",children:p.jsx(Ll,{rightIcon:tO,placeholder:"Buscar",value:o,onChange:y=>i(y.target.value)})}),m>1&&p.jsx("div",{className:"flex w-full justify-end",children:p.jsx(u2,{currentPage:l,totalPages:m,onPageChange:c})})]}),p.jsx("div",{className:"overflow-x-auto",children:p.jsxs(qr,{striped:!0,children:[p.jsx(qr.Head,{children:t.map((y,k)=>p.jsx(qr.HeadCell,{className:"cursor-pointer",onClick:()=>y.sortable!==!1&&b(y.relation),children:p.jsxs("div",{className:"flex items-center gap-2",children:[y.header,y.sortable!==!1&&p.jsx("span",{children:(d==null?void 0:d.key)===y.relation?d.direction==="asc"?p.jsx(ag,{className:"size-4"}):p.jsx(nO,{className:"size-4"}):p.jsx(ag,{className:"size-4 opacity-50"})})]})},k))}),p.jsx(
|
|
496
|
+
dark:peer-focus:ring-blue-800 rtl:peer-checked:after:-translate-x-full`})]}),t&&p.jsx("span",{className:`text-sm ${n?"text-gray-500":"text-gray-700"}`,children:t})]})}const h2=({columns:t,data:e,showSearch:n=!1,itemsPerPage:r=5,title:a,onToggleChange:s})=>{const[o,i]=W.useState(""),[l,c]=W.useState(1),[d,u]=W.useState(null),f=W.useMemo(()=>d?[...e].sort((y,k)=>{const v=y[d.key],x=k[d.key];return v==null||x==null?0:typeof v=="string"&&typeof x=="string"?d.direction==="asc"?v.localeCompare(x):x.localeCompare(v):d.direction==="asc"?Number(v)-Number(x):Number(x)-Number(v)}):e,[e,d]),h=W.useMemo(()=>o.trim()?f.filter(y=>t.some(k=>{const v=y[k.relation];return v!=null&&String(v).toLowerCase().includes(o.toLowerCase().trim())})):f,[f,o,t]),g=W.useMemo(()=>{const y=(l-1)*r,k=y+r;return h.slice(y,k)},[h,l,r]),m=Math.ceil(h.length/r),b=y=>{u(k=>!k||k.key!==y?{key:y,direction:"asc"}:{key:y,direction:k.direction==="asc"?"desc":"asc"})},w=(y,k)=>{const v=k[y.relation];if(y.isToggle){const x=!!v;return p.jsxs("div",{className:"flex items-center gap-2",children:[p.jsx(f2,{checked:x,onChange:O=>s==null?void 0:s({rowId:k.id,checked:O,row:k,columnKey:y.relation}),disabled:!1}),y.toggleText&&p.jsx("span",{className:"text-sm text-gray-600",children:x?y.toggleText.active:y.toggleText.inactive})]})}return y.cell?y.cell(k):v!=null?String(v):""};return p.jsxs("div",{className:"w-full",children:[p.jsx("div",{className:"mb-4 flex items-center justify-between",children:a&&p.jsx("h2",{className:"text-xl font-bold",children:a})}),p.jsxs("div",{className:"mb-4 flex",children:[n&&p.jsx("div",{className:"w-1/2",children:p.jsx(Ll,{rightIcon:tO,placeholder:"Buscar",value:o,onChange:y=>i(y.target.value)})}),m>1&&p.jsx("div",{className:"flex w-full justify-end",children:p.jsx(u2,{currentPage:l,totalPages:m,onPageChange:c})})]}),p.jsx("div",{className:"overflow-x-auto",children:p.jsxs(qr,{striped:!0,children:[p.jsx(qr.Head,{children:t.map((y,k)=>p.jsx(qr.HeadCell,{className:"cursor-pointer",onClick:()=>y.sortable!==!1&&b(y.relation),children:p.jsxs("div",{className:"flex items-center gap-2",children:[y.header,y.sortable!==!1&&p.jsx("span",{children:(d==null?void 0:d.key)===y.relation?d.direction==="asc"?p.jsx(ag,{className:"size-4"}):p.jsx(nO,{className:"size-4"}):p.jsx(ag,{className:"size-4 opacity-50"})})]})},k))}),p.jsx(qr.Body,{className:"divide-y",children:g.map(y=>p.jsx(qr.Row,{className:"bg-white dark:border-gray-700 dark:bg-gray-800",children:t.map((k,v)=>p.jsx(qr.Cell,{className:"whitespace-nowrap font-medium text-gray-900 dark:text-white",children:w(k,y)},`${y.id}-${v}`))},y.id))})]})})]})},lp={"m-image-container":"layoutOutside-module__m-image-container__sCvFu","m-image":"layoutOutside-module__m-image__kZHyH"},g2=()=>p.jsxs("div",{className:"mt-32",children:[p.jsx(Pn,{classIm:"mx-auto",src:"https://ftp.mathilde-ads.com/151-41415c0c026df82dbb391c09db474cfa.png",alt:"Logo Mathilde ads",width:400,height:250}),p.jsx("div",{className:lp["m-image-container"],children:p.jsx(Pn,{classIm:lp["m-image"],src:"https://ftp.mathilde-ads.com/151-3f28d319ba5adbe318c58ef38b858e50.png",alt:"Logo Mathilde ads",width:400,height:300})})]}),m2=({onOpenModal:t,checked:e,onChange:n,label:r,...a})=>{const s=()=>{e||t(),n(!1)};return p.jsx("div",{className:"mb-5",children:p.jsxs("label",{className:ws["checkbox-container"],children:[p.jsx("input",{type:"checkbox",...a,checked:e,onChange:s,required:!0}),p.jsx("span",{className:ws.checkmark}),r&&p.jsx("span",{children:r})]})})},cp=({validations:t})=>{const e=({isValid:r})=>p.jsx("svg",{className:`me-2 h-3.5 w-3.5 ${r?"text-green-500 dark:text-green-400":"text-gray-500 dark:text-gray-400"} shrink-0`,"aria-hidden":"true",xmlns:"http://www.w3.org/2000/svg",fill:"currentColor",viewBox:"0 0 20 20",children:p.jsx("path",{d:"M10 .5a9.5 9.5 0 1 0 9.5 9.5A9.51 9.51 0 0 0 10 .5Zm3.707 8.207-4 4a1 1 0 0 1-1.414 0l-2-2a1 1 0 0 1 1.414-1.414L9 10.586l3.293-3.293a1 1 0 0 1 1.414 1.414Z"})}),n=[{key:"hasMinLength",text:"Debe ser minimo de 8 caracteres"},{key:"hasNumber",text:"Debe tener minimo un numero"},{key:"hasUpperCase",text:"Debe tener minimo una letra mayuscula"},{key:"hasLowerCase",text:"Debe tener minimo una letra minuscula"},{key:"hasSpecialChar",text:"Debe tener minimo un caracter especial"}];return p.jsx("ul",{className:"mb-3 max-w-md list-inside space-y-1 text-sm text-gray-500 dark:text-gray-400",children:n.map(({key:r,text:a})=>p.jsxs("li",{className:"flex items-center",children:[p.jsx(e,{isValid:t[r]}),a]},r))})},p2=()=>{const[t,e]=_.useState(""),[n,r]=_.useState(""),[a,s]=_.useState({hasMinLength:!1,hasNumber:!1,hasUpperCase:!1,hasLowerCase:!1,hasSpecialChar:!1});_.useEffect(()=>{s({hasMinLength:t.length>=8,hasNumber:/\d/.test(t),hasUpperCase:/[A-Z]/.test(t),hasLowerCase:/[a-z]/.test(t),hasSpecialChar:/[!@#$%^&*(),.?":{}|<>]/.test(t)})},[t]);const o=()=>t.trim()&&n.trim()&&t===n&&Object.values(a).every(l=>l);return{password:t,setPassword:e,confirmPassword:n,setConfirmPassword:r,showError:()=>!o()&&t.trim()&&n.trim(),validations:a}},b2=({formik:t})=>{const{password:e,setPassword:n,confirmPassword:r,setConfirmPassword:a,validations:s}=p2();return p.jsxs(p.Fragment,{children:[p.jsxs("div",{className:"block",children:[p.jsx(Pi,{placeholder:"Contraseña",value:e,onChange:o=>{n(o.target.value),t.setFieldValue("password",o.target.value)},onBlur:t.handleBlur("password")}),t.errors.password&&t.touched.password&&p.jsx("div",{className:"my-2 text-sm text-red-500",children:String(t.errors.password)})]}),p.jsxs("div",{className:"block",children:[p.jsx(Pi,{placeholder:"Confirmar contraseña",value:r,onChange:o=>{a(o.target.value),t.setFieldValue("confirmPassword",o.target.value)},onBlur:t.handleBlur("confirmPassword")}),t.errors.confirmPassword&&t.touched.confirmPassword&&p.jsx("div",{className:"my-2 text-sm text-red-500",children:String(t.errors.confirmPassword)})]}),p.jsx(cp,{validations:s})]})},y2=({items:t})=>{const[e,n]=_.useState([]),r=s=>{n(o=>o.includes(s)?o.filter(i=>i!==s):[...o,s])},a=(s,o=0)=>p.jsx("ul",{className:"list-none space-y-2",children:s.map(i=>{const l=i.subItems&&i.subItems.length>0,c=e.includes(i.id);return p.jsxs("li",{className:`
|
|
497
497
|
${o>0?"ml-7":""}
|
|
498
498
|
`,children:[p.jsxs("div",{className:"flex items-center gap-2 py-1",children:[p.jsxs("div",{className:"flex min-w-[48px] items-center gap-1",children:[l&&p.jsx("button",{onClick:()=>r(i.id),className:"rounded-full p-1 transition-transform duration-200 hover:bg-gray-100",children:c?p.jsx(_y,{className:"text-sm text-gray-500"}):p.jsx(ky,{className:"text-sm text-gray-500"})}),!l&&p.jsx("div",{className:"w-[28px]"})," ",i.icon&&p.jsx(i.icon,{className:`text-lg ${i.isActive?"text-blue-700 dark:text-blue-500":"text-gray-600"}`})]}),p.jsx("a",{href:i.href,className:`
|
|
499
499
|
flex-grow transition-colors duration-200
|
package/package.json
CHANGED
|
@@ -1,76 +1,76 @@
|
|
|
1
1
|
{
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
2
|
+
"name": "ui-mathilde-web",
|
|
3
|
+
"version": "0.1.16",
|
|
4
|
+
"type": "module",
|
|
5
|
+
"files": [
|
|
6
|
+
"dist"
|
|
7
|
+
],
|
|
8
|
+
"main": "./dist/ui-mathilde-web.umd.cjs",
|
|
9
|
+
"module": "./dist/ui-mathilde-web.js",
|
|
10
|
+
"exports": {
|
|
11
|
+
".": {
|
|
12
|
+
"import": "./dist/ui-mathilde-web.js",
|
|
13
|
+
"require": "./dist/ui-mathilde-web.umd.cjs"
|
|
14
|
+
},
|
|
15
|
+
"./dist/style.css": "./dist/style.css"
|
|
14
16
|
},
|
|
15
|
-
"
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
"
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
"
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
"
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
}
|
|
76
|
-
}
|
|
17
|
+
"scripts": {
|
|
18
|
+
"dev": "vite",
|
|
19
|
+
"build": "tsc && vite build",
|
|
20
|
+
"preview": "vite preview",
|
|
21
|
+
"format": "prettier . --write",
|
|
22
|
+
"format:check": "prettier . --check",
|
|
23
|
+
"lint": "eslint .",
|
|
24
|
+
"lint:fix": "eslint . --fix",
|
|
25
|
+
"typecheck": "tsc --noEmit",
|
|
26
|
+
"storybook": "storybook dev -p 6006",
|
|
27
|
+
"build-storybook": "storybook build"
|
|
28
|
+
},
|
|
29
|
+
"peerDependencies": {
|
|
30
|
+
"flowbite-react": "^0.8.0",
|
|
31
|
+
"react": "^18.2.0",
|
|
32
|
+
"react-chartjs-2": "^5.3.0",
|
|
33
|
+
"react-pro-sidebar": "^1.1.0"
|
|
34
|
+
},
|
|
35
|
+
"devDependencies": {
|
|
36
|
+
"@chromatic-com/storybook": "^3.2.6",
|
|
37
|
+
"@storybook/addon-essentials": "^8.6.10",
|
|
38
|
+
"@storybook/addon-interactions": "^8.6.10",
|
|
39
|
+
"@storybook/addon-onboarding": "^8.6.10",
|
|
40
|
+
"@storybook/blocks": "^8.6.10",
|
|
41
|
+
"@storybook/react": "^8.6.10",
|
|
42
|
+
"@storybook/react-vite": "^8.6.10",
|
|
43
|
+
"@storybook/test": "^8.6.10",
|
|
44
|
+
"@types/node": "^22.13.13",
|
|
45
|
+
"@types/react": "^18.2.67",
|
|
46
|
+
"@types/react-dom": "^18.2.22",
|
|
47
|
+
"@typescript-eslint/eslint-plugin": "^7.3.1",
|
|
48
|
+
"@typescript-eslint/parser": "^7.3.1",
|
|
49
|
+
"@vitejs/plugin-react": "^4.2.1",
|
|
50
|
+
"autoprefixer": "^10.4.18",
|
|
51
|
+
"eslint": "^8.57.0",
|
|
52
|
+
"eslint-config-prettier": "^9.1.0",
|
|
53
|
+
"eslint-plugin-react-hooks": "^4.6.0",
|
|
54
|
+
"eslint-plugin-react-refresh": "^0.4.6",
|
|
55
|
+
"eslint-plugin-storybook": "^0.12.0",
|
|
56
|
+
"eslint-plugin-tailwindcss": "^3.15.1",
|
|
57
|
+
"flowbite-react": "^0.8.0",
|
|
58
|
+
"postcss": "^8.4.37",
|
|
59
|
+
"prettier-plugin-tailwindcss": "^0.5.14",
|
|
60
|
+
"react": "^18.2.0",
|
|
61
|
+
"react-chartjs-2": "^5.3.0",
|
|
62
|
+
"react-pro-sidebar": "^1.1.0",
|
|
63
|
+
"storybook": "^8.6.10",
|
|
64
|
+
"tailwindcss": "^3.4.1",
|
|
65
|
+
"typescript": "^5.4.2",
|
|
66
|
+
"vite": "^5.2.0",
|
|
67
|
+
"vite-plugin-dts": "^4.5.3"
|
|
68
|
+
},
|
|
69
|
+
"dependencies": {
|
|
70
|
+
"clsx": "^2.1.1",
|
|
71
|
+
"date-fns": "^4.1.0",
|
|
72
|
+
"formik": "^2.4.6",
|
|
73
|
+
"react-date-range": "^2.0.1",
|
|
74
|
+
"tailwind-merge": "^3.0.2"
|
|
75
|
+
}
|
|
76
|
+
}
|