Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

7.0 #4776

Merged
merged 4 commits into from
Sep 18, 2023
Merged

7.0 #4776

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
The diff you're trying to view is too large. We only load the first 3000 changed files.
Binary file added .demo/social-preview.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,4 @@ public
.cache
.eslintrc.js
*.d.ts
*.js
9 changes: 8 additions & 1 deletion .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,17 @@ module.exports = {
rules: {
'jest/no-export': 'off',
'jest/expect-expect': 'off',
'jest/valid-title': 'off',
'react/jsx-pascal-case': 'off',
'newline-per-chained-call': 'off',
'import/extensions': 'off',
'jsx-a11y/label-has-associated-control': 'off',
'react/self-closing-comp': 'off',
'react/jsx-closing-bracket-location': 'off',
'@typescript-eslint/no-loop-func': 'off',
'no-restricted-syntax': 'off',
},
parserOptions: {
project: './tsconfig.json',
project: './tsconfig.eslint.json',
},
};
8 changes: 6 additions & 2 deletions .github/ISSUE_TEMPLATE/bug_report.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
name: Report an issue with @mantine/ scoped package
description: Tell us if something is not working as expected
labels: 'review required'
body:
- type: markdown
attributes:
Expand All @@ -17,12 +18,15 @@ body:
- '@mantine/form'
- '@mantine/notifications'
- '@mantine/tiptap'
- '@mantine/prism'
- '@mantine/code-highlight'
- '@mantine/modals'
- '@mantine/dropzone'
- '@mantine/spotlight'
- '@mantine/nprogress'
- '@mantine/carousel'
- '@mantine/colors-generator'
- '@mantine/store'
- '@mantine/vanilla-extract'
validations:
required: true
- type: textarea
Expand All @@ -34,7 +38,7 @@ body:
- type: input
id: version
attributes:
label: What version of @mantine/hooks page do you have in package.json?
label: What version of @mantine/* page do you have in package.json? (Note that all @mantine/* packages must have the same version in order to work correctly)
validations:
required: true
- type: input
Expand Down
1 change: 1 addition & 0 deletions .github/ISSUE_TEMPLATE/docs_report.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
name: Report an issue with mantine.dev website
description: Nothing is perfect, especially our docs, help us find and fix mistakes, bad wording, etc.
labels: 'review required'
body:
- type: markdown
attributes:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/pull_request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: '16.10.0'
node-version: '18.17.0'
cache: 'yarn'
cache-dependency-path: '**/yarn.lock'
- name: Install dependencies
Expand Down
7 changes: 3 additions & 4 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,8 @@ docs/.docgen/
# project
.eslintcache
docs/.cache
docs/public
storybook-static
.next
docs/src/components/Test.tsx
____*.internal.ts
____*.internal.tsx
docs/components/___test.internal.tsx
src/*/styles.css
.stylelintcache
2 changes: 1 addition & 1 deletion .nvmrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
v16.13.2
v20.5.0
52 changes: 52 additions & 0 deletions .storybook/main.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
const TsconfigPathsPlugin = require('tsconfig-paths-webpack-plugin').default;
const path = require('path');

module.exports = {
stories: ['../src/**/*.story.@(js|jsx|ts|tsx)'],
addons: [
'storybook-dark-mode',
'@storybook/addon-links',
'@storybook/addon-essentials',
'@storybook/addon-interactions',
{
name: 'storybook-css-modules',
options: {
cssModulesLoaderOptions: {
importLoaders: 1,
modules: {
localIdentName: 'mantine-[hash:base64:7]',
},
},
},
},
{
name: '@storybook/addon-postcss',
options: {
postcssLoaderOptions: {
implementation: require('postcss'),
},
},
},
],
framework: '@storybook/react',
core: {
builder: '@storybook/builder-webpack5',
},
webpackFinal: async (config) => {
config.resolve = {
...config.resolve,
plugins: [
...(config.resolve.plugins || []),
new TsconfigPathsPlugin({
extensions: ['.ts', '.tsx', '.js'],
configFile: path.join(__dirname, '../tsconfig.json'),
}),
],
};

// Turn off docgen plugin as it breaks bundle with displayName
config.plugins.pop();

return config;
},
};
58 changes: 58 additions & 0 deletions .storybook/preview.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
import React, { useEffect } from 'react';
import addons from '@storybook/addons';
import { IconTextDirectionLtr, IconTextDirectionRtl } from '@tabler/icons-react';
import { DARK_MODE_EVENT_NAME } from 'storybook-dark-mode';
import {
MantineProvider,
useMantineColorScheme,
ActionIcon,
DirectionProvider,
useDirection,
} from '@mantine/core';
import { Notifications } from '@mantine/notifications';
import { theme } from '../docs/theme';

export const parameters = { layout: 'fullscreen' };

const channel = addons.getChannel();

function ColorSchemeWrapper({ children }: { children: React.ReactNode }) {
const { setColorScheme } = useMantineColorScheme();
const handleColorScheme = (value: boolean) => setColorScheme(value ? 'dark' : 'light');

useEffect(() => {
channel.on(DARK_MODE_EVENT_NAME, handleColorScheme);
return () => channel.off(DARK_MODE_EVENT_NAME, handleColorScheme);
}, [channel]);

return <DirectionProvider>{children}</DirectionProvider>;
}

function DirectionWrapper({ children }: { children: React.ReactNode }) {
const { dir, toggleDirection } = useDirection();
return (
<>
<ActionIcon
size="xl"
radius="md"
variant="default"
pos="fixed"
bottom={20}
right={20}
onClick={toggleDirection}
style={{ zIndex: 1000 }}
aria-label="Toggle text direction"
>
{dir === 'ltr' ? <IconTextDirectionLtr /> : <IconTextDirectionRtl />}
</ActionIcon>
<Notifications />
{children}
</>
);
}

export const decorators = [
(renderStory: any) => <DirectionWrapper>{renderStory()}</DirectionWrapper>,
(renderStory: any) => <ColorSchemeWrapper>{renderStory()}</ColorSchemeWrapper>,
(renderStory: any) => <MantineProvider theme={theme}>{renderStory()}</MantineProvider>,
];
4 changes: 4 additions & 0 deletions .stylelintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
src/*/esm/**/*.css
src/*/cjs/**/*.css
docs/.next
docs/out
28 changes: 28 additions & 0 deletions .stylelintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
{
"extends": ["stylelint-config-standard-scss"],
"rules": {
"custom-property-pattern": null,
"selector-class-pattern": null,
"scss/no-duplicate-mixins": null,
"declaration-empty-line-before": null,
"declaration-block-no-redundant-longhand-properties": null,
"alpha-value-notation": null,
"custom-property-empty-line-before": null,
"property-no-vendor-prefix": null,
"color-function-notation": null,
"length-zero-no-unit": null,
"selector-not-notation": null,
"no-descending-specificity": null,
"comment-empty-line-before": null,
"scss/at-mixin-pattern": null,
"scss/at-rule-no-unknown": null,
"value-keyword-case": null,
"media-feature-range-notation": null,
"selector-pseudo-class-no-unknown": [
true,
{
"ignorePseudoClasses": ["global"]
}
]
}
}
29 changes: 25 additions & 4 deletions .syncpackrc.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,27 @@
{
"dev": true,
"peer": false,
"prod": true,
"source": ["package.json", "src/*/package.json", "docs/package.json"]
"dependencyTypes": ["dev", "prod", "peer"],
"source": ["package.json", "src/*/package.json", "docs/package.json"],
"versionGroups": [
{
"packages": ["docs"],
"dependencies": [
"@mantine/store",
"@mantine/styles-api",
"@mantine/code-highlight",
"@mantine/core",
"@mantine/ds",
"@mantine/hooks",
"@mantine/notifications",
"@mantine/spotlight",
"@mantine/carousel",
"@mantine/dropzone",
"@mantine/form",
"@mantine/nprogress",
"@mantine/dates",
"@mantine/modals",
"@mantine/tiptap"
],
"isIgnored": true
}
]
}
2 changes: 1 addition & 1 deletion .tool-versions
Original file line number Diff line number Diff line change
@@ -1 +1 @@
nodejs 16.13.2
nodejs 14.17.0
11 changes: 0 additions & 11 deletions .vscode/extensions.json

This file was deleted.

14 changes: 0 additions & 14 deletions .vscode/launch.json

This file was deleted.

Loading
Loading