15 Commits

17 changed files with 1910 additions and 1486 deletions

View File

@ -1 +0,0 @@
module.exports = require('eslint-config-mantine/.prettierrc.js');

35
.prettierrc.mjs Normal file
View File

@ -0,0 +1,35 @@
/** @type {import("@ianvs/prettier-plugin-sort-imports").PrettierConfig} */
const config = {
printWidth: 100,
singleQuote: true,
trailingComma: 'es5',
plugins: ['@ianvs/prettier-plugin-sort-imports'],
importOrder: [
'.*styles.css$',
'',
'dayjs',
'^react$',
'^next$',
'^next/.*$',
'<BUILTIN_MODULES>',
'<THIRD_PARTY_MODULES>',
'^@mantine/(.*)$',
'^@mantinex/(.*)$',
'^@mantine-tests/(.*)$',
'^@docs/(.*)$',
'^@/.*$',
'^../(?!.*.css$).*$',
'^./(?!.*.css$).*$',
'\\.css$',
],
overrides: [
{
files: '*.mdx',
options: {
printWidth: 70,
},
},
],
};
export default config;

View File

@ -1,16 +1,16 @@
import type { StorybookConfig } from '@storybook/nextjs';
const config: StorybookConfig = {
core: {
disableWhatsNewNotifications: true,
disableTelemetry: true,
enableCrashReports: false,
},
stories: ['../components/**/*.(stories|story).@(js|jsx|ts|tsx)'],
addons: [
'@storybook/addon-essentials',
'storybook-dark-mode',
'@storybook/addon-styling-webpack',
],
addons: ['storybook-dark-mode'],
framework: {
name: '@storybook/nextjs',
options: {},
},
};
export default config;

View File

@ -1,10 +1,18 @@
import '@mantine/core/styles.css';
import React, { useEffect } from 'react';
import { addons } from '@storybook/preview-api';
import { DARK_MODE_EVENT_NAME } from 'storybook-dark-mode';
import { MantineProvider, useMantineColorScheme } from '@mantine/core';
import { theme } from '../theme';
export const parameters = {
layout: 'fullscreen',
options: {
showPanel: false,
},
};
const channel = addons.getChannel();
function ColorSchemeWrapper({ children }: { children: React.ReactNode }) {

File diff suppressed because one or more lines are too long

934
.yarn/releases/yarn-4.5.1.cjs vendored Executable file

File diff suppressed because one or more lines are too long

View File

@ -1,3 +1,3 @@
nodeLinker: node-modules
yarnPath: .yarn/releases/yarn-4.3.1.cjs
yarnPath: .yarn/releases/yarn-4.5.1.cjs

64
_mantine.scss Normal file
View File

@ -0,0 +1,64 @@
@use 'sass:math';
// Define variables for your breakpoints,
// values must be the same as in your theme
$mantine-breakpoint-xs: '36em';
$mantine-breakpoint-sm: '48em';
$mantine-breakpoint-md: '62em';
$mantine-breakpoint-lg: '75em';
$mantine-breakpoint-xl: '88em';
@function rem($value) {
@return #{math.div(math.div($value, $value * 0 + 1), 16)}rem;
}
@mixin light {
[data-mantine-color-scheme='light'] & {
@content;
}
}
@mixin dark {
[data-mantine-color-scheme='dark'] & {
@content;
}
}
@mixin hover {
@media (hover: hover) {
&:hover {
@content;
}
}
@media (hover: none) {
&:active {
@content;
}
}
}
@mixin smaller-than($breakpoint) {
@media (max-width: $breakpoint) {
@content;
}
}
@mixin larger-than($breakpoint) {
@media (min-width: $breakpoint) {
@content;
}
}
// Add direction mixins if you need rtl support
@mixin rtl {
[dir='rtl'] & {
@content;
}
}
@mixin ltr {
[dir='ltr'] & {
@content;
}
}

View File

@ -1,6 +1,7 @@
import '@mantine/core/styles.css';
import React from 'react';
import { MantineProvider, ColorSchemeScript } from '@mantine/core';
import { ColorSchemeScript, MantineProvider } from '@mantine/core';
import { theme } from '../theme';
export const metadata = {
@ -10,7 +11,7 @@ export const metadata = {
export default function RootLayout({ children }: { children: any }) {
return (
<html lang="en">
<html lang="en" suppressHydrationWarning>
<head>
<ColorSchemeScript />
<link rel="shortcut icon" href="/favicon.svg" />

View File

@ -1,5 +1,5 @@
import { Welcome } from '../components/Welcome/Welcome';
import { ColorSchemeToggle } from '../components/ColorSchemeToggle/ColorSchemeToggle';
import { Welcome } from '../components/Welcome/Welcome';
export default function HomePage() {
return (

View File

@ -1,10 +0,0 @@
.title {
color: light-dark(var(--mantine-color-black), var(--mantine-color-white));
font-size: rem(100px);
font-weight: 900;
letter-spacing: rem(-2px);
@media (max-width: $mantine-breakpoint-md) {
font-size: rem(50px);
}
}

View File

@ -0,0 +1,10 @@
.title {
color: light-dark(var(--mantine-color-black), var(--mantine-color-white));
font-size: mantine.rem(100px);
font-weight: 900;
letter-spacing: mantine.rem(-2px);
@media (max-width: mantine.$mantine-breakpoint-md) {
font-size: mantine.rem(50px);
}
}

View File

@ -1,5 +1,5 @@
import { Title, Text, Anchor } from '@mantine/core';
import classes from './Welcome.module.css';
import classes from './Welcome.module.scss';
import { Anchor, Text, Title } from '@mantine/core';
export function Welcome() {
return (

2
next-env.d.ts vendored
View File

@ -2,4 +2,4 @@
/// <reference types="next/image-types/global" />
// NOTE: This file should not be edited
// see https://nextjs.org/docs/basic-features/typescript for more information.
// see https://nextjs.org/docs/app/building-your-application/configuring/typescript for more information.

View File

@ -1,3 +1,4 @@
import path from 'path';
import bundleAnalyzer from '@next/bundle-analyzer';
const withBundleAnalyzer = bundleAnalyzer({
@ -12,4 +13,9 @@ export default withBundleAnalyzer({
experimental: {
optimizePackageImports: ['@mantine/core', '@mantine/hooks'],
},
sassOptions: {
implementation: 'sass-embedded',
additionalData: `@use "${path.join(process.cwd(), '_mantine')}" as mantine;`,
},
});

View File

@ -19,20 +19,18 @@
"storybook:build": "storybook build"
},
"dependencies": {
"@mantine/core": "7.11.2",
"@mantine/hooks": "7.11.2",
"@mantine/core": "7.13.4",
"@mantine/hooks": "7.13.4",
"@next/bundle-analyzer": "^14.2.4",
"@tabler/icons-react": "^3.6.0",
"next": "14.2.4",
"next": "15.0.1",
"react": "18.3.1",
"react-dom": "18.3.1"
},
"devDependencies": {
"@babel/core": "^7.24.7",
"@ianvs/prettier-plugin-sort-imports": "^4.3.1",
"@next/eslint-plugin-next": "^14.2.4",
"@storybook/addon-essentials": "^8.1.10",
"@storybook/addon-styling-webpack": "^1.0.0",
"@storybook/blocks": "^8.1.10",
"@storybook/nextjs": "^8.1.10",
"@storybook/react": "^8.1.10",
"@testing-library/dom": "^10.1.0",
@ -61,6 +59,7 @@
"postcss-preset-mantine": "1.17.0",
"postcss-simple-vars": "^7.0.1",
"prettier": "^3.3.2",
"sass-embedded": "^1.80.6",
"storybook": "^8.1.10",
"storybook-dark-mode": "^4.0.2",
"stylelint": "^16.6.1",
@ -68,5 +67,5 @@
"ts-jest": "^29.1.5",
"typescript": "5.5.2"
},
"packageManager": "yarn@4.3.1"
"packageManager": "yarn@4.5.1"
}

1394
yarn.lock

File diff suppressed because it is too large Load Diff