mirror of
https://github.com/mantinedev/next-app-template.git
synced 2025-11-09 20:12:02 +10:00
41 lines
970 B
TypeScript
41 lines
970 B
TypeScript
import '@mantine/core/styles.css';
|
|
|
|
import { ColorSchemeScript, MantineProvider } from '@mantine/core';
|
|
import { theme } from '../theme';
|
|
|
|
export const parameters = {
|
|
layout: 'fullscreen',
|
|
options: {
|
|
showPanel: false,
|
|
storySort: (a: any, b: any) => a.title.localeCompare(b.title, undefined, { numeric: true }),
|
|
},
|
|
backgrounds: { disable: true },
|
|
};
|
|
|
|
export const globalTypes = {
|
|
theme: {
|
|
name: 'Theme',
|
|
description: 'Mantine color scheme',
|
|
defaultValue: 'light',
|
|
toolbar: {
|
|
icon: 'mirror',
|
|
items: [
|
|
{ value: 'light', title: 'Light' },
|
|
{ value: 'dark', title: 'Dark' },
|
|
],
|
|
},
|
|
},
|
|
};
|
|
|
|
export const decorators = [
|
|
(renderStory: any, context: any) => {
|
|
const scheme = (context.globals.theme || 'light') as 'light' | 'dark';
|
|
return (
|
|
<MantineProvider theme={theme} forceColorScheme={scheme}>
|
|
<ColorSchemeScript />
|
|
{renderStory()}
|
|
</MantineProvider>
|
|
);
|
|
},
|
|
];
|