├── .gitignore ├── LICENSE ├── README.md ├── common ├── Loading.jsx ├── Modal.jsx └── Nav.jsx ├── components ├── Header.jsx └── LoginPage.jsx └── pages └── dashboard └── index.jsx /.gitignore: -------------------------------------------------------------------------------- 1 | # Logs 2 | logs 3 | *.log 4 | npm-debug.log* 5 | yarn-debug.log* 6 | yarn-error.log* 7 | lerna-debug.log* 8 | 9 | # Diagnostic reports (https://nodejs.org/api/report.html) 10 | report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json 11 | 12 | # Runtime data 13 | pids 14 | *.pid 15 | *.seed 16 | *.pid.lock 17 | 18 | # Directory for instrumented libs generated by jscoverage/JSCover 19 | lib-cov 20 | 21 | # Coverage directory used by tools like istanbul 22 | coverage 23 | *.lcov 24 | 25 | # nyc test coverage 26 | .nyc_output 27 | 28 | # Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files) 29 | .grunt 30 | 31 | # Bower dependency directory (https://bower.io/) 32 | bower_components 33 | 34 | # node-waf configuration 35 | .lock-wscript 36 | 37 | # Compiled binary addons (https://nodejs.org/api/addons.html) 38 | build/Release 39 | 40 | # Dependency directories 41 | node_modules/ 42 | jspm_packages/ 43 | 44 | # TypeScript v1 declaration files 45 | typings/ 46 | 47 | # TypeScript cache 48 | *.tsbuildinfo 49 | 50 | # Optional npm cache directory 51 | .npm 52 | 53 | # Optional eslint cache 54 | .eslintcache 55 | 56 | # Microbundle cache 57 | .rpt2_cache/ 58 | .rts2_cache_cjs/ 59 | .rts2_cache_es/ 60 | .rts2_cache_umd/ 61 | 62 | # Optional REPL history 63 | .node_repl_history 64 | 65 | # Output of 'npm pack' 66 | *.tgz 67 | 68 | # Yarn Integrity file 69 | .yarn-integrity 70 | 71 | # dotenv environment variables file 72 | .env 73 | .env.test 74 | 75 | # parcel-bundler cache (https://parceljs.org/) 76 | .cache 77 | 78 | # Next.js build output 79 | .next 80 | 81 | # Nuxt.js build / generate output 82 | .nuxt 83 | dist 84 | 85 | # Gatsby files 86 | .cache/ 87 | # Comment in the public line in if your project uses Gatsby and *not* Next.js 88 | # https://nextjs.org/blog/next-9-1#public-directory-support 89 | # public 90 | 91 | # vuepress build output 92 | .vuepress/dist 93 | 94 | # Serverless directories 95 | .serverless/ 96 | 97 | # FuseBox cache 98 | .fusebox/ 99 | 100 | # DynamoDB Local files 101 | .dynamodb/ 102 | 103 | # TernJS port file 104 | .tern-port 105 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2021 Oscar Barajas Tavares 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # nextjs-ui -------------------------------------------------------------------------------- /common/Loading.jsx: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | 3 | const Loading = () => { 4 | return ( 5 |
6 |
7 | 8 | 9 | 10 |
Loading ...
11 |
12 |
13 | ); 14 | }; 15 | 16 | export default Loading; 17 | -------------------------------------------------------------------------------- /common/Modal.jsx: -------------------------------------------------------------------------------- 1 | import { Fragment, useRef } from 'react'; 2 | import { Dialog, Transition } from '@headlessui/react'; 3 | import { XCircleIcon } from '@heroicons/react/solid'; 4 | 5 | export default function Modal({ open, setOpen, children }) { 6 | const cancelButtonRef = useRef(null); 7 | return ( 8 | 9 | 10 |
11 | 12 | 13 | 14 | 17 | 26 |
27 |
28 |
30 |
31 |
{children}
32 |
33 |
34 |
35 |
36 |
37 |
38 | ); 39 | } 40 | -------------------------------------------------------------------------------- /common/Nav.jsx: -------------------------------------------------------------------------------- 1 | import { useRouter } from 'next/router'; 2 | 3 | export default function Nav() { 4 | const router = useRouter(); 5 | const route = router.pathname.substring(1); 6 | 7 | return ( 8 | 13 | ); 14 | } 15 | -------------------------------------------------------------------------------- /components/Header.jsx: -------------------------------------------------------------------------------- 1 | /* This example requires Tailwind CSS v2.0+ */ 2 | import { Fragment } from 'react'; 3 | import { Disclosure, Menu, Transition } from '@headlessui/react'; 4 | import { BellIcon, MenuIcon, XIcon } from '@heroicons/react/outline'; 5 | 6 | const userData = { 7 | name: 'Tom Cook', 8 | email: 'tom@example.com', 9 | imageUrl: 'https://images.unsplash.com/photo-1472099645785-5658abf4ff4e?ixlib=rb-1.2.1&ixid=eyJhcHBfaWQiOjEyMDd9&auto=format&fit=facearea&facepad=2&w=256&h=256&q=80', 10 | }; 11 | const navigation = [ 12 | { name: 'Dashboard', href: '#', current: true }, 13 | { name: 'Productos', href: '/dashboard/products/', current: false }, 14 | { name: 'Ventas', href: '#', current: false }, 15 | ]; 16 | const userNavigation = [ 17 | { name: 'Your Profile', href: '#' }, 18 | { name: 'Settings', href: '#' }, 19 | { name: 'Sign out', href: '#' }, 20 | ]; 21 | 22 | function classNames(...classes) { 23 | return classes.filter(Boolean).join(' '); 24 | } 25 | 26 | export default function Header() { 27 | return ( 28 | <> 29 | 30 | {({ open }) => ( 31 | <> 32 |
33 |
34 |
35 |
36 | Workflow 37 |
38 |
39 |
40 | {navigation.map((item) => ( 41 | 47 | {item.name} 48 | 49 | ))} 50 |
51 |
52 |
53 |
54 |
55 | 62 | 63 | {/* Profile dropdown */} 64 | 65 |
66 | 67 | Open user menu 68 | 69 | 70 |
71 | 80 | 81 | {userNavigation.map((item) => ( 82 | 83 | {({ active }) => ( 84 | 85 | {item.name} 86 | 87 | )} 88 | 89 | ))} 90 | 91 | 92 |
93 |
94 |
95 |
96 | {/* Mobile menu button */} 97 | 98 | Open main menu 99 | {open ? 101 |
102 |
103 |
104 | 105 | 106 |
107 | {navigation.map((item) => ( 108 | 115 | {item.name} 116 | 117 | ))} 118 |
119 |
120 |
121 |
122 | 123 |
124 |
125 |
{userData.name}
126 |
{userData.email}
127 |
128 | 135 |
136 |
137 | {userNavigation.map((item) => ( 138 | 139 | {item.name} 140 | 141 | ))} 142 |
143 |
144 |
145 | 146 | )} 147 |
148 | 149 | ); 150 | } 151 | -------------------------------------------------------------------------------- /components/LoginPage.jsx: -------------------------------------------------------------------------------- 1 | import { LockClosedIcon } from '@heroicons/react/solid'; 2 | 3 | export default function LoginPage() { 4 | return ( 5 | <> 6 |
7 |
8 |
9 | Workflow 10 |

Sign in to your account

11 |
12 |
13 | 14 |
15 |
16 | 19 | 28 |
29 |
30 | 33 | 42 |
43 |
44 | 45 |
46 |
47 | 48 | 51 |
52 | 53 |
54 | 55 | Forgot your password? 56 | 57 |
58 |
59 | 60 |
61 | 70 |
71 |
72 |
73 |
74 | 75 | ); 76 | } 77 | -------------------------------------------------------------------------------- /pages/dashboard/index.jsx: -------------------------------------------------------------------------------- 1 | const people = [ 2 | { 3 | name: 'Jane Cooper', 4 | title: 'Regional Paradigm Technician', 5 | department: 'Optimization', 6 | role: 'Admin', 7 | email: 'jane.cooper@example.com', 8 | image: 'https://images.unsplash.com/photo-1494790108377-be9c29b29330?ixlib=rb-1.2.1&ixid=eyJhcHBfaWQiOjEyMDd9&auto=format&fit=facearea&facepad=4&w=256&h=256&q=60', 9 | }, 10 | ]; 11 | 12 | export default function Dashboard() { 13 | return ( 14 | <> 15 |
16 |
17 |
18 |
19 | 20 | 21 | 22 | 25 | 28 | 31 | 34 | 37 | 38 | 39 | 40 | {people.map((person) => ( 41 | 42 | 53 | 57 | 60 | 61 | 66 | 67 | ))} 68 | 69 |
23 | Name 24 | 26 | Title 27 | 29 | Status 30 | 32 | Role 33 | 35 | Edit 36 |
43 |
44 |
45 | 46 |
47 |
48 |
{person.name}
49 |
{person.email}
50 |
51 |
52 |
54 |
{person.title}
55 |
{person.department}
56 |
58 | Active 59 | {person.role} 62 | 63 | Edit 64 | 65 |
70 |
71 |
72 |
73 |
74 | 75 | ); 76 | } 77 | --------------------------------------------------------------------------------