This commit is contained in:
jorgemike
2025-05-12 11:06:37 -06:00
parent 7aad346502
commit e9fa13f375
41 changed files with 1972 additions and 326 deletions
+11
View File
@@ -0,0 +1,11 @@
{
"semi": true,
"singleQuote": true,
"tabWidth": 2,
"useTabs": false,
"trailingComma": "es5",
"printWidth": 80,
"bracketSpacing": true,
"arrowParens": "always",
"endOfLine": "lf"
}
+248 -9
View File
@@ -8,9 +8,13 @@
"name": "impresiones_front",
"version": "0.1.0",
"dependencies": {
"@zxing/library": "^0.21.3",
"bootstrap": "^5.3.6",
"bootstrap-icons": "^1.12.1",
"next": "15.3.2",
"react": "^19.0.0",
"react-dom": "^19.0.0"
"react-dom": "^19.0.0",
"react-hot-toast": "^2.5.2"
},
"devDependencies": {
"@eslint/eslintrc": "^3",
@@ -19,6 +23,7 @@
"@types/react-dom": "^19",
"eslint": "^9",
"eslint-config-next": "15.3.2",
"sass": "^1.32.13",
"typescript": "^5"
}
},
@@ -863,6 +868,17 @@
"node": ">=12.4.0"
}
},
"node_modules/@popperjs/core": {
"version": "2.11.8",
"resolved": "https://registry.npmjs.org/@popperjs/core/-/core-2.11.8.tgz",
"integrity": "sha512-P1st0aksCrn9sGZhp8GMYwBnQsbvAWsZAX44oXNNvLHGqAOcoVxmjZiohstwQ7SqKnbR47akdNi+uleWD8+g6A==",
"license": "MIT",
"peer": true,
"funding": {
"type": "opencollective",
"url": "https://opencollective.com/popperjs"
}
},
"node_modules/@rtsao/scc": {
"version": "1.1.0",
"resolved": "https://registry.npmjs.org/@rtsao/scc/-/scc-1.1.0.tgz",
@@ -1431,6 +1447,28 @@
"win32"
]
},
"node_modules/@zxing/library": {
"version": "0.21.3",
"resolved": "https://registry.npmjs.org/@zxing/library/-/library-0.21.3.tgz",
"integrity": "sha512-hZHqFe2JyH/ZxviJZosZjV+2s6EDSY0O24R+FQmlWZBZXP9IqMo7S3nb3+2LBWxodJQkSurdQGnqE7KXqrYgow==",
"license": "MIT",
"dependencies": {
"ts-custom-error": "^3.2.1"
},
"engines": {
"node": ">= 10.4.0"
},
"optionalDependencies": {
"@zxing/text-encoding": "~0.9.0"
}
},
"node_modules/@zxing/text-encoding": {
"version": "0.9.0",
"resolved": "https://registry.npmjs.org/@zxing/text-encoding/-/text-encoding-0.9.0.tgz",
"integrity": "sha512-U/4aVJ2mxI0aDNI8Uq0wEhMgY+u4CNtEb0om3+y3+niDAsoTCOB33UF0sxpzqzdqXLqmvc+vZyAt4O8pPdfkwA==",
"license": "(Unlicense OR Apache-2.0)",
"optional": true
},
"node_modules/accepts": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/accepts/-/accepts-2.0.0.tgz",
@@ -1501,6 +1539,20 @@
"url": "https://github.com/chalk/ansi-styles?sponsor=1"
}
},
"node_modules/anymatch": {
"version": "3.1.3",
"resolved": "https://registry.npmjs.org/anymatch/-/anymatch-3.1.3.tgz",
"integrity": "sha512-KMReFUr0B4t+D+OBkjR3KYqvocp2XaSzO55UcB6mgQMd3KbcE+mWTyvVV7D/zsdEbNnV6acZUutkiHQXvTr1Rw==",
"devOptional": true,
"license": "ISC",
"dependencies": {
"normalize-path": "^3.0.0",
"picomatch": "^2.0.4"
},
"engines": {
"node": ">= 8"
}
},
"node_modules/argparse": {
"version": "2.0.1",
"resolved": "https://registry.npmjs.org/argparse/-/argparse-2.0.1.tgz",
@@ -1736,6 +1788,19 @@
"dev": true,
"license": "MIT"
},
"node_modules/binary-extensions": {
"version": "2.3.0",
"resolved": "https://registry.npmjs.org/binary-extensions/-/binary-extensions-2.3.0.tgz",
"integrity": "sha512-Ceh+7ox5qe7LJuLHoY0feh3pHuUDHAcRUeyL2VYghZwfpkNIy/+8Ocg0a3UuSoYzavmylwuLWQOf3hl0jjMMIw==",
"devOptional": true,
"license": "MIT",
"engines": {
"node": ">=8"
},
"funding": {
"url": "https://github.com/sponsors/sindresorhus"
}
},
"node_modules/body-parser": {
"version": "2.2.0",
"resolved": "https://registry.npmjs.org/body-parser/-/body-parser-2.2.0.tgz",
@@ -1757,6 +1822,41 @@
"node": ">=18"
}
},
"node_modules/bootstrap": {
"version": "5.3.6",
"resolved": "https://registry.npmjs.org/bootstrap/-/bootstrap-5.3.6.tgz",
"integrity": "sha512-jX0GAcRzvdwISuvArXn3m7KZscWWFAf1MKBcnzaN02qWMb3jpMoUX4/qgeiGzqyIb4ojulRzs89UCUmGcFSzTA==",
"funding": [
{
"type": "github",
"url": "https://github.com/sponsors/twbs"
},
{
"type": "opencollective",
"url": "https://opencollective.com/bootstrap"
}
],
"license": "MIT",
"peerDependencies": {
"@popperjs/core": "^2.11.8"
}
},
"node_modules/bootstrap-icons": {
"version": "1.12.1",
"resolved": "https://registry.npmjs.org/bootstrap-icons/-/bootstrap-icons-1.12.1.tgz",
"integrity": "sha512-ekwupjsteHQmgGV+haQ0nNMoSyKCbJj5ou+06vFzb9uR2/bwN9isNEgXBaQzcT+fLzhKS3OaBNpwz8XdZlIgYQ==",
"funding": [
{
"type": "github",
"url": "https://github.com/sponsors/twbs"
},
{
"type": "opencollective",
"url": "https://opencollective.com/bootstrap"
}
],
"license": "MIT"
},
"node_modules/brace-expansion": {
"version": "1.1.11",
"resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz",
@@ -1772,7 +1872,7 @@
"version": "3.0.3",
"resolved": "https://registry.npmjs.org/braces/-/braces-3.0.3.tgz",
"integrity": "sha512-yQbXgO/OSZVD2IsiLlro+7Hf6Q18EJrKSEsdoMzKePKXct3gvD8oLcOQdIzGupr5Fj+EDe8gO/lxc1BzfMpxvA==",
"dev": true,
"devOptional": true,
"license": "MIT",
"dependencies": {
"fill-range": "^7.1.1"
@@ -1899,6 +1999,44 @@
"url": "https://github.com/chalk/chalk?sponsor=1"
}
},
"node_modules/chokidar": {
"version": "3.6.0",
"resolved": "https://registry.npmjs.org/chokidar/-/chokidar-3.6.0.tgz",
"integrity": "sha512-7VT13fmjotKpGipCW9JEQAusEPE+Ei8nl6/g4FBAmIm0GOOLMua9NDDo/DWp0ZAxCr3cPq5ZpBqmPAQgDda2Pw==",
"devOptional": true,
"license": "MIT",
"dependencies": {
"anymatch": "~3.1.2",
"braces": "~3.0.2",
"glob-parent": "~5.1.2",
"is-binary-path": "~2.1.0",
"is-glob": "~4.0.1",
"normalize-path": "~3.0.0",
"readdirp": "~3.6.0"
},
"engines": {
"node": ">= 8.10.0"
},
"funding": {
"url": "https://paulmillr.com/funding/"
},
"optionalDependencies": {
"fsevents": "~2.3.2"
}
},
"node_modules/chokidar/node_modules/glob-parent": {
"version": "5.1.2",
"resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.2.tgz",
"integrity": "sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==",
"devOptional": true,
"license": "ISC",
"dependencies": {
"is-glob": "^4.0.1"
},
"engines": {
"node": ">= 6"
}
},
"node_modules/client-only": {
"version": "0.0.1",
"resolved": "https://registry.npmjs.org/client-only/-/client-only-0.0.1.tgz",
@@ -2033,7 +2171,6 @@
"version": "3.1.3",
"resolved": "https://registry.npmjs.org/csstype/-/csstype-3.1.3.tgz",
"integrity": "sha512-M1uQkMl8rQK/szD0LNhtqxIPLpimGm8sOBwU7lLnCpSbTyY3yeU1Vc7l4KT5zT4s/yOxHH5O7tIuuLOCnLADRw==",
"dev": true,
"license": "MIT"
},
"node_modules/damerau-levenshtein": {
@@ -3022,7 +3159,7 @@
"version": "7.1.1",
"resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.1.1.tgz",
"integrity": "sha512-YsGpe3WHLK8ZYi4tWDg2Jy3ebRz2rXowDxnld4bkQB00cc/1Zw9AWnC0i9ztDJitivtQvaI9KaLyKrc+hBW0yg==",
"dev": true,
"devOptional": true,
"license": "MIT",
"dependencies": {
"to-regex-range": "^5.0.1"
@@ -3123,6 +3260,21 @@
"node": ">= 0.8"
}
},
"node_modules/fsevents": {
"version": "2.3.3",
"resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.3.tgz",
"integrity": "sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw==",
"dev": true,
"hasInstallScript": true,
"license": "MIT",
"optional": true,
"os": [
"darwin"
],
"engines": {
"node": "^8.16.0 || ^10.6.0 || >=11.0.0"
}
},
"node_modules/function-bind": {
"version": "1.1.2",
"resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.2.tgz",
@@ -3277,6 +3429,15 @@
"url": "https://github.com/sponsors/ljharb"
}
},
"node_modules/goober": {
"version": "2.1.16",
"resolved": "https://registry.npmjs.org/goober/-/goober-2.1.16.tgz",
"integrity": "sha512-erjk19y1U33+XAMe1VTvIONHYoSqE4iS7BYUZfHaqeohLmnC0FdxEh7rQU+6MZ4OajItzjZFSRtVANrQwNq6/g==",
"license": "MIT",
"peerDependencies": {
"csstype": "^3.0.10"
}
},
"node_modules/gopd": {
"version": "1.2.0",
"resolved": "https://registry.npmjs.org/gopd/-/gopd-1.2.0.tgz",
@@ -3551,6 +3712,19 @@
"url": "https://github.com/sponsors/ljharb"
}
},
"node_modules/is-binary-path": {
"version": "2.1.0",
"resolved": "https://registry.npmjs.org/is-binary-path/-/is-binary-path-2.1.0.tgz",
"integrity": "sha512-ZMERYes6pDydyuGidse7OsHxtbI7WVeUEozgR/g7rd0xUimYNlvZRE/K2MgZTjWy725IfelLeVcEM97mmtRGXw==",
"devOptional": true,
"license": "MIT",
"dependencies": {
"binary-extensions": "^2.0.0"
},
"engines": {
"node": ">=8"
}
},
"node_modules/is-boolean-object": {
"version": "1.2.2",
"resolved": "https://registry.npmjs.org/is-boolean-object/-/is-boolean-object-1.2.2.tgz",
@@ -3646,7 +3820,7 @@
"version": "2.1.1",
"resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz",
"integrity": "sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ==",
"dev": true,
"devOptional": true,
"license": "MIT",
"engines": {
"node": ">=0.10.0"
@@ -3691,7 +3865,7 @@
"version": "4.0.3",
"resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.3.tgz",
"integrity": "sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==",
"dev": true,
"devOptional": true,
"license": "MIT",
"dependencies": {
"is-extglob": "^2.1.1"
@@ -3717,7 +3891,7 @@
"version": "7.0.0",
"resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz",
"integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==",
"dev": true,
"devOptional": true,
"license": "MIT",
"engines": {
"node": ">=0.12.0"
@@ -4289,6 +4463,16 @@
}
}
},
"node_modules/normalize-path": {
"version": "3.0.0",
"resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-3.0.0.tgz",
"integrity": "sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA==",
"devOptional": true,
"license": "MIT",
"engines": {
"node": ">=0.10.0"
}
},
"node_modules/object-assign": {
"version": "4.1.1",
"resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz",
@@ -4573,7 +4757,7 @@
"version": "2.3.1",
"resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.1.tgz",
"integrity": "sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==",
"dev": true,
"devOptional": true,
"license": "MIT",
"engines": {
"node": ">=8.6"
@@ -4760,6 +4944,23 @@
"react": "^19.1.0"
}
},
"node_modules/react-hot-toast": {
"version": "2.5.2",
"resolved": "https://registry.npmjs.org/react-hot-toast/-/react-hot-toast-2.5.2.tgz",
"integrity": "sha512-Tun3BbCxzmXXM7C+NI4qiv6lT0uwGh4oAfeJyNOjYUejTsm35mK9iCaYLGv8cBz9L5YxZLx/2ii7zsIwPtPUdw==",
"license": "MIT",
"dependencies": {
"csstype": "^3.1.3",
"goober": "^2.1.16"
},
"engines": {
"node": ">=10"
},
"peerDependencies": {
"react": ">=16",
"react-dom": ">=16"
}
},
"node_modules/react-is": {
"version": "16.13.1",
"resolved": "https://registry.npmjs.org/react-is/-/react-is-16.13.1.tgz",
@@ -4767,6 +4968,19 @@
"dev": true,
"license": "MIT"
},
"node_modules/readdirp": {
"version": "3.6.0",
"resolved": "https://registry.npmjs.org/readdirp/-/readdirp-3.6.0.tgz",
"integrity": "sha512-hOS089on8RduqdbhvQ5Z37A0ESjsqz6qnRcffsMU3495FuTdqSm+7bhJ29JvIOsBDEEnan5DPu9t3To9VRlMzA==",
"devOptional": true,
"license": "MIT",
"dependencies": {
"picomatch": "^2.2.1"
},
"engines": {
"node": ">=8.10.0"
}
},
"node_modules/reflect.getprototypeof": {
"version": "1.0.10",
"resolved": "https://registry.npmjs.org/reflect.getprototypeof/-/reflect.getprototypeof-1.0.10.tgz",
@@ -4987,6 +5201,22 @@
"dev": true,
"license": "MIT"
},
"node_modules/sass": {
"version": "1.32.13",
"resolved": "https://registry.npmjs.org/sass/-/sass-1.32.13.tgz",
"integrity": "sha512-dEgI9nShraqP7cXQH+lEXVf73WOPCse0QlFzSD8k+1TcOxCMwVXfQlr0jtoluZysQOyJGnfr21dLvYKDJq8HkA==",
"devOptional": true,
"license": "MIT",
"dependencies": {
"chokidar": ">=3.0.0 <4.0.0"
},
"bin": {
"sass": "sass.js"
},
"engines": {
"node": ">=8.9.0"
}
},
"node_modules/scheduler": {
"version": "0.26.0",
"resolved": "https://registry.npmjs.org/scheduler/-/scheduler-0.26.0.tgz",
@@ -5519,7 +5749,7 @@
"version": "5.0.1",
"resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz",
"integrity": "sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==",
"dev": true,
"devOptional": true,
"license": "MIT",
"dependencies": {
"is-number": "^7.0.0"
@@ -5551,6 +5781,15 @@
"typescript": ">=4.8.4"
}
},
"node_modules/ts-custom-error": {
"version": "3.3.1",
"resolved": "https://registry.npmjs.org/ts-custom-error/-/ts-custom-error-3.3.1.tgz",
"integrity": "sha512-5OX1tzOjxWEgsr/YEUWSuPrQ00deKLh6D7OTWcvNHm12/7QPyRh8SYpyWvA4IZv8H/+GQWQEh/kwo95Q9OVW1A==",
"license": "MIT",
"engines": {
"node": ">=14.0.0"
}
},
"node_modules/tsconfig-paths": {
"version": "3.15.0",
"resolved": "https://registry.npmjs.org/tsconfig-paths/-/tsconfig-paths-3.15.0.tgz",
+8 -3
View File
@@ -9,17 +9,22 @@
"lint": "next lint"
},
"dependencies": {
"@zxing/library": "^0.21.3",
"bootstrap": "^5.3.6",
"bootstrap-icons": "^1.12.1",
"next": "15.3.2",
"react": "^19.0.0",
"react-dom": "^19.0.0",
"next": "15.3.2"
"react-hot-toast": "^2.5.2"
},
"devDependencies": {
"typescript": "^5",
"@eslint/eslintrc": "^3",
"@types/node": "^20",
"@types/react": "^19",
"@types/react-dom": "^19",
"eslint": "^9",
"eslint-config-next": "15.3.2",
"@eslint/eslintrc": "^3"
"sass": "^1.32.13",
"typescript": "^5"
}
}
-1
View File
@@ -1 +0,0 @@
<svg fill="none" viewBox="0 0 16 16" xmlns="http://www.w3.org/2000/svg"><path d="M14.5 13.5V5.41a1 1 0 0 0-.3-.7L9.8.29A1 1 0 0 0 9.08 0H1.5v13.5A2.5 2.5 0 0 0 4 16h8a2.5 2.5 0 0 0 2.5-2.5m-1.5 0v-7H8v-5H3v12a1 1 0 0 0 1 1h8a1 1 0 0 0 1-1M9.5 5V2.12L12.38 5zM5.13 5h-.62v1.25h2.12V5zm-.62 3h7.12v1.25H4.5zm.62 3h-.62v1.25h7.12V11z" clip-rule="evenodd" fill="#666" fill-rule="evenodd"/></svg>

Before

Width:  |  Height:  |  Size: 391 B

-1
View File
@@ -1 +0,0 @@
<svg fill="none" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16"><g clip-path="url(#a)"><path fill-rule="evenodd" clip-rule="evenodd" d="M10.27 14.1a6.5 6.5 0 0 0 3.67-3.45q-1.24.21-2.7.34-.31 1.83-.97 3.1M8 16A8 8 0 1 0 8 0a8 8 0 0 0 0 16m.48-1.52a7 7 0 0 1-.96 0H7.5a4 4 0 0 1-.84-1.32q-.38-.89-.63-2.08a40 40 0 0 0 3.92 0q-.25 1.2-.63 2.08a4 4 0 0 1-.84 1.31zm2.94-4.76q1.66-.15 2.95-.43a7 7 0 0 0 0-2.58q-1.3-.27-2.95-.43a18 18 0 0 1 0 3.44m-1.27-3.54a17 17 0 0 1 0 3.64 39 39 0 0 1-4.3 0 17 17 0 0 1 0-3.64 39 39 0 0 1 4.3 0m1.1-1.17q1.45.13 2.69.34a6.5 6.5 0 0 0-3.67-3.44q.65 1.26.98 3.1M8.48 1.5l.01.02q.41.37.84 1.31.38.89.63 2.08a40 40 0 0 0-3.92 0q.25-1.2.63-2.08a4 4 0 0 1 .85-1.32 7 7 0 0 1 .96 0m-2.75.4a6.5 6.5 0 0 0-3.67 3.44 29 29 0 0 1 2.7-.34q.31-1.83.97-3.1M4.58 6.28q-1.66.16-2.95.43a7 7 0 0 0 0 2.58q1.3.27 2.95.43a18 18 0 0 1 0-3.44m.17 4.71q-1.45-.12-2.69-.34a6.5 6.5 0 0 0 3.67 3.44q-.65-1.27-.98-3.1" fill="#666"/></g><defs><clipPath id="a"><path fill="#fff" d="M0 0h16v16H0z"/></clipPath></defs></svg>

Before

Width:  |  Height:  |  Size: 1.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 19 KiB

-1
View File
@@ -1 +0,0 @@
<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 394 80"><path fill="#000" d="M262 0h68.5v12.7h-27.2v66.6h-13.6V12.7H262V0ZM149 0v12.7H94v20.4h44.3v12.6H94v21h55v12.6H80.5V0h68.7zm34.3 0h-17.8l63.8 79.4h17.9l-32-39.7 32-39.6h-17.9l-23 28.6-23-28.6zm18.3 56.7-9-11-27.1 33.7h17.8l18.3-22.7z"/><path fill="#000" d="M81 79.3 17 0H0v79.3h13.6V17l50.2 62.3H81Zm252.6-.4c-1 0-1.8-.4-2.5-1s-1.1-1.6-1.1-2.6.3-1.8 1-2.5 1.6-1 2.6-1 1.8.3 2.5 1a3.4 3.4 0 0 1 .6 4.3 3.7 3.7 0 0 1-3 1.8zm23.2-33.5h6v23.3c0 2.1-.4 4-1.3 5.5a9.1 9.1 0 0 1-3.8 3.5c-1.6.8-3.5 1.3-5.7 1.3-2 0-3.7-.4-5.3-1s-2.8-1.8-3.7-3.2c-.9-1.3-1.4-3-1.4-5h6c.1.8.3 1.6.7 2.2s1 1.2 1.6 1.5c.7.4 1.5.5 2.4.5 1 0 1.8-.2 2.4-.6a4 4 0 0 0 1.6-1.8c.3-.8.5-1.8.5-3V45.5zm30.9 9.1a4.4 4.4 0 0 0-2-3.3 7.5 7.5 0 0 0-4.3-1.1c-1.3 0-2.4.2-3.3.5-.9.4-1.6 1-2 1.6a3.5 3.5 0 0 0-.3 4c.3.5.7.9 1.3 1.2l1.8 1 2 .5 3.2.8c1.3.3 2.5.7 3.7 1.2a13 13 0 0 1 3.2 1.8 8.1 8.1 0 0 1 3 6.5c0 2-.5 3.7-1.5 5.1a10 10 0 0 1-4.4 3.5c-1.8.8-4.1 1.2-6.8 1.2-2.6 0-4.9-.4-6.8-1.2-2-.8-3.4-2-4.5-3.5a10 10 0 0 1-1.7-5.6h6a5 5 0 0 0 3.5 4.6c1 .4 2.2.6 3.4.6 1.3 0 2.5-.2 3.5-.6 1-.4 1.8-1 2.4-1.7a4 4 0 0 0 .8-2.4c0-.9-.2-1.6-.7-2.2a11 11 0 0 0-2.1-1.4l-3.2-1-3.8-1c-2.8-.7-5-1.7-6.6-3.2a7.2 7.2 0 0 1-2.4-5.7 8 8 0 0 1 1.7-5 10 10 0 0 1 4.3-3.5c2-.8 4-1.2 6.4-1.2 2.3 0 4.4.4 6.2 1.2 1.8.8 3.2 2 4.3 3.4 1 1.4 1.5 3 1.5 5h-5.8z"/></svg>

Before

Width:  |  Height:  |  Size: 1.3 KiB

BIN
View File
Binary file not shown.

After

Width:  |  Height:  |  Size: 223 KiB

-1
View File
@@ -1 +0,0 @@
<svg fill="none" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1155 1000"><path d="m577.3 0 577.4 1000H0z" fill="#fff"/></svg>

Before

Width:  |  Height:  |  Size: 128 B

-1
View File
@@ -1 +0,0 @@
<svg fill="none" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16"><path fill-rule="evenodd" clip-rule="evenodd" d="M1.5 2.5h13v10a1 1 0 0 1-1 1h-11a1 1 0 0 1-1-1zM0 1h16v11.5a2.5 2.5 0 0 1-2.5 2.5h-11A2.5 2.5 0 0 1 0 12.5zm3.75 4.5a.75.75 0 1 0 0-1.5.75.75 0 0 0 0 1.5M7 4.75a.75.75 0 1 1-1.5 0 .75.75 0 0 1 1.5 0m1.75.75a.75.75 0 1 0 0-1.5.75.75 0 0 0 0 1.5" fill="#666"/></svg>

Before

Width:  |  Height:  |  Size: 385 B

-42
View File
@@ -1,42 +0,0 @@
:root {
--background: #ffffff;
--foreground: #171717;
}
@media (prefers-color-scheme: dark) {
:root {
--background: #0a0a0a;
--foreground: #ededed;
}
}
html,
body {
max-width: 100vw;
overflow-x: hidden;
}
body {
color: var(--foreground);
background: var(--background);
font-family: Arial, Helvetica, sans-serif;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
}
* {
box-sizing: border-box;
padding: 0;
margin: 0;
}
a {
color: inherit;
text-decoration: none;
}
@media (prefers-color-scheme: dark) {
html {
color-scheme: dark;
}
}
+13 -11
View File
@@ -1,20 +1,20 @@
import BootstrapClient from "@/components/bootstrap-client";
import Header from "@/components/header";
import type { Metadata } from "next";
import { Geist, Geist_Mono } from "next/font/google";
import "./globals.css";
import { Roboto } from "next/font/google";
const geistSans = Geist({
variable: "--font-geist-sans",
subsets: ["latin"],
});
import 'bootstrap-icons/font/bootstrap-icons.css';
import '@/styles/sass/bootstrap.scss';
const geistMono = Geist_Mono({
variable: "--font-geist-mono",
const roboto = Roboto({
variable: "--font-roboto",
subsets: ["latin"],
weight: ["400", "700"], // Specify weights if needed
});
export const metadata: Metadata = {
title: "Create Next App",
description: "Generated by create next app",
title: "Impresiones - FES Acatlán",
description: "Sistema de impresión de documentos para la FES Acatlán",
};
export default function RootLayout({
@@ -24,7 +24,9 @@ export default function RootLayout({
}>) {
return (
<html lang="en">
<body className={`${geistSans.variable} ${geistMono.variable}`}>
<body className={`${roboto.variable}`}>
<Header />
<BootstrapClient />
{children}
</body>
</html>
-168
View File
@@ -1,168 +0,0 @@
.page {
--gray-rgb: 0, 0, 0;
--gray-alpha-200: rgba(var(--gray-rgb), 0.08);
--gray-alpha-100: rgba(var(--gray-rgb), 0.05);
--button-primary-hover: #383838;
--button-secondary-hover: #f2f2f2;
display: grid;
grid-template-rows: 20px 1fr 20px;
align-items: center;
justify-items: center;
min-height: 100svh;
padding: 80px;
gap: 64px;
font-family: var(--font-geist-sans);
}
@media (prefers-color-scheme: dark) {
.page {
--gray-rgb: 255, 255, 255;
--gray-alpha-200: rgba(var(--gray-rgb), 0.145);
--gray-alpha-100: rgba(var(--gray-rgb), 0.06);
--button-primary-hover: #ccc;
--button-secondary-hover: #1a1a1a;
}
}
.main {
display: flex;
flex-direction: column;
gap: 32px;
grid-row-start: 2;
}
.main ol {
font-family: var(--font-geist-mono);
padding-left: 0;
margin: 0;
font-size: 14px;
line-height: 24px;
letter-spacing: -0.01em;
list-style-position: inside;
}
.main li:not(:last-of-type) {
margin-bottom: 8px;
}
.main code {
font-family: inherit;
background: var(--gray-alpha-100);
padding: 2px 4px;
border-radius: 4px;
font-weight: 600;
}
.ctas {
display: flex;
gap: 16px;
}
.ctas a {
appearance: none;
border-radius: 128px;
height: 48px;
padding: 0 20px;
border: none;
border: 1px solid transparent;
transition:
background 0.2s,
color 0.2s,
border-color 0.2s;
cursor: pointer;
display: flex;
align-items: center;
justify-content: center;
font-size: 16px;
line-height: 20px;
font-weight: 500;
}
a.primary {
background: var(--foreground);
color: var(--background);
gap: 8px;
}
a.secondary {
border-color: var(--gray-alpha-200);
min-width: 158px;
}
.footer {
grid-row-start: 3;
display: flex;
gap: 24px;
}
.footer a {
display: flex;
align-items: center;
gap: 8px;
}
.footer img {
flex-shrink: 0;
}
/* Enable hover only on non-touch devices */
@media (hover: hover) and (pointer: fine) {
a.primary:hover {
background: var(--button-primary-hover);
border-color: transparent;
}
a.secondary:hover {
background: var(--button-secondary-hover);
border-color: transparent;
}
.footer a:hover {
text-decoration: underline;
text-underline-offset: 4px;
}
}
@media (max-width: 600px) {
.page {
padding: 32px;
padding-bottom: 80px;
}
.main {
align-items: center;
}
.main ol {
text-align: center;
}
.ctas {
flex-direction: column;
}
.ctas a {
font-size: 14px;
height: 40px;
padding: 0 16px;
}
a.secondary {
min-width: auto;
}
.footer {
flex-wrap: wrap;
align-items: center;
justify-content: center;
}
}
@media (prefers-color-scheme: dark) {
.logo {
filter: invert();
}
}
+165 -87
View File
@@ -1,95 +1,173 @@
import Image from "next/image";
import styles from "./page.module.css";
'use client';
import React, { useState } from 'react';
import Button from '@/components/button';
import Input from '@/components/input';
import toast from 'react-hot-toast';
import MultiScanner from '@/components/scanner';
export default function Page() {
const [numeroCuenta, setNumeroCuenta] = useState('');
const [numeroFolio, setNumeroFolio] = useState('');
const [scanningType, setScanningType] = useState<
'credencial' | 'folio' | null
>(null);
const [enableScan, setEnableScan] = useState(false);
const [statusMessage, setStatusMessage] = useState('');
const handleScan = (rawValue: string) => {
setEnableScan(false);
if (scanningType === 'credencial') {
// Credencial solo texto plano
setNumeroCuenta(rawValue);
toast.success('✅ Credencial escaneada correctamente');
setScanningType(null);
return;
}
// Para folio, intentar JSON o texto plano
try {
const data = JSON.parse(rawValue);
if (scanningType === 'folio' && data.folio) {
setNumeroFolio(data.folio);
toast.success('✅ Folio escaneado correctamente');
} else {
throw new Error('No contiene folio');
}
} catch (err) {
console.log(err);
if (scanningType === 'folio') {
setNumeroFolio(rawValue);
toast.success('✅ Folio escaneado correctamente');
} else {
setStatusMessage(
'⚠️ El código escaneado no contiene los datos requeridos o está malformado'
);
}
} finally {
setScanningType(null);
}
};
export default function Home() {
return (
<div className={styles.page}>
<main className={styles.main}>
<Image
className={styles.logo}
src="/next.svg"
alt="Next.js logo"
width={180}
height={38}
priority
/>
<ol>
<li>
Get started by editing <code>src/app/page.tsx</code>.
</li>
<li>Save and see your changes instantly.</li>
</ol>
<div className="container">
<h1 className="text-dorado fw-bold mt-3">Sistema de Impresiones</h1>
<div className={styles.ctas}>
<a
className={styles.primary}
href="https://vercel.com/new?utm_source=create-next-app&utm_medium=appdir-template&utm_campaign=create-next-app"
target="_blank"
rel="noopener noreferrer"
>
<Image
className={styles.logo}
src="/vercel.svg"
alt="Vercel logomark"
width={20}
height={20}
/>
Deploy now
</a>
<a
href="https://nextjs.org/docs?utm_source=create-next-app&utm_medium=appdir-template&utm_campaign=create-next-app"
target="_blank"
rel="noopener noreferrer"
className={styles.secondary}
>
Read our docs
</a>
{/* Formulario de búsqueda por número de cuenta */}
<form className="d-flex align-items-end gap-3 float-description border p-3 rounded mt-4">
<span>Buscar alumno por numero de cuenta</span>
<div>
<Input
label="Numero de cuenta"
value={numeroCuenta}
onChange={(e) => setNumeroCuenta(e.target.value)}
placeholder="Ejemplo: 123456789"
className={{ container: 'mb-0 w-400px' }}
/>
</div>
</main>
<footer className={styles.footer}>
<a
href="https://nextjs.org/learn?utm_source=create-next-app&utm_medium=appdir-template&utm_campaign=create-next-app"
target="_blank"
rel="noopener noreferrer"
>
<Image
aria-hidden
src="/file.svg"
alt="File icon"
width={16}
height={16}
<div>
<Button
onClick={(e) => {
e.preventDefault(); /* buscar alumno */
}}
>
Buscar
</Button>
</div>
<div>
<Button
icon="upc-scan"
onClick={(e) => {
e.preventDefault();
setScanningType('credencial');
setEnableScan(true);
setStatusMessage('');
}}
>
Escanear Credencial
</Button>
</div>
</form>
{/* Escáner ZXing */}
{enableScan && (
<div className="mt-3 text-center">
<div style={{ width: '100%', maxWidth: '400px', margin: 'auto' }}>
<MultiScanner onDetected={handleScan} />
</div>
<Button
variant="outline-danger"
className="mt-3"
onClick={() => {
setEnableScan(false);
setScanningType(null);
}}
>
Detener cámara
</Button>
</div>
)}
{/* Resultados */}
<div className="border p-3 rounded mt-4 float-description">
<span>Resultados</span>
<div className="row g-3">
<div className="col-md-3">
<span className="fw-bold">Nombres</span>
<div className="text-muted">Jorge Miguel</div>
</div>
<div className="col-md-3">
<span className="fw-bold">Apellidos</span>
<div className="text-muted">Alvarado Diaz</div>
</div>
<div className="col-md-3">
<span className="fw-bold">Numero de cuenta</span>
<div className="text-muted">{numeroCuenta}</div>
</div>
<div className="col-md-3">
<span className="fw-bold">Saldo</span>
<div className="text-muted">$13</div>
</div>
</div>
</div>
{/* Formulario de registro de folio */}
<form className="d-flex align-items-end gap-3 float-description border p-3 rounded mt-4">
<span>Registrar Ticket</span>
<div>
<Input
label="Numero de folio"
value={numeroFolio}
onChange={(e) => setNumeroFolio(e.target.value)}
placeholder="Ejemplo: 123456789"
className={{ container: 'mb-0 w-400px' }}
/>
Learn
</a>
<a
href="https://vercel.com/templates?framework=next.js&utm_source=create-next-app&utm_medium=appdir-template&utm_campaign=create-next-app"
target="_blank"
rel="noopener noreferrer"
>
<Image
aria-hidden
src="/window.svg"
alt="Window icon"
width={16}
height={16}
/>
Examples
</a>
<a
href="https://nextjs.org?utm_source=create-next-app&utm_medium=appdir-template&utm_campaign=create-next-app"
target="_blank"
rel="noopener noreferrer"
>
<Image
aria-hidden
src="/globe.svg"
alt="Globe icon"
width={16}
height={16}
/>
Go to nextjs.org
</a>
</footer>
</div>
<div>
<Button
onClick={(e) => {
e.preventDefault(); /* registrar ticket */
}}
>
Registrar
</Button>
</div>
<div>
<Button
icon="upc-scan"
onClick={(e) => {
e.preventDefault();
setScanningType('folio');
setEnableScan(true);
setStatusMessage('');
}}
>
Escanear Folio
</Button>
</div>
</form>
{statusMessage && <p className="mt-3">{statusMessage}</p>}
</div>
);
}
+17
View File
@@ -0,0 +1,17 @@
'use client';
import { useEffect } from 'react';
export default function BootstrapClient() {
useEffect(() => {
const loadBootstrap = async () => {
if (typeof document !== 'undefined') {
// @ts-expect-error: Bootstrap is loaded dynamically
await import('bootstrap/dist/js/bootstrap.bundle.min.js');
}
};
loadBootstrap();
}, []);
return null;
}
+72
View File
@@ -0,0 +1,72 @@
import React from 'react';
/**
* Botón reutilizable con soporte para variantes de Bootstrap y personalización de íconos.
*
* @component
*/
interface ButtonProps extends React.ButtonHTMLAttributes<HTMLButtonElement> {
/**
* Variante Bootstrap o personalizada. Ej: `primary`, `danger`, `mi-clase-custom`.
* @default "primary"
*/
variant?: string;
/**
* Si se usa variante `outline` (por ejemplo, `btn-outline-primary`).
* @default false
*/
outline?: boolean;
/**
* Ícono Bootstrap (`string`, como `check-circle`) o componente React.
*/
icon?: string | React.ReactNode;
/**
* Tamaño del botón: `sm` o `lg` para tamaños Bootstrap.
*/
size?: 'sm' | 'lg';
/**
* Clases adicionales personalizadas para el botón.
*/
className?: string;
}
/**
* Componente `Button` con estilos de Bootstrap y soporte para íconos.
*/
const Button: React.FC<ButtonProps> = ({
children,
type = 'button',
icon,
className = '',
variant = 'primary',
outline = false,
disabled = false,
size,
...rest
}) => {
const btnVariant = outline ? `btn-outline-${variant}` : `btn-${variant}`;
const sizeClass = size ? `btn-${size}` : '';
const combinedClasses = `btn ${btnVariant} ${sizeClass} ${className}`.trim();
return (
<button
type={type}
disabled={disabled}
className={combinedClasses}
{...rest}
>
{typeof icon === 'string' ? (
<i className={`me-2 bi bi-${icon}`}></i>
) : (
icon && <span className="me-2">{icon}</span>
)}
{children}
</button>
);
};
export default Button;
+58
View File
@@ -0,0 +1,58 @@
import React from "react";
export interface CheckboxOption<T = unknown> {
label: string;
value: T;
disabled?: boolean;
}
interface CheckboxOptionGroupProps<T = unknown> {
name: string;
options: CheckboxOption<T>[];
selectedValues: T[];
onChange: (option: CheckboxOption<T>) => void;
maxSelected?: number;
disabled?: boolean;
className?: string;
}
export default function CheckboxOptionGroup<T = unknown>({
name,
options,
selectedValues,
onChange,
maxSelected,
disabled = false,
className = "",
}: CheckboxOptionGroupProps<T>) {
const isSelected = (value: T) => selectedValues.includes(value);
return (
<div className={`d-flex flex-column gap-2 mb-3 ${className}`}>
{options.map((option, index) => {
const checked = isSelected(option.value);
const limitReached =
maxSelected !== undefined &&
selectedValues.length >= maxSelected &&
!checked;
return (
<label
key={index}
className="option list-group-item-action d-flex align-items-center"
>
<input
type="checkbox"
name={name}
className="form-check-input me-2"
disabled={disabled || option.disabled || limitReached}
checked={checked}
onChange={() => onChange(option)}
/>
{option.label}
</label>
);
})}
</div>
);
}
+30
View File
@@ -0,0 +1,30 @@
import Image from "next/image";
import Link from "next/link";
import React from "react";
interface ComponentCardProps {
title: string;
src: string;
href: string;
}
export default function ComponentCard({
title,
src,
href,
}: ComponentCardProps) {
return (
<div className="box text-center scale-hover-1">
<Link href={href} className="text-decoration-none text-dark">
<h2>{title}</h2>
<Image
src={src}
alt="Placeholder"
width={400}
height={400}
className="img-fluid rounded"
/>
</Link>
</div>
);
}
+23
View File
@@ -0,0 +1,23 @@
interface IndiceContenidoProps {
items: {
id: string;
label: string;
}[];
}
export default function IndiceContenido({ items }: IndiceContenidoProps) {
return (
<aside className="bd-sidebar">
<p className="text-muted fs-5">On this page</p>
<nav className="bd-links">
<ul className="list-unstyled">
{items.map((item) => (
<li key={item.id}>
<a href={`#${item.id}`}>{item.label}</a>
</li>
))}
</ul>
</nav>
</aside>
);
}
+32
View File
@@ -0,0 +1,32 @@
import Image from 'next/image';
import React from 'react';
import Link from 'next/link';
export default function Header({ small = false }: { small?: boolean }) {
return (
<header className="bg-azul p-3">
<div className="container flex-center justify-content-sm-between">
<Link
href={'https://www.unam.mx/'}
target="_blank"
className="d-none d-sm-block"
>
<Image
src="/logo-unam.png"
alt="Logo de la UNAM"
width={small ? 200 : 280}
height={small ? 60 : 84}
/>
</Link>
<Link href={'https://acatlan.unam.mx/'} target="_blank">
<Image
src="/logo-fes.png"
alt="Logo de la fes Acatlàn"
width={small ? 200 : 250}
height={small ? 48 : 60}
/>
</Link>
</div>
</header>
);
}
+80
View File
@@ -0,0 +1,80 @@
'use client';
import React, { useState } from "react";
export interface InputProps
extends Omit<React.InputHTMLAttributes<HTMLInputElement>, "className"> {
label?: string;
className?: {
container?: string;
label?: string;
input?: string;
};
}
/**
* Componente de entrada (`Input`) reutilizable en React.
*
* Este componente renderiza un campo de entrada (`<input>`) con una etiqueta opcional y
* funcionalidad para mostrar u ocultar contraseñas cuando el tipo es `password`.
* También permite personalizar clases CSS y es accesible mediante `aria-label` y `htmlFor`.
*
* @component
* @param {Object} props - Propiedades del componente.
* @param {string} [props.label] - Etiqueta visible asociada al campo de entrada.
* @param {Object} [props.className] - Clases CSS personalizables para distintos elementos.
* @param {string} [props.className.container] - Clases para el contenedor del input.
* @param {string} [props.className.label] - Clases para la etiqueta del input.
* @param {string} [props.className.input] - Clases para el input en .
* @param {string} [props.type] - Tipo del input (`text`, `password`, `email`, etc.).
* @param {string} [props.name] - Nombre del input (útil para formularios).
* @param {string} [props.id] - ID personalizado para el input (para accesibilidad).
* @param {string} [props.value] - Valor del input (para uso controlado).
* @param {function} [props.onChange] - Manejador del cambio de valor del input.
* @param {React.InputHTMLAttributes<HTMLInputElement>} [rest] - Atributos adicionales compatibles con `<input>`.
*/
export default function Input(props: InputProps) {
const { className, label, type, name, id, ...rest } = props;
const [showPassword, setShowPassword] = useState(false);
const isPassword = type === "password";
const inputType = isPassword && showPassword ? "text" : type;
const inputId =
id || name || (label ? `input-${label.replace(/\s+/g, "-")}` : undefined);
const togglePasswordVisibility = () => setShowPassword(!showPassword);
return (
<div className={className?.container || "mb-3"}>
{label && inputId && (
<label
htmlFor={inputId}
className={`form-label ${className?.label || ""}`}
>
{label}
</label>
)}
<div className="input-group">
<input
id={inputId}
name={name}
type={inputType}
className={`form-control bg-white ${className?.input || ""}`}
{...rest}
/>
{isPassword && (
<button
type="button"
className="btn btn-light border"
onClick={togglePasswordVisibility}
aria-label={
showPassword ? "Ocultar contraseña" : "Mostrar contraseña"
}
title={showPassword ? "Ocultar contraseña" : "Mostrar contraseña"}
>
<i className={`bi ${showPassword ? "bi-eye-slash" : "bi-eye"}`}></i>
</button>
)}
</div>
</div>
);
}
+74
View File
@@ -0,0 +1,74 @@
import React from "react";
import Link from "next/link";
const Navbar: React.FC = () => {
return (
<nav className="navbar navbar-expand-lg navbar-light bg-transparent fixed-top">
<div className="container">
<button
className="navbar-toggler border-0 ms-auto"
type="button"
data-bs-toggle="offcanvas"
data-bs-target="#offcanvasNavbar"
aria-controls="offcanvasNavbar"
>
<span className="navbar-toggler-icon"></span>
</button>
<div
className="offcanvas offcanvas-end"
tabIndex={-1}
id="offcanvasNavbar"
aria-labelledby="offcanvasNavbarLabel"
>
<div className="offcanvas-header">
<h5 className="offcanvas-title" id="offcanvasNavbarLabel">
Menu
</h5>
<button
type="button"
className="btn-close"
data-bs-dismiss="offcanvas"
aria-label="Close"
></button>
</div>
<div className="offcanvas-body justify-content-center">
<ul className="navbar-nav gap-lg-5">
<li className="nav-item" data-bs-dismiss="offcanvas">
<Link className="nav-link" href="/">
Inicio
</Link>
</li>
<li className="nav-item" data-bs-dismiss="offcanvas">
<Link className="nav-link" href="/table">
Table
</Link>
</li>
<li className="nav-item" data-bs-dismiss="offcanvas">
<Link className="nav-link" href="/input">
Input
</Link>
</li>
<li className="nav-item" data-bs-dismiss="offcanvas">
<Link className="nav-link" href="/pagination">
Pagination
</Link>
</li>
<li className="nav-item" data-bs-dismiss="offcanvas">
<Link className="nav-link" href="/options">
Options
</Link>
</li>
<li className="nav-item" data-bs-dismiss="offcanvas">
<Link className="nav-link" href="/styles">
Styles
</Link>
</li>
</ul>
</div>
</div>
</div>
</nav>
);
};
export default Navbar;
+105
View File
@@ -0,0 +1,105 @@
import React, { useMemo } from "react";
interface PaginationProps {
totalPages: number;
currentPage: number;
onPageChange: (page: number) => void;
delta?: number;
}
export default function Pagination({
currentPage,
onPageChange,
totalPages,
delta = 1,
}: PaginationProps) {
const handlePageChange = (page: number) => {
if (page >= 1 && page <= totalPages && page !== currentPage) {
onPageChange(page);
}
};
const visiblePages = useMemo(() => {
const pages: (number | -1)[] = [];
if (totalPages <= 5 + delta * 2) {
return Array.from({ length: totalPages }, (_, i) => i + 1);
}
const left = Math.max(2, currentPage - delta);
const right = Math.min(totalPages - 1, currentPage + delta);
pages.push(1);
if (left > 2) pages.push(-1);
for (let i = left; i <= right; i++) {
pages.push(i);
}
if (right < totalPages - 1) pages.push(-1);
pages.push(totalPages);
return pages;
}, [currentPage, totalPages, delta]);
return (
<nav aria-label="Page navigation">
<ul className="pagination gap-1">
{/* Botón Anterior */}
<li className={`page-item ${currentPage === 1 ? "disabled" : ""}`}>
<button
className="page-link shadow-sm rounded border-0 bg-white"
onClick={() => handlePageChange(currentPage - 1)}
disabled={currentPage === 1}
aria-label="Previous"
>
&laquo;
</button>
</li>
{/* Números de Página */}
{visiblePages.map((page, index) =>
page === -1 ? (
<li key={`ellipsis-${index}`} className="page-item disabled">
<span className="page-link shadow-sm rounded border-0 bg-white">
...
</span>
</li>
) : (
<li
key={page}
className={`page-item ${currentPage === page ? "active" : ""}`}
>
<button
className={`page-link shadow-sm rounded border-0 ${
currentPage === page
? ""
: "bg-white text-primary"
}`}
onClick={() => handlePageChange(page)}
>
{page}
</button>
</li>
)
)}
{/* Botón Siguiente */}
<li
className={`page-item ${
currentPage === totalPages ? "disabled" : ""
}`}
>
<button
className="page-link shadow-sm rounded border-0 bg-white"
onClick={() => handlePageChange(currentPage + 1)}
disabled={currentPage === totalPages}
aria-label="Next"
>
&raquo;
</button>
</li>
</ul>
</nav>
);
}
+46
View File
@@ -0,0 +1,46 @@
import React from "react";
export interface RadioOption<T = unknown> {
label: string;
value: T;
disabled?: boolean;
}
interface RadioOptionGroupProps<T = unknown> {
name: string;
options: RadioOption<T>[];
selectedValue?: T;
onChange: (option: RadioOption<T>) => void;
disabled?: boolean;
className?: string;
}
export default function RadioOptionGroup<T>({
name,
options,
selectedValue,
onChange,
disabled = false,
className = "",
}: RadioOptionGroupProps<T>) {
return (
<div className={`d-flex flex-column gap-2 mb-3 ${className}`}>
{options.map((option, index) => (
<label
key={index}
className="option list-group-item-action d-flex align-items-center"
>
<input
type="radio"
name={name}
className="form-check-input me-2"
disabled={disabled || option.disabled}
checked={option.value === selectedValue}
onChange={() => onChange(option)}
/>
{option.label}
</label>
))}
</div>
);
}
+22
View File
@@ -0,0 +1,22 @@
import React, { useEffect, useRef } from 'react';
import { BrowserMultiFormatReader } from '@zxing/library';
export default function MultiScanner({ onDetected }) {
const videoRef = useRef(null);
useEffect(() => {
const codeReader = new BrowserMultiFormatReader();
codeReader
.decodeFromVideoDevice(null, videoRef.current, (result, err) => {
if (result) {
console.log(result);
onDetected(result.getText());
}
})
.catch((err) => console.error(err));
return () => codeReader.reset();
}, [onDetected]);
return <video ref={videoRef} style={{ width: '100%', height: '400px' }} />;
}
+103
View File
@@ -0,0 +1,103 @@
import React, { useId } from 'react';
interface Option {
value: string | number;
label: string;
}
interface SelectProps
extends Omit<React.SelectHTMLAttributes<HTMLSelectElement>, 'className'> {
label: string;
className?: {
container?: string;
label?: string;
input?: string;
};
options: Option[];
placeholder?: string;
}
/**
* Componente `Select` reutilizable en React.
*
* Este componente renderiza un elemento `<select>` con una etiqueta visible,
* opciones personalizadas y estilos configurables por clase. Es compatible
* con el uso controlado (`value`) o no controlado (`defaultValue`).
*
* Además, genera automáticamente un `id` si no se proporciona, manteniendo
* buenas prácticas de accesibilidad.
*
* @component
* @example
* // Uso básico
* <Select
* label="País"
* name="pais"
* options={[
* { value: 'mx', label: 'México' },
* { value: 'us', label: 'Estados Unidos' },
* { value: 'ca', label: 'Canadá' }
* ]}
* placeholder="Selecciona un país"
* defaultValue=""
* />
*
* @param {Object} props - Propiedades del componente.
* @param {string} props.label - Etiqueta visible asociada al campo.
* @param {Array<{ value: string | number, label: string }>} props.options - Lista de opciones disponibles en el select.
* @param {string} [props.placeholder] - Opción deshabilitada inicial que actúa como guía o título (si se proporciona).
* @param {string} [props.name] - Nombre del campo (útil en formularios).
* @param {string} [props.id] - ID del campo; si no se proporciona, se genera automáticamente.
* @param {string | number} [props.defaultValue] - Valor por defecto del select (modo no controlado).
* @param {string | number} [props.value] - Valor actual del select (modo controlado).
* @param {Object} [props.className] - Objeto para aplicar clases CSS personalizadas.
* @param {string} [props.className.container] - Clases del contenedor principal.
* @param {string} [props.className.label] - Clases de la etiqueta.
* @param {string} [props.className.input] - Clases del `<select>`.
* @param {React.SelectHTMLAttributes<HTMLSelectElement>} [rest] - Cualquier otra prop válida para `<select>`.
*
* @returns {JSX.Element} Un elemento `<select>` con sus opciones y etiqueta asociada.
*/
const Select: React.FC<SelectProps> = ({
label,
className,
options,
placeholder,
id,
name,
defaultValue,
value,
...rest
}) => {
const generatedId = useId();
const selectId = id || name || generatedId;
return (
<div className={`mb-3 ${className?.container ?? ''}`}>
<label htmlFor={selectId} className={`form-label ${className?.label ?? ''}`}>
{label}
</label>
<select
id={selectId}
name={name}
className={`form-select bg-white ${className?.input ?? ''}`}
defaultValue={defaultValue ?? (value === undefined ? '' : undefined)}
value={value}
{...rest}
>
{placeholder && (
<option value="" disabled>
{placeholder}
</option>
)}
{options.map((option) => (
<option key={option.value.toString()} value={option.value}>
{option.label}
</option>
))}
</select>
</div>
);
};
export default Select;
+174
View File
@@ -0,0 +1,174 @@
"use client";
import Image from "next/image";
import Link from "next/link";
import { usePathname } from "next/navigation";
import React, { useEffect, useState } from "react";
export interface SidebarLink {
icon?: string;
text?: string;
href?: string;
show?: boolean;
className?: string;
onClick?: () => void;
render?: () => React.ReactNode;
}
interface SidebarProps {
id: string;
userName?: string;
userRole?: string;
logoSrc?: string;
appTitle?: string;
links: SidebarLink[];
}
export default function Sidebar({
userName = "Usuario",
userRole = "Administrador",
logoSrc = "/unam.png",
appTitle = "Sistema de -------",
links,
id,
}: SidebarProps) {
const pathname = usePathname();
const [isOpen, setIsOpen] = useState(false);
useEffect(() => {
const open = localStorage.getItem(id) === "true";
setIsOpen(open);
}, [id]);
const toggleSidebar = () => {
localStorage.setItem(id, `${!isOpen}`);
setIsOpen(!isOpen);
};
return (
<aside className={`sidebar ${isOpen ? "open" : "close"}`}>
{/* Header for mobile */}
<div className="d-flex justify-content-between align-items-center p-2 d-lg-none">
<h1 className="h3 m-0">{appTitle}</h1>
<button
type="button"
className="m-0 p-0 border-0 bg-transparent"
data-bs-toggle="offcanvas"
data-bs-target={`#${id}-offcanvas`}
aria-controls={`${id}-offcanvas`}
>
<i className="bi bi-list fs-2"></i>
</button>
</div>
<div
className="offcanvas-lg offcanvas-end"
tabIndex={-1}
id={`${id}-offcanvas`}
aria-labelledby={`${id}-offcanvas-label`}
>
<div className="offcanvas-header">
<h5 className="offcanvas-title" id={`${id}-offcanvas-label`}>
{appTitle}
</h5>
<button
type="button"
className="btn-close"
data-bs-dismiss="offcanvas"
data-bs-target={`#${id}-offcanvas`}
aria-label="Close"
/>
</div>
<div className="offcanvas-body position-relative">
{/* Toggle sidebar button */}
<div
className="d-none d-lg-flex position-absolute"
style={{ top: "0", right: "-2rem" }}
>
<button
className="bg-white border-0 shadow-sm px-2 py-1"
type="button"
onClick={toggleSidebar}
>
<i
className={`bi bi-layout-sidebar-${
isOpen ? "inset" : "inset-reverse"
} text-muted`}
></i>
</button>
</div>
<div>
{/* User Info */}
<div className="d-flex align-items-center gap-3 my-2">
<Image src={logoSrc} width={40} height={40} alt="Logo" />
<div className="nav-link">
<span>
<b>{userName}</b>
<br />
<p className="text-muted m-0">{userRole}</p>
</span>
</div>
</div>
<hr />
<ul className="nav flex-column gap-2">
{links
.filter((link) => link.show !== false)
.map((link, index) => {
if (link.render) {
return (
<React.Fragment key={index}>
{link.render()}
</React.Fragment>
);
}
const isActive =
!!link.href &&
(pathname === link.href ||
(pathname?.startsWith(link.href) && link.href !== "/u"));
const baseClass = `nav-item ${isActive ? "active" : ""} ${
link.className || ""
}`;
return (
<li
key={index}
className={baseClass}
data-tooltip={link.text}
data-bs-dismiss="offcanvas"
data-bs-target="#offcanvasResponsive"
aria-label="Close"
>
{link.href ? (
<Link
href={link.href}
className="nav-link"
onClick={link.onClick}
>
{link.icon && <i className={`bi ${link.icon}`}></i>}
<span>{link.text}</span>
</Link>
) : (
<button
className="nav-link w-100 text-start"
onClick={link.onClick}
>
{link.icon && <i className={`bi ${link.icon}`}></i>}
<span>{link.text}</span>
</button>
)}
</li>
);
})}
</ul>
</div>
</div>
</div>
</aside>
);
}
+196
View File
@@ -0,0 +1,196 @@
import React, { useState, useMemo } from "react";
import Pagination from "./pagination";
export interface Header<T> {
key: keyof T;
label: string;
render?: (value: T[keyof T], row: T) => React.ReactNode;
width?: string;
className?: string;
}
interface TableProps<T> {
headers: Header<T>[];
data: T[];
rowsPerPage?: number;
onRowClick?: (rowData: T) => void;
rowKey?: (row: T) => string | number;
className?: {
table?: string;
row?: string;
cell?: string;
header?: string;
};
controlledPage?: number;
onPageChange?: (page: number) => void;
}
export default function Table<T>({
headers,
data,
rowsPerPage = 10,
onRowClick,
rowKey,
className,
controlledPage,
onPageChange,
}: TableProps<T>) {
const [sortConfig, setSortConfig] = useState<{
key: keyof T;
direction: "asc" | "desc";
} | null>(null);
const [internalPage, setInternalPage] = useState(1);
const currentPage = controlledPage ?? internalPage;
const setPage = onPageChange ?? setInternalPage;
const handleSort = (key: keyof T) => {
let direction: "asc" | "desc" = "asc";
if (
sortConfig &&
sortConfig.key === key &&
sortConfig.direction === "asc"
) {
direction = "desc";
}
setSortConfig({ key, direction });
};
const sortedData = useMemo(() => {
if (!sortConfig) return data;
return [...data].sort((a, b) => {
if (a[sortConfig.key]! < b[sortConfig.key]!)
return sortConfig.direction === "asc" ? -1 : 1;
if (a[sortConfig.key]! > b[sortConfig.key]!)
return sortConfig.direction === "asc" ? 1 : -1;
return 0;
});
}, [data, sortConfig]);
const totalPages = Math.ceil(sortedData.length / rowsPerPage);
const paginatedData = sortedData.slice(
(currentPage - 1) * rowsPerPage,
currentPage * rowsPerPage
);
return (
<div className="table-container">
<table className={`e-table ${className?.table || ""}`}>
<colgroup>
{headers.map((header, index) => (
<col key={index} style={{ width: header.width }} />
))}
</colgroup>
<thead>
<tr>
{headers.map((header, index) => (
<th
key={index}
onClick={() => handleSort(header.key)}
tabIndex={0}
aria-sort={
sortConfig?.key === header.key
? sortConfig.direction === "asc"
? "ascending"
: "descending"
: "none"
}
style={{ width: header.width }}
className={`sortable ${className?.header || ""} ${
header.className || ""
} ${
sortConfig?.key === header.key
? `sorted-${sortConfig.direction}`
: ""
}`}
>
{header.label}
{sortConfig?.key === header.key && (
<i
className={`ms-1 bi bi-caret-${
sortConfig.direction === "asc" ? "up" : "down"
}`}
></i>
)}
</th>
))}
</tr>
</thead>
<tbody>
{paginatedData.length === 0 ? (
<tr>
<td colSpan={headers.length} className="text-center text-muted">
No hay datos disponibles
</td>
</tr>
) : (
paginatedData.map((row, rowIndex) => (
<tr
key={rowKey ? rowKey(row) : rowIndex}
onClick={() => onRowClick?.(row)}
className={`${onRowClick ? "clickable-row" : ""} ${
className?.row || ""
}`}
>
{headers.map((header, cellIndex) => (
<td
key={cellIndex}
className={`${className?.cell || ""} ${
header.className || ""
}`}
style={{ width: header.width }}
data-titulo={header.label}
>
{header.render
? header.render(row[header.key], row)
: (row[header.key] as React.ReactNode)}
</td>
))}
</tr>
))
)}
</tbody>
</table>
{totalPages > 1 && (
<Pagination
currentPage={currentPage}
onPageChange={setPage}
totalPages={totalPages}
/>
)}
</div>
);
}
interface TablaSkeletonProps {
rows?: number;
columns?: number;
}
export function TableSkeleton({ rows = 5, columns = 5 }: TablaSkeletonProps) {
return (
<table className="e-table placeholder-glow">
<thead>
<tr>
{Array.from({ length: columns }).map((_, index) => (
<th key={index}>
<span className="placeholder rounded col-12"></span>
</th>
))}
</tr>
</thead>
<tbody>
{Array.from({ length: rows }).map((_, rowIndex) => (
<tr key={rowIndex}>
{Array.from({ length: columns }).map((_, colIndex) => (
<td key={colIndex}>
<span className="placeholder rounded col-12"></span>
</td>
))}
</tr>
))}
</tbody>
</table>
);
}
+74
View File
@@ -0,0 +1,74 @@
import React, { useState, JSX } from "react";
interface Tab {
id: string;
title: string | JSX.Element;
content: JSX.Element;
disabled?: boolean;
}
interface TabsProps {
tabs: Tab[];
style?: "default" | "box";
className?: {
container?: string;
tab?: string;
content?: string;
};
}
export default function Tabs({
tabs,
style = "default",
className,
}: TabsProps) {
const [activeTab, setActiveTab] = useState(tabs[0]?.id || "");
return (
<>
<ul className={`nav nav-tabs style-${style}`} id="myTab" role="tablist">
{tabs.map((tab) => (
<li
key={tab.id}
className="nav-item"
role="presentation"
title={tab.title.toString()}
>
<button
className={`nav-link ${tab.disabled ? "disabled" : ""} ${
activeTab === tab.id ? "active" : ""
}`}
id={`tab-${tab.id}`}
data-bs-toggle="tab"
data-bs-target={`#tab-pane-${tab.id}`}
type="button"
role="tab"
aria-controls={`tab-pane-${tab.id}`}
aria-selected={activeTab === tab.id}
onClick={() => !tab.disabled && setActiveTab(tab.id)}
>
{tab.title.toString().length > 35
? `${tab.title.toString().slice(0, 35)}...`
: tab.title}
</button>
</li>
))}
</ul>
<div className="tab-content mt-3" id="myTabContent">
{tabs.map((tab) => (
<div
key={tab.id}
className={`tab-pane fade ${
activeTab === tab.id ? "show active" : ""
} ${className?.content}`}
id={`tab-pane-${tab.id}`}
role="tabpanel"
aria-labelledby={`tab-${tab.id}`}
>
{activeTab === tab.id && tab.content}
</div>
))}
</div>
</>
);
}
View File
+73
View File
@@ -0,0 +1,73 @@
.box {
@extend .shadow-sm;
@extend .rounded;
@extend .bg-white;
@extend .p-3;
&.active {
@extend .bg-primary;
@extend .bg-opacity-75;
@extend .text-white;
}
&.disabled {
@extend .text-muted;
cursor: not-allowed !important;
}
}
.unlink {
@extend .text-decoration-none;
@extend .text-dark;
}
.flex-center {
@extend .d-flex;
@extend .justify-content-center;
@extend .align-items-center;
}
.option {
@extend .box;
@extend .py-2;
cursor: pointer;
transition: all 0.3s;
&:has(input:checked) {
@extend .bg-primary;
@extend .bg-opacity-75;
@extend .text-white;
}
input[type='radio']:checked {
border: 1px solid #ffffff;
@extend .bg-primary;
@extend .bg-opacity-75;
}
&:hover {
background-color: #f1f1f1 !important;
}
&:has(input:disabled) {
@extend .bg-light;
@extend .text-muted;
cursor: not-allowed;
}
}
.border-top-azul {
position: relative;
&::before {
content: '';
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 5px;
background: $azul;
border-radius: 5px 5px 0 0;
}
}
+26
View File
@@ -0,0 +1,26 @@
// Este bloque crea una clase por cada color del tema, en cada dirección.
@each $color-name, $color-value in $theme-colors {
.bg-gradient-#{$color-name}-top {
background-image: linear-gradient(
to top,
rgba($color-value, 0.5),
$body-bg
);
}
.bg-gradient-#{$color-name}-bottom {
background-image: linear-gradient(
to bottom,
rgba($color-value, 0.5),
$body-bg
);
}
.bg-gradient-#{$color-name}-left {
background-image: linear-gradient(to left, rgba($color-value, 0.5), $body-bg);
}
.bg-gradient-#{$color-name}-right {
background-image: linear-gradient(to right, rgba($color-value, 0.5), $body-bg);
}
}
+15
View File
@@ -0,0 +1,15 @@
// Clases personalizadas de hover por color
@each $name, $color in $theme-colors {
.hover-bg-#{$name} {
transition: background-color 0.4s;
&:hover,
&.active {
background-color: rgba($color, 0.75) !important;
.nav-link {
color: #ffffff !important;
}
}
}
}
+90
View File
@@ -0,0 +1,90 @@
.sidebar {
@extend .py-0;
@extend .box;
@extend .m-lg-2;
.nav-item {
@extend .rounded-pill;
@extend .w-100;
transition: background-color 0.4s;
// Hover por defecto (solo si no tiene clase hover-bg-*)
&:not([class*="hover-bg-"]):hover,
&:not([class*="hover-bg-"]).active {
@extend .bg-primary;
@extend .bg-opacity-75;
.nav-link {
color: #ffffff !important;
}
}
.nav-link {
i {
@extend .me-2;
}
}
}
@include media-breakpoint-up(lg) {
@extend .py-lg-2;
position: sticky;
top: 0;
left: 0;
width: clamp(250px, 100%, 300px);
max-width: 300px;
transition: width 0.3s ease;
.offcanvas-body {
display: block;
}
&.open {
.nav-link {
overflow: hidden;
white-space: nowrap;
span {
transition: opacity 0.3s, visibility 0.3s;
opacity: 1;
visibility: visible;
}
}
}
&.close {
width: 80px;
.nav-item:hover {
position: relative;
&::after {
content: attr(data-tooltip);
position: absolute;
top: 50%;
left: 100%;
transform: translate(10px, -50%);
background-color: rgba(0, 0, 0, 0.7);
color: white;
padding: 5px 10px;
border-radius: 5px;
opacity: 0;
animation: fadeInOut 4s ease-in-out;
font-style: normal;
max-width: 200px;
}
}
.nav-link {
overflow: hidden;
white-space: nowrap;
span {
transition: opacity 0.3s, visibility 0.3s;
opacity: 0;
visibility: hidden;
}
}
}
}
}
+87
View File
@@ -0,0 +1,87 @@
:root {
--bg-header-table: #eee9e9;
--border-row-table: #cecece;
--hover-background-color: #f0f0f0;
}
.e-table {
width: 100%;
border-collapse: separate;
border-spacing: 0 10px;
thead {
tr {
box-shadow: var(--bs-box-shadow-sm);
th {
background-color: var(--bg-header-table);
position: sticky;
top: 5px;
}
}
}
th,
td {
padding: 12px 15px;
background-color: #ffffff;
transition: background-color 0.5s;
&:first-child {
border-radius: 8px 0 0 8px;
}
&:last-child {
border-radius: 0 8px 8px 0;
}
}
tbody {
tr {
border-radius: 8px;
overflow: hidden;
box-shadow: var(--bs-box-shadow-sm);
&.clickable-row {
cursor: pointer;
&:hover {
td {
background-color: var(--hover-background-color);
}
}
}
}
}
@media (max-width: 768px) {
thead {
display: none;
}
tbody {
tr {
display: flex;
flex-direction: column;
margin: 0 0 10px 10px;
border-radius: 8px;
th,
td,
th:first-child,
td:first-child,
th:last-child,
td:last-child {
border-radius: 0;
border: 0;
}
td[data-titulo]::before {
content: attr(data-titulo) ':';
margin-right: 15px;
font-weight: 600;
color: #3e3e3e;
}
}
}
}
}
+16
View File
@@ -0,0 +1,16 @@
.tab-pane.fade {
transition: opacity 10s linear !important;
}
.nav-tabs.style-box {
border-bottom: 0cap;
gap: 0.8rem;
.nav-item .nav-link {
@extend .box;
@extend .py-2;
@extend .text-black;
margin: 0 !important;
border: 0;
}
}
+30
View File
@@ -0,0 +1,30 @@
// Archivo: _utilities.scss
$hover-scales: (
1: 1.05,
2: 1.1,
3: 1.15,
4: 1.2,
5: 1.25
);
@each $key, $value in $hover-scales {
.scale-hover-#{$key} {
transition: transform 0.3s ease-in-out;
&:hover {
transform: scale(#{$value});
}
}
}
$min-width: 100px;
$max-width: 600px;
@for $i from 1 through (($max-width - $min-width) / 100px + 1) {
$current-width: $min-width + ($i - 1) * 100px;
.w-#{$current-width} {
width: $current-width;
}
}
+8
View File
@@ -0,0 +1,8 @@
/* Variables sobreescritas de bootstrap */
$body-bg: #f5f5f7;
$placeholder-opacity-max: 0.2;
$placeholder-opacity-min: 0.1;
$modal-content-border-color: none;
$modal-content-bg: #f5f5f7;
$modal-lg: 900px;
+75
View File
@@ -0,0 +1,75 @@
@import 'bootstrap/scss/functions';
@import 'variables';
@import 'bootstrap/scss/variables';
@import 'bootstrap/scss/variables-dark';
// Include any default map overrides here
$azul: #003d79;
$dorado: #d59f0f;
$custom-colors: (
'azul': $azul,
'dorado': $dorado,
);
$theme-colors: map-merge($theme-colors, $custom-colors);
@import 'bootstrap/scss/maps';
@import 'bootstrap/scss/mixins';
@import 'bootstrap/scss/bootstrap';
@import 'gradients';
@import 'extends';
@import 'table';
@import 'utilities';
@import 'sidebar';
@import 'hover';
@import 'tabs';
//Add additional custom code here
@include media-breakpoint-up(lg) {
.bd-layout {
display: grid;
grid-template-areas: 'sidebar main';
grid-template-columns: 1fr 5fr;
gap: $spacer * 1.5;
}
}
@include media-breakpoint-up(lg) {
.bd-sidebar {
grid-area: sidebar;
position: sticky;
top: ($spacer * 3);
height: calc(100vh - 6rem);
}
}
ul.list-unstyled li {
padding: 0.5rem 0;
a {
color: $azul;
transition: color 0.2s;
text-decoration: none;
&:hover {
color: $dorado;
}
}
}
.btn-dorado {
color: $white !important;
}
.float-description {
position: relative;
& > span {
background-color: $body-bg;
position: absolute;
top: -15px;
left: 20px;
}
}
+1 -1
View File
@@ -22,6 +22,6 @@
"@/*": ["./src/*"]
}
},
"include": ["next-env.d.ts", "**/*.ts", "**/*.tsx", ".next/types/**/*.ts"],
"include": ["next-env.d.ts", "**/*.ts", "**/*.tsx", ".next/types/**/*.ts", "src/components/barcode-scanner.jsx"],
"exclude": ["node_modules"]
}