Skip to content

Commit

Permalink
Merge pull request #430 from icflorescu/next
Browse files Browse the repository at this point in the history
Prep for upgrading to V7
  • Loading branch information
icflorescu committed Oct 19, 2023
2 parents 0b97b0e + 80c916d commit 56b7e1c
Show file tree
Hide file tree
Showing 14 changed files with 658 additions and 697 deletions.
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@
[![Language][language-image]][repo-url]
[![Sponsor the author][sponsor-image]][sponsor-url]

⚠️ Mantine DataTable V6 supports Mantine V6.
💡 Mantine V7 support is in the works, and I could really use your help to speed things up. Please consider [sponsoring my work](https://github.com/sponsors/icflorescu) 🙏

The lightweight, dependency-free, "dark-theme aware" [**table component**](https://icflorescu.github.io/mantine-datatable/) for your Mantine UI data-rich applications, featuring asynchronous data loading support, pagination, intuitive Gmail-style additive batch rows selection, column sorting, custom cell data rendering, row context menu, row expansion, nesting, and more.

[![Mantine DataTable](https://user-images.githubusercontent.com/581999/189911698-369ba48e-65f0-4772-aad3-cb5e6d4cb59d.png)](https://icflorescu.github.io/mantine-datatable/)
Expand Down
2 changes: 1 addition & 1 deletion docs/components/appHeader/NpmDownloads.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { useEffect, useState } from 'react';
import useIsMounted from '~/lib/useIsMounted';

export function NpmDownloads() {
const [downloads, setDownloads] = useState(process.env.INITIAL_NPM_DOWNLOADS);
const [downloads, setDownloads] = useState(Number(process.env.INITIAL_NPM_DOWNLOADS));
const isMounted = useIsMounted();

useEffect(() => {
Expand Down
65 changes: 65 additions & 0 deletions docs/components/homePage/HomePageSubtitle.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
import { Anchor, Text, createStyles } from '@mantine/core';
import { IconArrowDown, IconDiscountCheck, IconExclamationCircle } from '@tabler/icons-react';
import InternalLink from '../InternalLink';

const useStyles = createStyles((theme) => ({
root: {
marginBottom: '2em',
},
line: {
display: 'flex',
gap: '.5em',
alignItems: 'flex-start',
},
lineIcon: {
marginTop: 1,
},
checkIcon: {
color: theme.colors.green[6],
},
warningIcon: {
color: theme.colors.red[6],
},
break: {
[`@media (min-width: 370px)`]: {
display: 'none',
},
},
link: {
'&:hover': {
textDecoration: 'none',
borderBottom: `1px solid ${theme.colorScheme === 'dark' ? theme.colors.blue[7] : theme.colors.blue[5]}`,
},
},
linkIcon: {
verticalAlign: -2,
},
}));

function handleLinkClick() {
window.scrollTo({ left: 0, top: document.body.scrollHeight, behavior: 'smooth' });
}

export default function HomePageSubtitle() {
const { classes, cx } = useStyles();
return (
<div className={classes.root}>
<div className={classes.line}>
<IconDiscountCheck className={cx(classes.lineIcon, classes.checkIcon)} size={18} />
<Text color="dimmed" size="sm">
trusted by <br className={classes.break} />
<Anchor className={classes.link} onClick={handleLinkClick}>
awesome companies and developers <IconArrowDown className={classes.linkIcon} size={14} />
</Anchor>
</Text>
</div>
<div className={classes.line}>
<IconExclamationCircle className={cx(classes.lineIcon, classes.warningIcon)} size={18} />
<Text color="dimmed" size="sm">
supports <strong>Mantine V6</strong>; support for <strong>Mantine V7</strong> is{' '}
<InternalLink to="/mantine-v7-support">under development</InternalLink>
</Text>
</div>
</div>
);
}
48 changes: 0 additions & 48 deletions docs/components/homePage/HomePageTrustedBy.tsx

This file was deleted.

30 changes: 30 additions & 0 deletions docs/next.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
/* eslint-disable @typescript-eslint/no-var-requires */
const withPWA = require('@ducanh2912/next-pwa').default({ dest: 'public' });
const { version: PACKAGE_VERSION } = require('./package.json');

module.exports = async (phase) => {
const { downloads } = await fetch('https://api.npmjs.org/downloads/point/last-month/mantine-datatable')
.then((res) => res.json())
.catch(() => ({ downloads: 0 }));

/**
* @type {import('next').NextConfig}
*/
const config = {
output: 'export',
reactStrictMode: true,
transpilePackages: ['mantine-datatable'],
env: {
PACKAGE_VERSION,
BASE_PATH: '',
INITIAL_NPM_DOWNLOADS: String(downloads),
},
};

if (phase === 'phase-production-build' && process.env.GITHUB_PAGES === 'true') {
config.env.BASE_PATH = config.basePath = '/mantine-datatable';
config.env.CANONICAL_URL = 'https://icflorescu.github.io/mantine-datatable/';
}

return withPWA(config);
};
33 changes: 0 additions & 33 deletions docs/next.config.mjs

This file was deleted.

24 changes: 12 additions & 12 deletions docs/package.json
Original file line number Diff line number Diff line change
@@ -1,18 +1,19 @@
{
"name": "mantine-datatable-docs",
"version": "6.0.0",
"version": "6.0.1",
"description": "Docs website for mantine-datatable; see ../package/package.json for more info",
"private": true,
"scripts": {
"dev": "NODE_NO_WARNINGS=1 next dev",
"build": "NODE_NO_WARNINGS=1 next build && next-sitemap",
"dev": "next dev",
"build": "next build && next-sitemap",
"lint": "eslint . --ext=.ts,.tsx && tsc --noEmit"
},
"dependencies": {
"@docsearch/react": "^3.5.2",
"@ducanh2912/next-pwa": "^9.7.2",
"@emotion/react": "^11.11.1",
"@emotion/server": "^11.11.0",
"@faker-js/faker": "^8.1.0",
"@faker-js/faker": "^8.2.0",
"@formkit/auto-animate": "^0.8.0",
"@mantine/core": "^6.0.21",
"@mantine/dates": "^6.0.21",
Expand All @@ -21,22 +22,21 @@
"@mantine/next": "^6.0.21",
"@mantine/notifications": "^6.0.21",
"@mantine/prism": "^6.0.21",
"@tabler/icons-react": "^2.38.0",
"@tanstack/react-query": "^4.35.7",
"@tabler/icons-react": "^2.39.0",
"@tanstack/react-query": "^4.36.1",
"dayjs": "^1.11.10",
"lodash": "^4.17.21",
"mantine-datatable": "*",
"next": "^13.5.3",
"next-pwa": "^5.6.0",
"next": "^13.5.6",
"next-sitemap": "^4.2.3",
"react": "^18.2.0",
"react-dom": "^18.2.0"
},
"devDependencies": {
"@types/lodash": "^4.14.199",
"@types/node": "^20.8.0",
"@types/react": "^18.2.24",
"@types/lodash": "^4.14.200",
"@types/node": "^20.8.7",
"@types/react": "^18.2.30",
"typescript": "^5.2.2",
"webpack": "^5.88.2"
"webpack": "^5.89.0"
}
}
6 changes: 3 additions & 3 deletions docs/pages/getting-started.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -38,17 +38,17 @@ export default function Page({ code }: InferGetStaticPropsType<typeof getStaticP
{
title: 'yarn',
language: 'bash',
content: 'yarn add @mantine/core @mantine/hooks @emotion/react mantine-datatable',
content: 'yarn add @mantine/core@6 @mantine/hooks@6 @emotion/react mantine-datatable',
},
{
title: 'pnpm',
language: 'bash',
content: 'pnpm i @mantine/core @mantine/hooks @emotion/react mantine-datatable',
content: 'pnpm i @mantine/core@6 @mantine/hooks@6 @emotion/react mantine-datatable',
},
{
title: 'npm',
language: 'bash',
content: 'npm i @mantine/core @mantine/hooks @emotion/react mantine-datatable',
content: 'npm i @mantine/core@6 @mantine/hooks@6 @emotion/react mantine-datatable',
},
]}
/>
Expand Down
4 changes: 2 additions & 2 deletions docs/pages/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ import InternalLink from '~/components/InternalLink';
import HomePageButtons from '~/components/homePage/HomePageButtons';
import HomePageFeature from '~/components/homePage/HomePageFeature';
import HomePageQuote from '~/components/homePage/HomePageQuote';
import HomePageSubtitle from '~/components/homePage/HomePageSubtitle';
import HomePageTitle from '~/components/homePage/HomePageTitle';
import HomePageTrustedBy from '~/components/homePage/HomePageTrustedBy';
import {
CRA_LINK,
GATSBY_LINK,
Expand Down Expand Up @@ -58,7 +58,7 @@ export default function Page() {
<Container>
<div className={classes.root}>
<HomePageTitle />
<HomePageTrustedBy />
<HomePageSubtitle />
<div className={classes.image}>
<img src={`${process.env.BASE_PATH}/mantine-datatable.png`} alt="Mantine DataTable supports dark mode" />
</div>
Expand Down
24 changes: 12 additions & 12 deletions docs/pages/mantine-v7-support.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@ export default function Page() {
<Container>
<PageTitle of={PATH} />
<PageText idea>
Mantine DataTable v6.x supports <ExternalLink to="https://v6.mantine.dev/">Mantine v6.x</ExternalLink>.
Mantine DataTable V6 supports <ExternalLink to="https://v6.mantine.dev/">Mantine V6</ExternalLink>.
<br />
<ExternalLink to={MANTINE_LINK}>Mantine v7.x</ExternalLink> support is on the roadmap. You can help speed up the
process by <ExternalLink to={SPONSOR_LINK}>sponsoring me on GitHub</ExternalLink>.
<ExternalLink to={MANTINE_LINK}>Mantine V7</ExternalLink> support is under development. You can help speed up
the process by <ExternalLink to={SPONSOR_LINK}>sponsoring me on GitHub</ExternalLink>.
</PageText>
<PageText>
As most of you already know, Mantine v7 came up with{' '}
Expand All @@ -43,21 +43,21 @@ export default function Page() {
<ExternalLink to="https://icflorescu.github.io/mantine-contextmenu">Mantine-ContextMenu</ExternalLink>,{' '}
<ExternalLink to="https://pocketbase-uml.github.io/">PocketBaseUML</ExternalLink>,{' '}
<ExternalLink to="https://icflorescu.github.io/trpc-sveltekit">tRPC-SvelteKit</ExternalLink>,{' '}
<ExternalLink to="https://github.com/icflorescu/expose-wsl">Expose-WSL</ExternalLink> and{' '}
<ExternalLink to={AUTHOR_LINK}>others</ExternalLink>. But I can’t be a full-time open-source developer; I wasn’t
born rich (on the contrary). Therefore, I have to make a living, so I have to spend most of my time working on
commercial projects as a <InternalLink to="/hire-the-author">freelancer or contractor</InternalLink>.
<ExternalLink to="https://github.com/icflorescu/expose-wsl">Expose-WSL</ExternalLink> and a few{' '}
<ExternalLink to={AUTHOR_LINK}>others</ExternalLink>.
<br />
But I can’t be a full-time open-source developer; I wasn’t born rich (on the contrary).
<br />
Therefore, I have to make a living, so I have to spend most of my time working on commercial projects as a{' '}
<InternalLink to="/hire-the-author">freelancer or contractor</InternalLink>.
</PageText>
<PageText>
Please understand that this is not a rant, but a simple explanation of why I can’t dedicate as much time as I
(and you) would like to this project.
</PageText>
<PageText warning>
To sum it up, Mantine V7 support is on the roadmap, but it will take a while to get there.
<br />
I’m doing my best to keep this project alive, but I can’t do it alone.
<br />
I need <ExternalLink to={SPONSOR_LINK}>your help</ExternalLink>.
To sum it up, Mantine V7 support is under development, but I can’t do it alone. I need{' '}
<ExternalLink to={SPONSOR_LINK}>your help</ExternalLink>.
</PageText>
<PageText>
Thank you for your support and understanding,
Expand Down
2 changes: 1 addition & 1 deletion docs/types.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@ namespace NodeJS {
PACKAGE_VERSION: string;
BASE_PATH: string;
CANONICAL_URL: string;
INITIAL_NPM_DOWNLOADS: number;
INITIAL_NPM_DOWNLOADS: string;
}
}
20 changes: 10 additions & 10 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "mantine-datatable-turborepo",
"version": "6.0.0",
"version": "6.0.1",
"description": "Monorepo for mantine-datatable; see package/package.json for more info",
"private": true,
"workspaces": [
Expand All @@ -20,23 +20,23 @@
},
"devDependencies": {
"@babel/preset-react": "^7.22.15",
"@babel/preset-typescript": "^7.22.15",
"@faker-js/faker": "^8.1.0",
"@testing-library/jest-dom": "^6.1.3",
"@babel/preset-typescript": "^7.23.2",
"@faker-js/faker": "^8.2.0",
"@testing-library/jest-dom": "^6.1.4",
"@testing-library/react": "^14.0.0",
"@testing-library/react-hooks": "^8.0.1",
"@testing-library/user-event": "^14.5.1",
"@types/jest": "^29.5.5",
"@typescript-eslint/eslint-plugin": "^6.7.3",
"@typescript-eslint/parser": "^6.7.3",
"@types/jest": "^29.5.6",
"@typescript-eslint/eslint-plugin": "^6.8.0",
"@typescript-eslint/parser": "^6.8.0",
"babel-jest": "^29.7.0",
"eslint": "^8.50.0",
"eslint-config-next": "^13.5.3",
"eslint": "^8.51.0",
"eslint-config-next": "^13.5.6",
"eslint-config-prettier": "^9.0.0",
"jest": "^29.7.0",
"jest-environment-jsdom": "^29.7.0",
"prettier": "^3.0.3",
"turbo": "^1.10.14",
"turbo": "^1.10.16",
"typescript": "^5.2.2"
},
"engines": {
Expand Down
Loading

0 comments on commit 56b7e1c

Please sign in to comment.