├── .github
├── ISSUE_TEMPLATE
│ ├── ---bug-report.md
│ └── ---feature-request.md
└── windmill-dashboard-react.png
├── .gitignore
├── CHANGELOG.md
├── CODE_OF_CONDUCT.md
├── LICENSE
├── README.md
├── package-lock.json
├── package.json
├── postcss.config.js
├── public
├── favicon.ico
├── index.html
├── logo192.png
├── logo512.png
├── manifest.json
└── robots.txt
├── src
├── @types
│ └── icons
│ │ └── index.d.ts
├── App.tsx
├── assets
│ ├── css
│ │ └── tailwind.css
│ └── img
│ │ ├── create-account-office-dark.jpeg
│ │ ├── create-account-office.jpeg
│ │ ├── forgot-password-office-dark.jpeg
│ │ ├── forgot-password-office.jpeg
│ │ ├── login-office-dark.jpeg
│ │ └── login-office.jpeg
├── components
│ ├── AccessibleNavigationAnnouncer.tsx
│ ├── CTA.tsx
│ ├── Cards
│ │ └── InfoCard.tsx
│ ├── Chart
│ │ ├── ChartCard.tsx
│ │ └── ChartLegend.tsx
│ ├── Header.tsx
│ ├── RoundIcon.tsx
│ ├── Sidebar
│ │ ├── DesktopSidebar.tsx
│ │ ├── MobileSidebar.tsx
│ │ ├── SidebarContent.tsx
│ │ ├── SidebarSubmenu.tsx
│ │ └── index.tsx
│ ├── ThemedSuspense.tsx
│ └── Typography
│ │ ├── PageTitle.tsx
│ │ └── SectionTitle.tsx
├── containers
│ ├── Layout.tsx
│ └── Main.tsx
├── context
│ ├── SidebarContext.tsx
│ └── ThemeContext.tsx
├── icons
│ ├── bell.svg
│ ├── buttons.svg
│ ├── cards.svg
│ ├── cart.svg
│ ├── charts.svg
│ ├── chat.svg
│ ├── dropdown.svg
│ ├── edit.svg
│ ├── forbidden.svg
│ ├── forms.svg
│ ├── github.svg
│ ├── heart.svg
│ ├── home.svg
│ ├── index.ts
│ ├── mail.svg
│ ├── menu.svg
│ ├── modals.svg
│ ├── money.svg
│ ├── moon.svg
│ ├── outlineCog.svg
│ ├── outlineLogout.svg
│ ├── outlinePerson.svg
│ ├── pages.svg
│ ├── people.svg
│ ├── search.svg
│ ├── sun.svg
│ ├── tables.svg
│ ├── trash.svg
│ └── twitter.svg
├── index.tsx
├── pages
│ ├── 404.tsx
│ ├── Blank.tsx
│ ├── Buttons.tsx
│ ├── Cards.tsx
│ ├── Charts.tsx
│ ├── CreateAccount.tsx
│ ├── Dashboard.tsx
│ ├── ForgotPassword.tsx
│ ├── Forms.tsx
│ ├── Login.tsx
│ ├── Modals.tsx
│ └── Tables.tsx
├── react-app-env.d.ts
├── routes
│ ├── index.ts
│ └── sidebar.tsx
├── serviceWorker.ts
├── setupTests.tsx
└── utils
│ └── demo
│ ├── chartsData.ts
│ ├── index.ts
│ └── tableData.ts
├── tailwind.config.js
├── tsconfig.json
└── yarn.lock
/.github/ISSUE_TEMPLATE/---bug-report.md:
--------------------------------------------------------------------------------
1 | ---
2 | name: "\U0001F41B Bug report"
3 | about: 'Bugs, missing documentation, or unexpected behavior '
4 | title: ''
5 | labels: ''
6 | assignees: ''
7 | ---
8 |
9 |
19 |
20 | `windmill-dashboard-react` version: ``
21 |
22 | ### Relevant code or config:
23 |
24 | ```html
25 |
26 | ```
27 |
28 | ### What you did:
29 |
30 |
31 |
32 | ### What happened:
33 |
34 |
35 |
36 | ### Reproduction:
37 |
38 |
44 |
45 | ### Problem description:
46 |
47 |
48 |
49 | ### Suggested solution:
50 |
51 |
55 |
--------------------------------------------------------------------------------
/.github/ISSUE_TEMPLATE/---feature-request.md:
--------------------------------------------------------------------------------
1 | ---
2 | name: "\U0001F4A1 Feature request"
3 | about: 'I have a suggestion (and might want to implement myself)! '
4 | title: ''
5 | labels: ''
6 | assignees: ''
7 |
8 | ---
9 |
10 | **Is your feature request related to a problem? Please describe.**
11 | A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
12 |
13 | **Describe the solution you'd like**
14 | A clear and concise description of what you want to happen.
15 |
16 | **Describe alternatives you've considered**
17 | A clear and concise description of any alternative solutions or features you've considered.
18 |
19 | **Additional context**
20 | Add any other context or screenshots about the feature request here.
21 |
--------------------------------------------------------------------------------
/.github/windmill-dashboard-react.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/neutralboy/windmill-dashboard-react-ts/eb57233648ac05bf7d7c99709060bbc814cca76e/.github/windmill-dashboard-react.png
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | # See https://help.github.com/articles/ignoring-files/ for more about ignoring files.
2 |
3 | # dependencies
4 | /node_modules
5 | /.pnp
6 | .pnp.js
7 |
8 | # testing
9 | /coverage
10 |
11 | # production
12 | /build
13 |
14 | # misc
15 | .DS_Store
16 | .env.local
17 | .env.development.local
18 | .env.test.local
19 | .env.production.local
20 | .env
21 |
22 | npm-debug.log*
23 | yarn-debug.log*
24 | yarn-error.log*
25 |
26 | # css
27 | /src/assets/css/tailwind.output.css
28 | Dockerfile
29 | .devcontainer
--------------------------------------------------------------------------------
/CHANGELOG.md:
--------------------------------------------------------------------------------
1 | # [0.4.0](https://github.com/estevanmaito/windmill-dashboard-react/compare/0.3.2...0.4.0) (2020-07-22)
2 |
3 |
4 | ### Bug Fixes
5 |
6 | * **buttons:** update icon Buttons syntax as recommended in @windmill/react-ui ([15260fd](https://github.com/estevanmaito/windmill-dashboard-react/commit/15260fd23600bfcef488edd818df35a7e4652a58))
7 | * **sidebar:** hide sidebar until `lg` breakpoint for a better experience on tablets ([57293d9](https://github.com/estevanmaito/windmill-dashboard-react/commit/57293d92d76bbe48f8fab71ea6ef8606fbce72a3)), closes [#3](https://github.com/estevanmaito/windmill-dashboard-react/issues/3)
8 |
9 |
10 | ### Features
11 |
12 | * **app:** add antialiased font smoothing ([2355363](https://github.com/estevanmaito/windmill-dashboard-react/commit/2355363d30b94ab2e9862f2bfb3eac0e6c75ef61))
13 |
14 |
15 | ### BREAKING CHANGES
16 |
17 | * **sidebar:** The sidebar now only shows from `lg` breakpoint up, instead of `md`. This should
18 | create a better experience on smaller screens, especially tablets.
19 |
20 | ## [0.3.2](https://github.com/estevanmaito/windmill-dashboard-react/compare/0.3.1...0.3.2) (2020-07-21)
21 |
22 |
23 | ### Bug Fixes
24 |
25 | * **modal:** improve button visibility between sm and md breakpoints ([f9dc194](https://github.com/estevanmaito/windmill-dashboard-react/commit/f9dc1941dff21d8d22a7628903fa44c65b86d316))
26 |
27 | ## [0.3.1](https://github.com/estevanmaito/windmill-dashboard-react/compare/0.3.0...0.3.1) (2020-07-21)
28 |
29 |
30 | ### Bug Fixes
31 |
32 | * **windmill:** bump @windmill/react-ui from 0.3.0 to 0.3.1 ([2d3499c](https://github.com/estevanmaito/windmill-dashboard-react/commit/2d3499c4ca3a0b69cc4c9885303505f03646c111))
33 |
34 | # [0.3.0](https://github.com/estevanmaito/windmill-dashboard-react/compare/0.2.2...0.3.0) (2020-07-21)
35 |
36 |
37 | ### Bug Fixes
38 |
39 | * **windmill:** bump windmill to the scoped package ([dad6261](https://github.com/estevanmaito/windmill-dashboard-react/commit/dad626125c05816ddba8cd4dd11c08c4f8154095))
40 |
41 |
42 | ### BREAKING CHANGES
43 |
44 | * **windmill:** Changed every occurrence of `windmill-react-ui` with the scoped
45 | `@windmill/react-ui`. You should see no difference updating and you should update, as the other
46 | project is now deprecated and will no longer be developed. This was needed because the `windmill`
47 | org was in dispute and npm solved it today.
48 |
49 | ## [0.2.2](https://github.com/estevanmaito/windmill-dashboard-react/compare/0.2.1...0.2.2) (2020-07-19)
50 |
51 |
52 | ### Bug Fixes
53 |
54 | * **env:** use cross-env for env variables ([18fdfda](https://github.com/estevanmaito/windmill-dashboard-react/commit/18fdfda80f00bd5e5f2cfa0fb8c3de7a5a32fb02))
55 | * **windmill:** bump windmill-react-ui from 0.1.2-beta.0 to 0.1.2 ([07dcf08](https://github.com/estevanmaito/windmill-dashboard-react/commit/07dcf086125c263b85fb72bdf4c34429e83923b7))
56 |
57 | ## [0.2.1](https://github.com/estevanmaito/windmill-dashboard-react/compare/0.2.0...0.2.1) (2020-07-17)
58 |
59 |
60 | ### Bug Fixes
61 |
62 | * **header:** fix bleeding header shadow ([4eef708](https://github.com/estevanmaito/windmill-dashboard-react/commit/4eef7087e7e3d63b12cca040084f68d13604cb57))
63 |
64 | # [0.2.0](https://github.com/estevanmaito/windmill-dashboard-react/compare/0.1.0...0.2.0) (2020-07-17)
65 |
66 |
67 | ### Bug Fixes
68 |
69 | * **favicon:** update logo for pwa ([5e788d2](https://github.com/estevanmaito/windmill-dashboard-react/commit/5e788d24b8a18f90b450c85d04f319daf42bcf82))
70 |
71 |
72 | ### Features
73 |
74 | * **global:** update windmill-react-ui ([6c5c3c0](https://github.com/estevanmaito/windmill-dashboard-react/commit/6c5c3c0cb42df1bbbe8cf5d7e5e637101d556433))
75 | * **serviceworker:** activate service worker ([984dd8b](https://github.com/estevanmaito/windmill-dashboard-react/commit/984dd8b87aa7ee54f7a521550b8ad9c396b21e04))
76 |
77 |
78 | ### BREAKING CHANGES
79 |
80 | * **global:** Now you need to wrap the entire tailwind config object with Windmill's config
81 | wrapper. There is no need to use Windmill plugin or purge anymore.
82 |
83 | Complete example:
84 |
85 | ```js
86 | const defaultTheme = require('tailwindcss/defaultTheme')
87 | const windmill = require('windmill-react-ui/config')
88 |
89 | module.exports = windmill({
90 | purge: ['src/**/*.js'],
91 | theme: {
92 | extend: {
93 | fontFamily: {
94 | sans: ['Inter', ...defaultTheme.fontFamily.sans],
95 | },
96 | },
97 | },
98 | })
99 | ```
100 |
101 | # [0.1.0](https://github.com/estevanmaito/windmill-dashboard-react/compare/0.1.0-alpha.2...0.1.0) (2020-07-14)
102 |
103 |
104 | ### Features
105 |
106 | * **global:** upgrade to last windmill-ui version ([708fce4](https://github.com/estevanmaito/windmill-dashboard-react/commit/708fce44efe18e97190775fb41ca068c653549a7))
107 |
108 | # [0.1.0-alpha.2](https://github.com/estevanmaito/windmill-dashboard-react/compare/0.1.0-alpha.1...0.1.0-alpha.2) (2020-07-07)
109 |
110 |
111 | ### Bug Fixes
112 |
113 | * **avatar:** update avatar image syntax ([e16ea68](https://github.com/estevanmaito/windmill-dashboard-react/commit/e16ea68435ffd9bc7404dfb80120ff18c4c39052))
114 | * **layout:** increase header and sidebar z-index ([c948638](https://github.com/estevanmaito/windmill-dashboard-react/commit/c9486383e3129fb57af5aa0a9ca91c57946c44c1))
115 | * **routes:** redirect index to login ([06405ac](https://github.com/estevanmaito/windmill-dashboard-react/commit/06405ac345c4bdfa6e66bf5225bad868d5721d8b))
116 |
117 |
118 | ### BREAKING CHANGES
119 |
120 | * **avatar:** Avatar, with the udate to windmill-react-ui-alpha.10, now uses src instead of img
121 | to pass the image path to the inner image, to better resemble the actual element underneath
122 | * **layout:** increased z-index for header and sidebar
123 |
124 | # 0.1.0-alpha.1 (2020-07-01)
125 |
126 |
--------------------------------------------------------------------------------
/CODE_OF_CONDUCT.md:
--------------------------------------------------------------------------------
1 | # Code of Conduct
2 |
3 | ## Our Pledge
4 |
5 | In the interest of fostering an open and welcoming environment, we as
6 | contributors and maintainers pledge to make participation in our project and
7 | our community a harassment-free experience for everyone, regardless of age, body
8 | size, disability, ethnicity, sex characteristics, gender identity and expression,
9 | level of experience, education, socio-economic status, nationality, personal
10 | appearance, race, religion, or sexual identity and orientation.
11 |
12 | ## Our Standards
13 |
14 | Examples of behavior that contributes to creating a positive environment
15 | include:
16 |
17 | - Using welcoming and inclusive language
18 | - Being respectful of differing viewpoints and experiences
19 | - Gracefully accepting constructive criticism
20 | - Focusing on what is best for the community
21 | - Showing empathy towards other community members
22 |
23 | Examples of unacceptable behavior by participants include:
24 |
25 | - The use of sexualized language or imagery and unwelcome sexual attention or
26 | advances
27 | - Trolling, insulting/derogatory comments, and personal or political attacks
28 | - Public or private harassment
29 | - Publishing others' private information, such as a physical or electronic
30 | address, without explicit permission
31 | - Other conduct which could reasonably be considered inappropriate in a
32 | professional setting
33 |
34 | ## Our Responsibilities
35 |
36 | Project maintainers are responsible for clarifying the standards of acceptable
37 | behavior and are expected to take appropriate and fair corrective action in
38 | response to any instances of unacceptable behavior.
39 |
40 | Project maintainers have the right and responsibility to remove, edit, or
41 | reject comments, commits, code, wiki edits, issues, and other contributions
42 | that are not aligned to this Code of Conduct, or to ban temporarily or
43 | permanently any contributor for other behaviors that they deem inappropriate,
44 | threatening, offensive, or harmful.
45 |
46 | ## Scope
47 |
48 | This Code of Conduct applies within all project spaces, and it also applies when
49 | an individual is representing the project or its community in public spaces.
50 | Examples of representing a project or community include using an official
51 | project e-mail address, posting via an official social media account, or acting
52 | as an appointed representative at an online or offline event. Representation of
53 | a project may be further defined and clarified by project maintainers.
54 |
55 | ## Enforcement
56 |
57 | Instances of abusive, harassing, or otherwise unacceptable behavior may be
58 | reported by contacting the project team at [INSERT CONTACT]. All
59 | complaints will be reviewed and investigated and will result in a response that
60 | is deemed necessary and appropriate to the circumstances. The project team is
61 | obligated to maintain confidentiality with regard to the reporter of an incident.
62 | Further details of specific enforcement policies may be posted separately.
63 |
64 | Project maintainers who do not follow or enforce the Code of Conduct in good
65 | faith may face temporary or permanent repercussions as determined by other
66 | members of the project's leadership.
67 |
68 | ## Attribution
69 |
70 | This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4,
71 | available at https://www.contributor-covenant.org/version/1/4/code-of-conduct.html
72 |
73 | [homepage]: https://www.contributor-covenant.org
74 |
75 | For answers to common questions about this code of conduct, see
76 | https://www.contributor-covenant.org/faq
77 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | MIT License
2 |
3 | Copyright (c) 2020 Estevan Maito
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 |
2 |
3 |
4 |
5 | Four 100 scores and PWA ready. Just connect your data.
6 |
7 |
8 | 🚀 [See it live](https://windmillui.com/dashboard-react)
9 |
10 | This is not a template. This is a complete application, built on top of React, with all tiny details taken care of so you just need to bring the data to feed it.
11 |
12 | Accessibility is a priority in my projects and I think it should be in yours too, so this was developed listening to real screen readers, focus traps and keyboard navigation are available everywhere.
13 |
14 | This is a Typescript version of the popular windmill-dashboard-react. It works the exact same way. You can find the original project [here](https://github.com/estevanmaito/windmill-dashboard-react)
15 |
16 | ## 📦 Features
17 |
18 | - 🦮 Throughly accessible (developed using screen readers)
19 | - 🌗 Dark theme enabled (load even different images based on theme)
20 | - 🧩 Multiple (custom) components
21 | - ⚡ Code splitting
22 | - Tailwind CSS
23 | - [Windmill React UI](https://windmillui.com/react-ui)
24 | - React Router
25 | - Heroicons
26 | - Chart.js
27 | - PWA delivering offline-first and app-like experience
28 |
29 | ## 📚 Docs
30 |
31 | ### General components
32 |
33 | Windmill Dashboard React is built on top of [Windmill React UI](https://windmillui.com/react-ui). You will find the documentation for every small component there.
34 |
35 | ### Routing
36 |
37 | Routes in Windmill Dashboard are separated into two categories, sidebar ([routes/sidebar.js](src/routes/sidebar.js)) and general ([routes/index.js](src/routes/index.js)).
38 |
39 | #### Sidebar routes
40 |
41 | These are the routes that will show in the sidebar. They expect three properties:
42 |
43 | - `path`: the destination;
44 | - `name`: the name to be shown;
45 | - `icon`: an icon to illustrate the item
46 |
47 | Item that are used as dropdowns, like the Pages option, don't need a `path`, but expect a `routes` array of objects with `path` and `name`:
48 |
49 | ```js
50 | // sidebar.js
51 | {
52 | path: '/app/tables',
53 | icon: 'TablesIcon',
54 | name: 'Tables',
55 | },
56 | {
57 | icon: 'PagesIcon', // <-- this is used as a submenu, so no path
58 | name: 'Pages',
59 | routes: [
60 | // submenu
61 | {
62 | path: '/login',
63 | name: 'Login', // <-- these don't have icons
64 | },
65 | {
66 | path: '/create-account',
67 | name: 'Create account',
68 | },
69 | ```
70 |
71 | #### General (Router) routes
72 |
73 | These are **internal** (private) routes. They will be rendered inside the app, using the default `containers/Layout`.
74 |
75 | If you want to add a route to, let's say, a landing page, you should add it to the `App`'s router ([src/App.js](src/App.js), exactly like `Login`, `CreateAccount` and other pages are routed.
76 |
77 | #### How to add a new page to router?
78 |
79 | 1. Create your page inside `src/pages`, say `MyPage.js`;
80 | 2. Add it to the global router (`src/routes/index.js`)
81 |
82 | ```js
83 | const MyPage = lazy(() => import('../pages/MyPage'))
84 | ```
85 |
86 | Then add it to the `routes` array:
87 |
88 | ```js
89 | {
90 | path: '/my-page', // the url that will be added to /app/
91 | component: MyPage, // the page component you jsut imported
92 | }
93 | ```
94 |
95 | 3. If you want to make this page accessible from the sidebar, you have to options:
96 |
97 | - add it to the root `routes` array
98 |
99 | ```js
100 | {
101 | path: '/app/my-page', // /app + the url you added in routes/index.js
102 | icon: 'HomeIcon', // the component being exported from src/icons/index.js
103 | name: 'My Page', // name that appear in Sidebar
104 | },
105 | ```
106 |
107 | - add it as an option under a dropdown
108 |
109 | ```js
110 | {
111 | icon: 'PagesIcon',
112 | name: 'Pages',
113 | routes: [
114 | // submenu
115 | {
116 | path: '/app/my-page',
117 | name: 'My Page',
118 | },
119 | ```
120 |
121 | If you're asking where does this `/app` come from, it is from this line inside `src/App.js`, that renders the app:
122 |
123 | ```jsx
124 |
125 | ```
126 |
127 | ---
128 |
129 | This project was bootstrapped with [Create React App](https://github.com/facebook/create-react-app).
130 |
131 | ## Available Scripts
132 |
133 | In the project directory, you can run:
134 |
135 | ### `npm start`
136 |
137 | Runs the app in the development mode.
138 | Open [http://localhost:3000](http://localhost:3000) to view it in the browser.
139 |
140 | The page will reload if you make edits.
141 | You will also see any lint errors in the console.
142 |
143 | ### `npm test`
144 |
145 | Launches the test runner in the interactive watch mode.
146 | See the section about [running tests](https://facebook.github.io/create-react-app/docs/running-tests) for more information.
147 |
148 | ### `npm run build`
149 |
150 | Builds the app for production to the `build` folder.
151 | It correctly bundles React in production mode and optimizes the build for the best performance.
152 |
153 | The build is minified and the filenames include the hashes.
154 | Your app is ready to be deployed!
155 |
156 | See the section about [deployment](https://facebook.github.io/create-react-app/docs/deployment) for more information.
157 |
158 | ### `npm run eject`
159 |
160 | **Note: this is a one-way operation. Once you `eject`, you can’t go back!**
161 |
162 | If you aren’t satisfied with the build tool and configuration choices, you can `eject` at any time. This command will remove the single build dependency from your project.
163 |
164 | Instead, it will copy all the configuration files and the transitive dependencies (webpack, Babel, ESLint, etc) right into your project so you have full control over them. All of the commands except `eject` will still work, but they will point to the copied scripts so you can tweak them. At this point you’re on your own.
165 |
166 | You don’t have to ever use `eject`. The curated feature set is suitable for small and middle deployments, and you shouldn’t feel obligated to use this feature. However we understand that this tool wouldn’t be useful if you couldn’t customize it when you are ready for it.
167 |
168 | ## Learn More
169 |
170 | You can learn more in the [Create React App documentation](https://facebook.github.io/create-react-app/docs/getting-started).
171 |
172 | To learn React, check out the [React documentation](https://reactjs.org/).
173 |
174 | ### Code Splitting
175 |
176 | This section has moved here: https://facebook.github.io/create-react-app/docs/code-splitting
177 |
178 | ### Analyzing the Bundle Size
179 |
180 | This section has moved here: https://facebook.github.io/create-react-app/docs/analyzing-the-bundle-size
181 |
182 | ### Making a Progressive Web App
183 |
184 | This section has moved here: https://facebook.github.io/create-react-app/docs/making-a-progressive-web-app
185 |
186 | ### Advanced Configuration
187 |
188 | This section has moved here: https://facebook.github.io/create-react-app/docs/advanced-configuration
189 |
190 | ### Deployment
191 |
192 | This section has moved here: https://facebook.github.io/create-react-app/docs/deployment
193 |
194 | ### `npm run build` fails to minify
195 |
196 | This section has moved here: https://facebook.github.io/create-react-app/docs/troubleshooting#npm-run-build-fails-to-minify
197 |
--------------------------------------------------------------------------------
/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "windmill-dashboard-react",
3 | "version": "0.4.0",
4 | "description": "A multi theme, completely accessible, with components and pages examples, (almost) ready for production dashboard.",
5 | "private": true,
6 | "scripts": {
7 | "tailwind:dev": "tailwindcss build src/assets/css/tailwind.css -o src/assets/css/tailwind.output.css",
8 | "tailwind:build": "cross-env NODE_ENV=production postcss src/assets/css/tailwind.css -o src/assets/css/tailwind.output.css",
9 | "prestart": "npm run tailwind:dev",
10 | "start": "react-scripts start",
11 | "prebuild": "npm run tailwind:build",
12 | "build": "react-scripts build",
13 | "cz": "git-cz",
14 | "release": "release-it",
15 | "test": "react-scripts test",
16 | "eject": "react-scripts eject",
17 | "tsc": "tsc"
18 | },
19 | "dependencies": {
20 | "@testing-library/jest-dom": "4.2.4",
21 | "@testing-library/react": "9.5.0",
22 | "@testing-library/user-event": "7.2.1",
23 | "@windmill/react-ui": "^0.6.0",
24 | "chart.js": "2.9.3",
25 | "classnames": "^2.3.1",
26 | "faker": "4.1.0",
27 | "react": "^16.13.1",
28 | "react-chartjs-2": "2.9.0",
29 | "react-dom": "^16.13.1",
30 | "react-focus-lock": "2.4.0",
31 | "react-router-dom": "^5.2.0",
32 | "react-scripts": "^4.0.3",
33 | "react-transition-group": "4.4.1"
34 | },
35 | "devDependencies": {
36 | "@release-it/conventional-changelog": "1.1.4",
37 | "@svgr/webpack": "5.4.0",
38 | "@types/classnames": "^2.3.1",
39 | "@types/react-router-dom": "^5.1.7",
40 | "autoprefixer": "^10.2.6",
41 | "commitizen": "4.1.2",
42 | "cross-env": "7.0.2",
43 | "cssnano": "^5.0.6",
44 | "cz-conventional-changelog": "3.2.0",
45 | "postcss": "^8.3.2",
46 | "postcss-cli": "^8.3.1",
47 | "react-axe": "3.5.2",
48 | "release-it": "13.6.4",
49 | "tailwindcss": "^2.1.4",
50 | "typescript": "^4.3.2"
51 | },
52 | "keywords": [
53 | "windmill",
54 | "dashboard",
55 | "admin",
56 | "tailwind",
57 | "react"
58 | ],
59 | "release-it": {
60 | "github": {
61 | "release": true
62 | },
63 | "npm": {
64 | "publish": false
65 | },
66 | "plugins": {
67 | "@release-it/conventional-changelog": {
68 | "preset": "angular",
69 | "infile": "CHANGELOG.md"
70 | }
71 | }
72 | },
73 | "config": {
74 | "commitizen": {
75 | "path": "./node_modules/cz-conventional-changelog"
76 | }
77 | },
78 | "eslintConfig": {
79 | "extends": "react-app"
80 | },
81 | "browserslist": {
82 | "production": [
83 | ">0.2%",
84 | "not dead",
85 | "not op_mini all"
86 | ],
87 | "development": [
88 | "last 1 chrome version",
89 | "last 1 firefox version",
90 | "last 1 safari version"
91 | ]
92 | }
93 | }
94 |
--------------------------------------------------------------------------------
/postcss.config.js:
--------------------------------------------------------------------------------
1 | module.exports = {
2 | plugins: [
3 | require('tailwindcss'),
4 | require('autoprefixer'),
5 | require('cssnano')({
6 | preset: 'default',
7 | }),
8 | ],
9 | }
10 |
--------------------------------------------------------------------------------
/public/favicon.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/neutralboy/windmill-dashboard-react-ts/eb57233648ac05bf7d7c99709060bbc814cca76e/public/favicon.ico
--------------------------------------------------------------------------------
/public/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
14 |
15 |
24 |
28 | Windmill Dashboard
29 |
30 |
31 |
32 |
33 |
43 |
44 |
45 |
--------------------------------------------------------------------------------
/public/logo192.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/neutralboy/windmill-dashboard-react-ts/eb57233648ac05bf7d7c99709060bbc814cca76e/public/logo192.png
--------------------------------------------------------------------------------
/public/logo512.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/neutralboy/windmill-dashboard-react-ts/eb57233648ac05bf7d7c99709060bbc814cca76e/public/logo512.png
--------------------------------------------------------------------------------
/public/manifest.json:
--------------------------------------------------------------------------------
1 | {
2 | "short_name": "Windmill",
3 | "name": "Windmill Dashboard React",
4 | "icons": [
5 | {
6 | "src": "favicon.ico",
7 | "sizes": "64x64 32x32 24x24 16x16",
8 | "type": "image/x-icon"
9 | },
10 | {
11 | "src": "logo192.png",
12 | "type": "image/png",
13 | "sizes": "192x192"
14 | },
15 | {
16 | "src": "logo512.png",
17 | "type": "image/png",
18 | "sizes": "512x512"
19 | }
20 | ],
21 | "start_url": ".",
22 | "display": "standalone",
23 | "theme_color": "#000000",
24 | "background_color": "#ffffff"
25 | }
26 |
--------------------------------------------------------------------------------
/public/robots.txt:
--------------------------------------------------------------------------------
1 | # https://www.robotstxt.org/robotstxt.html
2 | User-agent: *
3 | Disallow:
4 |
--------------------------------------------------------------------------------
/src/@types/icons/index.d.ts:
--------------------------------------------------------------------------------
1 | declare module '*.svg' {
2 | import React from "react";
3 | const ReactComponent: React.FC>;
4 | export default ReactComponent;
5 | // const content: (props: React.SVGProps) => React.ReactElement;
6 | // export default content;
7 | }
--------------------------------------------------------------------------------
/src/App.tsx:
--------------------------------------------------------------------------------
1 | import { lazy } from 'react'
2 | import { BrowserRouter as Router, Switch, Route, Redirect } from 'react-router-dom'
3 | import AccessibleNavigationAnnouncer from './components/AccessibleNavigationAnnouncer'
4 |
5 | const Layout = lazy(() => import('./containers/Layout'))
6 | const Login = lazy(() => import('./pages/Login'))
7 | const CreateAccount = lazy(() => import('./pages/CreateAccount'))
8 | const ForgotPassword = lazy(() => import('./pages/ForgotPassword'))
9 |
10 | function App() {
11 | return (
12 | <>
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 | {/* Place new routes over this */}
21 |
22 | {/* If you have an index page, you can remothis Redirect */}
23 |
24 |
25 |
26 | >
27 | )
28 | }
29 |
30 | export default App
31 |
--------------------------------------------------------------------------------
/src/assets/css/tailwind.css:
--------------------------------------------------------------------------------
1 | @tailwind base;
2 | @tailwind components;
3 | @tailwind utilities;
4 |
--------------------------------------------------------------------------------
/src/assets/img/create-account-office-dark.jpeg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/neutralboy/windmill-dashboard-react-ts/eb57233648ac05bf7d7c99709060bbc814cca76e/src/assets/img/create-account-office-dark.jpeg
--------------------------------------------------------------------------------
/src/assets/img/create-account-office.jpeg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/neutralboy/windmill-dashboard-react-ts/eb57233648ac05bf7d7c99709060bbc814cca76e/src/assets/img/create-account-office.jpeg
--------------------------------------------------------------------------------
/src/assets/img/forgot-password-office-dark.jpeg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/neutralboy/windmill-dashboard-react-ts/eb57233648ac05bf7d7c99709060bbc814cca76e/src/assets/img/forgot-password-office-dark.jpeg
--------------------------------------------------------------------------------
/src/assets/img/forgot-password-office.jpeg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/neutralboy/windmill-dashboard-react-ts/eb57233648ac05bf7d7c99709060bbc814cca76e/src/assets/img/forgot-password-office.jpeg
--------------------------------------------------------------------------------
/src/assets/img/login-office-dark.jpeg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/neutralboy/windmill-dashboard-react-ts/eb57233648ac05bf7d7c99709060bbc814cca76e/src/assets/img/login-office-dark.jpeg
--------------------------------------------------------------------------------
/src/assets/img/login-office.jpeg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/neutralboy/windmill-dashboard-react-ts/eb57233648ac05bf7d7c99709060bbc814cca76e/src/assets/img/login-office.jpeg
--------------------------------------------------------------------------------
/src/components/AccessibleNavigationAnnouncer.tsx:
--------------------------------------------------------------------------------
1 | import React, { useState, useEffect } from 'react';
2 | import { useLocation } from 'react-router-dom';
3 |
4 | function AccessibleNavigationAnnouncer() {
5 | const [message, setMessage] = useState('');
6 | const location = useLocation();
7 |
8 | useEffect(() => {
9 | // ignore the /
10 | if (location.pathname.slice(1)) {
11 | // make sure navigation has occurred and screen reader is ready
12 | setTimeout(() => setMessage(`Navigated to ${location.pathname.slice(1)} page.`), 500);
13 | } else {
14 | setMessage('');
15 | }
16 | }, [location])
17 |
18 | return (
19 |
20 | {message}
21 |
22 | );
23 | };
24 |
25 | export default AccessibleNavigationAnnouncer;
26 |
--------------------------------------------------------------------------------
/src/components/CTA.tsx:
--------------------------------------------------------------------------------
1 | import React from 'react';
2 |
3 | function CTA() {
4 | return (
5 |
9 |
79 | Lorem ipsum dolor sit, amet consectetur adipisicing elit. Fuga, cum commodi a omnis
80 | numquam quod? Totam exercitationem quos hic ipsam at qui cum numquam, sed amet
81 | ratione! Ratione, nihil dolorum.
82 |
83 |
84 |
85 |
86 |
87 |
88 |
Colored card
89 |
90 | Lorem ipsum dolor sit, amet consectetur adipisicing elit. Fuga, cum commodi a omnis
91 | numquam quod? Totam exercitationem quos hic ipsam at qui cum numquam, sed amet
92 | ratione! Ratione, nihil dolorum.
93 |
26 |
27 |
28 | Modal header
29 |
30 | Lorem, ipsum dolor sit amet consectetur adipisicing elit. Nostrum et eligendi repudiandae
31 | voluptatem tempore!
32 |
33 |
34 | {/* I don't like this approach. Consider passing a prop to ModalFooter
35 | * that if present, would duplicate the buttons in a way similar to this.
36 | * Or, maybe find some way to pass something like size="large md:regular"
37 | * to Button
38 | */}
39 |
40 |
43 |
44 |
45 |
46 |
47 |
48 |
51 |
52 |
53 |
56 |
57 |
58 |
59 | >
60 | );
61 | };
62 |
63 | export default Modals;
64 |
--------------------------------------------------------------------------------
/src/pages/Tables.tsx:
--------------------------------------------------------------------------------
1 | import React, { useState, useEffect } from 'react';
2 |
3 | import PageTitle from '../components/Typography/PageTitle';
4 | import SectionTitle from '../components/Typography/SectionTitle';
5 | import CTA from '../components/CTA';
6 | import {
7 | Table,
8 | TableHeader,
9 | TableCell,
10 | TableBody,
11 | TableRow,
12 | TableFooter,
13 | TableContainer,
14 | Badge,
15 | Avatar,
16 | Button,
17 | Pagination,
18 | } from '@windmill/react-ui';
19 | import { EditIcon, TrashIcon } from '../icons';
20 | import { ITableData } from "../utils/demo/tableData";
21 |
22 | import response from '../utils/demo/tableData';
23 | // make a copy of the data, for the second table
24 | const response2 = response.concat([]);
25 |
26 | function Tables() {
27 | /**
28 | * DISCLAIMER: This code could be badly improved, but for the sake of the example
29 | * and readability, all the logic for both table are here.
30 | * You would be better served by dividing each table in its own
31 | * component, like Table(?) and TableWithActions(?) hiding the
32 | * presentation details away from the page view.
33 | */
34 |
35 | // setup pages control for every table
36 | const [pageTable1, setPageTable1] = useState(1)
37 | const [pageTable2, setPageTable2] = useState(1)
38 |
39 | // setup data for every table
40 | const [dataTable1, setDataTable1] = useState([])
41 | const [dataTable2, setDataTable2] = useState([])
42 |
43 | // pagination setup
44 | const resultsPerPage = 10;
45 | const totalResults = response.length;
46 |
47 | // pagination change control
48 | function onPageChangeTable1(p: number) {
49 | setPageTable1(p)
50 | }
51 |
52 | // pagination change control
53 | function onPageChangeTable2(p: number) {
54 | setPageTable2(p)
55 | }
56 |
57 | // on page change, load new sliced data
58 | // here you would make another server request for new data
59 | useEffect(() => {
60 | setDataTable1(response.slice((pageTable1 - 1) * resultsPerPage, pageTable1 * resultsPerPage))
61 | }, [pageTable1])
62 |
63 | // on page change, load new sliced data
64 | // here you would make another server request for new data
65 | useEffect(() => {
66 | setDataTable2(response2.slice((pageTable2 - 1) * resultsPerPage, pageTable2 * resultsPerPage))
67 | }, [pageTable2])
68 |
69 | return (
70 | <>
71 | Tables
72 |
73 |
74 |
75 | Simple table
76 |
77 |
78 |
79 |
80 | Client
81 | Amount
82 | Status
83 | Date
84 |