@mantine/core 7.0.0-alpha.6 → 7.0.0-alpha.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/cjs/core/MantineProvider/MantineProvider.js +2 -0
- package/cjs/core/MantineProvider/MantineProvider.js.map +1 -1
- package/cjs/core/MantineProvider/suppress-nextjs-warning.js +16 -0
- package/cjs/core/MantineProvider/suppress-nextjs-warning.js.map +1 -0
- package/esm/core/MantineProvider/MantineProvider.js +2 -0
- package/esm/core/MantineProvider/MantineProvider.js.map +1 -1
- package/esm/core/MantineProvider/suppress-nextjs-warning.js +12 -0
- package/esm/core/MantineProvider/suppress-nextjs-warning.js.map +1 -0
- package/lib/core/MantineProvider/MantineProvider.d.ts +0 -1
- package/lib/core/MantineProvider/suppress-nextjs-warning.d.ts +1 -4
- package/package.json +2 -2
|
@@ -4,6 +4,7 @@
|
|
|
4
4
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
5
5
|
|
|
6
6
|
var React = require('react');
|
|
7
|
+
var suppressNextjsWarning = require('./suppress-nextjs-warning.js');
|
|
7
8
|
var Mantine_context = require('./Mantine.context.js');
|
|
8
9
|
var localStorageManager = require('./color-scheme-managers/local-storage-manager.js');
|
|
9
10
|
var useProviderColorScheme = require('./use-mantine-color-scheme/use-provider-color-scheme.js');
|
|
@@ -15,6 +16,7 @@ function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'defau
|
|
|
15
16
|
|
|
16
17
|
var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
|
|
17
18
|
|
|
19
|
+
suppressNextjsWarning.suppressNextjsWarning();
|
|
18
20
|
function MantineProvider({
|
|
19
21
|
theme,
|
|
20
22
|
children,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MantineProvider.js","sources":["../../../src/core/MantineProvider/MantineProvider.tsx"],"sourcesContent":["import './styles/css-reset.css';\nimport './styles/global-styles.css';\nimport './styles/default-css-variables.css';\nimport '
|
|
1
|
+
{"version":3,"file":"MantineProvider.js","sources":["../../../src/core/MantineProvider/MantineProvider.tsx"],"sourcesContent":["import './styles/css-reset.css';\nimport './styles/global-styles.css';\nimport './styles/default-css-variables.css';\nimport React from 'react';\nimport { suppressNextjsWarning } from './suppress-nextjs-warning';\nimport { MantineCssVariables, CSSVariablesResolver } from './MantineCssVariables';\nimport { MantineThemeProvider } from './MantineThemeProvider';\nimport type { MantineColorScheme, MantineThemeOverride } from './theme.types';\nimport { localStorageColorSchemeManager, MantineColorSchemeManager } from './color-scheme-managers';\nimport { MantineContext } from './Mantine.context';\nimport { useProviderColorScheme } from './use-mantine-color-scheme';\nimport { useRespectReduceMotion } from './use-respect-reduce-motion';\n\nsuppressNextjsWarning();\n\nexport interface MantineProviderProps {\n /** Theme override object */\n theme?: MantineThemeOverride;\n\n /** Used to retrieve/set color scheme value in external storage, by default uses `window.localStorage` */\n colorSchemeManager?: MantineColorSchemeManager;\n\n /** Default color scheme value used when `colorSchemeManager` cannot retrieve value from external storage, `auto` by default */\n defaultColorScheme?: MantineColorScheme;\n\n /** CSS selector to which CSS variables should be added, `:root` by default */\n cssVariablesSelector?: string;\n\n /** Determines whether theme CSS variables should be added to given `cssVariablesSelector`, `true` by default */\n withCssVariables?: boolean;\n\n /** Function to resolve root element to set `data-mantine-color-scheme` attribute, must return undefined on server, `() => document.documentElement` by default */\n getRootElement?(): HTMLElement | undefined;\n\n /** A prefix for components static classes (for example {selector}-Text-root), `mantine` by default */\n classNamesPrefix?: string;\n\n /** Function to generate nonce attribute added to all generated `<style />` tags */\n getStyleNonce?(): string;\n\n /** Function to generate CSS variables based on theme object */\n cssVariablesResolver?: CSSVariablesResolver;\n\n /** Your application */\n children?: React.ReactNode;\n}\n\nexport function MantineProvider({\n theme,\n children,\n getStyleNonce,\n withCssVariables = true,\n cssVariablesSelector = ':root',\n classNamesPrefix = 'mantine',\n colorSchemeManager = localStorageColorSchemeManager(),\n defaultColorScheme = 'auto',\n getRootElement = () => document.documentElement,\n cssVariablesResolver,\n}: MantineProviderProps) {\n const { colorScheme, setColorScheme, clearColorScheme } = useProviderColorScheme({\n defaultColorScheme,\n manager: colorSchemeManager,\n getRootElement,\n });\n\n useRespectReduceMotion({\n respectReducedMotion: theme?.respectReducedMotion || false,\n getRootElement,\n });\n\n return (\n <MantineContext.Provider\n value={{\n colorSchemeManager,\n colorScheme,\n setColorScheme,\n clearColorScheme,\n getRootElement,\n classNamesPrefix,\n getStyleNonce,\n cssVariablesResolver,\n }}\n >\n <MantineThemeProvider theme={theme}>\n {withCssVariables && <MantineCssVariables cssVariablesSelector={cssVariablesSelector} />}\n {children}\n </MantineThemeProvider>\n </MantineContext.Provider>\n );\n}\n\nMantineProvider.displayName = '@mantine/core/MantineProvider';\n"],"names":["suppressNextjsWarning","localStorageColorSchemeManager","useProviderColorScheme","useRespectReduceMotion","React","MantineContext","MantineThemeProvider","MantineCssVariables"],"mappings":";;;;;;;;;;;;;;;;;;AAWAA,2CAAqB,EAAE,CAAC;AACjB,SAAS,eAAe,CAAC;AAChC,EAAE,KAAK;AACP,EAAE,QAAQ;AACV,EAAE,aAAa;AACf,EAAE,gBAAgB,GAAG,IAAI;AACzB,EAAE,oBAAoB,GAAG,OAAO;AAChC,EAAE,gBAAgB,GAAG,SAAS;AAC9B,EAAE,kBAAkB,GAAGC,kDAA8B,EAAE;AACvD,EAAE,kBAAkB,GAAG,MAAM;AAC7B,EAAE,cAAc,GAAG,MAAM,QAAQ,CAAC,eAAe;AACjD,EAAE,oBAAoB;AACtB,CAAC,EAAE;AACH,EAAE,MAAM,EAAE,WAAW,EAAE,cAAc,EAAE,gBAAgB,EAAE,GAAGC,6CAAsB,CAAC;AACnF,IAAI,kBAAkB;AACtB,IAAI,OAAO,EAAE,kBAAkB;AAC/B,IAAI,cAAc;AAClB,GAAG,CAAC,CAAC;AACL,EAAEC,6CAAsB,CAAC;AACzB,IAAI,oBAAoB,EAAE,CAAC,KAAK,IAAI,IAAI,GAAG,KAAK,CAAC,GAAG,KAAK,CAAC,oBAAoB,KAAK,KAAK;AACxF,IAAI,cAAc;AAClB,GAAG,CAAC,CAAC;AACL,EAAE,uBAAuBC,cAAK,CAAC,aAAa,CAACC,8BAAc,CAAC,QAAQ,EAAE;AACtE,IAAI,KAAK,EAAE;AACX,MAAM,kBAAkB;AACxB,MAAM,WAAW;AACjB,MAAM,cAAc;AACpB,MAAM,gBAAgB;AACtB,MAAM,cAAc;AACpB,MAAM,gBAAgB;AACtB,MAAM,aAAa;AACnB,MAAM,oBAAoB;AAC1B,KAAK;AACL,GAAG,kBAAkBD,cAAK,CAAC,aAAa,CAACE,yCAAoB,EAAE;AAC/D,IAAI,KAAK;AACT,GAAG,EAAE,gBAAgB,oBAAoBF,cAAK,CAAC,aAAa,CAACG,uCAAmB,EAAE;AAClF,IAAI,oBAAoB;AACxB,GAAG,CAAC,EAAE,QAAQ,CAAC,CAAC,CAAC;AACjB,CAAC;AACD,eAAe,CAAC,WAAW,GAAG,+BAA+B;;"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
'use strict';
|
|
3
|
+
|
|
4
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
5
|
+
|
|
6
|
+
function suppressNextjsWarning() {
|
|
7
|
+
const originalError = console.error;
|
|
8
|
+
console.error = (...args) => {
|
|
9
|
+
if (args.length > 1 && typeof args[0] === "string" && args[0].toLowerCase().includes("extra attributes from the server") && typeof args[1] === "string" && args[1].toLowerCase().includes("data-mantine-color-scheme")) ; else {
|
|
10
|
+
originalError(...args);
|
|
11
|
+
}
|
|
12
|
+
};
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
exports.suppressNextjsWarning = suppressNextjsWarning;
|
|
16
|
+
//# sourceMappingURL=suppress-nextjs-warning.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"suppress-nextjs-warning.js","sources":["../../../src/core/MantineProvider/suppress-nextjs-warning.ts"],"sourcesContent":["/* eslint-disable no-console */\nexport function suppressNextjsWarning() {\n const originalError = console.error;\n\n console.error = (...args) => {\n if (\n args.length > 1 &&\n typeof args[0] === 'string' &&\n args[0].toLowerCase().includes('extra attributes from the server') &&\n typeof args[1] === 'string' &&\n args[1].toLowerCase().includes('data-mantine-color-scheme')\n ) {\n // Suppress the warning\n } else {\n originalError(...args);\n }\n };\n}\n"],"names":[],"mappings":";;;;;AAAO,SAAS,qBAAqB,GAAG;AACxC,EAAE,MAAM,aAAa,GAAG,OAAO,CAAC,KAAK,CAAC;AACtC,EAAE,OAAO,CAAC,KAAK,GAAG,CAAC,GAAG,IAAI,KAAK;AAC/B,IAAI,IAAI,IAAI,CAAC,MAAM,GAAG,CAAC,IAAI,OAAO,IAAI,CAAC,CAAC,CAAC,KAAK,QAAQ,IAAI,IAAI,CAAC,CAAC,CAAC,CAAC,WAAW,EAAE,CAAC,QAAQ,CAAC,kCAAkC,CAAC,IAAI,OAAO,IAAI,CAAC,CAAC,CAAC,KAAK,QAAQ,IAAI,IAAI,CAAC,CAAC,CAAC,CAAC,WAAW,EAAE,CAAC,QAAQ,CAAC,2BAA2B,CAAC,EAAE,CACvN,MAAM;AACX,MAAM,aAAa,CAAC,GAAG,IAAI,CAAC,CAAC;AAC7B,KAAK;AACL,GAAG,CAAC;AACJ;;"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
import React from 'react';
|
|
3
|
+
import { suppressNextjsWarning } from './suppress-nextjs-warning.js';
|
|
3
4
|
import { MantineContext } from './Mantine.context.js';
|
|
4
5
|
import { localStorageColorSchemeManager } from './color-scheme-managers/local-storage-manager.js';
|
|
5
6
|
import { useProviderColorScheme } from './use-mantine-color-scheme/use-provider-color-scheme.js';
|
|
@@ -7,6 +8,7 @@ import { useRespectReduceMotion } from './use-respect-reduce-motion/use-respect-
|
|
|
7
8
|
import { MantineThemeProvider } from './MantineThemeProvider/MantineThemeProvider.js';
|
|
8
9
|
import { MantineCssVariables } from './MantineCssVariables/MantineCssVariables.js';
|
|
9
10
|
|
|
11
|
+
suppressNextjsWarning();
|
|
10
12
|
function MantineProvider({
|
|
11
13
|
theme,
|
|
12
14
|
children,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MantineProvider.js","sources":["../../../src/core/MantineProvider/MantineProvider.tsx"],"sourcesContent":["import './styles/css-reset.css';\nimport './styles/global-styles.css';\nimport './styles/default-css-variables.css';\nimport '
|
|
1
|
+
{"version":3,"file":"MantineProvider.js","sources":["../../../src/core/MantineProvider/MantineProvider.tsx"],"sourcesContent":["import './styles/css-reset.css';\nimport './styles/global-styles.css';\nimport './styles/default-css-variables.css';\nimport React from 'react';\nimport { suppressNextjsWarning } from './suppress-nextjs-warning';\nimport { MantineCssVariables, CSSVariablesResolver } from './MantineCssVariables';\nimport { MantineThemeProvider } from './MantineThemeProvider';\nimport type { MantineColorScheme, MantineThemeOverride } from './theme.types';\nimport { localStorageColorSchemeManager, MantineColorSchemeManager } from './color-scheme-managers';\nimport { MantineContext } from './Mantine.context';\nimport { useProviderColorScheme } from './use-mantine-color-scheme';\nimport { useRespectReduceMotion } from './use-respect-reduce-motion';\n\nsuppressNextjsWarning();\n\nexport interface MantineProviderProps {\n /** Theme override object */\n theme?: MantineThemeOverride;\n\n /** Used to retrieve/set color scheme value in external storage, by default uses `window.localStorage` */\n colorSchemeManager?: MantineColorSchemeManager;\n\n /** Default color scheme value used when `colorSchemeManager` cannot retrieve value from external storage, `auto` by default */\n defaultColorScheme?: MantineColorScheme;\n\n /** CSS selector to which CSS variables should be added, `:root` by default */\n cssVariablesSelector?: string;\n\n /** Determines whether theme CSS variables should be added to given `cssVariablesSelector`, `true` by default */\n withCssVariables?: boolean;\n\n /** Function to resolve root element to set `data-mantine-color-scheme` attribute, must return undefined on server, `() => document.documentElement` by default */\n getRootElement?(): HTMLElement | undefined;\n\n /** A prefix for components static classes (for example {selector}-Text-root), `mantine` by default */\n classNamesPrefix?: string;\n\n /** Function to generate nonce attribute added to all generated `<style />` tags */\n getStyleNonce?(): string;\n\n /** Function to generate CSS variables based on theme object */\n cssVariablesResolver?: CSSVariablesResolver;\n\n /** Your application */\n children?: React.ReactNode;\n}\n\nexport function MantineProvider({\n theme,\n children,\n getStyleNonce,\n withCssVariables = true,\n cssVariablesSelector = ':root',\n classNamesPrefix = 'mantine',\n colorSchemeManager = localStorageColorSchemeManager(),\n defaultColorScheme = 'auto',\n getRootElement = () => document.documentElement,\n cssVariablesResolver,\n}: MantineProviderProps) {\n const { colorScheme, setColorScheme, clearColorScheme } = useProviderColorScheme({\n defaultColorScheme,\n manager: colorSchemeManager,\n getRootElement,\n });\n\n useRespectReduceMotion({\n respectReducedMotion: theme?.respectReducedMotion || false,\n getRootElement,\n });\n\n return (\n <MantineContext.Provider\n value={{\n colorSchemeManager,\n colorScheme,\n setColorScheme,\n clearColorScheme,\n getRootElement,\n classNamesPrefix,\n getStyleNonce,\n cssVariablesResolver,\n }}\n >\n <MantineThemeProvider theme={theme}>\n {withCssVariables && <MantineCssVariables cssVariablesSelector={cssVariablesSelector} />}\n {children}\n </MantineThemeProvider>\n </MantineContext.Provider>\n );\n}\n\nMantineProvider.displayName = '@mantine/core/MantineProvider';\n"],"names":[],"mappings":";;;;;;;;;;AAWA,qBAAqB,EAAE,CAAC;AACjB,SAAS,eAAe,CAAC;AAChC,EAAE,KAAK;AACP,EAAE,QAAQ;AACV,EAAE,aAAa;AACf,EAAE,gBAAgB,GAAG,IAAI;AACzB,EAAE,oBAAoB,GAAG,OAAO;AAChC,EAAE,gBAAgB,GAAG,SAAS;AAC9B,EAAE,kBAAkB,GAAG,8BAA8B,EAAE;AACvD,EAAE,kBAAkB,GAAG,MAAM;AAC7B,EAAE,cAAc,GAAG,MAAM,QAAQ,CAAC,eAAe;AACjD,EAAE,oBAAoB;AACtB,CAAC,EAAE;AACH,EAAE,MAAM,EAAE,WAAW,EAAE,cAAc,EAAE,gBAAgB,EAAE,GAAG,sBAAsB,CAAC;AACnF,IAAI,kBAAkB;AACtB,IAAI,OAAO,EAAE,kBAAkB;AAC/B,IAAI,cAAc;AAClB,GAAG,CAAC,CAAC;AACL,EAAE,sBAAsB,CAAC;AACzB,IAAI,oBAAoB,EAAE,CAAC,KAAK,IAAI,IAAI,GAAG,KAAK,CAAC,GAAG,KAAK,CAAC,oBAAoB,KAAK,KAAK;AACxF,IAAI,cAAc;AAClB,GAAG,CAAC,CAAC;AACL,EAAE,uBAAuB,KAAK,CAAC,aAAa,CAAC,cAAc,CAAC,QAAQ,EAAE;AACtE,IAAI,KAAK,EAAE;AACX,MAAM,kBAAkB;AACxB,MAAM,WAAW;AACjB,MAAM,cAAc;AACpB,MAAM,gBAAgB;AACtB,MAAM,cAAc;AACpB,MAAM,gBAAgB;AACtB,MAAM,aAAa;AACnB,MAAM,oBAAoB;AAC1B,KAAK;AACL,GAAG,kBAAkB,KAAK,CAAC,aAAa,CAAC,oBAAoB,EAAE;AAC/D,IAAI,KAAK;AACT,GAAG,EAAE,gBAAgB,oBAAoB,KAAK,CAAC,aAAa,CAAC,mBAAmB,EAAE;AAClF,IAAI,oBAAoB;AACxB,GAAG,CAAC,EAAE,QAAQ,CAAC,CAAC,CAAC;AACjB,CAAC;AACD,eAAe,CAAC,WAAW,GAAG,+BAA+B;;"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
function suppressNextjsWarning() {
|
|
3
|
+
const originalError = console.error;
|
|
4
|
+
console.error = (...args) => {
|
|
5
|
+
if (args.length > 1 && typeof args[0] === "string" && args[0].toLowerCase().includes("extra attributes from the server") && typeof args[1] === "string" && args[1].toLowerCase().includes("data-mantine-color-scheme")) ; else {
|
|
6
|
+
originalError(...args);
|
|
7
|
+
}
|
|
8
|
+
};
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
export { suppressNextjsWarning };
|
|
12
|
+
//# sourceMappingURL=suppress-nextjs-warning.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"suppress-nextjs-warning.js","sources":["../../../src/core/MantineProvider/suppress-nextjs-warning.ts"],"sourcesContent":["/* eslint-disable no-console */\nexport function suppressNextjsWarning() {\n const originalError = console.error;\n\n console.error = (...args) => {\n if (\n args.length > 1 &&\n typeof args[0] === 'string' &&\n args[0].toLowerCase().includes('extra attributes from the server') &&\n typeof args[1] === 'string' &&\n args[1].toLowerCase().includes('data-mantine-color-scheme')\n ) {\n // Suppress the warning\n } else {\n originalError(...args);\n }\n };\n}\n"],"names":[],"mappings":";AAAO,SAAS,qBAAqB,GAAG;AACxC,EAAE,MAAM,aAAa,GAAG,OAAO,CAAC,KAAK,CAAC;AACtC,EAAE,OAAO,CAAC,KAAK,GAAG,CAAC,GAAG,IAAI,KAAK;AAC/B,IAAI,IAAI,IAAI,CAAC,MAAM,GAAG,CAAC,IAAI,OAAO,IAAI,CAAC,CAAC,CAAC,KAAK,QAAQ,IAAI,IAAI,CAAC,CAAC,CAAC,CAAC,WAAW,EAAE,CAAC,QAAQ,CAAC,kCAAkC,CAAC,IAAI,OAAO,IAAI,CAAC,CAAC,CAAC,KAAK,QAAQ,IAAI,IAAI,CAAC,CAAC,CAAC,CAAC,WAAW,EAAE,CAAC,QAAQ,CAAC,2BAA2B,CAAC,EAAE,CACvN,MAAM;AACX,MAAM,aAAa,CAAC,GAAG,IAAI,CAAC,CAAC;AAC7B,KAAK;AACL,GAAG,CAAC;AACJ;;"}
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import './styles/css-reset.css';
|
|
2
2
|
import './styles/global-styles.css';
|
|
3
3
|
import './styles/default-css-variables.css';
|
|
4
|
-
import './suppress-nextjs-warning';
|
|
5
4
|
import React from 'react';
|
|
6
5
|
import { CSSVariablesResolver } from './MantineCssVariables';
|
|
7
6
|
import type { MantineColorScheme, MantineThemeOverride } from './theme.types';
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mantine/core",
|
|
3
3
|
"description": "React components library focused on usability, accessibility and developer experience",
|
|
4
|
-
"version": "7.0.0-alpha.
|
|
4
|
+
"version": "7.0.0-alpha.7",
|
|
5
5
|
"main": "cjs/index.js",
|
|
6
6
|
"module": "esm/index.js",
|
|
7
7
|
"types": "lib/index.d.ts",
|
|
@@ -26,7 +26,7 @@
|
|
|
26
26
|
"design"
|
|
27
27
|
],
|
|
28
28
|
"peerDependencies": {
|
|
29
|
-
"@mantine/hooks": "7.0.0-alpha.
|
|
29
|
+
"@mantine/hooks": "7.0.0-alpha.7",
|
|
30
30
|
"react": ">=16.8.0",
|
|
31
31
|
"react-dom": ">=16.8.0"
|
|
32
32
|
},
|